Fix compiler warnings

This commit is contained in:
Benau 2020-01-03 13:16:16 +08:00
parent e401a3c865
commit d729c543f9
4 changed files with 20 additions and 20 deletions

View File

@ -251,7 +251,7 @@ static int prescan( const DEFBUF * defp, const char ** arglist
static char * catenate( const DEFBUF * defp, const char ** arglist
, char * out, char * out_end, char ** token_p);
/* Catenate tokens */
static const char * remove_magics( const char * argp, int from_last);
static char * remove_magics( const char * argp, int from_last);
/* Remove pair of magic characters */
#if DEBUG_MACRO_ANN
static void chk_symmetry( char * start_id, char * end_id, size_t len);
@ -710,7 +710,8 @@ static char * replace(
} else {
m_inf->locs.start_col = m_inf->locs.start_line = 0L;
}
m_inf->args = m_inf->loc_args = NULL; /* Default args */
m_inf->args = NULL; /* Default args */
m_inf->loc_args = NULL; /* Default args */
for (num = 1, recurs = 0; num < m_num; num++)
if (mac_inf[ num].defp == defp)
recurs++; /* Recursively nested macro */
@ -1233,7 +1234,7 @@ static char * catenate(
return out;
}
static const char * remove_magics(
static char * remove_magics(
const char * argp, /* The argument list */
int from_last /* token is the last or first? */
)
@ -1953,7 +1954,6 @@ static char * rescan(
if (inner->nargs >= 0 && mgc_seq.magic_start) {
/* Magic sequence is found between macro */
/* name and '('. This is a nuisance. */
char * mgc_cleared;
size_t seq_len;
size_t arg_elen = option_flags.v ? ARG_E_LEN_V
: ARG_E_LEN;
@ -1972,7 +1972,7 @@ static char * rescan(
seq_len = mgc_seq.magic_end - mgc_seq.magic_start;
if (seq_len) {
insert_to_bptr( mgc_seq.magic_start, seq_len);
mgc_cleared = remove_magics(
char * mgc_cleared = remove_magics(
(const char *) infile->bptr, FALSE);
/* Remove pair of magics */
strcpy( infile->bptr, mgc_cleared);

View File

@ -236,9 +236,9 @@ typedef struct fileinfo {
int sys_header; /* System header file or not */
int include_opt; /* Specified by -include option */
const char ** dirp; /* Include directory the file resides */
const char * src_dir; /* Directory of source file */
char * src_dir; /* Directory of source file */
const char * real_fname; /* Real file name */
const char * full_fname; /* Real full path list */
char * full_fname; /* Real full path list */
char * filename; /* File/macro name (maybe changed) */
char * buffer; /* Buffer of current input line */
#if MCPP_LIB
@ -479,7 +479,7 @@ extern FILEINFO * unget_string( const char * text, const char * name);
extern char * save_string( const char * text);
/* Stuff string in malloc mem. */
extern FILEINFO * get_file( const char * name, const char * src_dir
, const char * fullname, size_t bufsize, int include_opt);
, char * fullname, size_t bufsize, int include_opt);
/* New FILEINFO initialization */
extern char * (xmalloc)( size_t size);
/* Get memory or die */
@ -518,7 +518,7 @@ extern void put_depend( const char * filename);
extern int do_include( int next);
/* Process #include directive */
extern void add_file( FILE * fp, const char * src_dir
, const char * filename, const char * fullname, int include_opt);
, char * filename, char * fullname, int include_opt);
/* Chain the included file */
extern void sharp( FILEINFO * sharp_file, int marker);
/* Output # line number */

View File

@ -2274,7 +2274,7 @@ char * save_string(
FILEINFO * get_file(
const char * name, /* File or macro name */
const char * src_dir, /* Source file directory*/
const char * fullname, /* Full path list */
char * fullname, /* Full path list */
size_t bufsize, /* Line buffer size */
int include_opt /* Specified by -include opt (for GCC) */
)

View File

@ -175,9 +175,9 @@ static int is_full_path( const char * path);
static int search_dir( char * filename, int searchlocal, int next);
/* Search the include directories */
static int open_file( const char ** dirp, const char * src_dir
, const char * filename, int local, int include_opt, int sys_frame);
, char * filename, int local, int include_opt, int sys_frame);
/* Open a source file */
static const char * set_fname( const char * filename);
static char * set_fname( char * filename);
/* Remember the source filename */
#if SYSTEM == SYS_MAC
#if COMPILER == GNUC
@ -207,7 +207,7 @@ static char * bsl2sl( char * filename);
#endif
static int is_junk( void);
/* The directive has trailing junk? */
static void do_once( const char * fullname);
static void do_once( char * fullname);
/* Process #pragma once */
static int included( const char * fullname);
/* The file has been once included? */
@ -3375,7 +3375,7 @@ static int search_dir(
static int open_file(
const char ** dirp, /* Pointer to include directory */
const char * src_dir, /* Source directory of includer */
const char * filename, /* Filename (possibly has directory) */
char * filename, /* Filename (possibly has directory) */
int local, /* #include "file" */
int include_opt, /* Specified by -include option */
int sys_frame /* System framework header (for SYS_MAC)*/
@ -3520,8 +3520,8 @@ false:
void add_file(
FILE * fp, /* Open file pointer */
const char * src_dir, /* Directory of source */
const char * filename, /* Name of the file */
const char * fullname, /* Full path list */
char * filename, /* Name of the file */
char * fullname, /* Full path list */
int include_opt /* File specified by -include option */
)
/*
@ -3576,8 +3576,8 @@ void add_file(
include_nest++;
}
static const char * set_fname(
const char * filename
static char * set_fname(
char * filename
)
/*
* Register the source filename to fnamelist[].
@ -4250,7 +4250,7 @@ skip_nl: /* Don't use skip_nl() which skips to the newline in source file */
}
static void do_once(
const char * fullname /* Full-path-list of the header */
char * fullname /* Full-path-list of the header */
)
/*
* Process #pragma once so as not to re-include the file later.
@ -4595,7 +4595,7 @@ static void do_preprocessed( void)
const char ** incptr;
char * comment = NULL;
char * colon = NULL;
const char * dir;
char * dir;
#if STD_LINE_PREFIX == FALSE
char conv[ NBUFF];
char * arg;