From: Andre Noll Date: Wed, 11 Feb 2009 22:56:24 +0000 (+0100) Subject: Merge commit 'fml/master' X-Git-Tag: v0.3.4~63 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=7e254dc5041cc79249bf5307a19c9e04882cb3bf;hp=26d662890f5e1c29c0b09d1cac94b8b4acb065ed Merge commit 'fml/master' --- diff --git a/mp3_afh.c b/mp3_afh.c index 41874b86..932a7721 100644 --- a/mp3_afh.c +++ b/mp3_afh.c @@ -403,7 +403,7 @@ static int mp3_read_info(unsigned char *map, size_t numbytes, int fd, char *taginfo; afhi->chunks_total = 0; - afhi->chunk_table = para_malloc(chunk_table_size * sizeof(size_t)); + afhi->chunk_table = para_malloc(chunk_table_size * sizeof(uint32_t)); taginfo = mp3_get_id3(map, numbytes, fd); while (1) { unsigned long freq, br, fl; @@ -433,7 +433,7 @@ static int mp3_read_info(unsigned char *map, size_t numbytes, int fd, if (afhi->chunks_total >= chunk_table_size) { chunk_table_size *= 2; afhi->chunk_table = para_realloc(afhi->chunk_table, - chunk_table_size * sizeof(size_t)); + chunk_table_size * sizeof(uint32_t)); } afhi->chunk_table[afhi->chunks_total] = fpos; // if (afhi->chunks_total < 10 || !(afhi->chunks_total % 1000)) diff --git a/para.h b/para.h index fcc24746..06eb8b30 100644 --- a/para.h +++ b/para.h @@ -230,7 +230,8 @@ static inline long int para_random(unsigned max) } /** Round up x to a multiple of y */ -#define ROUND_UP(x, y) (((x) + ((y) - 1) / (y)) * (y)) +#define ROUND_UP(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) + /** Get the size of an array */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))