diff options
| author | Joel Klinghed <the_jk@opera.com> | 2015-08-04 16:47:14 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@opera.com> | 2015-08-04 16:47:14 +0200 |
| commit | 1ef9c463f1efc1adfb62e42ab3dd17e8c6394373 (patch) | |
| tree | 8b5d2f3cc4efabe1a1b5374a9d48fd8ef9d20187 | |
| parent | b41fddc7e8f5d41c928c1aef0e75973e33572918 (diff) | |
Remove warnings
| -rw-r--r-- | configure.ac | 12 | ||||
| -rw-r--r-- | src/common.h | 7 | ||||
| -rw-r--r-- | src/dynstr.c | 1 | ||||
| -rw-r--r-- | src/paths.c | 1 | ||||
| -rw-r--r-- | src/safe_fifo.c | 1 | ||||
| -rw-r--r-- | src/strutil.c | 1 | ||||
| -rw-r--r-- | src/thread-pthread.c | 1 | ||||
| -rw-r--r-- | src/timespec.c | 3 |
8 files changed, 9 insertions, 18 deletions
diff --git a/configure.ac b/configure.ac index 237821b..1b85507 100644 --- a/configure.ac +++ b/configure.ac @@ -14,12 +14,16 @@ AM_SILENT_RULES([yes]) AC_PROG_CC AM_PROG_CC_C_O -DEFINES="-D_GNU_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE" +DEFINES="-D_DEFAULT_SOURCE -D_GNU_SOURCE -D_XOPEN_SOURCE" AX_CFLAGS_WARN_ALL([DEFINES]) AC_ARG_ENABLE([debug], AC_HELP_STRING([compile with debug options]), - if test "x$enableval" = "xyes"; then - DEFINES="$DEFINES -g -DDEBUG" - fi) + use_debug="$enableval", + use_debug=no) +if test "x$use_debug" = "xyes"; then + DEFINES="$DEFINES -g -DDEBUG" +else + DEFINES="$DEFINES -DNDEBUG" +fi AC_SUBST([DEFINES]) # Common diff --git a/src/common.h b/src/common.h index 87fa887..5b5da04 100644 --- a/src/common.h +++ b/src/common.h @@ -5,18 +5,13 @@ # include "config.h" #endif +#include <assert.h> #include <stdbool.h> #include <stdlib.h> #include "compiler.h" #include "macros.h" -#ifdef DEBUG -# include <assert.h> -#else -# define assert(x) /* x */ -#endif - #define API #endif /* COMMON_H */ diff --git a/src/dynstr.c b/src/dynstr.c index fa9e9e0..72db26d 100644 --- a/src/dynstr.c +++ b/src/dynstr.c @@ -67,7 +67,6 @@ const char* dynstr_peek(dynstr_t* str) bool dynstr_nappend(dynstr_t* str, const char* add, size_t len) { - assert(str && add); if (str->len + len >= str->size) { size_t ns = MAX(str->size * 2, str->len + len + 1); diff --git a/src/paths.c b/src/paths.c index 6a253ca..1bdc4e3 100644 --- a/src/paths.c +++ b/src/paths.c @@ -783,7 +783,6 @@ void paths_find(paths_t* paths, paths_source_t source, void* userdata) { search_t* search; - assert(paths && match && find_callback); search = get_search(paths->search); search->dir = paths_user_dir(paths, source); search->dirs = paths_search_dirs(paths, source); diff --git a/src/safe_fifo.c b/src/safe_fifo.c index cdd634f..a294d1c 100644 --- a/src/safe_fifo.c +++ b/src/safe_fifo.c @@ -58,7 +58,6 @@ void safe_fifo_unref(safe_fifo_t* fifo) void safe_fifo_push(safe_fifo_t* fifo, void* item) { - assert(fifo && item); thread_lock_lock(fifo->lock); do { diff --git a/src/strutil.c b/src/strutil.c index 7d436ec..4502b83 100644 --- a/src/strutil.c +++ b/src/strutil.c @@ -83,7 +83,6 @@ char** split_len(const char* start, const char* end, char delim) { char** ret; size_t count = 0, size = 2; - assert(start && end); assert(start <= end); ret = malloc((size + 1) * sizeof(char*)); if (ret) diff --git a/src/thread-pthread.c b/src/thread-pthread.c index ad35d77..6e31cf9 100644 --- a/src/thread-pthread.c +++ b/src/thread-pthread.c @@ -339,6 +339,5 @@ void thread_data_set(thread_data_t *data, void *value) void thread_once(thread_once_t *once, thread_run_once_t run) { - assert(once && run); ABORTFAIL(pthread_once(once, run)); } diff --git a/src/timespec.c b/src/timespec.c index 42bc157..533f00d 100644 --- a/src/timespec.c +++ b/src/timespec.c @@ -195,7 +195,6 @@ void timespec_addms(struct timespec *ts, unsigned long ms) void timespec_add(struct timespec *ts, const struct timespec *add) { - assert(ts && add); ts->tv_nsec += add->tv_nsec; ts->tv_sec += ts->tv_nsec / 1000000000 + add->tv_sec; ts->tv_nsec = ts->tv_nsec % 1000000000; @@ -203,7 +202,6 @@ void timespec_add(struct timespec *ts, const struct timespec *add) int timespec_sub(struct timespec *ts, const struct timespec *sub) { - assert(ts && sub); if (ts->tv_sec < sub->tv_sec) { ts->tv_sec = sub->tv_sec - ts->tv_sec; @@ -255,7 +253,6 @@ int timespec_sub(struct timespec *ts, const struct timespec *sub) int timespec_cmp(const struct timespec *x, const struct timespec *y) { - assert(x && y); if (x->tv_sec < y->tv_sec) { return -1; |
