From 6df4ed2fc04c7eeb4474e7d152e4374c219c3aac Mon Sep 17 00:00:00 2001 From: Andre Date: Sun, 16 Apr 2006 20:37:52 +0200 Subject: [PATCH] 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 --- audiod.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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; } } -- 2.39.5