From: Timo Sirainen Date: Sun, 5 Dec 2010 23:52:37 +0000 (+0000) Subject: Moved a global NVL() macro to the few places in lib-imap where it was actually used. X-Git-Tag: 2.1.alpha1~459 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65b15c350a5bcb5f927280481a1e73abb600efba;p=thirdparty%2Fdovecot%2Fcore.git Moved a global NVL() macro to the few places in lib-imap where it was actually used. --- diff --git a/src/lib-imap/imap-bodystructure.c b/src/lib-imap/imap-bodystructure.c index edebef42fc..d693315181 100644 --- a/src/lib-imap/imap-bodystructure.c +++ b/src/lib-imap/imap-bodystructure.c @@ -360,6 +360,7 @@ static void part_write_body_multipart(const struct message_part *part, static void part_write_body(const struct message_part *part, string_t *str, bool extended) { +#define NVL(str, nullstr) ((str) != NULL ? (str) : (nullstr)) struct message_part_body_data *data = part->context; bool text; diff --git a/src/lib-imap/imap-envelope.c b/src/lib-imap/imap-envelope.c index b070b64022..5b867f79b9 100644 --- a/src/lib-imap/imap-envelope.c +++ b/src/lib-imap/imap-envelope.c @@ -182,6 +182,7 @@ static void imap_write_address(string_t *str, struct message_address *addr) void imap_envelope_write_part_data(struct message_part_envelope_data *data, string_t *str) { +#define NVL(str, nullstr) ((str) != NULL ? (str) : (nullstr)) static const char *empty_envelope = "NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL"; diff --git a/src/lib/macros.h b/src/lib/macros.h index 8aa4b9f9b2..aa0c824629 100644 --- a/src/lib/macros.h +++ b/src/lib/macros.h @@ -38,9 +38,6 @@ #define CLAMP(x, low, high) \ (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) -#undef NVL -#define NVL(str, nullstr) ((str) != NULL ? (str) : (nullstr)) - /* make it easier to cast from/to pointers. assumes that sizeof(size_t) == sizeof(void *) and they're both the largest datatypes that are allowed to be used. so, long long isn't safe with these. */