* Fix some warnings in gettext.c and function.c

* Don't try to execute tests which are actually directories.
This commit is contained in:
Paul Smith 2000-02-09 07:02:18 +00:00
parent 17f2dda0ac
commit e68a27ec7b
6 changed files with 24 additions and 51 deletions

View File

@ -87,6 +87,12 @@
* default.c (default_variables) [__MSDOS__]: Define CXX to gpp. * 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> 2000-01-25 Paul D. Smith <psmith@gnu.org>
Change gettext support to use the simplified version in libit 0.7. Change gettext support to use the simplified version in libit 0.7.

View File

@ -492,9 +492,9 @@ func_notdir_suffix(o, argv, funcname)
char *list_iterator = argv[0]; char *list_iterator = argv[0];
char *p2 =0; char *p2 =0;
int doneany =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; int is_notdir = !is_suffix;
while ((p2 = find_next_token (&list_iterator, &len)) != 0) while ((p2 = find_next_token (&list_iterator, &len)) != 0)
{ {
@ -555,7 +555,7 @@ func_basename_dir(o, argv, funcname)
int doneany=0; int doneany=0;
unsigned int len=0; unsigned int len=0;
char *p=0; char *p=0;
int is_basename= streq(funcname, "basename"); int is_basename= streq (funcname, "basename");
int is_dir= !is_basename; int is_dir= !is_basename;
while ((p2 = find_next_token (&p3, &len)) != 0) while ((p2 = find_next_token (&p3, &len)) != 0)
@ -563,7 +563,7 @@ func_basename_dir(o, argv, funcname)
p = p2 + len; p = p2 + len;
while (p >= p2 && (!is_basename || *p != '.')) while (p >= p2 && (!is_basename || *p != '.'))
{ {
if (IS_PATHSEP(*p)) if (IS_PATHSEP (*p))
break; break;
--p; --p;
} }

View File

@ -563,7 +563,8 @@ _nl_explode_name (name, language, modifier, territory, codeset,
if (*codeset != cp && (*codeset)[0] != '\0') if (*codeset != cp && (*codeset)[0] != '\0')
{ {
*normalized_codeset = _nl_normalize_codeset (*codeset, *normalized_codeset = _nl_normalize_codeset ((const unsigned
char *)*codeset,
cp - *codeset); cp - *codeset);
if (strcmp (*codeset, *normalized_codeset) == 0) if (strcmp (*codeset, *normalized_codeset) == 0)
free ((char *) *normalized_codeset); free ((char *) *normalized_codeset);
@ -1220,13 +1221,13 @@ read_alias_file (fname, fname_len)
unsigned char *value; unsigned char *value;
unsigned char *cp; unsigned char *cp;
if (fgets (buf, sizeof buf, fp) == NULL) if (fgets ((char *)buf, sizeof buf, fp) == NULL)
/* EOF reached. */ /* EOF reached. */
break; break;
/* Possibly not the whole line fits into the buffer. Ignore /* Possibly not the whole line fits into the buffer. Ignore
the rest of the line. */ the rest of the line. */
if (strchr (buf, '\n') == NULL) if (strchr ((char *)buf, '\n') == NULL)
{ {
char altbuf[BUFSIZ]; char altbuf[BUFSIZ];
do do
@ -1279,8 +1280,8 @@ read_alias_file (fname, fname_len)
if (nmap >= maxmap) if (nmap >= maxmap)
extend_alias_table (); extend_alias_table ();
alias_len = strlen (alias) + 1; alias_len = strlen ((char *)alias) + 1;
value_len = strlen (value) + 1; value_len = strlen ((char *)value) + 1;
if (string_space_act + alias_len + value_len > string_space_max) 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)) const char *categoryname))
internal_function; 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 /* Names for the libintl functions are a problem. They must not clash
with existing names and they should follow ANSI C. But this source 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 __ code is also used in GNU C Library where the names have a __

View File

@ -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 should only make one goal at a time and return as soon as one goal whose
`changed' member is nonzero is successfully made. */ `changed' member is nonzero is successfully made. */
/* We need to know this "lower down" for correct error handling. */
static int updating_makefiles = 0;
int int
update_goal_chain (goals, makefiles) update_goal_chain (goals, makefiles)
register struct dep *goals; register struct dep *goals;
@ -74,8 +71,6 @@ update_goal_chain (goals, makefiles)
unsigned int j = job_slots; unsigned int j = job_slots;
int status = -1; int status = -1;
updating_makefiles = makefiles;
#define MTIME(file) (makefiles ? file_mtime_no_search (file) \ #define MTIME(file) (makefiles ? file_mtime_no_search (file) \
: file_mtime (file)) : file_mtime (file))

View File

@ -17,6 +17,11 @@
* scripts/targets/SECONDARY: Ditto. * scripts/targets/SECONDARY: Ditto.
* scripts/targets/INTERMEDIATE: 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> 2000-01-23 Paul D. Smith <psmith@gnu.org>
* scripts/features/include: Remove a check; the fix caused more * scripts/features/include: Remove a check; the fix caused more

View File

@ -117,7 +117,8 @@ sub toplevel
closedir (SCRIPTDIR); closedir (SCRIPTDIR);
foreach $dir (@dirs) 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); push (@rmdirs, $dir);
mkdir ("$workpath/$dir", 0777) mkdir ("$workpath/$dir", 0777)
|| &error ("Couldn't mkdir $workpath/$dir: $!\n"); || &error ("Couldn't mkdir $workpath/$dir: $!\n");
@ -127,7 +128,7 @@ sub toplevel
closedir (SCRIPTDIR); closedir (SCRIPTDIR);
foreach $test (@files) foreach $test (@files)
{ {
next if $test =~ /^\.\.?$/ || $test =~ /~$/ || $test eq 'CVS'; next if $test =~ /~$/ || -d $test;
push (@TESTS, "$dir/$test"); push (@TESTS, "$dir/$test");
} }
} }