X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lib-src%2Fetags.c;h=12bdc61498f8d5be984535e48c9b50b9a2e8811f;hb=12d15df6028e65adcc90f8e9edc947ee3286b733;hp=5f2223a5e1d86f9e928177b8c0a52fd219766d3f;hpb=afa9772e3fcbb4e80e3e4cfd1a40b4fccc6d08b8;p=chise%2Fxemacs-chise.git diff --git a/lib-src/etags.c b/lib-src/etags.c index 5f2223a..12bdc61 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -37,9 +37,6 @@ char pot_etags_version[] = "@(#) pot revision number is 13.33"; #define TRUE 1 #define FALSE 0 -#ifndef _GNU_SOURCE -# define _GNU_SOURCE /* enables some compiler checks on GNU */ -#endif #ifndef DEBUG # define DEBUG FALSE #endif @@ -53,6 +50,10 @@ char pot_etags_version[] = "@(#) pot revision number is 13.33"; # define LONG_OPTIONS /* accept long options */ #endif /* HAVE_CONFIG_H */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 /* enables some compiler checks on GNU */ +#endif + #ifdef MSDOS # include # include @@ -95,9 +96,6 @@ char pot_etags_version[] = "@(#) pot revision number is 13.33"; #include #include #include -#ifndef errno - extern int errno; -#endif #include #include @@ -193,8 +191,6 @@ typedef struct char **interpreters; } language; -extern char *getenv (); - typedef struct node_st { /* sorting structure */ char *name; /* function or type name */ @@ -281,8 +277,8 @@ char *skip_spaces (char *cp); char *skip_non_spaces (char *cp); char *savenstr (char *cp, int len); char *savestr (char *cp); -char *etags_strchr (char *sp, char c); -char *etags_strrchr (char *sp, char c); +char *etags_strchr (const char *sp, int c); +char *etags_strrchr (const char *sp, int c); char *etags_getcwd (void); char *relative_filename (char *file, char *dir); char *absolute_filename (char *file, char *dir); @@ -1207,17 +1203,21 @@ get_compressor_from_suffix (file, extptr) /* Let those poor souls who live with DOS 8+3 file name limits get some solace by treating foo.cgz as if it were foo.c.gz, etc. Only the first do loop is run if not MSDOS */ +#ifdef MSDOS do { for (compr = compressors; compr->suffix != NULL; compr++) if (streq (compr->suffix, suffix)) return compr; -#ifndef MSDOS - break; -#endif if (extptr != NULL) *extptr = ++suffix; } while (*suffix != '\0'); +#else + for (compr = compressors; compr->suffix != NULL; compr++) + if (streq (compr->suffix, suffix)) + return compr; +#endif + return NULL; } @@ -5111,14 +5111,13 @@ savenstr (cp, len) /* * Return the ptr in sp at which the character c last * appears; NULL if not found - * - * Identical to System V strrchr, included for portability. */ char * etags_strrchr (sp, c) - register char *sp, c; + const char *sp; + int c; { - register char *r; + register const char *r; r = NULL; do @@ -5126,24 +5125,23 @@ etags_strrchr (sp, c) if (*sp == c) r = sp; } while (*sp++); - return r; + return (char *) r; } /* * Return the ptr in sp at which the character c first * appears; NULL if not found - * - * Identical to System V strchr, included for portability. */ char * etags_strchr (sp, c) - register char *sp, c; + const char *sp; + int c; { do { if (*sp == c) - return sp; + return (char *) sp; } while (*sp++); return NULL; }