From 275fc3ad0fe524a7c322713ddc4c44361a6a082f Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 18 Dec 2001 09:33:44 +0000 Subject: [PATCH] Some host fail on `assert (!"foo")', which expands to ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__)) Reported by Nelson Beebee. * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with `#define it_succeeded 0' and `assert (it_succeeded)'. --- ChangeLog | 9 +++++++++ THANKS | 1 + src/output.c | 4 ++-- src/vcg.c | 36 ++++++++++++++++++++++++------------ 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d146563..b5828cf8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-12-18 Akim Demaille + + Some host fail on `assert (!"foo")', which expands to + ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__)) + Reported by Nelson Beebee. + + * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with + `#define it_succeeded 0' and `assert (it_succeeded)'. + 2001-12-17 Marc Autret * src/bison.simple: Don't hard code the skeleton line and filename. diff --git a/THANKS b/THANKS index 195a0463..4dec9d60 100644 --- a/THANKS +++ b/THANKS @@ -19,6 +19,7 @@ Keith Browne kbrowne@legato.com Laurent Mascherpa laurent.mascherpa@epita.fr Marc Autret autret_m@epita.fr Neil Booth NeilB@earthling.net +Nelson H. F. Beebe beebe@math.utah.edu Noah Friedman friedman@gnu.org Pascal Bart pascal.bart@epita.fr Paul Eggert eggert@twinsun.com diff --git a/src/output.c b/src/output.c index ca5eb63c..7e7b3538 100644 --- a/src/output.c +++ b/src/output.c @@ -755,8 +755,8 @@ pack_vector (int vector) return j; } } - - assert (!"pack_vector"); +#define pack_vector_succeeded 0 + assert (pack_vector_succeeded); return 0; } diff --git a/src/vcg.c b/src/vcg.c index 7bac7876..5e3263e4 100644 --- a/src/vcg.c +++ b/src/vcg.c @@ -242,7 +242,8 @@ get_color_str (enum color_e c) case orchid: return "orchid"; case black: return "black"; default: - assert (!"Not a default color."); +#define A_known_default_color 0 + assert (A_known_default_color); } return NULL; } @@ -256,7 +257,8 @@ get_textmode_str (enum textmode_e t) case left_justify: return "left_justify"; case right_justify: return "right_justify"; default: - assert (!"Not a text mode."); +#define A_known_text_mode 0 + assert (A_known_text_mode); } return NULL; } @@ -271,7 +273,8 @@ get_shape_str (enum shape_e s) case ellipse: return "ellipse"; case triangle: return "triangle"; default: - assert (!"Not a shape."); +#define A_known_shape 0 + assert (A_known_shape); } return NULL; } @@ -296,7 +299,8 @@ get_layoutalgorithm_str (enum layoutalgorithm_e l) case dfs: return "dfs"; case tree: return "tree"; default: - assert (!"Not a layout algorithm."); +#define A_known_layout_algorithm 0 + assert (A_known_layout_algorithm); } return NULL; } @@ -309,7 +313,8 @@ get_decision_str (enum decision_e d) case no: return "no"; case yes: return "yes"; default: - assert (!"Either yes nor no."); +#define Either_yes_nor_no 0 + assert (Either_yes_nor_no); } return NULL; } @@ -324,7 +329,8 @@ get_orientation_str (enum orientation_e o) case left_to_right: return "left_to_right"; case right_to_left: return "right_to_left"; default: - assert (!"Not an orientation."); +#define A_knownn_orientation 0 + assert (A_knownn_orientation); } return NULL; } @@ -338,7 +344,8 @@ get_node_alignement_str (enum alignement_e a) case top: return "top"; case bottom: return "bottom"; default: - assert (!"Not an alignement."); +#define A_known_alignement 0 + assert (A_known_alignement); } return NULL; } @@ -351,7 +358,8 @@ get_arrow_mode_str (enum arrow_mode_e a) case fixed: return "fixed"; case free_a: return "free"; default: - assert (!"Not an arrow mode."); +#define A_known_arrow_mode 0 + assert (A_known_arrow_mode); } return NULL; } @@ -366,7 +374,8 @@ get_crossing_type_str (enum crossing_type_e c) case barymedian: return "barymedian"; case medianbary: return "medianbary"; default: - assert (!"Not a crossing type."); +#define A_known_crossing_type 0 + assert (A_known_crossing_type); } return NULL; } @@ -382,7 +391,8 @@ get_view_str (enum view_e v) case fcfish: return "fcfish"; case fpfish: return "fpfish"; default: - assert (!"Not a view."); +#define A_known_view 0 + assert (A_known_view); } return NULL; } @@ -397,7 +407,8 @@ get_linestyle_str (enum linestyle_e l) case dotted: return "dotted"; case invisible: return "invisible"; default: - assert (!"Not a line style."); +#define A_known_line_style 0 + assert (A_known_line_style); } return NULL; } @@ -411,7 +422,8 @@ get_arrowstyle_str (enum arrowstyle_e a) case line: return "line"; case none: return "none"; default: - assert (!"Not an arrow style."); +#define A_known_arrow_style 0 + assert (A_known_arrow_style); } return NULL; } -- 2.45.2