Changes to resolve warnings.

Fixes Savannah bug #34608.
This commit is contained in:
Paul Smith 2011-11-14 02:26:00 +00:00
parent 83ce81fcaa
commit 9fcd90e36c
7 changed files with 18 additions and 7 deletions

View file

@ -1,5 +1,14 @@
2011-11-13 Paul Smith <psmith@gnu.org> 2011-11-13 Paul Smith <psmith@gnu.org>
* file.c (file_timestamp_cons): Match up data types to avoid warnings.
* filedef.h: Ditto.
* misc.c (concat): Ditto.
* read.c (eval): Assign value to avoid warnings.
* function.c (func_shell_base): Use fork() instead of vfork() to
avoid warnings.
* make.h (INTEGER_TYPE_SIGNED): Use <=0 to avoid warnings.
Fixes Savannah bug #34608.
* job.c (construct_command_argv): Remove _p. * job.c (construct_command_argv): Remove _p.
(construct_command_argv_internal): Remove _ptr. (construct_command_argv_internal): Remove _ptr.
Fixes Savannah bug #32567. Fixes Savannah bug #32567.

3
file.c
View file

@ -788,9 +788,10 @@ set_command_state (struct file *file, enum cmd_state state)
/* Convert an external file timestamp to internal form. */ /* Convert an external file timestamp to internal form. */
FILE_TIMESTAMP FILE_TIMESTAMP
file_timestamp_cons (const char *fname, time_t s, int ns) file_timestamp_cons (const char *fname, time_t stamp, long int ns)
{ {
int offset = ORDINARY_MTIME_MIN + (FILE_TIMESTAMP_HI_RES ? ns : 0); int offset = ORDINARY_MTIME_MIN + (FILE_TIMESTAMP_HI_RES ? ns : 0);
FILE_TIMESTAMP s = stamp;
FILE_TIMESTAMP product = (FILE_TIMESTAMP) s << FILE_TIMESTAMP_LO_BITS; FILE_TIMESTAMP product = (FILE_TIMESTAMP) s << FILE_TIMESTAMP_LO_BITS;
FILE_TIMESTAMP ts = product + offset; FILE_TIMESTAMP ts = product + offset;

View file

@ -155,7 +155,7 @@ void print_file_data_base (void);
* 302 / 1000) \ * 302 / 1000) \
+ 1 + 1 + 4 + 25) + 1 + 1 + 4 + 25)
FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, int); FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, long int);
FILE_TIMESTAMP file_timestamp_now (int *); FILE_TIMESTAMP file_timestamp_now (int *);
void file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts); void file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts);

View file

@ -1681,7 +1681,7 @@ func_shell_base (char *o, char **argv, int trim_newlines)
if (pid < 0) if (pid < 0)
perror_with_name (error_prefix, "spawn"); perror_with_name (error_prefix, "spawn");
# else /* ! __EMX__ */ # else /* ! __EMX__ */
pid = vfork (); pid = fork ();
if (pid < 0) if (pid < 0)
perror_with_name (error_prefix, "fork"); perror_with_name (error_prefix, "fork");
else if (pid == 0) else if (pid == 0)

5
make.h
View file

@ -157,8 +157,9 @@ unsigned int get_path_max (void);
# define USHRT_MAX 65535 # define USHRT_MAX 65535
#endif #endif
/* Nonzero if the integer type T is signed. */ /* Nonzero if the integer type T is signed.
#define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0) Use <= to avoid GCC warnings about always-false expressions. */
#define INTEGER_TYPE_SIGNED(t) ((t) -1 <= 0)
/* The minimum and maximum values for the integer type T. /* The minimum and maximum values for the integer type T.
Use ~ (t) 0, not -1, for portability to 1's complement hosts. */ Use ~ (t) 0, not -1, for portability to 1's complement hosts. */

2
misc.c
View file

@ -171,7 +171,7 @@ concat (num, va_alist)
{ {
static unsigned int rlen = 0; static unsigned int rlen = 0;
static char *result = NULL; static char *result = NULL;
int ri = 0; unsigned int ri = 0;
#if USE_VARIADIC #if USE_VARIADIC
va_list args; va_list args;

2
read.c
View file

@ -562,7 +562,7 @@ eval (struct ebuffer *ebuf, int set_default)
char *depstr = 0; char *depstr = 0;
long nlines = 0; long nlines = 0;
int two_colon = 0; int two_colon = 0;
char prefix; char prefix = cmd_prefix;
const char *pattern = 0; const char *pattern = 0;
const char *pattern_percent; const char *pattern_percent;
struct floc *fstart; struct floc *fstart;