diff --git a/src/cookies.c b/src/cookies.c index 6b24978..45cf8d5 100644 --- a/src/cookies.c +++ b/src/cookies.c @@ -41,7 +41,7 @@ new_cookies() { COOKIES this; char name[] = "cookies.txt"; - this = calloc(sizeof(struct COOKIES_T), 1); + this = calloc(1, sizeof(struct COOKIES_T)); this->size = 0; char *p = getenv("HOME"); len = p ? strlen(p) : 60; diff --git a/src/creds.c b/src/creds.c index ee4d06d..0ba8faf 100644 --- a/src/creds.c +++ b/src/creds.c @@ -44,7 +44,7 @@ new_creds(SCHEME scheme, char *str) { CREDS this; - this = calloc(sizeof(struct CREDS_T), 1); + this = calloc(1, sizeof(struct CREDS_T)); this->scheme = scheme; this->username = NULL; this->password = NULL; diff --git a/src/crew.c b/src/crew.c index cd08c2c..0ac95d8 100644 --- a/src/crew.c +++ b/src/crew.c @@ -55,7 +55,7 @@ new_crew(int size, int maxsize, BOOLEAN block) int c; CREW this; - if ((this = calloc(sizeof(*this),1)) == NULL) + if ((this = calloc(1,sizeof(*this))) == NULL) return NULL; if ((this->threads = (pthread_t *)malloc(sizeof(pthread_t)*size)) == NULL) @@ -147,7 +147,7 @@ private void } BOOLEAN -crew_add(CREW crew, void (*routine)(), void *arg) +crew_add(CREW crew, void (*routine)(void *), void *arg) { int c; WORK *workptr; diff --git a/src/crew.h b/src/crew.h index 7ec9d12..00fdc16 100644 --- a/src/crew.h +++ b/src/crew.h @@ -28,7 +28,7 @@ typedef struct work { - void (*routine)(); + void (*routine)(void *); void *arg; struct work *next; } WORK; @@ -36,7 +36,7 @@ typedef struct work typedef struct CREW_T *CREW; CREW new_crew(int size, int maxsize, BOOLEAN block); -BOOLEAN crew_add(CREW this, void (*routine)(), void *arg); +BOOLEAN crew_add(CREW this, void (*routine)(void *), void *arg); BOOLEAN crew_cancel(CREW this); BOOLEAN crew_join(CREW this, BOOLEAN finish, void **payload); void crew_destroy(CREW this); diff --git a/src/data.c b/src/data.c index c3d8d52..6414878 100644 --- a/src/data.c +++ b/src/data.c @@ -66,7 +66,7 @@ new_data() { DATA this; - this = calloc(sizeof(*this),1); + this = calloc(1,sizeof(*this)); this->total = 0.0; this->available = 0.0; this->count = 0.0; diff --git a/src/date.c b/src/date.c index d0da11a..d5a8796 100644 --- a/src/date.c +++ b/src/date.c @@ -142,7 +142,7 @@ DATE new_date(char *date) { time_t now; - DATE this = calloc(DATESIZE, 1); + DATE this = calloc(1, DATESIZE); this->tm = NULL; this->etag = NULL; this->date = xmalloc(MAX_DATE_LEN); diff --git a/src/date.h b/src/date.h index 5956883..64dcff4 100644 --- a/src/date.h +++ b/src/date.h @@ -34,7 +34,7 @@ extern size_t DATESIZE; * because then we have one destroyer * that we can pass to the HASH */ -DATE new_date(); +DATE new_date(char *); DATE new_etag(char *etag); DATE date_destroy(DATE this); diff --git a/src/handler.h b/src/handler.h index 42df64b..3a542e1 100644 --- a/src/handler.h +++ b/src/handler.h @@ -26,7 +26,7 @@ #include #include -void spin_doctor(); +void spin_doctor(CREW crew); void sig_handler(CREW crew); #endif/*HANDLER_H*/ diff --git a/src/init.c b/src/init.c index b04b318..bfb3568 100644 --- a/src/init.c +++ b/src/init.c @@ -233,7 +233,7 @@ show_config(int EXIT) printf("URLs file: %s\n", strlen(my.file) > 1 ? my.file : URL_FILE); printf("thread limit: %d\n", (my.limit < 1) ? 255 : my.limit); printf("logging: %s\n", my.logging ? "true" : "false"); - printf("log file: %s\n", (my.logfile == NULL) ? LOG_FILE : my.logfile); + printf("log file: %s\n", (*my.logfile) ? my.logfile : LOG_FILE); printf("resource file: %s\n", my.rc); printf("timestamped output: %s\n", my.timestamp?"true":"false"); printf("comma separated output: %s\n", my.csv?"true":"false"); diff --git a/src/page.h b/src/page.h index 2ffe6b0..6f5f005 100644 --- a/src/page.h +++ b/src/page.h @@ -7,7 +7,7 @@ */ typedef struct PAGE_T *PAGE; -PAGE new_page(); +PAGE new_page(char *); PAGE page_destroy(PAGE this); void page_concat(PAGE this, const char *str, const int len); void page_clear(PAGE this); diff --git a/src/setup.h b/src/setup.h index f867bc8..62f1dbe 100644 --- a/src/setup.h +++ b/src/setup.h @@ -91,16 +91,16 @@ char *strchr (), *strrchr (); #ifndef HAVE_STRCASECMP -int strcasecmp(); +int strcasecmp(const char *, const char *); #endif #ifndef HAVE_STRNCASECMP -int strncasecmp(); +int strncasecmp(const char *, const char *, size_t); #endif #ifndef HAVE_STRNCMP -int strncmp(); +int strncmp(const char *, const char *, size_t); #endif #ifndef HAVE_STRLEN -int strlen(); +int strlen(const char *); #endif #include