From 9f087e7aa4cdff1d5d46d5e188c0017a9d2d0029 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 12 Oct 2007 04:59:26 +0000 Subject: [PATCH] xalloc.h-instead-of-alloc.h.patch from patch #6230. Removes src/libpspp/alloc.[ch] and changes users to include "xalloc.h" from gnulib instead. --- src/data/case-map.c | 4 ++- src/data/case.c | 2 +- src/data/category.c | 3 ++- src/data/dictionary.c | 2 +- src/data/file-handle-def.c | 3 ++- src/data/make-file.c | 3 ++- src/data/por-file-reader.c | 3 ++- src/data/por-file-writer.c | 3 ++- src/data/procedure.c | 2 +- src/data/sys-file-reader.c | 2 +- src/data/sys-file-writer.c | 2 +- src/data/value-labels.c | 3 ++- src/data/variable.c | 3 ++- src/language/control/do-if.c | 4 +-- src/language/control/loop.c | 3 ++- src/language/control/repeat.c | 2 +- src/language/control/temporary.c | 4 +-- src/language/data-io/data-list.c | 2 +- src/language/data-io/data-reader.c | 2 +- src/language/data-io/data-writer.c | 2 +- src/language/data-io/file-handle.q | 3 ++- src/language/data-io/get.c | 3 ++- src/language/data-io/inpt-pgm.c | 3 ++- src/language/data-io/list.q | 2 +- src/language/data-io/print.c | 3 ++- src/language/dictionary/modify-variables.c | 4 +-- src/language/dictionary/rename-variables.c | 3 ++- src/language/dictionary/split-file.c | 3 ++- src/language/dictionary/sys-file-info.c | 2 +- src/language/dictionary/value-labels.c | 3 ++- src/language/dictionary/variable-display.c | 3 ++- src/language/dictionary/variable-label.c | 3 ++- src/language/dictionary/vector.c | 2 +- src/language/expressions/evaluate.c | 3 ++- src/language/expressions/optimize.c | 3 ++- src/language/expressions/parse.c | 3 ++- src/language/lexer/lexer.c | 2 +- src/language/lexer/q2c.c | 4 ++- src/language/lexer/variable-parser.c | 3 ++- src/language/prompt.c | 3 ++- src/language/stats/aggregate.c | 2 +- src/language/stats/autorecode.c | 4 +-- src/language/stats/binomial.c | 3 ++- src/language/stats/chisquare.c | 3 ++- src/language/stats/correlations.q | 3 ++- src/language/stats/descriptives.c | 3 ++- src/language/stats/examine.q | 2 +- src/language/stats/flip.c | 2 +- src/language/stats/frequencies.q | 2 +- src/language/stats/glm.q | 2 +- src/language/stats/means.q | 3 ++- src/language/stats/oneway.q | 3 ++- src/language/stats/regression.q | 3 ++- src/language/stats/sort-cases.c | 3 ++- src/language/stats/t-test.q | 2 +- src/language/syntax-file.c | 3 ++- src/language/syntax-string-source.c | 3 ++- src/language/utilities/echo.c | 3 ++- src/language/utilities/include.c | 6 ++--- src/language/utilities/set.q | 3 ++- src/language/utilities/title.c | 3 ++- src/language/xforms/compute.c | 5 ++-- src/language/xforms/count.c | 3 ++- src/language/xforms/recode.c | 4 +-- src/language/xforms/sample.c | 3 ++- src/language/xforms/select-if.c | 3 ++- src/libpspp/ChangeLog | 7 ++++++ src/libpspp/alloc.c | 29 ---------------------- src/libpspp/alloc.h | 27 -------------------- src/libpspp/array.c | 4 +-- src/libpspp/automake.mk | 2 -- src/libpspp/getl.c | 3 ++- src/libpspp/hash.c | 2 +- src/libpspp/message.c | 2 +- src/libpspp/msg-locator.c | 3 ++- src/libpspp/pool.c | 5 ++-- src/libpspp/str.c | 2 +- src/math/design-matrix.c | 3 ++- src/math/factor-stats.c | 2 +- src/math/group.c | 2 +- src/math/interaction.c | 3 ++- src/math/levene.c | 3 ++- src/math/moments.c | 3 ++- src/math/sort.c | 3 ++- src/math/ts/innovations.c | 3 ++- src/output/ascii.c | 2 +- src/output/chart.c | 2 +- src/output/chart.h | 3 ++- src/output/charts/plot-chart.c | 2 +- src/output/charts/plot-chart.h | 2 +- src/output/html.c | 3 ++- src/output/output.c | 2 +- src/output/postscript.c | 7 +++--- src/output/table.c | 2 +- src/ui/gui/clipboard.c | 2 +- src/ui/gui/find-dialog.c | 5 ++-- src/ui/gui/syntax-editor-source.c | 3 ++- src/ui/terminal/command-line.c | 3 ++- 98 files changed, 170 insertions(+), 167 deletions(-) delete mode 100644 src/libpspp/alloc.c delete mode 100644 src/libpspp/alloc.h diff --git a/src/data/case-map.c b/src/data/case-map.c index a1a65cc1..7a91f497 100644 --- a/src/data/case-map.c +++ b/src/data/case-map.c @@ -19,13 +19,15 @@ #include #include +#include #include #include #include -#include #include +#include "xalloc.h" + /* A case map. */ struct case_map { diff --git a/src/data/case.c b/src/data/case.c index 4b8c79de..cec6f21e 100644 --- a/src/data/case.c +++ b/src/data/case.c @@ -24,10 +24,10 @@ #include #include -#include #include #include "minmax.h" +#include "xalloc.h" /* Reference-counted case implementation. */ struct case_data diff --git a/src/data/category.c b/src/data/category.c index 835c0907..b0424d9f 100644 --- a/src/data/category.c +++ b/src/data/category.c @@ -34,12 +34,13 @@ #include #include -#include #include #include "category.h" #include "value.h" #include "variable.h" +#include "xalloc.h" + #define CAT_VALUE_NOT_FOUND -2 #define N_INITIAL_CATEGORIES 1 diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 5d6633bd..32e9840b 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -28,7 +28,6 @@ #include "vardict.h" #include "variable.h" #include "vector.h" -#include #include #include #include @@ -38,6 +37,7 @@ #include #include "minmax.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/data/file-handle-def.c b/src/data/file-handle-def.c index 59195e91..1dea25a5 100644 --- a/src/data/file-handle-def.c +++ b/src/data/file-handle-def.c @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -31,6 +30,8 @@ #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/data/make-file.c b/src/data/make-file.c index 3225d2ca..051905b8 100644 --- a/src/data/make-file.c +++ b/src/data/make-file.c @@ -23,7 +23,8 @@ #include "file-name.h" #include "make-file.h" #include -#include + +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/data/por-file-reader.c b/src/data/por-file-reader.c index 9977158e..4636d5fb 100644 --- a/src/data/por-file-reader.c +++ b/src/data/por-file-reader.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -43,6 +42,8 @@ #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/data/por-file-writer.c b/src/data/por-file-writer.c index cfb9c303..111043a8 100644 --- a/src/data/por-file-writer.c +++ b/src/data/por-file-writer.c @@ -38,13 +38,14 @@ #include #include -#include #include #include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/data/procedure.c b/src/data/procedure.c index f280b682..e446a659 100644 --- a/src/data/procedure.c +++ b/src/data/procedure.c @@ -32,12 +32,12 @@ #include #include #include -#include #include #include #include #include +#include "xalloc.h" struct dataset { /* Cases are read from source, diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c index 6900c2cc..baa0c0e6 100644 --- a/src/data/sys-file-reader.c +++ b/src/data/sys-file-reader.c @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -51,6 +50,7 @@ #include "inttostr.h" #include "minmax.h" #include "unlocked-io.h" +#include "xalloc.h" #include "xsize.h" #include "gettext.h" diff --git a/src/data/sys-file-writer.c b/src/data/sys-file-writer.c index b21053c2..a20b9fc1 100644 --- a/src/data/sys-file-writer.c +++ b/src/data/sys-file-writer.c @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -49,6 +48,7 @@ #include "minmax.h" #include "unlocked-io.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/data/value-labels.c b/src/data/value-labels.c index 5a42ea3c..b9acc2bd 100644 --- a/src/data/value-labels.c +++ b/src/data/value-labels.c @@ -24,12 +24,13 @@ #include #include #include -#include #include #include #include #include +#include "xalloc.h" + static hsh_compare_func compare_int_val_lab; static hsh_hash_func hash_int_val_lab; static hsh_free_func free_int_val_lab; diff --git a/src/data/variable.c b/src/data/variable.c index b3b34be0..4a2e4405 100644 --- a/src/data/variable.c +++ b/src/data/variable.c @@ -29,13 +29,14 @@ #include "vardict.h" #include -#include #include #include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/control/do-if.c b/src/language/control/do-if.c index 2e1e0abf..61c450a5 100644 --- a/src/language/control/do-if.c +++ b/src/language/control/do-if.c @@ -26,12 +26,12 @@ #include #include #include -#include #include #include -#include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/control/loop.c b/src/language/control/loop.c index 1edbf25c..20cf69e5 100644 --- a/src/language/control/loop.c +++ b/src/language/control/loop.c @@ -26,13 +26,14 @@ #include #include #include -#include #include #include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/control/repeat.c b/src/language/control/repeat.c index cd56d7c8..e518d51e 100644 --- a/src/language/control/repeat.c +++ b/src/language/control/repeat.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -38,6 +37,7 @@ #include #include "intprops.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/control/temporary.c b/src/language/control/temporary.c index b0064141..2f8b4023 100644 --- a/src/language/control/temporary.c +++ b/src/language/control/temporary.c @@ -27,12 +27,12 @@ #include #include #include -#include #include #include -#include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/data-io/data-list.c b/src/language/data-io/data-list.c index 75db52af..61f8d8bd 100644 --- a/src/language/data-io/data-list.c +++ b/src/language/data-io/data-list.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -51,6 +50,7 @@ #include "size_max.h" #include "xsize.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/data-io/data-reader.c b/src/language/data-io/data-reader.c index 7176aed4..12bb43a3 100644 --- a/src/language/data-io/data-reader.c +++ b/src/language/data-io/data-reader.c @@ -31,13 +31,13 @@ #include #include #include -#include #include #include #include #include "minmax.h" #include "size_max.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/data-io/data-writer.c b/src/language/data-io/data-writer.c index 0680fc41..55b6737b 100644 --- a/src/language/data-io/data-writer.c +++ b/src/language/data-io/data-writer.c @@ -24,12 +24,12 @@ #include #include -#include #include #include #include #include "minmax.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/data-io/file-handle.q b/src/language/data-io/file-handle.q index 2e3d8a34..7845ca33 100644 --- a/src/language/data-io/file-handle.q +++ b/src/language/data-io/file-handle.q @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -29,6 +28,8 @@ #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/data-io/get.c b/src/language/data-io/get.c index abfc6247..e34ea799 100644 --- a/src/language/data-io/get.c +++ b/src/language/data-io/get.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -46,6 +45,8 @@ #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/data-io/inpt-pgm.c b/src/language/data-io/inpt-pgm.c index 59d7bfa7..844fe2fe 100644 --- a/src/language/data-io/inpt-pgm.c +++ b/src/language/data-io/inpt-pgm.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -41,6 +40,8 @@ #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/data-io/list.q b/src/language/data-io/list.q index 0227c72b..ca69ab25 100644 --- a/src/language/data-io/list.q +++ b/src/language/data-io/list.q @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -44,6 +43,7 @@ #include #include "minmax.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/data-io/print.c b/src/language/data-io/print.c index d8f95d4e..67dfa129 100644 --- a/src/language/data-io/print.c +++ b/src/language/data-io/print.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -40,6 +39,8 @@ #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/dictionary/modify-variables.c b/src/language/dictionary/modify-variables.c index c20285fe..d9a72f35 100644 --- a/src/language/dictionary/modify-variables.c +++ b/src/language/dictionary/modify-variables.c @@ -24,17 +24,17 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/dictionary/rename-variables.c b/src/language/dictionary/rename-variables.c index 9f2c96e7..3179efda 100644 --- a/src/language/dictionary/rename-variables.c +++ b/src/language/dictionary/rename-variables.c @@ -24,11 +24,12 @@ #include #include #include -#include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/dictionary/split-file.c b/src/language/dictionary/split-file.c index 99766287..91c27c95 100644 --- a/src/language/dictionary/split-file.c +++ b/src/language/dictionary/split-file.c @@ -29,12 +29,13 @@ #include #include #include -#include #include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/dictionary/sys-file-info.c b/src/language/dictionary/sys-file-info.c index 15b7e859..48703b4a 100644 --- a/src/language/dictionary/sys-file-info.c +++ b/src/language/dictionary/sys-file-info.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -44,6 +43,7 @@ #include #include "minmax.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/dictionary/value-labels.c b/src/language/dictionary/value-labels.c index 6af0b62c..4b7c0396 100644 --- a/src/language/dictionary/value-labels.c +++ b/src/language/dictionary/value-labels.c @@ -25,11 +25,12 @@ #include #include #include -#include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/dictionary/variable-display.c b/src/language/dictionary/variable-display.c index cf3bad79..bada0814 100644 --- a/src/language/dictionary/variable-display.c +++ b/src/language/dictionary/variable-display.c @@ -24,10 +24,11 @@ #include #include #include -#include #include #include +#include "xalloc.h" + /* Set variables' alignment This is the alignment for GUI display only. It affects nothing but GUIs diff --git a/src/language/dictionary/variable-label.c b/src/language/dictionary/variable-label.c index 88b60ad0..e8abe70d 100644 --- a/src/language/dictionary/variable-label.c +++ b/src/language/dictionary/variable-label.c @@ -24,10 +24,11 @@ #include #include #include -#include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/dictionary/vector.c b/src/language/dictionary/vector.c index dd5c0cf4..e61ee53a 100644 --- a/src/language/dictionary/vector.c +++ b/src/language/dictionary/vector.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -34,6 +33,7 @@ #include #include "intprops.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/expressions/evaluate.c b/src/language/expressions/evaluate.c index 10759b97..52dafef8 100644 --- a/src/language/expressions/evaluate.c +++ b/src/language/expressions/evaluate.c @@ -18,13 +18,14 @@ #include "private.h" #include -#include #include #include #include "helpers.h" #include "evaluate.h" #include +#include "xalloc.h" + static void expr_evaluate (struct expression *e, const struct ccase *c, int case_idx, void *result) diff --git a/src/language/expressions/optimize.c b/src/language/expressions/optimize.c index df0ab75f..b0abd946 100644 --- a/src/language/expressions/optimize.c +++ b/src/language/expressions/optimize.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -33,6 +32,8 @@ #include #include +#include "xalloc.h" + static union any_node *evaluate_tree (struct composite_node *, struct expression *); static union any_node *optimize_tree (union any_node *, struct expression *); diff --git a/src/language/expressions/parse.c b/src/language/expressions/parse.c index 073feaf7..5ae49944 100644 --- a/src/language/expressions/parse.c +++ b/src/language/expressions/parse.c @@ -31,13 +31,14 @@ #include #include #include -#include #include #include #include #include #include #include + +#include "xalloc.h" /* Declarations. */ diff --git a/src/language/lexer/lexer.c b/src/language/lexer/lexer.c index 7d5ece79..fb0ddb49 100644 --- a/src/language/lexer/lexer.c +++ b/src/language/lexer/lexer.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -33,6 +32,7 @@ #include #include "size_max.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/lexer/q2c.c b/src/language/lexer/q2c.c index fcb2f5c6..60a5790f 100644 --- a/src/language/lexer/q2c.c +++ b/src/language/lexer/q2c.c @@ -2073,7 +2073,6 @@ main (int argc, char *argv[]) indent = 0; dump (0, "#include "); - dump (0, "#include "); dump (0, "#include "); dump (0, "#include "); dump (0, "#include "); @@ -2084,6 +2083,9 @@ main (int argc, char *argv[]) dump (0, "#include "); dump (0, nullstr); + dump (0, "#include \"xalloc.h\""); + dump (0, nullstr); + dump (0, "#include \"gettext.h\""); dump (0, "#define _(msgid) gettext (msgid)"); dump (0, nullstr); diff --git a/src/language/lexer/variable-parser.c b/src/language/lexer/variable-parser.c index ed64d034..37781561 100644 --- a/src/language/lexer/variable-parser.c +++ b/src/language/lexer/variable-parser.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -35,6 +34,8 @@ #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/prompt.c b/src/language/prompt.c index 378fa851..5ecd42fb 100644 --- a/src/language/prompt.c +++ b/src/language/prompt.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -36,6 +35,8 @@ #include #include +#include "xalloc.h" + /* Current prompts in each style. */ static char *prompts[PROMPT_CNT]; diff --git a/src/language/stats/aggregate.c b/src/language/stats/aggregate.c index 921c8ed0..b464a289 100644 --- a/src/language/stats/aggregate.c +++ b/src/language/stats/aggregate.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -46,6 +45,7 @@ #include #include "minmax.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/autorecode.c b/src/language/stats/autorecode.c index b075fb0b..8b64ff3d 100644 --- a/src/language/stats/autorecode.c +++ b/src/language/stats/autorecode.c @@ -26,14 +26,14 @@ #include #include #include -#include #include #include #include -#include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/binomial.c b/src/language/stats/binomial.c index 1d8d15fc..f82647a4 100644 --- a/src/language/stats/binomial.c +++ b/src/language/stats/binomial.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include @@ -33,6 +32,8 @@ #include "binomial.h" #include "freq.h" +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/chisquare.c b/src/language/stats/chisquare.c index 1b839272..337203f1 100644 --- a/src/language/stats/chisquare.c +++ b/src/language/stats/chisquare.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -39,6 +38,8 @@ #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/correlations.q b/src/language/stats/correlations.q index 0ed9cc30..540024db 100644 --- a/src/language/stats/correlations.q +++ b/src/language/stats/correlations.q @@ -26,9 +26,10 @@ #include #include #include -#include #include +#include "xalloc.h" + /* (headers) */ struct cor_set diff --git a/src/language/stats/descriptives.c b/src/language/stats/descriptives.c index 70751495..e1ca73bb 100644 --- a/src/language/stats/descriptives.c +++ b/src/language/stats/descriptives.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -39,6 +38,8 @@ #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) #define N_(msgid) msgid diff --git a/src/language/stats/examine.q b/src/language/stats/examine.q index acf14e39..9d7ed136 100644 --- a/src/language/stats/examine.q +++ b/src/language/stats/examine.q @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -47,6 +46,7 @@ #include #include "minmax.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/flip.c b/src/language/stats/flip.c index 760b2ffc..2bcd1e4b 100644 --- a/src/language/stats/flip.c +++ b/src/language/stats/flip.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -43,6 +42,7 @@ #include "intprops.h" #include "minmax.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/frequencies.q b/src/language/stats/frequencies.q index 681d2161..ce313678 100644 --- a/src/language/stats/frequencies.q +++ b/src/language/stats/frequencies.q @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -59,6 +58,7 @@ #include "freq.h" #include "minmax.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/glm.q b/src/language/stats/glm.q index e7620a30..2e230c36 100644 --- a/src/language/stats/glm.q +++ b/src/language/stats/glm.q @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -45,6 +44,7 @@ #include #include +#include "xalloc.h" #include "gettext.h" #define GLM_LARGE_DATA 1000 diff --git a/src/language/stats/means.q b/src/language/stats/means.q index 0e8ba1ee..071253f3 100644 --- a/src/language/stats/means.q +++ b/src/language/stats/means.q @@ -24,10 +24,11 @@ #include #include #include -#include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/oneway.q b/src/language/stats/oneway.q index 2522ef5d..d10dbb5b 100644 --- a/src/language/stats/oneway.q +++ b/src/language/stats/oneway.q @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -45,6 +44,8 @@ #include #include "sort-criteria.h" +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/regression.q b/src/language/stats/regression.q index 7b02e4b9..515081a4 100644 --- a/src/language/stats/regression.q +++ b/src/language/stats/regression.q @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -47,6 +46,8 @@ #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/sort-cases.c b/src/language/stats/sort-cases.c index 4cf1f9fd..2435c19a 100644 --- a/src/language/stats/sort-cases.c +++ b/src/language/stats/sort-cases.c @@ -26,12 +26,13 @@ #include #include #include -#include #include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/t-test.q b/src/language/stats/t-test.q index dc227c1f..fa33a446 100644 --- a/src/language/stats/t-test.q +++ b/src/language/stats/t-test.q @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -45,6 +44,7 @@ #include #include "size_max.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/syntax-file.c b/src/language/syntax-file.c index dde807c3..5bd6fafa 100644 --- a/src/language/syntax-file.c +++ b/src/language/syntax-file.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -40,6 +39,8 @@ #include "prompt.h" +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/syntax-string-source.c b/src/language/syntax-string-source.c index f80bca2e..94a56f97 100644 --- a/src/language/syntax-string-source.c +++ b/src/language/syntax-string-source.c @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -26,6 +25,8 @@ #include "syntax-string-source.h" +#include "xalloc.h" + struct syntax_string_source { struct getl_interface parent; diff --git a/src/language/utilities/echo.c b/src/language/utilities/echo.c index fe148ab8..74136da3 100644 --- a/src/language/utilities/echo.c +++ b/src/language/utilities/echo.c @@ -16,13 +16,14 @@ #include #include -#include #include #include #include #include #include +#include "xalloc.h" + /* Echos a string to the output stream */ int cmd_echo (struct lexer *lexer, struct dataset *ds UNUSED) diff --git a/src/language/utilities/include.c b/src/language/utilities/include.c index 26c718a4..d7b10283 100644 --- a/src/language/utilities/include.c +++ b/src/language/utilities/include.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -25,9 +24,10 @@ #include #include #include -#include -#include +#include "dirname.h" +#include "canonicalize.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/utilities/set.q b/src/language/utilities/set.q index 18ead915..2248b85e 100644 --- a/src/language/utilities/set.q +++ b/src/language/utilities/set.q @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -52,6 +51,8 @@ int tgetnum (const char *); #endif /* !HAVE_TERMCAP_H */ #endif /* !HAVE_LIBTERMCAP */ +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/utilities/title.c b/src/language/utilities/title.c index 982c626e..1bdb0e9a 100644 --- a/src/language/utilities/title.c +++ b/src/language/utilities/title.c @@ -24,12 +24,13 @@ #include #include #include -#include #include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/xforms/compute.c b/src/language/xforms/compute.c index bf279c90..ec5a15a1 100644 --- a/src/language/xforms/compute.c +++ b/src/language/xforms/compute.c @@ -16,6 +16,7 @@ #include +#include #include #include @@ -27,12 +28,12 @@ #include #include #include -#include -#include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/xforms/count.c b/src/language/xforms/count.c index 4942f97a..1c9b4d65 100644 --- a/src/language/xforms/count.c +++ b/src/language/xforms/count.c @@ -27,13 +27,14 @@ #include #include #include -#include #include #include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/xforms/recode.c b/src/language/xforms/recode.c index dd370554..08bece5d 100644 --- a/src/language/xforms/recode.c +++ b/src/language/xforms/recode.c @@ -30,14 +30,14 @@ #include #include #include -#include #include #include #include -#include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/xforms/sample.c b/src/language/xforms/sample.c index 2aa21c22..632009ed 100644 --- a/src/language/xforms/sample.c +++ b/src/language/xforms/sample.c @@ -25,12 +25,13 @@ #include #include #include -#include #include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/xforms/select-if.c b/src/language/xforms/select-if.c index 3cd2f16c..5576c420 100644 --- a/src/language/xforms/select-if.c +++ b/src/language/xforms/select-if.c @@ -26,10 +26,11 @@ #include #include #include -#include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/libpspp/ChangeLog b/src/libpspp/ChangeLog index bd5398ee..bd3bc536 100644 --- a/src/libpspp/ChangeLog +++ b/src/libpspp/ChangeLog @@ -1,3 +1,10 @@ +2007-10-11 Ben Pfaff + + * xalloc.h: Removed. Changed all users to include "xalloc.h" from + gnulib instead. + + * xalloc.c: Removed. + 2007-10-11 Ben Pfaff * alloc.h (local_alloc): Removed. Changed all users to use diff --git a/src/libpspp/alloc.c b/src/libpspp/alloc.c deleted file mode 100644 index f4cab0d7..00000000 --- a/src/libpspp/alloc.c +++ /dev/null @@ -1,29 +0,0 @@ -/* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#include -#include "alloc.h" -#include - -/* Allocates and returns N elements of S bytes each. - N must be nonnegative, S must be positive. - Returns a null pointer if the memory cannot be obtained, - including the case where N * S overflows the range of size_t. */ -void * -nmalloc (size_t n, size_t s) -{ - return !xalloc_oversized (n, s) ? malloc (n * s) : NULL; -} diff --git a/src/libpspp/alloc.h b/src/libpspp/alloc.h deleted file mode 100644 index b1a2a655..00000000 --- a/src/libpspp/alloc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#if !alloc_h -#define alloc_h 1 - -#include - -/* malloc() wrapper functions. */ -#include "xalloc.h" - -void *nmalloc (size_t n, size_t s); - -#endif /* alloc.h */ diff --git a/src/libpspp/array.c b/src/libpspp/array.c index e4d26937..6df2a2d8 100644 --- a/src/libpspp/array.c +++ b/src/libpspp/array.c @@ -88,11 +88,9 @@ #include #include #include -#include "alloc.h" #include -#include "message.h" - +#include "xalloc.h" #include "minmax.h" /* Finds an element in ARRAY, which contains COUNT elements of diff --git a/src/libpspp/automake.mk b/src/libpspp/automake.mk index 1c56ca61..4c714f20 100644 --- a/src/libpspp/automake.mk +++ b/src/libpspp/automake.mk @@ -6,8 +6,6 @@ noinst_LIBRARIES += src/libpspp/libpspp.a src_libpspp_libpspp_a_SOURCES = \ src/libpspp/abt.c \ src/libpspp/abt.h \ - src/libpspp/alloc.c \ - src/libpspp/alloc.h \ src/libpspp/array.c \ src/libpspp/array.h \ src/libpspp/assertion.h \ diff --git a/src/libpspp/getl.c b/src/libpspp/getl.c index 4d6338ce..1214b95c 100644 --- a/src/libpspp/getl.c +++ b/src/libpspp/getl.c @@ -22,7 +22,8 @@ #include #include #include -#include + +#include "xalloc.h" struct getl_source { diff --git a/src/libpspp/hash.c b/src/libpspp/hash.c index bc5933a2..9f1079a2 100644 --- a/src/libpspp/hash.c +++ b/src/libpspp/hash.c @@ -24,12 +24,12 @@ #include #include #include "array.h" -#include "alloc.h" #include "compiler.h" #include "misc.h" #include "str.h" #include "pool.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/libpspp/message.c b/src/libpspp/message.c index 622388a1..695b7132 100644 --- a/src/libpspp/message.c +++ b/src/libpspp/message.c @@ -26,10 +26,10 @@ #include #include -#include #include #include "progname.h" +#include "xalloc.h" #include "xvasprintf.h" /* Current command name as set by msg_set_command_name(). */ diff --git a/src/libpspp/msg-locator.c b/src/libpspp/msg-locator.c index 3e915382..09550e29 100644 --- a/src/libpspp/msg-locator.c +++ b/src/libpspp/msg-locator.c @@ -16,12 +16,13 @@ #include #include -#include #include "msg-locator.h" #include #include #include "getl.h" +#include "xalloc.h" + /* File locator stack. */ static const struct msg_locator **file_loc; diff --git a/src/libpspp/pool.c b/src/libpspp/pool.c index 896a27ed..ecf263ab 100644 --- a/src/libpspp/pool.c +++ b/src/libpspp/pool.c @@ -17,12 +17,13 @@ #include #include "pool.h" #include -#include "alloc.h" #include #include "message.h" -#include "size_max.h" #include "str.h" +#include "size_max.h" +#include "xalloc.h" + /* Fast, low-overhead memory block suballocator. */ struct pool { diff --git a/src/libpspp/str.c b/src/libpspp/str.c index 6539b380..13c081dd 100644 --- a/src/libpspp/str.c +++ b/src/libpspp/str.c @@ -22,12 +22,12 @@ #include #include -#include #include #include #include "minmax.h" #include "size_max.h" +#include "xalloc.h" #include "xsize.h" /* Reverses the order of NBYTES bytes at address P, thus converting diff --git a/src/math/design-matrix.c b/src/math/design-matrix.c index 86d19f68..298d0335 100644 --- a/src/math/design-matrix.c +++ b/src/math/design-matrix.c @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -36,6 +35,8 @@ #include #include +#include "xalloc.h" + #define DM_COLUMN_NOT_FOUND -1 #define DM_INDEX_NOT_FOUND -3 diff --git a/src/math/factor-stats.c b/src/math/factor-stats.c index 836fba98..1b91e84e 100644 --- a/src/math/factor-stats.c +++ b/src/math/factor-stats.c @@ -19,7 +19,6 @@ #include #include #include -#include #include "moments.h" #include "percentiles.h" @@ -29,6 +28,7 @@ #include #include "histogram.h" +#include "xalloc.h" void metrics_precalc(struct metrics *m) diff --git a/src/math/group.c b/src/math/group.c index 154e6f88..13b545f3 100644 --- a/src/math/group.c +++ b/src/math/group.c @@ -16,7 +16,6 @@ #include #include -#include #include #include #include "group.h" @@ -25,6 +24,7 @@ #include #include +#include "xalloc.h" /* Return -1 if the id of a is less than b; +1 if greater than and 0 if equal */ diff --git a/src/math/interaction.c b/src/math/interaction.c index 2d670b2d..c8ead429 100644 --- a/src/math/interaction.c +++ b/src/math/interaction.c @@ -28,13 +28,14 @@ #include #include -#include #include #include #include #include #include "interaction.h" +#include "xalloc.h" + /* Convert a list of values to a binary vector. The order of VALS must correspond to the order of V. diff --git a/src/math/levene.c b/src/math/levene.c index 4a9f1307..3f8ddb29 100644 --- a/src/math/levene.c +++ b/src/math/levene.c @@ -25,13 +25,14 @@ #include #include #include -#include #include #include "group.h" #include #include +#include "xalloc.h" + /* This module calculates the Levene statistic for variables. diff --git a/src/math/moments.c b/src/math/moments.c index 2934dd7a..a5be12e9 100644 --- a/src/math/moments.c +++ b/src/math/moments.c @@ -19,10 +19,11 @@ #include #include #include -#include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/math/sort.c b/src/math/sort.c index 95c40fb3..5e909422 100644 --- a/src/math/sort.c +++ b/src/math/sort.c @@ -26,11 +26,12 @@ #include #include #include -#include #include #include #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/math/ts/innovations.c b/src/math/ts/innovations.c index f69cf898..3e3be202 100644 --- a/src/math/ts/innovations.c +++ b/src/math/ts/innovations.c @@ -30,11 +30,12 @@ #include #include #include -#include #include #include #include +#include "xalloc.h" + static void get_mean (const gsl_matrix *data, struct innovations_estimate **est) diff --git a/src/output/ascii.c b/src/output/ascii.c index f2dff490..ad72e8dc 100644 --- a/src/output/ascii.c +++ b/src/output/ascii.c @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -35,6 +34,7 @@ #include "error.h" #include "minmax.h" #include "output.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/output/chart.c b/src/output/chart.c index 489ef189..49819e9f 100644 --- a/src/output/chart.c +++ b/src/output/chart.c @@ -29,12 +29,12 @@ #include -#include #include #include #include #include "error.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/output/chart.h b/src/output/chart.h index ee879560..5444b2d1 100644 --- a/src/output/chart.h +++ b/src/output/chart.h @@ -25,10 +25,11 @@ #include #include -#include #include "manager.h" #include "output.h" +#include "xalloc.h" + #ifndef CHART_H #define CHART_H diff --git a/src/output/charts/plot-chart.c b/src/output/charts/plot-chart.c index 9978c8c9..88aa58b0 100644 --- a/src/output/charts/plot-chart.c +++ b/src/output/charts/plot-chart.c @@ -32,11 +32,11 @@ #include -#include #include #include #include +#include "xalloc.h" const char *const data_colour[] = { "brown", diff --git a/src/output/charts/plot-chart.h b/src/output/charts/plot-chart.h index 958a0dfd..5cee5a9a 100644 --- a/src/output/charts/plot-chart.h +++ b/src/output/charts/plot-chart.h @@ -28,10 +28,10 @@ #include #include -#include #include #include +#include "xalloc.h" #ifndef PLOT_CHART_H #define PLOT_CHART_H diff --git a/src/output/html.c b/src/output/html.c index 17be1751..893c1852 100644 --- a/src/output/html.c +++ b/src/output/html.c @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -34,6 +33,8 @@ #include "table.h" #include +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/output/output.c b/src/output/output.c index 842e1c15..8eccf763 100644 --- a/src/output/output.c +++ b/src/output/output.c @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -33,6 +32,7 @@ #include "error.h" #include "intprops.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/output/postscript.c b/src/output/postscript.c index 9a338070..d4f5b9f3 100644 --- a/src/output/postscript.c +++ b/src/output/postscript.c @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -38,11 +37,13 @@ #include "afm.h" #include "chart.h" #include "error.h" -#include "intprops.h" #include "manager.h" -#include "minmax.h" #include "output.h" + +#include "intprops.h" +#include "minmax.h" #include "size_max.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/output/table.c b/src/output/table.c index c0af3d0f..92f79541 100644 --- a/src/output/table.c +++ b/src/output/table.c @@ -29,13 +29,13 @@ #include #include #include -#include #include #include #include #include #include "minmax.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/ui/gui/clipboard.c b/src/ui/gui/clipboard.c index 1661d413..4d7ca63e 100644 --- a/src/ui/gui/clipboard.c +++ b/src/ui/gui/clipboard.c @@ -22,7 +22,6 @@ #include "psppire-data-store.h" #include #include -#include #include #include #include @@ -30,6 +29,7 @@ #include #include "data-editor.h" +#include "xalloc.h" /* A casereader and dictionary holding the data currently in the clip */ static struct casereader *clip_datasheet = NULL; diff --git a/src/ui/gui/find-dialog.c b/src/ui/gui/find-dialog.c index 4978edaf..0fc43620 100644 --- a/src/ui/gui/find-dialog.c +++ b/src/ui/gui/find-dialog.c @@ -30,18 +30,17 @@ which match particular strings */ #include #include #include "psppire-data-store.h" -#include #include #include #include #include - - #include #include #include +#include "xalloc.h" + #include #define _(msgid) gettext (msgid) #define N_(msgid) msgid diff --git a/src/ui/gui/syntax-editor-source.c b/src/ui/gui/syntax-editor-source.c index 289bd37a..f7617a89 100644 --- a/src/ui/gui/syntax-editor-source.c +++ b/src/ui/gui/syntax-editor-source.c @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -29,6 +28,8 @@ #include "syntax-editor-source.h" #include "syntax-editor.h" +#include "xalloc.h" + struct syntax_editor_source { struct getl_interface parent; diff --git a/src/ui/terminal/command-line.c b/src/ui/terminal/command-line.c index 976af0c2..71d42a04 100644 --- a/src/ui/terminal/command-line.c +++ b/src/ui/terminal/command-line.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -38,6 +37,8 @@ #include #include "read-line.h" +#include "xalloc.h" + #include "gettext.h" #define _(msgid) gettext (msgid) #define N_(msgid) msgid -- 2.30.2