aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThien-Thi Nguyen2004-05-07 15:31:07 +0000
committerThien-Thi Nguyen2004-05-07 15:31:07 +0000
commit3f0656ff20abbcd328175e055ae0ecd77acd6ce6 (patch)
treeb314e12141d2391e599315b5bae02993b1b7dab3
parentbef96454bf4b3f03410410f53fa269d67e6c8620 (diff)
downloademacs-3f0656ff20abbcd328175e055ae0ecd77acd6ce6.tar.gz
emacs-3f0656ff20abbcd328175e055ae0ecd77acd6ce6.zip
(GOOD, BAD): Delete macros. Throughout,
replace w/ `EXIT_SUCCESS' and `EXIT_FAILURE', respectively. (main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value.
-rw-r--r--lib-src/ChangeLog8
-rw-r--r--lib-src/b2m.c21
-rw-r--r--lib-src/etags.c29
3 files changed, 26 insertions, 32 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index b280abc4111..75d5f964201 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,11 @@
12004-05-07 Thien-Thi Nguyen <ttn@gnu.org>
2
3 * b2m.c (GOOD, BAD): Delete macros. Throughout,
4 replace w/ `EXIT_SUCCESS' and `EXIT_FAILURE', respectively.
5 (main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value.
6
7 * etags.c: Likewise.
8
12004-05-03 Jason Rumney <jasonr@gnu.org> 92004-05-03 Jason Rumney <jasonr@gnu.org>
2 10
3 * makefile.nt: Remove. 11 * makefile.nt: Remove.
diff --git a/lib-src/b2m.c b/lib-src/b2m.c
index 5a1f9e85473..5bebe560e2a 100644
--- a/lib-src/b2m.c
+++ b/lib-src/b2m.c
@@ -39,15 +39,6 @@
39#undef FALSE 39#undef FALSE
40#define FALSE 0 40#define FALSE 0
41 41
42/* Exit codes for success and failure. */
43#ifdef VMS
44#define GOOD 1
45#define BAD 0
46#else
47#define GOOD 0
48#define BAD 1
49#endif
50
51#define streq(s,t) (strcmp (s, t) == 0) 42#define streq(s,t) (strcmp (s, t) == 0)
52#define strneq(s,t,n) (strncmp (s, t, n) == 0) 43#define strneq(s,t,n) (strncmp (s, t, n) == 0)
53 44
@@ -124,18 +115,18 @@ main (argc, argv)
124 case 'V': 115 case 'V':
125 printf ("%s (GNU Emacs %s)\n", "b2m", VERSION); 116 printf ("%s (GNU Emacs %s)\n", "b2m", VERSION);
126 puts ("b2m is in the public domain."); 117 puts ("b2m is in the public domain.");
127 exit (GOOD); 118 exit (EXIT_SUCCESS);
128 119
129 case 'h': 120 case 'h':
130 fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname); 121 fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname);
131 exit (GOOD); 122 exit (EXIT_SUCCESS);
132 } 123 }
133 } 124 }
134 125
135 if (optind != argc) 126 if (optind != argc)
136 { 127 {
137 fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname); 128 fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname);
138 exit (GOOD); 129 exit (EXIT_SUCCESS);
139 } 130 }
140 131
141 labels_saved = printing = header = FALSE; 132 labels_saved = printing = header = FALSE;
@@ -191,7 +182,7 @@ main (argc, argv)
191 puts (data.buffer); 182 puts (data.buffer);
192 } 183 }
193 184
194 return 0; 185 return EXIT_SUCCESS;
195} 186}
196 187
197 188
@@ -298,8 +289,10 @@ fatal (message)
298 char *message; 289 char *message;
299{ 290{
300 fprintf (stderr, "%s: %s\n", progname, message); 291 fprintf (stderr, "%s: %s\n", progname, message);
301 exit (BAD); 292 exit (EXIT_FAILURE);
302} 293}
303 294
304/* arch-tag: 5a3ad2af-a802-408f-83cc-e7cf5e98653e 295/* arch-tag: 5a3ad2af-a802-408f-83cc-e7cf5e98653e
305 (do not change this comment) */ 296 (do not change this comment) */
297
298/* b2m.c ends here */
diff --git a/lib-src/etags.c b/lib-src/etags.c
index e9fab1be3ee..829fc97fbfd 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -177,15 +177,6 @@ If you want regular expression support, you should delete this notice and
177# define CTAGS FALSE 177# define CTAGS FALSE
178#endif 178#endif
179 179
180/* Exit codes for success and failure. */
181#ifdef VMS
182# define GOOD 1
183# define BAD 0
184#else
185# define GOOD 0
186# define BAD 1
187#endif
188
189#define streq(s,t) (assert((s)!=NULL || (t)!=NULL), !strcmp (s, t)) 180#define streq(s,t) (assert((s)!=NULL || (t)!=NULL), !strcmp (s, t))
190#define strcaseeq(s,t) (assert((s)!=NULL && (t)!=NULL), !etags_strcasecmp (s, t)) 181#define strcaseeq(s,t) (assert((s)!=NULL && (t)!=NULL), !etags_strcasecmp (s, t))
191#define strneq(s,t,n) (assert((s)!=NULL || (t)!=NULL), !strncmp (s, t, n)) 182#define strneq(s,t,n) (assert((s)!=NULL || (t)!=NULL), !strncmp (s, t, n))
@@ -830,7 +821,7 @@ print_version ()
830 puts ("Copyright (C) 2002 Free Software Foundation, Inc. and Ken Arnold"); 821 puts ("Copyright (C) 2002 Free Software Foundation, Inc. and Ken Arnold");
831 puts ("This program is distributed under the same terms as Emacs"); 822 puts ("This program is distributed under the same terms as Emacs");
832 823
833 exit (GOOD); 824 exit (EXIT_SUCCESS);
834} 825}
835 826
836static void 827static void
@@ -849,7 +840,7 @@ print_help (argbuffer)
849 } 840 }
850 841
851 if (help_for_lang) 842 if (help_for_lang)
852 exit (GOOD); 843 exit (EXIT_SUCCESS);
853 844
854 printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ 845 printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\
855\n\ 846\n\
@@ -990,7 +981,7 @@ Relative ones are stored relative to the output file's directory.\n");
990 puts (""); 981 puts ("");
991 puts ("Report bugs to bug-gnu-emacs@gnu.org"); 982 puts ("Report bugs to bug-gnu-emacs@gnu.org");
992 983
993 exit (GOOD); 984 exit (EXIT_SUCCESS);
994} 985}
995 986
996 987
@@ -1413,7 +1404,7 @@ main (argc, argv)
1413 1404
1414 if (fclose (tagf) == EOF) 1405 if (fclose (tagf) == EOF)
1415 pfatal (tagfile); 1406 pfatal (tagfile);
1416 exit (GOOD); 1407 exit (EXIT_SUCCESS);
1417 } 1408 }
1418 1409
1419 if (update) 1410 if (update)
@@ -1432,7 +1423,7 @@ main (argc, argv)
1432 sprintf (cmd, 1423 sprintf (cmd,
1433 "mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS", 1424 "mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS",
1434 tagfile, argbuffer[i].what, tagfile); 1425 tagfile, argbuffer[i].what, tagfile);
1435 if (system (cmd) != GOOD) 1426 if (system (cmd) != EXIT_SUCCESS)
1436 fatal ("failed to execute shell command", (char *)NULL); 1427 fatal ("failed to execute shell command", (char *)NULL);
1437 } 1428 }
1438 append_to_tagfile = TRUE; 1429 append_to_tagfile = TRUE;
@@ -1453,7 +1444,7 @@ main (argc, argv)
1453 sprintf (cmd, "sort -o %.*s %.*s", BUFSIZ, tagfile, BUFSIZ, tagfile); 1444 sprintf (cmd, "sort -o %.*s %.*s", BUFSIZ, tagfile, BUFSIZ, tagfile);
1454 exit (system (cmd)); 1445 exit (system (cmd));
1455 } 1446 }
1456 return GOOD; 1447 return EXIT_SUCCESS;
1457} 1448}
1458 1449
1459 1450
@@ -6470,7 +6461,7 @@ fatal (s1, s2)
6470 char *s1, *s2; 6461 char *s1, *s2;
6471{ 6462{
6472 error (s1, s2); 6463 error (s1, s2);
6473 exit (BAD); 6464 exit (EXIT_FAILURE);
6474} 6465}
6475 6466
6476static void 6467static void
@@ -6478,7 +6469,7 @@ pfatal (s1)
6478 char *s1; 6469 char *s1;
6479{ 6470{
6480 perror (s1); 6471 perror (s1);
6481 exit (BAD); 6472 exit (EXIT_FAILURE);
6482} 6473}
6483 6474
6484static void 6475static void
@@ -6492,7 +6483,7 @@ fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
6492fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", 6483fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n",
6493 progname, "-h"); 6484 progname, "-h");
6494#endif 6485#endif
6495 exit (BAD); 6486 exit (EXIT_FAILURE);
6496} 6487}
6497 6488
6498/* Print error message. `s1' is printf control string, `s2' is arg for it. */ 6489/* Print error message. `s1' is printf control string, `s2' is arg for it. */
@@ -6788,3 +6779,5 @@ xrealloc (ptr, size)
6788 6779
6789/* arch-tag: 8a9b748d-390c-4922-99db-2eeefa921051 6780/* arch-tag: 8a9b748d-390c-4922-99db-2eeefa921051
6790 (do not change this comment) */ 6781 (do not change this comment) */
6782
6783/* etags.c ends here */