From: Arnaud Giersch Date: Fri, 4 Feb 2011 07:19:41 +0000 (+0100) Subject: Rewrite macro ESSE() and get rid of misc::str_nil. X-Git-Tag: v0.1~179 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/205d7a7a1b84d22f885579108d6e0f015c1454a6 Rewrite macro ESSE() and get rid of misc::str_nil. --- diff --git a/misc.cpp b/misc.cpp index 06ec972..1d15ac7 100644 --- a/misc.cpp +++ b/misc.cpp @@ -1,6 +1,6 @@ #include "misc.h" namespace misc { + // Defined here to avoid multiple instances. const char str_esse[] = "s"; - const char str_nil[] = ""; } diff --git a/misc.h b/misc.h index 50a4d5d..72d98ab 100644 --- a/misc.h +++ b/misc.h @@ -34,12 +34,10 @@ #endif /* Returns c-string "s" if n > 1, empty string "" otherwise. */ -#define ESSE(n) ((n) > 1 ? misc::str_esse : misc::str_nil) -namespace misc { +#define ESSE(n) (misc::str_esse + ((n) <= 1)) +namespace misc { extern const char str_esse[]; - extern const char str_nil[]; - } #endif // !MISC_H