diff options
author | Bruno Haible <bruno@clisp.org> | 2016-11-27 18:18:00 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2016-11-27 18:18:00 +0100 |
commit | cabd2af10e509b7889b57f9ef21ec3e08e85c8e6 (patch) | |
tree | 034d29b0df8973f7fe5b9e6bb766f7cee4d05b7d /tests | |
parent | a705809f3d2cfe02b3419662e3880458219a2e4a (diff) | |
download | gperf-cabd2af10e509b7889b57f9ef21ec3e08e85c8e6.tar.gz |
Assume the available C compiler supports ANSI C. Remove K&R C cruft.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/jstest1.gperf | 11 | ||||
-rw-r--r-- | tests/jstest2.gperf | 11 | ||||
-rw-r--r-- | tests/jstest3.gperf | 11 | ||||
-rw-r--r-- | tests/jstest4.gperf | 11 | ||||
-rw-r--r-- | tests/test.c | 10 | ||||
-rw-r--r-- | tests/test2.c | 10 |
6 files changed, 16 insertions, 48 deletions
diff --git a/tests/jstest1.gperf b/tests/jstest1.gperf index f6696b1..7358f3d 100644 --- a/tests/jstest1.gperf +++ b/tests/jstest1.gperf @@ -54,12 +54,7 @@ with %% #include <stdlib.h> #include <string.h> -#if defined(__STDC__) || defined(__cplusplus) -#define CONST const -#else -#define CONST -#endif -static CONST char* testdata[] = { +static const char* testdata[] = { "bogus", "abstract", "boolean", @@ -121,9 +116,9 @@ int main () for (i = 0; i < sizeof(testdata)/sizeof(testdata[0]); i++) { #ifdef CPLUSPLUS_TEST - CONST char * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i])); + const char * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i])); #else - CONST char * resword = in_word_set(testdata[i],strlen(testdata[i])); + const char * resword = in_word_set(testdata[i],strlen(testdata[i])); #endif if (i > 0) { diff --git a/tests/jstest2.gperf b/tests/jstest2.gperf index ee0fa7f..68553c3 100644 --- a/tests/jstest2.gperf +++ b/tests/jstest2.gperf @@ -59,12 +59,7 @@ with, 53 %% #include <stdlib.h> #include <string.h> -#if defined(__STDC__) || defined(__cplusplus) -#define CONST const -#else -#define CONST -#endif -static CONST char* testdata[] = { +static const char* testdata[] = { "bogus", "abstract", "boolean", @@ -126,9 +121,9 @@ int main () for (i = 0; i < sizeof(testdata)/sizeof(testdata[0]); i++) { #ifdef CPLUSPLUS_TEST - CONST struct js_keyword * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i])); + const struct js_keyword * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i])); #else - CONST struct js_keyword * resword = in_word_set(testdata[i],strlen(testdata[i])); + const struct js_keyword * resword = in_word_set(testdata[i],strlen(testdata[i])); #endif if (i > 0) { diff --git a/tests/jstest3.gperf b/tests/jstest3.gperf index 54d37ce..4c23eb6 100644 --- a/tests/jstest3.gperf +++ b/tests/jstest3.gperf @@ -59,12 +59,7 @@ with, 53 %% #include <stdlib.h> #include <string.h> -#if defined(__STDC__) || defined(__cplusplus) -#define CONST const -#else -#define CONST -#endif -static CONST char* testdata[] = { +static const char* testdata[] = { "bogus", "abstract", "boolean", @@ -126,9 +121,9 @@ int main () for (i = 0; i < sizeof(testdata)/sizeof(testdata[0]); i++) { #ifdef CPLUSPLUS_TEST - CONST struct js_keyword * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i])); + const struct js_keyword * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i])); #else - CONST struct js_keyword * resword = in_word_set(testdata[i],strlen(testdata[i])); + const struct js_keyword * resword = in_word_set(testdata[i],strlen(testdata[i])); #endif if (i > 0) { diff --git a/tests/jstest4.gperf b/tests/jstest4.gperf index b02617c..6b30ac3 100644 --- a/tests/jstest4.gperf +++ b/tests/jstest4.gperf @@ -59,12 +59,7 @@ with, 53 %% #include <stdlib.h> #include <string.h> -#if defined(__STDC__) || defined(__cplusplus) -#define CONST const -#else -#define CONST -#endif -static CONST char* testdata[] = { +static const char* testdata[] = { "bogus", "abstract", "boolean", @@ -126,9 +121,9 @@ int main () for (i = 0; i < sizeof(testdata)/sizeof(testdata[0]); i++) { #ifdef CPLUSPLUS_TEST - CONST struct js_keyword * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i])); + const struct js_keyword * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i])); #else - CONST struct js_keyword * resword = in_word_set(testdata[i],strlen(testdata[i])); + const struct js_keyword * resword = in_word_set(testdata[i],strlen(testdata[i])); #endif if (i > 0) { diff --git a/tests/test.c b/tests/test.c index 6ee16e0..52d41d8 100644 --- a/tests/test.c +++ b/tests/test.c @@ -7,18 +7,12 @@ #include <stdio.h> #include <string.h> -#if defined __STDC__ || defined __cplusplus -extern char * in_word_set (const char *, int); -#else -extern char * in_word_set (); -#endif +extern const char * in_word_set (const char *, size_t); #define MAX_LEN 80 int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int verbose = argc > 1 ? 1 : 0; char buf[MAX_LEN]; diff --git a/tests/test2.c b/tests/test2.c index e408d45..130a0a3 100644 --- a/tests/test2.c +++ b/tests/test2.c @@ -21,18 +21,12 @@ # define SET_BINARY(f) (void)0 #endif -#if defined __STDC__ || defined __cplusplus -extern struct language * in_word_set (const char *, int); -#else -extern struct language * in_word_set (); -#endif +extern struct language * in_word_set (const char *, size_t); #define MAX_LEN 80 int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int verbose = argc > 1 ? 1 : 0; char buf[2*MAX_LEN]; |