(CHECK_POINTER_COMPATIBILITY (&((STRUCT *) 0)->MEMBER, POINTER), \
(STRUCT *) ((char *) (POINTER) - offsetof (STRUCT, MEMBER)))
+/* A null pointer constant suitable for use in a varargs parameter list.
+
+ This is useful because a literal 0 may not have the same width as a null
+ pointer. NULL by itself is also insufficient because in C it may expand to
+ simply 0. */
+#define NULL_SENTINEL ((void *) NULL)
+
#endif /* libpspp/cast.h */
#include <stdint.h>
#include <stdlib.h>
-#include <data/file-name.h>
-#include <data/settings.h>
-#include <libpspp/assertion.h>
-#include <libpspp/compiler.h>
-#include <libpspp/message.h>
-#include <libpspp/start-date.h>
-#include <libpspp/string-map.h>
-#include <libpspp/version.h>
-#include <output/cairo.h>
-#include <output/chart-item-provider.h>
-#include <output/message-item.h>
-#include <output/options.h>
-#include <output/tab.h>
-#include <output/text-item.h>
-#include <output/driver-provider.h>
-#include <output/render.h>
-#include <output/table-item.h>
-
-#include "error.h"
-#include "minmax.h"
-#include "xalloc.h"
+#include "data/file-name.h"
+#include "data/settings.h"
+#include "libpspp/assertion.h"
+#include "libpspp/cast.h"
+#include "libpspp/compiler.h"
+#include "libpspp/message.h"
+#include "libpspp/start-date.h"
+#include "libpspp/string-map.h"
+#include "libpspp/version.h"
+#include "output/cairo.h"
+#include "output/chart-item-provider.h"
+#include "output/driver-provider.h"
+#include "output/message-item.h"
+#include "output/options.h"
+#include "output/render.h"
+#include "output/tab.h"
+#include "output/table-item.h"
+#include "output/text-item.h"
+
+#include "gl/error.h"
+#include "gl/minmax.h"
+#include "gl/xalloc.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
"bold", EMPH_BOLD,
"underline", EMPH_UNDERLINE,
"none", EMPH_NONE,
- NULL);
+ NULL_SENTINEL);
a->chart_file_name = parse_chart_file_name (opt (d, o, "charts", file_name));
O has no user-specified value, then O's default value is treated the same
way. If the default value still does not match, parse_enum() returns 0.
- Example: parse_enum (o, "a", 1, "b", 2, NULL) returns 1 if O's
+ Example: parse_enum (o, "a", 1, "b", 2, NULL_SENTINEL) returns 1 if O's
value if "a", 2 if O's value is "b".
Destroys O. */
#include "libpspp/argv-parser.h"
#include "libpspp/assertion.h"
+#include "libpspp/cast.h"
#include "libpspp/getl.h"
#include "libpspp/version.h"
#include "libpspp/copyleft.h"
case OPT_VERSION:
version_etc (stdout, "psppire", PACKAGE_NAME, PACKAGE_VERSION,
"Ben Pfaff", "John Darrington", "Jason Stover",
- NULL);
+ NULL_SENTINEL);
exit (EXIT_SUCCESS);
case OPT_NO_SPLASH:
#include "language/syntax-file.h"
#include "libpspp/argv-parser.h"
#include "libpspp/assertion.h"
+#include "libpspp/cast.h"
#include "libpspp/compiler.h"
#include "libpspp/getl.h"
#include "libpspp/llx.h"
case OPT_VERSION:
version_etc (stdout, "pspp", PACKAGE_NAME, PACKAGE_VERSION,
"Ben Pfaff", "John Darrington", "Jason Stover",
- NULL);
+ NULL_SENTINEL);
exit (EXIT_SUCCESS);
default: