From: Andre Date: Sun, 16 Apr 2006 18:37:52 +0000 (+0200) Subject: audiod: do not use pointers to members of struct timeval for sscanf() X-Git-Tag: v0.2.12~84 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=6df4ed2fc04c7eeb4474e7d152e4374c219c3aac audiod: do not use pointers to members of struct timeval for sscanf() Use temporary long unsigned variables instead. Fixes warnings of the form audiod.c:844: warning: format '%lu' expects type 'long unsigned int *', but argument 4 has type 'suseconds_t *' on MacOs --- diff --git a/audiod.c b/audiod.c index ae20d701..462ecc8b 100644 --- a/audiod.c +++ b/audiod.c @@ -806,7 +806,7 @@ static void check_stat_line(char *line) { int itemnum; size_t ilen = 0; - struct timeval tv; + long unsigned sec, usec; char *tmp; PARA_INFO_LOG("line: %s\n", line); @@ -838,14 +838,16 @@ static void check_stat_line(char *line) length_seconds = atoi(line + ilen + 1); break; case SI_STREAM_START: - if (sscanf(line + ilen + 1, "%lu.%lu", - &tv.tv_sec, &tv.tv_usec) == 2) - server_stream_start = tv; + if (sscanf(line + ilen + 1, "%lu.%lu", &sec, &usec) == 2) { + server_stream_start.tv_sec = sec; + server_stream_start.tv_usec = usec; + } break; case SI_CURRENT_TIME: - if (sscanf(line + ilen + 1, "%lu.%lu", &tv.tv_sec, - &tv.tv_usec) == 2) + if (sscanf(line + ilen + 1, "%lu.%lu", &sec, &usec) == 2) { + struct timeval tv = {sec, usec}; compute_time_diff(&tv); + } break; } }