* Fix some warnings in gettext.c and function.c
authorPaul Smith <psmith@gnu.org>
Wed, 9 Feb 2000 07:02:18 +0000 (07:02 +0000)
committerPaul Smith <psmith@gnu.org>
Wed, 9 Feb 2000 07:02:18 +0000 (07:02 +0000)
* Don't try to execute tests which are actually directories.

ChangeLog
function.c
gettext.c
remake.c
tests/ChangeLog
tests/test_driver.pl

index 3888642..2b0ba8c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
        * default.c (default_variables) [__MSDOS__]: Define CXX to gpp.
 
+2000-01-27  Paul D. Smith  <psmith@gnu.org>
+
+       * gettext.c: Some warning cleanups, and a fix for systems which
+       don't define HAVE_ALLOCA (the workaround code was included
+       twice).
+
 2000-01-25  Paul D. Smith  <psmith@gnu.org>
 
        Change gettext support to use the simplified version in libit 0.7.
index 743fe79..c993c74 100644 (file)
@@ -492,9 +492,9 @@ func_notdir_suffix(o, argv, funcname)
   char *list_iterator = argv[0];
   char *p2 =0;
   int doneany =0;
-  int len=0;
+  unsigned int len=0;
 
-  int is_suffix = streq(funcname, "suffix");
+  int is_suffix = streq (funcname, "suffix");
   int is_notdir = !is_suffix;
   while ((p2 = find_next_token (&list_iterator, &len)) != 0)
     {
@@ -555,7 +555,7 @@ func_basename_dir(o, argv, funcname)
   int doneany=0;
   unsigned int len=0;
   char *p=0;
-  int is_basename= streq(funcname, "basename");
+  int is_basename= streq (funcname, "basename");
   int is_dir= !is_basename;
 
   while ((p2 = find_next_token (&p3, &len)) != 0)
@@ -563,7 +563,7 @@ func_basename_dir(o, argv, funcname)
          p = p2 + len;
          while (p >= p2 && (!is_basename  || *p != '.'))
            {
-             if (IS_PATHSEP(*p))
+             if (IS_PATHSEP (*p))
                break;
                    --p;
            }
index b35b18d..aef9c01 100644 (file)
--- a/gettext.c
+++ b/gettext.c
@@ -563,7 +563,8 @@ _nl_explode_name (name, language, modifier, territory, codeset,
 
          if (*codeset != cp && (*codeset)[0] != '\0')
            {
-             *normalized_codeset = _nl_normalize_codeset (*codeset,
+             *normalized_codeset = _nl_normalize_codeset ((const unsigned
+                                                            char *)*codeset,
                                                           cp - *codeset);
              if (strcmp (*codeset, *normalized_codeset) == 0)
                free ((char *) *normalized_codeset);
@@ -1220,13 +1221,13 @@ read_alias_file (fname, fname_len)
       unsigned char *value;
       unsigned char *cp;
 
-      if (fgets (buf, sizeof buf, fp) == NULL)
+      if (fgets ((char *)buf, sizeof buf, fp) == NULL)
        /* EOF reached.  */
        break;
 
       /* Possibly not the whole line fits into the buffer.  Ignore
         the rest of the line.  */
-      if (strchr (buf, '\n') == NULL)
+      if (strchr ((char *)buf, '\n') == NULL)
        {
          char altbuf[BUFSIZ];
          do
@@ -1279,8 +1280,8 @@ read_alias_file (fname, fname_len)
              if (nmap >= maxmap)
                extend_alias_table ();
 
-             alias_len = strlen (alias) + 1;
-             value_len = strlen (value) + 1;
+             alias_len = strlen ((char *)alias) + 1;
+             value_len = strlen ((char *)value) + 1;
 
              if (string_space_act + alias_len + value_len > string_space_max)
                {
@@ -1750,41 +1751,6 @@ static const char *guess_category_value PARAMS ((int category,
                                                 const char *categoryname))
      internal_function;
 
-/* For those loosing systems which don't have `alloca' we have to add
-   some additional code emulating it.  */
-#ifdef HAVE_ALLOCA
-/* Nothing has to be done.  */
-# define ADD_BLOCK(list, address) /* nothing */
-# define FREE_BLOCKS(list) /* nothing */
-#else
-struct block_list
-{
-  void *address;
-  struct block_list *next;
-};
-# define ADD_BLOCK(list, addr)                                               \
-  do {                                                                       \
-    struct block_list *newp = (struct block_list *) malloc (sizeof (*newp));  \
-    /* If we cannot get a free block we cannot add the new element to        \
-       the list.  */                                                         \
-    if (newp != NULL) {                                                              \
-      newp->address = (addr);                                                \
-      newp->next = (list);                                                   \
-      (list) = newp;                                                         \
-    }                                                                        \
-  } while (0)
-# define FREE_BLOCKS(list)                                                   \
-  do {                                                                       \
-    while (list != NULL) {                                                   \
-      struct block_list *old = list;                                         \
-      list = list->next;                                                     \
-      free (old);                                                            \
-    }                                                                        \
-  } while (0)
-# undef alloca
-# define alloca(size) (malloc (size))
-#endif /* have alloca */
-
 /* Names for the libintl functions are a problem.  They must not clash
    with existing names and they should follow ANSI C.  But this source
    code is also used in GNU C Library where the names have a __
index d4c8a03..914e7d4 100644 (file)
--- a/remake.c
+++ b/remake.c
@@ -62,9 +62,6 @@ static int library_search PARAMS ((char **lib, FILE_TIMESTAMP *mtime_ptr));
    should only make one goal at a time and return as soon as one goal whose
    `changed' member is nonzero is successfully made.  */
 
-/* We need to know this "lower down" for correct error handling.  */
-static int updating_makefiles = 0;
-
 int
 update_goal_chain (goals, makefiles)
      register struct dep *goals;
@@ -74,8 +71,6 @@ update_goal_chain (goals, makefiles)
   unsigned int j = job_slots;
   int status = -1;
 
-  updating_makefiles = makefiles;
-
 #define        MTIME(file) (makefiles ? file_mtime_no_search (file) \
                     : file_mtime (file))
 
index 231c486..fe8b25c 100644 (file)
        * scripts/targets/SECONDARY: Ditto.
        * scripts/targets/INTERMEDIATE: Ditto.
 
+2000-01-27  Paul D. Smith  <psmith@gnu.org>
+
+       * test_driver.pl (toplevel): Don't try to run test scripts which
+       are really directories.
+
 2000-01-23  Paul D. Smith  <psmith@gnu.org>
 
        * scripts/features/include: Remove a check; the fix caused more
index 4fb738b..18dcc4b 100644 (file)
@@ -117,7 +117,8 @@ sub toplevel
     closedir (SCRIPTDIR);
     foreach $dir (@dirs)
     {
-      next if ! -d "$scriptpath/$dir" || $dir =~ /^\.\.?$/ || $dir eq 'CVS';
+      next if ($dir =~ /^\.\.?$/ || $dir eq 'CVS' || $dir eq 'RCS'
+               || ! -d "$scriptpath/$dir");
       push (@rmdirs, $dir);
       mkdir ("$workpath/$dir", 0777)
            || &error ("Couldn't mkdir $workpath/$dir: $!\n");
@@ -127,7 +128,7 @@ sub toplevel
       closedir (SCRIPTDIR);
       foreach $test (@files)
       {
-        next if $test =~ /^\.\.?$/ || $test =~ /~$/ || $test eq 'CVS';
+        next if $test =~ /~$/ || -d $test;
        push (@TESTS, "$dir/$test");
       }
     }