X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fparams.c;h=09c2b0f640a12b6d8c641fb45b64389ae8f83d41;hp=d78730a0ef0253e7a0a5ab8a502a7b31142a7b6e;hb=c4f34e487fbf061ee6385d1f75e4ef0084c9a1ba;hpb=a7908ed63584ff12653b37fb2c2548c52c8ed9da diff --git a/discover/params.c b/discover/params.c index d78730a..09c2b0f 100644 --- a/discover/params.c +++ b/discover/params.c @@ -22,29 +22,29 @@ #include #include +#include + #include "params.h" #define new_array(type, num) ((type *)_new_array(sizeof(type), (num))) #define realloc_array(ptr, type, num) \ ((type *)_realloc_array((ptr), sizeof(type), (num))) -#define rprintf(x, ...) do { pb_log(stderr, ##__VA_ARGS__); \ - pb_log(stderr, "\n"); } while (0) -#define rsyserr(x, y, ...) do { pb_log(stderr, ##__VA_ARGS__); \ - pb_log(stderr, "\n"); } while (0) +#define rprintf(x, ...) do {pb_log(__VA_ARGS__); pb_log("\n");} while (0) +#define rsyserr(x, y, ...) do {pb_log(__VA_ARGS__); pb_log("\n");} while (0) #define MALLOC_MAX 0x40000000 #define False 0 #define True 1 -void *_new_array(unsigned int size, unsigned long num) +static void *_new_array(unsigned int size, unsigned long num) { if (num >= MALLOC_MAX/size) return NULL; return malloc(size * num); } -void *_realloc_array(void *ptr, unsigned int size, unsigned long num) +static void *_realloc_array(void *ptr, unsigned int size, unsigned long num) { if (num >= MALLOC_MAX/size) return NULL;