From: Andre Noll Date: Sat, 15 Oct 2011 13:36:38 +0000 (+0200) Subject: Merge branch 't/clang_analyzer_fixes' X-Git-Tag: v0.4.9~18 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=63aab30b55d5809704a2d0e1c4e8de20e8228d7d;hp=474b4dfc006b9a7520d017ca4c82aab589dff934 Merge branch 't/clang_analyzer_fixes' --- diff --git a/NEWS b/NEWS index 50f9b699..6db72253 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,14 @@ 0.4.9 (to be announced) "hybrid causality" ------------------------------------------ + - Fix for an endless loop in the mp3 decoder for certain + (corrupt) mp3 files. + - autogen.sh now detects a distcc setup and adjusts the + parameter for the -j option of make accordingly. + - Shared memory areas are no longer restricted to 64K. We now + detect the maximal size of a shared memory area at runtime. + - cleanup of the internal uptime API. + -------------------------------------- 0.4.8 (2011-08-19) "nested assignment" -------------------------------------- diff --git a/afs.c b/afs.c index 755537da..955b8f20 100644 --- a/afs.c +++ b/afs.c @@ -537,7 +537,7 @@ static int activate_mood_or_playlist(char *arg, int *num_admissible) static void com_select_callback(int fd, const struct osl_object *query) { struct para_buffer pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm }; diff --git a/aft.c b/aft.c index f4080233..e91d734f 100644 --- a/aft.c +++ b/aft.c @@ -1037,7 +1037,7 @@ static int make_status_items(struct audio_file_data *afd, .flags = LS_FLAG_FULL_PATH | LS_FLAG_ADMISSIBLE_ONLY, .mode = LS_MODE_VERBOSE, }; - struct para_buffer pb = {.max_size = SHMMAX - 1}; + struct para_buffer pb = {.max_size = shm_get_shmmax() - 1}; time_t current_time; int ret; @@ -1048,7 +1048,7 @@ static int make_status_items(struct audio_file_data *afd, free(status_items); status_items = pb.buf; memset(&pb, 0, sizeof(pb)); - pb.max_size = SHMMAX - 1; + pb.max_size = shm_get_shmmax() - 1; pb.flags = PBF_SIZE_PREFIX; ret = print_list_item(&d, &opts, &pb, current_time); if (ret < 0) { @@ -1343,7 +1343,7 @@ static void com_ls_callback(int fd, const struct osl_object *query) { struct ls_options *opts = query->data; char *p, *pattern_start = (char *)query->data + sizeof(*opts); - struct para_buffer b = {.max_size = SHMMAX, + struct para_buffer b = {.max_size = shm_get_shmmax(), .flags = (opts->mode == LS_MODE_PARSER)? PBF_SIZE_PREFIX : 0, .max_size_handler = pass_buffer_as_shm, .private_data = &fd}; int i = 0, ret; @@ -1665,7 +1665,7 @@ static void com_add_callback(int fd, const struct osl_object *query) char afsi_buf[AFSI_SIZE]; uint32_t flags = read_u32(buf + CAB_FLAGS_OFFSET); struct afs_info default_afsi = {.last_played = 0}; - struct para_buffer msg = {.max_size = SHMMAX, + struct para_buffer msg = {.max_size = shm_get_shmmax(), .max_size_handler = pass_buffer_as_shm, .private_data = &fd}; uint16_t afhi_offset, chunks_offset; @@ -2080,7 +2080,7 @@ static void com_touch_callback(int fd, const struct osl_object *query) { struct touch_action_data tad = {.cto = query->data, .pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm } @@ -2226,7 +2226,7 @@ static void com_rm_callback(int fd, const struct osl_object *query) { struct com_rm_action_data crd = {.flags = *(uint32_t *)query->data, .pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm } @@ -2371,7 +2371,7 @@ static void com_cpsi_callback(int fd, const struct osl_object *query) struct cpsi_action_data cad = { .flags = *(unsigned *)query->data, .pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm } @@ -2543,7 +2543,7 @@ static int check_audio_file(struct osl_row *row, void *data) void aft_check_callback(int fd, __a_unused const struct osl_object *query) { struct para_buffer pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm }; diff --git a/attribute.c b/attribute.c index 42fa421c..f36f4e7d 100644 --- a/attribute.c +++ b/attribute.c @@ -149,7 +149,7 @@ static void com_lsatt_callback(int fd, const struct osl_object *query) struct lsatt_action_data laad = { .flags = *(unsigned *) query->data, .pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm } @@ -295,7 +295,7 @@ static void com_addatt_callback(int fd, const struct osl_object *query) char *p; int ret = 1, ret2 = 0; struct para_buffer pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm }; @@ -378,7 +378,7 @@ static void com_mvatt_callback(int fd, const struct osl_object *query) struct osl_object obj = {.data = old, .size = size}; struct osl_row *row; struct para_buffer pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm }; @@ -448,7 +448,7 @@ static void com_rmatt_callback(int fd, const struct osl_object *query) struct remove_attribute_action_data raad = { .num_removed = 0, .pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm } diff --git a/audiod.c b/audiod.c index c78df5b8..4864c855 100644 --- a/audiod.c +++ b/audiod.c @@ -1370,7 +1370,7 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } log_welcome("para_audiod"); - server_uptime(UPTIME_SET); + set_server_start_time(NULL); set_initial_status(); FOR_EACH_SLOT(i) clear_slot(i); diff --git a/audiod_command.c b/audiod_command.c index 1c22f58b..dfb014ae 100644 --- a/audiod_command.c +++ b/audiod_command.c @@ -480,7 +480,7 @@ void audiod_status_dump(void) free(new); } - new = uptime_str(); + new = get_server_uptime_str(now); old = stat_item_values[SI_AUDIOD_UPTIME]; if (!old || strcmp(old, new)) { free(old); diff --git a/autogen.sh b/autogen.sh index e5000a6f..ea38dbf7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -5,6 +5,11 @@ if [ -z "$n" ]; then n=$(grep ^processor /proc/cpuinfo 2>/dev/null | wc -l) [ $n -eq 0 ] && n=1 fi +# If we are compiling with distcc, try to guess a reasonable number +# based on (a) the number of cores on this machine and (b) the number +# of words in the DISTCC_HOSTS variable. +d="$(echo $DISTCC_HOSTS | wc -w)" +n=$(($n + 2 * $n * $d)) echo preparing, parallel=$n... if test -f Makefile; then make maintainer-clean > /dev/null 2>&1 diff --git a/blob.c b/blob.c index 25aa2a6d..707c6c62 100644 --- a/blob.c +++ b/blob.c @@ -80,12 +80,13 @@ static struct osl_column_description blob_cols[] = { DEFINE_BLOB_TABLE_DESC(table_name); \ DEFINE_BLOB_TABLE_PTR(table_name); -/** \cond doxygen isn't smart enough to recognize these */ +/* doxygen isn't smart enough to recognize these */ +/** \cond blob_table */ INIT_BLOB_TABLE(lyrics); INIT_BLOB_TABLE(images); INIT_BLOB_TABLE(moods); INIT_BLOB_TABLE(playlists); -/** \endcond */ +/** \endcond blob_table */ /** Flags that may be passed to the \p ls functions of each blob type. */ enum blob_ls_flags { @@ -130,7 +131,7 @@ static void com_lsblob_callback(struct osl_table *table, struct lsblob_action_data lbad = { .flags = *(uint32_t *)query->data, .pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm } @@ -261,7 +262,7 @@ static void com_rmblob_callback(struct osl_table *table, int fd, struct rmblob_data rmbd = { .num_removed = 0, .pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm } @@ -662,9 +663,10 @@ static int blob_open(struct osl_table **table, DEFINE_GET_DEF_BY_NAME(table_name, cmd_prefix); \ DEFINE_GET_NAME_AND_DEF_BY_ROW(table_name, cmd_prefix); \ -/** \cond doxygen isn't smart enough to recognize these */ +/* doxygen isn't smart enough to recognize these */ +/** \cond blob_function */ DEFINE_BLOB_FUNCTIONS(lyrics, lyr); DEFINE_BLOB_FUNCTIONS(images, img); DEFINE_BLOB_FUNCTIONS(moods, mood); DEFINE_BLOB_FUNCTIONS(playlists, pl); -/** \endcond */ +/** \endcond blob_function */ diff --git a/command.c b/command.c index 74d82697..b6861b88 100644 --- a/command.c +++ b/command.c @@ -108,7 +108,8 @@ static char *get_status(struct misc_meta_data *nmmd, int parser_friendly) { char mtime[30] = ""; char *status, *flags; /* vss status info */ - char *ut = uptime_str(); + /* nobody updates our version of "now" */ + char *ut = get_server_uptime_str(NULL); long offset = (nmmd->offset + 500) / 1000; struct timeval current_time; struct tm mtime_tm; @@ -258,7 +259,7 @@ int com_si(struct stream_cipher_context *scc, int argc, __a_unused char * const sender_info = para_strcat(sender_info, info); free(info); } - ut = uptime_str(); + ut = get_server_uptime_str(now); ret = sc_send_va_buffer(scc, "version: " GIT_VERSION "\n" "up: %s\nplayed: %u\n" "server_pid: %d\n" diff --git a/crypt.c b/crypt.c index 207ad5db..431de6fe 100644 --- a/crypt.c +++ b/crypt.c @@ -307,7 +307,7 @@ int sc_send_bin_buffer(struct stream_cipher_context *scc, char *buf, int sc_recv_bin_buffer(struct stream_cipher_context *scc, char *buf, size_t size) { - unsigned char *tmp = para_malloc(size); + unsigned char *tmp = para_malloc(ROUND_UP(size, RC4_ALIGN)); ssize_t ret = recv(scc->fd, tmp, size, 0); if (ret > 0) diff --git a/crypt.h b/crypt.h index 4696ee4a..833bbf1b 100644 --- a/crypt.h +++ b/crypt.h @@ -7,13 +7,14 @@ /** \file crypt.h Public crypto interface. */ -/** \cond used to distinguish between loading of private/public key */ +/* These are used to distinguish between loading of private/public key. */ + +/** The key to load is a public key. */ #define LOAD_PUBLIC_KEY 0 +/** The key to load is a private key. */ #define LOAD_PRIVATE_KEY 1 +/** The size of the challenge sent to the client. */ #define CHALLENGE_SIZE 64 -/** \endcond **/ - -/* asymetric (public key) crypto */ /** Opaque structure for public and private keys. */ struct asymmetric_key; diff --git a/daemon.c b/daemon.c index b7a0a326..ffdec4e3 100644 --- a/daemon.c +++ b/daemon.c @@ -26,7 +26,6 @@ struct daemon { char *logfile_name; /** Current loglevel, see \ref daemon_set_loglevel(). */ int loglevel; - /** Used by \ref server_uptime() and \ref uptime_str(). */ time_t startuptime; /** The file pointer if the logfile is open. */ @@ -277,43 +276,59 @@ void drop_privileges_or_die(const char *username, const char *groupname) } /** - * Set/get the server uptime. + * Set the server startup time. + * + * \param startuptime The value to store as the server start time. * - * \param set_or_get Chose one of the two modes. + * This should be called once on startup with \a startuptime either NULL or a + * pointer to a struct timeval which contains the current time. If \a + * startuptime is NULL, the server start time is set to the current time. * - * This should be called at startup time with \a set_or_get equal to \p - * UPTIME_SET which sets the uptime to zero. Subsequent calls with \a - * set_or_get equal to \p UPTIME_GET return the uptime. + * \sa time(2), difftime(3) \ref get_server_uptime(), \ref + * get_server_uptime_str(). + */ +void set_server_start_time(const struct timeval *startuptime) +{ + if (startuptime) + me->startuptime = startuptime->tv_sec; + else + time(&me->startuptime); +} - * \return Zero if called with \a set_or_get equal to \p UPTIME_SET, the number - * of seconds elapsed since the last reset otherwise. +/** + * Get the server uptime. + * + * \param current_time The current time. + * + * The \a current_time pointer may be \p NULL. In this case the function + * obtains the current time from the system. * - * \sa time(2), difftime(3). + * \return This returns the server uptime in seconds, i.e. the difference + * between the current time and the value stored previously via \ref + * set_server_start_time(). */ -time_t server_uptime(enum uptime set_or_get) +time_t get_server_uptime(const struct timeval *current_time) { - time_t now; - double diff; + time_t t; - if (set_or_get == UPTIME_SET) { - time(&me->startuptime); - return 0; - } - time(&now); - diff = difftime(now, me->startuptime); - return (time_t) diff; + if (current_time) + return current_time->tv_sec - me->startuptime; + time(&t); + return difftime(t, me->startuptime); } /** - * Construct string containing uptime. + * Construct a string containing the current uptime. + * + * \param current_time See a \ref get_server_uptime(). * * \return A dynamically allocated string of the form "days:hours:minutes". * * \sa server_uptime. */ -__malloc char *uptime_str(void) +__malloc char *get_server_uptime_str(const struct timeval *current_time) { - long t = server_uptime(UPTIME_GET); + long t = get_server_uptime(current_time); return make_message("%li:%02li:%02li", t / 86400, (t / 3600) % 24, (t / 60) % 60); } diff --git a/daemon.h b/daemon.h index 4e803bdc..d5583f58 100644 --- a/daemon.h +++ b/daemon.h @@ -7,9 +7,9 @@ void daemon_close_log(void); void log_welcome(const char *whoami); void drop_privileges_or_die(const char *username, const char *groupname); /** used for server_uptime() */ -enum uptime {UPTIME_SET, UPTIME_GET}; -time_t server_uptime(enum uptime set_or_get); -__malloc char *uptime_str(void); +void set_server_start_time(const struct timeval *startuptime); +time_t get_server_uptime(const struct timeval *current_time); +__malloc char *get_server_uptime_str(const struct timeval *current_time); void daemon_set_logfile(char *logfile_name); void daemon_set_flag(unsigned flag); void daemon_clear_flag(unsigned flag); diff --git a/error.h b/error.h index 306546d6..65494131 100644 --- a/error.h +++ b/error.h @@ -6,7 +6,7 @@ /** \file error.h List of error messages for all subsystems. */ -/** \cond */ +/** \cond errors */ /* List of all subsystems that use paraslash's error facility. */ DEFINE_ERRLIST_OBJECT_ENUM; @@ -455,7 +455,7 @@ extern const char **para_errlist[]; PARA_ERROR(QUEUE, "packet queue overrun"), \ -/** \endcond */ +/** \endcond errors */ /** * The subsystem shift. diff --git a/ipc.c b/ipc.c index c1069ad9..674d1cb0 100644 --- a/ipc.c +++ b/ipc.c @@ -9,6 +9,10 @@ #include "para.h" #include "error.h" #include "ipc.h" +#include +#include +#include + #include #include #include @@ -171,3 +175,45 @@ int shm_detach(void *addr) int ret = shmdt(addr); return ret < 0? -ERRNO_TO_PARA_ERROR(errno) : 1; } + +# if defined __FreeBSD__ || defined __NetBSD__ +# define SYSCTL_SHMMAX_VARIABLE "kern.ipc.shmmax" +# elif defined __APPLE__ +# define SYSCTL_SHMMAX_VARIABLE "kern.sysv.shmmax" +# else +# undef SYSCTL_SHMMAX_VARIABLE +# endif + +size_t shm_get_shmmax(void) +{ + static size_t shmmax; + + if (shmmax > 0) /* only dance once */ + return shmmax; +#ifdef __linux__ /* get it from proc fs */ + { + int fd = open("/proc/sys/kernel/shmmax", O_RDONLY); + if (fd >= 0) { + char buf[100] = ""; + int ret = read(fd, buf, sizeof(buf) - 1); + if (ret > 0) { + buf[ret] = '\0'; + shmmax = strtoul(buf, NULL, 10); + } + } + } +#elif defined SYSCTL_SHMMAX_VARIABLE + { + size_t len = sizeof(shmmax); + sysctlbyname(SYSCTL_SHMMAX_VARIABLE, &shmmax, &len, NULL, 0); + } +#elif defined SHMMAX + shmmax = SHMMAX; +#endif + if (shmmax == 0) { + PARA_WARNING_LOG("unable to determine shmmax\n"); + shmmax = 65535; /* last ressort */ + } + PARA_INFO_LOG("shmmax: %zu\n", shmmax); + return shmmax; +} diff --git a/ipc.h b/ipc.h index 71e09ec1..c8d31c0c 100644 --- a/ipc.h +++ b/ipc.h @@ -11,7 +11,4 @@ int shm_new(size_t size); int shm_attach(int id, enum shm_attach_mode mode, void **result); int shm_detach(void *addr); int shm_destroy(int id); - -#ifndef SHMMAX -#define SHMMAX 65535 -#endif +size_t shm_get_shmmax(void); diff --git a/mood.c b/mood.c index 93461ee8..d9ae48bf 100644 --- a/mood.c +++ b/mood.c @@ -422,7 +422,7 @@ out: void mood_check_callback(int fd, __a_unused const struct osl_object *query) { struct para_buffer pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm }; diff --git a/mp3_afh.c b/mp3_afh.c index b0d44ec9..d72d85e7 100644 --- a/mp3_afh.c +++ b/mp3_afh.c @@ -23,8 +23,6 @@ #include "afh.h" #include "string.h" -/** \cond some defines and structs which are only used in this file */ - /* * MIN_CONSEC_GOOD_FRAMES defines how many consecutive valid MP3 frames we need * to see before we decide we are looking at a real MP3 file @@ -47,7 +45,6 @@ struct mp3header { unsigned int emphasis; }; -/** \endcond */ static const int frequencies[3][4] = { {22050,24000,16000,50000}, /* MPEG 2.0 */ {44100,48000,32000,50000}, /* MPEG 1.0 */ diff --git a/oggdec_filter.c b/oggdec_filter.c index 32ffdef9..07e4cec1 100644 --- a/oggdec_filter.c +++ b/oggdec_filter.c @@ -175,6 +175,7 @@ out: pod->converted = 0; fn->min_iqs = 0; pod->vf = vf; + pod->have_more = true; } return ret; } diff --git a/para.h b/para.h index 5dc39124..bc6aa929 100644 --- a/para.h +++ b/para.h @@ -229,12 +229,12 @@ _static_inline_ long int para_random(unsigned max) SAMPLE_FORMAT(SF_U16_LE, "16 bit unsigned, little endian"), \ SAMPLE_FORMAT(SF_U16_BE, "16 bit unsigned, big endian"), \ -/** \cond */ +/** \cond sample_format */ #define SAMPLE_FORMAT(a, b) a enum sample_format {SAMPLE_FORMATS}; #undef SAMPLE_FORMAT #define SAMPLE_FORMAT(a, b) b -/** \endcond */ +/** \endcond sample_format */ /** Debug loglevel, gets really noisy. */ #define LL_DEBUG 0 @@ -256,7 +256,7 @@ enum sample_format {SAMPLE_FORMATS}; /** Log messages with lower priority than that will not be compiled in. */ #define COMPILE_TIME_LOGLEVEL 0 -/** \cond */ +/** \cond log */ #if LL_DEBUG >= COMPILE_TIME_LOGLEVEL #define PARA_DEBUG_LOG(f,...) para_log(LL_DEBUG, "%s: " f, __FUNCTION__, ## __VA_ARGS__) #else @@ -298,4 +298,4 @@ enum sample_format {SAMPLE_FORMATS}; #else #define PARA_EMERG_LOG(...) #endif -/** \endcond */ +/** \endcond log */ diff --git a/playlist.c b/playlist.c index 2d2f23b4..806e49d5 100644 --- a/playlist.c +++ b/playlist.c @@ -131,7 +131,7 @@ static int check_playlist(struct osl_row *row, void *data) void playlist_check_callback(int fd, __a_unused const struct osl_object *query) { struct para_buffer pb = { - .max_size = SHMMAX, + .max_size = shm_get_shmmax(), .private_data = &fd, .max_size_handler = pass_buffer_as_shm }; diff --git a/recv.h b/recv.h index ee8138f9..7555dfb4 100644 --- a/recv.h +++ b/recv.h @@ -121,7 +121,7 @@ void *check_receiver_arg(char *ra, int *receiver_num); void print_receiver_helps(int detailed); int generic_recv_pre_select(struct sched *s, struct task *t); -/** \cond */ +/** \cond receiver */ extern void http_recv_init(struct receiver *r); #define HTTP_RECEIVER {.name = "http", .init = http_recv_init}, extern void dccp_recv_init(struct receiver *r); @@ -130,5 +130,5 @@ extern void udp_recv_init(struct receiver *r); #define UDP_RECEIVER {.name = "udp", .init = udp_recv_init}, extern struct receiver receivers[]; -/** \endcond */ +/** \endcond receiver */ diff --git a/server.c b/server.c index 142e2abb..15ae5c9a 100644 --- a/server.c +++ b/server.c @@ -491,7 +491,7 @@ static void server_init(int argc, char **argv) init_ipc_or_die(); /* init mmd struct and mmd->lock */ /* make sure, the global now pointer is uptodate */ gettimeofday(now, NULL); - server_uptime(UPTIME_SET); /* reset server uptime */ + set_server_start_time(now); init_user_list(user_list_file); /* become daemon */ if (conf.daemon_given) @@ -525,7 +525,7 @@ static void server_init(int argc, char **argv) static void status_refresh(void) { static int prev_uptime = -1, prev_events = -1; - int uptime = server_uptime(UPTIME_GET), ret = 1; + int uptime = get_server_uptime(now); if (prev_events != mmd->events) goto out; @@ -540,11 +540,8 @@ out: prev_uptime = uptime; prev_events = mmd->events; mmd->vss_status_flags = mmd->new_vss_status_flags; - if (ret) { - PARA_DEBUG_LOG("%d events, forcing status update\n", - mmd->events); - killpg(0, SIGUSR1); - } + PARA_DEBUG_LOG("%d events, forcing status update\n", mmd->events); + killpg(0, SIGUSR1); } static int server_select(int max_fileno, fd_set *readfds, fd_set *writefds, diff --git a/string.c b/string.c index 0a32c0f4..cefb45d6 100644 --- a/string.c +++ b/string.c @@ -521,14 +521,15 @@ __printf_2_3 int para_printf(struct para_buffer *b, const char *fmt, ...) } } -/** \cond LLONG_MAX and LLONG_MIN might not be defined. */ +/** \cond llong_minmax */ +/* LLONG_MAX and LLONG_MIN might not be defined. */ #ifndef LLONG_MAX #define LLONG_MAX 9223372036854775807LL #endif #ifndef LLONG_MIN #define LLONG_MIN (-LLONG_MAX - 1LL) #endif -/** \endcond */ +/** \endcond llong_minmax */ /** * Convert a string to a 64-bit signed integer value. diff --git a/time.c b/time.c index 3ec2a2d4..d7d803d9 100644 --- a/time.c +++ b/time.c @@ -82,7 +82,7 @@ int tv_diff(const struct timeval *b, const struct timeval *a, struct timeval *di * * \param a First addend. * \param b Second addend. - * \param sum Contains the sum \a + \a b on return. + * \param sum Contains the sum \a a + \a b on return. */ void tv_add(const struct timeval *a, const struct timeval *b, struct timeval *sum) @@ -180,7 +180,7 @@ int tv_convex_combination(const long a, const struct timeval *tv1, * \param stream_start When the first chunk was sent. * \param result The time when to send chunk number \a chunk_num. * - * This function computes stream_start + chunk_num * chunk_time. + * This function computes \a stream_start + \a chunk_num * \a chunk_time. */ void compute_chunk_time(long unsigned chunk_num, struct timeval *chunk_tv, struct timeval *stream_start,