X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aft.c;h=daa9c730484437f58b56dca863d9d0b617d5c418;hp=90989284df90cac401a056b7af1d6d7c05c2a27f;hb=e5e59d29676be79d4938e8871b46f12f6a5fca66;hpb=97e3deb06e0dd2e63520c2dc0736e753e1276fde diff --git a/aft.c b/aft.c index 90989284..daa9c730 100644 --- a/aft.c +++ b/aft.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2008 Andre Noll + * Copyright (C) 2007-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -20,6 +20,7 @@ #include "vss.h" #include "fd.h" #include "ipc.h" +#include "portable_io.h" static struct osl_table *audio_file_table; @@ -740,7 +741,7 @@ static int get_local_time(uint64_t *seconds, char *buf, size_t size, #define GET_NUM_DIGITS(x, num) { \ typeof((x)) _tmp = PARA_ABS(x); \ *num = 1; \ - if ((x)) \ + if ((_tmp)) \ while ((_tmp) > 9) { \ (_tmp) /= 10; \ (*num)++; \ @@ -1007,6 +1008,13 @@ out: return ret; } +/** + * Write a list of audio-file related status items with empty values. + * + * \param buf Result pointer. + * + * This is used by vss when currently no audio file is open. + */ void make_empty_status_items(char *buf) { sprintf(buf, @@ -1259,8 +1267,8 @@ static int prepare_ls_row(struct osl_row *row, void *ls_opts) GET_NUM_DIGITS(d->afsi.num_played, &num_digits); w->num_played_width = PARA_MAX(w->num_played_width, num_digits); /* get the number of chars to print this amount of time */ - tmp = get_duration_width(d->afhi.seconds_total); - w->duration_width = PARA_MAX(w->duration_width, tmp); + num_digits = get_duration_width(d->afhi.seconds_total); + w->duration_width = PARA_MAX(w->duration_width, num_digits); GET_NUM_DIGITS(d->afsi.amp, &num_digits); w->amp_width = PARA_MAX(w->amp_width, num_digits); if (options->flags & LS_FLAG_ADMISSIBLE_ONLY) {