summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRuben Kerkhof <ruben@rubenkerkhof.com>2020-03-10 16:50:03 +0100
committerRuben Kerkhof <ruben@rubenkerkhof.com>2020-03-10 16:53:13 +0100
commit1e20238af5bcfa58ffb70f321e56f510a6ab33d9 (patch)
tree0cd2bd36d2cfd736aef59fafa6afa0c7fbc500d5 /lib
parent7cda3a87d130c8f18764ec2e4c986bf30ae25416 (diff)
treewide: fix some issues found with -Werror=undef
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/getopt.h2
-rw-r--r--lib/seqlock.c4
-rw-r--r--lib/skiplist.c12
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/getopt.h b/lib/getopt.h
index 138870d199..63e12e947e 100644
--- a/lib/getopt.h
+++ b/lib/getopt.h
@@ -111,7 +111,7 @@ struct option {
#if defined(__STDC__) && __STDC__
-#if REALLY_NEED_PLAIN_GETOPT
+#ifdef REALLY_NEED_PLAIN_GETOPT
/*
* getopt is defined in POSIX.2. Assume that if the system defines
diff --git a/lib/seqlock.c b/lib/seqlock.c
index 588a1175bc..77673146ea 100644
--- a/lib/seqlock.c
+++ b/lib/seqlock.c
@@ -165,7 +165,7 @@ bool seqlock_timedwait(struct seqlock *sqlo, seqlock_val_t val,
/*
* ABS_REALTIME - used on NetBSD, Solaris and OSX
*/
-#if TIME_ABS_REALTIME
+#ifdef TIME_ABS_REALTIME
#define time_arg1 &abs_rt
#define time_arg2 NULL
#define time_prep
@@ -187,7 +187,7 @@ bool seqlock_timedwait(struct seqlock *sqlo, seqlock_val_t val,
/*
* RELATIVE - used on OpenBSD (might get a patch to get absolute monotime)
*/
-#elif TIME_RELATIVE
+#elif defined(TIME_RELATIVE)
struct timespec reltime;
#define time_arg1 abs_monotime_limit
diff --git a/lib/skiplist.c b/lib/skiplist.c
index 67cc1ab378..d955c6eb9e 100644
--- a/lib/skiplist.c
+++ b/lib/skiplist.c
@@ -211,12 +211,12 @@ int skiplist_insert(register struct skiplist *l, register void *key,
q = newNodeOfLevel(k);
q->key = key;
q->value = value;
-#if SKIPLIST_0TIMER_DEBUG
+#ifdef SKIPLIST_0TIMER_DEBUG
q->flags = SKIPLIST_NODE_FLAG_INSERTED; /* debug */
#endif
++(l->stats->forward[k]);
-#if SKIPLIST_DEBUG
+#ifdef SKIPLIST_DEBUG
zlog_debug("%s: incremented stats @%p:%d, now %ld", __func__, l, k,
l->stats->forward[k] - (struct skiplistnode *)NULL);
#endif
@@ -281,7 +281,7 @@ int skiplist_delete(register struct skiplist *l, register void *key,
/*
* found node to delete
*/
-#if SKIPLIST_0TIMER_DEBUG
+#ifdef SKIPLIST_0TIMER_DEBUG
q->flags &= ~SKIPLIST_NODE_FLAG_INSERTED;
#endif
/*
@@ -300,7 +300,7 @@ int skiplist_delete(register struct skiplist *l, register void *key,
p->forward[k] = q->forward[k];
}
--(l->stats->forward[k - 1]);
-#if SKIPLIST_DEBUG
+#ifdef SKIPLIST_DEBUG
zlog_debug("%s: decremented stats @%p:%d, now %ld",
__func__, l, k - 1,
l->stats->forward[k - 1]
@@ -549,7 +549,7 @@ int skiplist_delete_first(register struct skiplist *l)
}
}
-#if SKIPLIST_0TIMER_DEBUG
+#ifdef SKIPLIST_0TIMER_DEBUG
q->flags &= ~SKIPLIST_NODE_FLAG_INSERTED;
#endif
/*
@@ -561,7 +561,7 @@ int skiplist_delete_first(register struct skiplist *l)
}
--(l->stats->forward[nodelevel]);
-#if SKIPLIST_DEBUG
+#ifdef SKIPLIST_DEBUG
zlog_debug("%s: decremented stats @%p:%d, now %ld", __func__, l,
nodelevel,
l->stats->forward[nodelevel] - (struct skiplistnode *)NULL);