Use dedicated union member for option offsets
[users/jgh/exim.git] / src / src / transports / autoreply.c
index 666591b6029cc79645156659e5761465e64b5c9d..4b5ef8e1748844934fb948b1e31bdb2399523911 100644 (file)
@@ -16,44 +16,27 @@ order (note that "_" comes before the lower case letters). Those starting
 with "*" are not settable by the user but are used by the option-reading
 software for alternative value types. Some options are publicly visible and so
 are stored in the driver instance block. These are flagged with opt_public. */
+#define LOFF(field) OPT_OFF(autoreply_transport_options_block, field)
 
 optionlist autoreply_transport_options[] = {
-  { "bcc",               opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, bcc) },
-  { "cc",                opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, cc) },
-  { "file",              opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, file) },
-  { "file_expand",     opt_bool,
-      (void *)offsetof(autoreply_transport_options_block, file_expand) },
-  { "file_optional",     opt_bool,
-      (void *)offsetof(autoreply_transport_options_block, file_optional) },
-  { "from",              opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, from) },
-  { "headers",           opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, headers) },
-  { "log",               opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, logfile) },
-  { "mode",              opt_octint,
-      (void *)offsetof(autoreply_transport_options_block, mode) },
-  { "never_mail",        opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, never_mail) },
-  { "once",              opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, oncelog) },
-  { "once_file_size",    opt_int,
-      (void *)offsetof(autoreply_transport_options_block, once_file_size) },
-  { "once_repeat",       opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, once_repeat) },
-  { "reply_to",          opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, reply_to) },
-  { "return_message",    opt_bool,
-      (void *)offsetof(autoreply_transport_options_block, return_message) },
-  { "subject",           opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, subject) },
-  { "text",              opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, text) },
-  { "to",                opt_stringptr,
-      (void *)offsetof(autoreply_transport_options_block, to) },
+  { "bcc",               opt_stringptr,        LOFF(bcc) },
+  { "cc",                opt_stringptr,        LOFF(cc) },
+  { "file",              opt_stringptr,        LOFF(file) },
+  { "file_expand",     opt_bool,       LOFF(file_expand) },
+  { "file_optional",     opt_bool,     LOFF(file_optional) },
+  { "from",              opt_stringptr,        LOFF(from) },
+  { "headers",           opt_stringptr,        LOFF(headers) },
+  { "log",               opt_stringptr,        LOFF(logfile) },
+  { "mode",              opt_octint,   LOFF(mode) },
+  { "never_mail",        opt_stringptr,        LOFF(never_mail) },
+  { "once",              opt_stringptr,        LOFF(oncelog) },
+  { "once_file_size",    opt_int,      LOFF(once_file_size) },
+  { "once_repeat",       opt_stringptr,        LOFF(once_repeat) },
+  { "reply_to",          opt_stringptr,        LOFF(reply_to) },
+  { "return_message",    opt_bool,     LOFF(return_message) },
+  { "subject",           opt_stringptr,        LOFF(subject) },
+  { "text",              opt_stringptr,        LOFF(text) },
+  { "to",                opt_stringptr,        LOFF(to) },
 };
 
 /* Size of the options list. An extern variable has to be used so that its