X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lib-src%2Footags.c;h=23ef63901bddd3853cd1ed8eab52e4cb37ee048b;hb=39f02e4b63c133608962f417c617ed3da6a1ab70;hp=8a9d0c36be023bb8bcadc6b6b6ff9210cc56937c;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git.1 diff --git a/lib-src/ootags.c b/lib-src/ootags.c index 8a9d0c3..23ef639 100644 --- a/lib-src/ootags.c +++ b/lib-src/ootags.c @@ -64,31 +64,18 @@ char pot_etags_version[] = "@(#) pot revision number is 12.28"; # define DEBUG FALSE #endif -#ifdef MSDOS -# include -# include -# include -# ifndef HAVE_CONFIG_H -# define DOS_NT -# include -# endif -#endif /* MSDOS */ - -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE # include # include # include # include # define MAXPATHLEN _MAX_PATH -# ifdef HAVE_CONFIG_H -# undef HAVE_NTGUI -# else -# define DOS_NT +# ifndef HAVE_CONFIG_H # define HAVE_GETCWD # endif /* not HAVE_CONFIG_H */ -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */ -#if !defined (WINDOWSNT) && defined (STDC_HEADERS) +#if !defined (WIN32_NATIVE) && defined (STDC_HEADERS) #include #include #endif @@ -104,9 +91,6 @@ char pot_etags_version[] = "@(#) pot revision number is 12.28"; #include #include #include -#ifndef errno - extern int errno; -#endif #include #include @@ -176,9 +160,9 @@ char pot_etags_version[] = "@(#) pot revision number is 12.28"; #ifdef OO_BROWSER #define set_construct(construct) \ if (!oo_browser_construct) oo_browser_construct = construct -void oo_browser_clear_all_globals(); -void oo_browser_clear_some_globals(); -void oo_browser_check_and_clear_structtype(); +void oo_browser_clear_all_globals(void); +void oo_browser_clear_some_globals(void); +void oo_browser_check_and_clear_structtype(void); #endif /* @@ -200,7 +184,7 @@ void oo_browser_check_and_clear_structtype(); typedef int bool; -typedef void Lang_function (); +typedef void Lang_function (FILE *); typedef struct { @@ -860,9 +844,7 @@ char *massage_name (s) int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int i; unsigned int nincluded_files; @@ -875,9 +857,9 @@ main (argc, argv) bool got_err; #endif -#ifdef DOS_NT +#ifdef WIN32_NATIVE _fmode = O_BINARY; /* all of files are treated as binary files */ -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ progname = argv[0]; nincluded_files = 0; @@ -1069,12 +1051,12 @@ main (argc, argv) if (streq (tagfile, "-")) { tagf = stdout; -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* Switch redirected `stdout' to binary mode (setting `_fmode' doesn't take effect until after `stdout' is already open). */ if (!isatty (fileno (stdout))) setmode (fileno (stdout), O_BINARY); -#endif /* DOS_NT */ +#endif /* WIN32_NATIVE */ } else tagf = fopen (tagfile, append_to_tagfile ? "a" : "w"); @@ -1654,8 +1636,7 @@ static char oo_browser_prefix; #endif void -put_entries (np) - register node *np; +put_entries (node *np) { register char *sp; @@ -1889,9 +1870,7 @@ struct C_stab_entry { char *name; int c_ext; enum sym_type type; }; /* maximum key range = 117, duplicates = 0 */ static unsigned int -hash (str, len) - register char *str; - register int unsigned len; +hash (char *str, unsigned int len) { static unsigned char asso_values[] = { @@ -1909,13 +1888,13 @@ hash (str, len) 10, 62, 59, 130, 28, 27, 50, 19, 3, 130, 130, 130, 130, 130, 130, 130, 130, 130, }; - return len + asso_values[str[2]] + asso_values[str[0]]; + return len + + asso_values[(unsigned char) str[2]] + + asso_values[(unsigned char) str[0]]; } -struct C_stab_entry * -in_word_set (str, len) - register char *str; - register unsigned int len; +static struct C_stab_entry * +in_word_set (char *str, unsigned int len) { static struct C_stab_entry wordlist[] = { @@ -2077,7 +2056,7 @@ enum sym_type structtype; #ifdef OO_BROWSER void -oo_browser_check_and_clear_structtype() +oo_browser_check_and_clear_structtype(void) { /* Allow for multiple enum_label tags. */ if (structtype != st_C_enum) @@ -2156,7 +2135,7 @@ int methodlen; #ifdef OO_BROWSER void -oo_browser_clear_all_globals() +oo_browser_clear_all_globals(void) { /* Initialize globals so there is no carry over between files. */ oo_browser_construct = C_NULL; @@ -2167,7 +2146,7 @@ oo_browser_clear_all_globals() } void -oo_browser_clear_some_globals() +oo_browser_clear_some_globals(void) { oo_browser_construct = C_NULL; structtype = st_none; @@ -3638,8 +3617,7 @@ Fortran_functions (inf) * look for '^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]' */ void -Asm_labels (inf) - FILE *inf; +Asm_labels (FILE *inf) { register char *cp; @@ -4433,7 +4411,7 @@ prolog_pred (s, last) /* Save only the first clause. */ if (last == NULL - || len != strlen (last) + || len != (int) strlen (last) || !strneq (s, last, len)) { pfnote ((CTAGS) ? savenstr (s, len) : NULL, TRUE, @@ -4587,7 +4565,7 @@ erlang_func (s, last) /* Save only the first clause. */ if (s[pos++] == '(' && (last == NULL - || len != strlen (last) + || len != (int) strlen (last) || !strneq (s, last, len))) { pfnote ((CTAGS) ? savenstr (s, len) : NULL, TRUE, @@ -4969,7 +4947,7 @@ readline_internal (lbp, stream) if (p > buffer && p[-1] == '\r') { p -= 1; -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* Assume CRLF->LF translation will be performed by Emacs when loading this file, so CRs won't appear in the buffer. It would be cleaner to compensate within Emacs; @@ -5225,19 +5203,6 @@ etags_getcwd () return path; #else /* not HAVE_GETCWD */ -#ifdef MSDOS - char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ - - getwd (path); - - for (p = path; *p != '\0'; p++) - if (*p == '\\') - *p = '/'; - else - *p = lowcase (*p); - - return strdup (path); -#else /* not MSDOS */ linebuffer path; FILE *pipe; @@ -5248,7 +5213,6 @@ etags_getcwd () pclose (pipe); return path.buffer; -#endif /* not MSDOS */ #endif /* not HAVE_GETCWD */ } @@ -5298,7 +5262,7 @@ absolute_filename (file, dir) if (filename_is_absolute (file)) res = savestr (file); -#ifdef DOS_NT +#ifdef WIN32_NATIVE /* We don't support non-absolute file names with a drive letter, like `d:NAME' (it's too much hassle). */ else if (file[1] == ':') @@ -5322,8 +5286,8 @@ absolute_filename (file, dir) while (cp >= res && !filename_is_absolute (cp)); if (cp < res) cp = slashp; /* the absolute name begins with "/.." */ -#ifdef DOS_NT - /* Under MSDOS and NT we get `d:/NAME' as absolute +#ifdef WIN32_NATIVE + /* Under Windows we get `d:/NAME' as absolute file name, so the luser could say `d:/../NAME'. We silently treat this as `d:/NAME'. */ else if (cp[0] != '/') @@ -5378,7 +5342,7 @@ filename_is_absolute (fn) char *fn; { return (fn[0] == '/' -#ifdef DOS_NT +#ifdef WIN32_NATIVE || (isalpha(fn[0]) && fn[1] == ':' && fn[2] == '/') #endif ); @@ -5389,7 +5353,7 @@ void canonicalize_filename (fn) register char *fn; { -#ifdef DOS_NT +#ifdef WIN32_NATIVE for (; *fn != '\0'; fn++) if (*fn == '\\') *fn = '/';