diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2014-01-31 17:43:00 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2014-01-31 17:43:00 +0100 |
commit | ef4fe8e4c89bcf8df9b3f74d285d8bbd71a09eea (patch) | |
tree | 9fccf82e53d3df2f41546c609a613872c48c0ee9 /src/libpiano/piano.h | |
parent | b91dada75f804ccca64644f6d40276db4815f4b3 (diff) | |
download | pianobar-ef4fe8e4c89bcf8df9b3f74d285d8bbd71a09eea.tar.gz pianobar-ef4fe8e4c89bcf8df9b3f74d285d8bbd71a09eea.tar.bz2 pianobar-ef4fe8e4c89bcf8df9b3f74d285d8bbd71a09eea.zip |
Switch to clang for debugging build + fix issues
Diffstat (limited to 'src/libpiano/piano.h')
-rw-r--r-- | src/libpiano/piano.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libpiano/piano.h b/src/libpiano/piano.h index ce66171..d8b84ce 100644 --- a/src/libpiano/piano.h +++ b/src/libpiano/piano.h @@ -310,14 +310,17 @@ size_t PianoListCount (const PianoListHead_t * const l); #define PianoListCountP(l) PianoListCount(&(l)->head) void *PianoListAppend (PianoListHead_t * const l, PianoListHead_t * const e) __attribute__ ((warn_unused_result)); -#define PianoListAppendP(l,e) PianoListAppend(&(l)->head, &(e)->head) +#define PianoListAppendP(l,e) PianoListAppend(((l) == NULL) ? NULL : &(l)->head, \ + &(e)->head) void *PianoListDelete (PianoListHead_t * const l, PianoListHead_t * const e) __attribute__ ((warn_unused_result)); -#define PianoListDeleteP(l,e) PianoListDelete(&(l)->head, &(e)->head) +#define PianoListDeleteP(l,e) PianoListDelete(((l) == NULL) ? NULL : &(l)->head, \ + &(e)->head) #define PianoListNextP(e) ((void *) (e)->head.next) void *PianoListPrepend (PianoListHead_t * const l, PianoListHead_t * const e) __attribute__ ((warn_unused_result)); -#define PianoListPrependP(l,e) PianoListPrepend (&(l)->head, &(e)->head) +#define PianoListPrependP(l,e) PianoListPrepend (((l) == NULL) ? NULL : &(l)->head, \ + &(e)->head) void *PianoListGet (PianoListHead_t * const l, const size_t n); #define PianoListGetP(l,n) PianoListGet (&(l)->head, n) #define PianoListForeachP(l) for (; (l) != NULL; (l) = (void *) (l)->head.next) |