]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Moved a global NVL() macro to the few places in lib-imap where it was actually used.
authorTimo Sirainen <tss@iki.fi>
Sun, 5 Dec 2010 23:52:37 +0000 (23:52 +0000)
committerTimo Sirainen <tss@iki.fi>
Sun, 5 Dec 2010 23:52:37 +0000 (23:52 +0000)
src/lib-imap/imap-bodystructure.c
src/lib-imap/imap-envelope.c
src/lib/macros.h

index edebef42fcff0e07e68d81f0ac7ce4b99ba683a6..d693315181c54ad60e9a693e7f72a3b8bcd24915 100644 (file)
@@ -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;
 
index b070b6402206fb5630d96d66054a9c3d66a0f254..5b867f79b9796bdc26399df814cd214946e8d019 100644 (file)
@@ -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";
 
index 8aa4b9f9b220099368d49d806c78ce88445fe302..aa0c8246291f528421f4bc97b9fee5a34fc31513 100644 (file)
@@ -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. */