mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	fix a number of warnings
most of them were due to missing #ifdefs or wrong printf format type for [s]size_t.
This commit is contained in:
		
							parent
							
								
									0ccc7afcd8
								
							
						
					
					
						commit
						f452c6cdd9
					
				
					 4 changed files with 16 additions and 12 deletions
				
			
		| 
						 | 
					@ -466,6 +466,7 @@ static int parse_rtprio(const char *filename, unsigned line, const char *section
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAVE_DBUS
 | 
				
			||||||
static int parse_server_type(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
 | 
					static int parse_server_type(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
 | 
				
			||||||
    pa_daemon_conf *c = data;
 | 
					    pa_daemon_conf *c = data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -481,6 +482,7 @@ static int parse_server_type(const char *filename, unsigned line, const char *se
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
 | 
					int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
 | 
				
			||||||
    int r = -1;
 | 
					    int r = -1;
 | 
				
			||||||
| 
						 | 
					@ -666,12 +668,14 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
 | 
				
			||||||
        [PA_LOG_ERROR] = "error"
 | 
					        [PA_LOG_ERROR] = "error"
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAVE_DBUS
 | 
				
			||||||
    static const char* const server_type_to_string[] = {
 | 
					    static const char* const server_type_to_string[] = {
 | 
				
			||||||
        [PA_SERVER_TYPE_UNSET] = "!!UNSET!!",
 | 
					        [PA_SERVER_TYPE_UNSET] = "!!UNSET!!",
 | 
				
			||||||
        [PA_SERVER_TYPE_USER] = "user",
 | 
					        [PA_SERVER_TYPE_USER] = "user",
 | 
				
			||||||
        [PA_SERVER_TYPE_SYSTEM] = "system",
 | 
					        [PA_SERVER_TYPE_SYSTEM] = "system",
 | 
				
			||||||
        [PA_SERVER_TYPE_NONE] = "none"
 | 
					        [PA_SERVER_TYPE_NONE] = "none"
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_strbuf *s;
 | 
					    pa_strbuf *s;
 | 
				
			||||||
    char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
 | 
					    char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -580,8 +580,8 @@ char *pa_strlcpy(char *b, const char *s, size_t l) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int set_scheduler(int rtprio) {
 | 
					static int set_scheduler(int rtprio) {
 | 
				
			||||||
    struct sched_param sp;
 | 
					    struct sched_param sp;
 | 
				
			||||||
    int r;
 | 
					 | 
				
			||||||
#ifdef HAVE_DBUS
 | 
					#ifdef HAVE_DBUS
 | 
				
			||||||
 | 
					    int r;
 | 
				
			||||||
    DBusError error;
 | 
					    DBusError error;
 | 
				
			||||||
    DBusConnection *bus;
 | 
					    DBusConnection *bus;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -628,7 +628,7 @@ static int set_scheduler(int rtprio) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    errno = -r;
 | 
					    errno = -r;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    errno = r;
 | 
					    errno = 0;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return -1;
 | 
					    return -1;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -597,7 +597,7 @@ void pa_envelope_apply(pa_envelope *e, pa_memchunk *chunk) {
 | 
				
			||||||
        fs = pa_frame_size(&e->sample_spec);
 | 
					        fs = pa_frame_size(&e->sample_spec);
 | 
				
			||||||
        n = chunk->length;
 | 
					        n = chunk->length;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        pa_log_debug("Envelop position %d applying factor %d=%f, sample spec is %d, chunk's length is %d, fs is %d\n", e->x, linear_get_int(e, v), ((float) linear_get_int(e,v))/0x10000, e->sample_spec.format, n, fs);
 | 
					        pa_log_debug("Envelop position %zu applying factor %d=%f, sample spec is %d, chunk's length is %zu, fs is %zu\n", e->x, linear_get_int(e, v), ((float) linear_get_int(e,v))/0x10000, e->sample_spec.format, n, fs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        switch (e->sample_spec.format) {
 | 
					        switch (e->sample_spec.format) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -965,11 +965,10 @@ void pa_envelope_restart(pa_envelope* e) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pa_bool_t pa_envelope_is_finished(pa_envelope* e) {
 | 
					pa_bool_t pa_envelope_is_finished(pa_envelope* e) {
 | 
				
			||||||
    pa_assert(e);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int v;
 | 
					    int v;
 | 
				
			||||||
    pa_bool_t finished;
 | 
					    pa_bool_t finished;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pa_assert(e);
 | 
				
			||||||
    envelope_begin_read(e, &v);
 | 
					    envelope_begin_read(e, &v);
 | 
				
			||||||
    finished = (e->x >=  e->points[v].x[e->points[v].n_points-1]);
 | 
					    finished = (e->x >=  e->points[v].x[e->points[v].n_points-1]);
 | 
				
			||||||
    envelope_commit_read(e, v);
 | 
					    envelope_commit_read(e, v);
 | 
				
			||||||
| 
						 | 
					@ -978,11 +977,10 @@ pa_bool_t pa_envelope_is_finished(pa_envelope* e) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int32_t pa_envelope_length(pa_envelope *e) {
 | 
					int32_t pa_envelope_length(pa_envelope *e) {
 | 
				
			||||||
    pa_assert(e);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int v;
 | 
					    int v;
 | 
				
			||||||
    size_t size;
 | 
					    size_t size;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pa_assert(e);
 | 
				
			||||||
    envelope_begin_read(e, &v);
 | 
					    envelope_begin_read(e, &v);
 | 
				
			||||||
    size = e->points[v].x[e->points[v].n_points-1] - e->points[v].x[0];
 | 
					    size = e->points[v].x[e->points[v].n_points-1] - e->points[v].x[0];
 | 
				
			||||||
    envelope_commit_read(e, v);
 | 
					    envelope_commit_read(e, v);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -779,11 +779,11 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink frames */, p
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!i->thread_info.ramp_info.envelope_dead) {
 | 
					    if (!i->thread_info.ramp_info.envelope_dead) {
 | 
				
			||||||
        i->thread_info.ramp_info.envelope_dying += chunk->length;
 | 
					        i->thread_info.ramp_info.envelope_dying += chunk->length;
 | 
				
			||||||
        pa_log_debug("Envelope dying is %d, chunk length is %d, dead thresholder is %d\n", i->thread_info.ramp_info.envelope_dying,
 | 
					        pa_log_debug("Envelope dying is %d, chunk length is %zu, dead thresholder is %lu\n", i->thread_info.ramp_info.envelope_dying,
 | 
				
			||||||
                chunk->length,
 | 
					                chunk->length,
 | 
				
			||||||
                i->sink->thread_info.max_rewind + pa_envelope_length(i->thread_info.ramp_info.envelope));
 | 
					                i->sink->thread_info.max_rewind + pa_envelope_length(i->thread_info.ramp_info.envelope));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (i->thread_info.ramp_info.envelope_dying >= (i->sink->thread_info.max_rewind + pa_envelope_length(i->thread_info.ramp_info.envelope))) {
 | 
					        if (i->thread_info.ramp_info.envelope_dying >= (int32_t) (i->sink->thread_info.max_rewind + pa_envelope_length(i->thread_info.ramp_info.envelope))) {
 | 
				
			||||||
            pa_log_debug("RELEASE Envelop");
 | 
					            pa_log_debug("RELEASE Envelop");
 | 
				
			||||||
            i->thread_info.ramp_info.envelope_dead = TRUE;
 | 
					            i->thread_info.ramp_info.envelope_dead = TRUE;
 | 
				
			||||||
            sink_input_release_envelope(i);
 | 
					            sink_input_release_envelope(i);
 | 
				
			||||||
| 
						 | 
					@ -1767,12 +1767,14 @@ static void sink_input_rewind_ramp_info(pa_sink_input *i, size_t nbytes) {
 | 
				
			||||||
    pa_assert(i);
 | 
					    pa_assert(i);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!i->thread_info.ramp_info.envelope_dead) {
 | 
					    if (!i->thread_info.ramp_info.envelope_dead) {
 | 
				
			||||||
        pa_assert(i->thread_info.ramp_info.envelope);
 | 
					        int32_t envelope_length;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int32_t envelope_length = pa_envelope_length(i->thread_info.ramp_info.envelope);
 | 
						pa_assert(i->thread_info.ramp_info.envelope);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        envelope_length = pa_envelope_length(i->thread_info.ramp_info.envelope);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (i->thread_info.ramp_info.envelope_dying > envelope_length) {
 | 
					        if (i->thread_info.ramp_info.envelope_dying > envelope_length) {
 | 
				
			||||||
            if ((i->thread_info.ramp_info.envelope_dying - nbytes) < envelope_length) {
 | 
					            if ((int32_t) (i->thread_info.ramp_info.envelope_dying - nbytes) < envelope_length) {
 | 
				
			||||||
                pa_log_debug("Envelope Become Alive");
 | 
					                pa_log_debug("Envelope Become Alive");
 | 
				
			||||||
                pa_envelope_rewind(i->thread_info.ramp_info.envelope, envelope_length - (i->thread_info.ramp_info.envelope_dying - nbytes));
 | 
					                pa_envelope_rewind(i->thread_info.ramp_info.envelope, envelope_length - (i->thread_info.ramp_info.envelope_dying - nbytes));
 | 
				
			||||||
                i->thread_info.ramp_info.is_ramping = TRUE;
 | 
					                i->thread_info.ramp_info.is_ramping = TRUE;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue