Mercurial > dovecot > core-2.2
changeset 12523:25958384d938
Moved a global NVL() macro to the few places in lib-imap where it was actually used.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 05 Dec 2010 23:52:37 +0000 |
parents | a4e683282d1a |
children | 12e89e04d690 |
files | src/lib-imap/imap-bodystructure.c src/lib-imap/imap-envelope.c src/lib/macros.h |
diffstat | 3 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-imap/imap-bodystructure.c Sun Dec 05 23:48:34 2010 +0000 +++ b/src/lib-imap/imap-bodystructure.c Sun Dec 05 23:52:37 2010 +0000 @@ -360,6 +360,7 @@ 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;
--- a/src/lib-imap/imap-envelope.c Sun Dec 05 23:48:34 2010 +0000 +++ b/src/lib-imap/imap-envelope.c Sun Dec 05 23:52:37 2010 +0000 @@ -182,6 +182,7 @@ 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";
--- a/src/lib/macros.h Sun Dec 05 23:48:34 2010 +0000 +++ b/src/lib/macros.h Sun Dec 05 23:52:37 2010 +0000 @@ -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. */