Kaydet (Commit) a15715c3 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

-Wstrict-prototypes

...no reason to not have it enabled for URE C include files and what
little real C code is still left.  (But note that Clang ignores that
warning.)

Change-Id: Ia6940f9f940a0c226e9b724331d65c9862ce32e6
üst 6fcc7efa
......@@ -113,7 +113,7 @@ static char* platformSpecific()
* @return the installation path or NULL, if no installation was found or
* if an error occurred
*/
static char* platformSpecific()
static char* platformSpecific(void)
{
const int SEPARATOR = '/';
const char* PATHSEPARATOR = ":";
......
......@@ -83,7 +83,7 @@ SAL_DLLPUBLIC rtl_Locale * SAL_CALL rtl_locale_register(
for different fields, e.g. in a spreadsheet.
<BR>Note that the initial setting will match the host system.
*/
SAL_DLLPUBLIC rtl_Locale * SAL_CALL rtl_locale_getDefault();
SAL_DLLPUBLIC rtl_Locale * SAL_CALL rtl_locale_getDefault(void);
/**
Sets the default.
......
......@@ -68,7 +68,7 @@ SAL_DLLPUBLIC oslProcessError SAL_CALL rtl_getAppCommandArg(sal_uInt32 nArg, rtl
@see osl_getCommandArgCount()
@see rtl_getCommandArg()
*/
SAL_DLLPUBLIC sal_uInt32 SAL_CALL rtl_getAppCommandArgCount();
SAL_DLLPUBLIC sal_uInt32 SAL_CALL rtl_getAppCommandArgCount(void);
#ifdef __cplusplus
}
......
......@@ -34,7 +34,7 @@ extern "C" {
#endif
SAL_DLLPUBLIC void SAL_CALL sal_detail_initialize(int argc, char ** argv);
SAL_DLLPUBLIC void SAL_CALL sal_detail_deinitialize();
SAL_DLLPUBLIC void SAL_CALL sal_detail_deinitialize(void);
#if defined IOS || defined ANDROID
......
......@@ -32,7 +32,7 @@
#include "rtl/string.h"
#include "sal/types.h"
char const* getPath();
char const* getPath(void);
char* createCommandName( char* argv0 );
const int SEPARATOR = '/';
......@@ -234,7 +234,7 @@ int main( int argc, char *argv[] )
* @return the installation path or NULL, if no installation was specified or
* found, or if an error occurred
*/
char const* getPath()
char const* getPath(void)
{
char const* path = cppuhelper_detail_findSofficePath();
......
......@@ -295,12 +295,12 @@ int rscpp_main( int argc, char **argv );
#endif
void InitCpp1();
void InitCpp2();
void InitCpp3();
void InitCpp4();
void InitCpp5();
void InitCpp6();
void InitCpp1(void);
void InitCpp2(void);
void InitCpp3(void);
void InitCpp4(void);
void InitCpp5(void);
void InitCpp6(void);
#define HELLO() fprintf( stderr, "[Hello at %s, %d] ", __FILE__, __LINE__ )
......@@ -310,8 +310,8 @@ void InitCpp6();
/* cpp1.c */
void output( int c );
void sharp();
void cppmain();
void sharp(void);
void cppmain(void);
#if OSL_DEBUG_LEVEL > 1
#ifdef EVALDEFS
int outputEval( int c );
......@@ -321,8 +321,8 @@ int outputEval( int c );
/* cpp2.c */
int control( int counter );
void doinclude();
void dodefine();
void doinclude(void);
void dodefine(void);
void doif( int hash );
int openinclude( char *, int );
int hasdirectory(char *, char * );
......@@ -331,19 +331,19 @@ int openfile( char * );
/* cpp3.c */
int openfiles( char *filename );
void addfile( FILE *fp, char *filename );
void setincdirs();
void setincdirs(void);
int AddInclude( char *pIncStr );
int getredirection( int argc, char **argv );
void zap_uc( char *ap );
void initdefines();
void initdefines(void);
int dooptions( int argc, char *argv[] );
int readoptions(char* filename, char*** pfargv);
/* cpp4.c */
void dodefines();
void dodefines(void);
void checkparm( int c, DEFBUF *dp );
int expcollect();
int expcollect(void);
void expstuff( DEFBUF *dp );
#if STRING_FORMAL
......@@ -355,27 +355,27 @@ void stparmscan( int delim);
void dumpparm( char *why );
#endif
void doundef();
void doundef(void);
void textput( char *text );
void charput( int c );
void expand( DEFBUF *tokenp );
/* cpp5.c */
int eval();
int eval(void);
int evallex(int);
int *evaleval(int *, int, int );
int evalchar(int);
int dosizeof();
int dosizeof(void);
int evalnum( int c );
int bittest( int );
/* cpp6.c */
void skipnl();
int skipws();
void skipnl(void);
int skipws(void);
void scanid( int c );
int macroid( int c );
int catenate();
int catenate(void);
int scanstring( int c, void (*outfun)( int c ) );
void scannumber( int c, void (*outfun)( int c ) );
void save( int c );
......@@ -386,9 +386,9 @@ DEFBUF *lookid( int c );
DEFBUF *defendel( char *name, int delete );
void dunpdef( char *why );
void dumpadef( char *why, DEFBUF *dp);
int get();
int cget();
void unget();
int get(void);
int cget(void);
void unget(void);
void ungetstring( char *text );
void cerror( char *format, char *sarg);
void cwarn( char *format, char *sarg);
......
......@@ -441,7 +441,7 @@ void initdefines()
time_t tvec;
#if !defined( WNT ) && !defined(G3)
extern char *ctime();
extern char *ctime(time_t const *);
#endif
/*
......
......@@ -397,7 +397,7 @@ void expand(DEFBUF* tokenp)
{
register int c;
register FILEINFO *file;
extern FILEINFO *getfile();
extern FILEINFO *getfile(int, char *);
#if OSL_DEBUG_LEVEL > 1
if (debug)
......@@ -553,7 +553,7 @@ void expstuff(DEFBUF* tokenp)
char *defend; /* -> output buff end */
int string_magic; /* String formal hack */
FILEINFO *file; /* Funny #include */
extern FILEINFO *getfile();
extern FILEINFO *getfile(int, char *);
file = getfile(NBUFF, tokenp->name);
inp = tokenp->repl; /* -> macro replacement */
......
......@@ -139,7 +139,7 @@ register int op;
#define S_PDOUBLE (sizeof (double *))
#endif
#ifndef S_PFPTR
#define S_PFPTR (sizeof (int (*)()))
#define S_PFPTR (sizeof (int (*)(void)))
#endif
typedef struct types {
......@@ -218,7 +218,7 @@ eval()
int skip; /* For short-circuit testing */
int value[NEXP]; /* Value stack */
OPTAB opstack[NEXP]; /* Operand stack */
extern int *evaleval(); /* Does actual evaluation */
extern int *evaleval(int *, int, int); /* Does actual evaluation */
valp = value;
opp = opstack;
opp->op = OP_END; /* Mark bottom of stack */
......
......@@ -1021,7 +1021,7 @@ void ungetstring(char* text)
*/
{
register FILEINFO *file;
extern FILEINFO *getfile();
extern FILEINFO *getfile(int, char *);
file = getfile(strlen(text) + 1, "");
strcpy(file->buffer, text);
}
......
......@@ -89,7 +89,7 @@ static oslPipeError osl_PipeErrorFromNative(int nativeType)
/* macros */
#define ERROR_FROM_NATIVE(y) osl_PipeErrorFromNative(y)
oslPipe __osl_createPipeImpl()
oslPipe __osl_createPipeImpl(void)
{
oslPipe pPipeImpl;
......
......@@ -26,7 +26,7 @@
extern "C" {
#endif
void sal_initGlobalTimer();
void sal_initGlobalTimer(void);
#if defined __cplusplus
}
......
......@@ -199,7 +199,7 @@ static sal_Bool is_soffice_Impl (void)
return (idx != -1);
}
static sal_Bool InitSignal()
static sal_Bool InitSignal(void)
{
int i;
struct sigaction act;
......@@ -288,7 +288,7 @@ static sal_Bool InitSignal()
return sal_True;
}
static sal_Bool DeInitSignal()
static sal_Bool DeInitSignal(void)
{
int i;
struct sigaction act;
......@@ -889,7 +889,7 @@ void CallSystemHandler(int Signal)
}
#if defined HAVE_VALGRIND_HEADERS
static void DUMPCURRENTALLOCS()
static void DUMPCURRENTALLOCS(void)
{
VALGRIND_PRINTF( "=== start memcheck dump of active allocations ===\n" );
......
......@@ -466,7 +466,7 @@ void __osl_destroySocketImpl(oslSocket Socket)
#endif
}
static oslSocketAddr __osl_createSocketAddr( )
static oslSocketAddr __osl_createSocketAddr(void)
{
oslSocketAddr pAddr = (oslSocketAddr) rtl_allocateZeroMemory( sizeof( struct oslSocketAddrImpl ));
#if OSL_DEBUG_LEVEL > 1
......
......@@ -260,7 +260,7 @@ sal_Bool SAL_CALL osl_getSystemTimeFromLocalTime( const TimeValue* pLocalTimeVal
return sal_False;
}
void sal_initGlobalTimer()
void sal_initGlobalTimer(void)
{
#ifdef __MACH__
clock_serv_t cclock;
......
......@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
int main() {
int main(void) {
for (;;) {
int c;
errno = 0;
......
......@@ -53,6 +53,7 @@ gb_CFLAGS_COMMON := \
-Wall \
-Wendif-labels \
-Wextra \
-Wstrict-prototypes \
-Wundef \
-Wunused-macros \
-fmessage-length=0 \
......
......@@ -119,10 +119,7 @@ struct _parse_data {
};
static const char *
_my_if_errors (ip, cp, expecting)
IfParser *ip;
const char *cp;
const char *expecting;
_my_if_errors (IfParser *ip, const char *cp, const char *expecting)
{
#ifdef DEBUG_MKDEPEND
struct _parse_data *pd = (struct _parse_data *) ip->data;
......@@ -154,9 +151,7 @@ _my_if_errors (ip, cp, expecting)
#define MAXNAMELEN 256
char *
_lookup_variable (var, len)
const char *var;
int len;
_lookup_variable (const char *var, int len)
{
char tmpbuf[MAXNAMELEN + 1];
......@@ -170,10 +165,7 @@ _lookup_variable (var, len)
static int
_my_eval_defined (ip, var, len)
IfParser *ip;
const char *var;
int len;
_my_eval_defined (IfParser *ip, const char *var, int len)
{
(void)ip;
if (_lookup_variable (var, len))
......@@ -185,10 +177,7 @@ _my_eval_defined (ip, var, len)
#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
static int
_my_eval_variable (ip, var, len)
IfParser *ip;
const char *var;
int len;
_my_eval_variable (IfParser *ip, const char *var, int len)
{
char *s;
......
......@@ -184,7 +184,7 @@ int match(register char *str, register char **list);
void recursive_pr_include(register struct inclist *head, register char *file,
register char *base);
void recursive_pr_dummy(register struct inclist *head, register char *file);
void inc_clean();
void inc_clean(void);
void fatalerr(char *, ...);
void warning(char *, ...);
......
......@@ -74,10 +74,7 @@
static const char *
parse_variable (g, cp, varp)
IfParser *g;
const char *cp;
const char **varp;
parse_variable (IfParser *g, const char *cp, const char **varp)
{
SKIPSPACE (cp);
......@@ -92,10 +89,7 @@ parse_variable (g, cp, varp)
static const char *
parse_number (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_number (IfParser *g, const char *cp, int *valp)
{
SKIPSPACE (cp);
......@@ -117,10 +111,7 @@ parse_number (g, cp, valp)
static const char *
parse_value (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_value (IfParser *g, const char *cp, int *valp)
{
const char *var;
......@@ -200,10 +191,7 @@ parse_value (g, cp, valp)
static const char *
parse_product (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_product (IfParser *g, const char *cp, int *valp)
{
int rightval;
......@@ -235,10 +223,7 @@ parse_product (g, cp, valp)
static const char *
parse_sum (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_sum (IfParser *g, const char *cp, int *valp)
{
int rightval;
......@@ -261,10 +246,7 @@ parse_sum (g, cp, valp)
static const char *
parse_shift (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_shift (IfParser *g, const char *cp, int *valp)
{
int rightval;
......@@ -291,10 +273,7 @@ parse_shift (g, cp, valp)
static const char *
parse_inequality (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_inequality (IfParser *g, const char *cp, int *valp)
{
int rightval;
......@@ -327,10 +306,7 @@ parse_inequality (g, cp, valp)
static const char *
parse_equality (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_equality (IfParser *g, const char *cp, int *valp)
{
int rightval;
......@@ -357,10 +333,7 @@ parse_equality (g, cp, valp)
static const char *
parse_band (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_band (IfParser *g, const char *cp, int *valp)
{
int rightval;
......@@ -380,10 +353,7 @@ parse_band (g, cp, valp)
static const char *
parse_bor (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_bor (IfParser *g, const char *cp, int *valp)
{
int rightval;
......@@ -403,10 +373,7 @@ parse_bor (g, cp, valp)
static const char *
parse_land (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_land (IfParser *g, const char *cp, int *valp)
{
int rightval;
......@@ -426,10 +393,7 @@ parse_land (g, cp, valp)
static const char *
parse_lor (g, cp, valp)
IfParser *g;
const char *cp;
int *valp;
parse_lor (IfParser *g, const char *cp, int *valp)
{
int rightval;
......
......@@ -64,10 +64,10 @@ typedef int Bool;
typedef struct _if_parser {
struct { /* functions */
const char *(*handle_error) (/* struct _if_parser *, const char *,
const char * */);
int (*eval_variable) (/* struct _if_parser *, const char *, int */);
int (*eval_defined) (/* struct _if_parser *, const char *, int */);
const char *(*handle_error) (struct _if_parser *, const char *,
const char *);
int (*eval_variable) (struct _if_parser *, const char *, int);
int (*eval_defined) (struct _if_parser *, const char *, int);
} funcs;
char *data;
} IfParser;
......
......@@ -317,7 +317,7 @@ void included_by(ip, newfile)
ip->i_list[ ip->i_listlen-1 ] = newfile;
}
void inc_clean ()
void inc_clean (void)
{
register struct inclist *ip;
......
......@@ -163,9 +163,7 @@ struct sigaction sig_act;
boolean native_win_slashes = FALSE;
int main(argc, argv)
int argc;
char **argv;
int main(int argc, char **argv)
{
register char **fp = filelist;
register char **incp = includedirs;
......
......@@ -410,8 +410,7 @@ void define( def, symbols )
hash_define( def, val, symbols );
}
static int hash( str )
register char *str;
static int hash( register char *str )
{
/* Hash (Kernighan and Ritchie) */
register unsigned int hashval = 0;
......
......@@ -79,8 +79,7 @@ void add_include(struct filepointer *filep, struct inclist *file, struct inclist
}
}
void pr_dummy(ip)
register struct inclist *ip;
void pr_dummy(register struct inclist *ip)
{
fwrite(ip->i_file, strlen(ip->i_file), 1, stdout);
fwrite(" :\n\n", 4, 1, stdout);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment