Skip to content

Commit 6cbc18b

Browse files
Copilotstarseeker
andcommitted
Fix legacy C style warnings - add void to parameterless function declarations
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
1 parent aa3b89a commit 6cbc18b

File tree

17 files changed

+27
-27
lines changed

17 files changed

+27
-27
lines changed

include/express/alloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct freelist_head {
5858
#endif
5959
};
6060

61-
char * nnew();
61+
char * nnew(void);
6262

6363
#include "error.h"
6464

include/express/basic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
/* function pointer types */
9494
/**************************/
9595

96-
typedef void ( *voidFuncptr )();
97-
typedef int ( *intFuncptr )();
96+
typedef void ( *voidFuncptr )(void);
97+
typedef int ( *intFuncptr )(void);
9898

9999
/* Option index - can we get rid of this? */
100100
extern SC_EXPRESS_EXPORT int sc_optind;

include/express/factory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
#include "sc_export.h"
55

6-
SC_EXPRESS_EXPORT void FACTORYinitialize();
6+
SC_EXPRESS_EXPORT void FACTORYinitialize(void);
77

88
#endif /* __FACTORY_H_ */

include/express/memory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
#include "sc_export.h"
55

6-
SC_EXPRESS_EXPORT void MEMORYinitialize();
6+
SC_EXPRESS_EXPORT void MEMORYinitialize(void);
77

88
#endif // __MEMORY_H

src/express/alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Freelist * create_freelist( struct freelist_head * flh, int bytes ) {
7676
}
7777

7878
void
79-
_ALLOCinitialize() {
79+
_ALLOCinitialize(void) {
8080
#ifdef DEBUG_MALLOC
8181
malloc_debug( 2 );
8282
#endif

src/express/entity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ Entity ENTITYcopy( Entity e ) {
292292
}
293293

294294
/** Initialize the Entity module. */
295-
void ENTITYinitialize() {
295+
void ENTITYinitialize(void) {
296296
}
297297

298298
/**

src/express/error.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static int ERROR_printf( const char *format, ... ) {
218218
return result;
219219
}
220220

221-
static void ERROR_nexterror() {
221+
static void ERROR_nexterror(void) {
222222
if( ERROR_string == ERROR_string_end ) {
223223
return;
224224
}
@@ -455,7 +455,7 @@ ERRORreport_with_symbol( enum ErrorCode errnum, Symbol * sym, ... ) {
455455
va_end( args );
456456
}
457457

458-
void ERRORnospace() {
458+
void ERRORnospace(void) {
459459
fprintf( stderr, "%s: out of space\n", EXPRESSprogram_name );
460460
ERRORabort( 0 );
461461
}
@@ -536,6 +536,6 @@ void ERRORsafe( jmp_buf env ) {
536536
memcpy( ERROR_safe_env, env, sizeof( jmp_buf ) );
537537
}
538538

539-
void ERRORunsafe() {
539+
void ERRORunsafe(void) {
540540
ERROR_unsafe = true;
541541
}

src/express/expr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Expression LITERAL_PI = EXPRESSION_NULL;
8585
Expression LITERAL_ZERO = EXPRESSION_NULL;
8686
Expression LITERAL_ONE;
8787

88-
void EXPop_init();
88+
void EXPop_init(void);
8989

9090
static inline int OPget_number_of_operands( Op_Code op ) {
9191
if( ( op == OP_NEGATE ) || ( op == OP_NOT ) ) {
@@ -760,7 +760,7 @@ void EXPop_create( int token_number, char * string, Resolve_expr_func * resolve_
760760
EXPop_table[token_number].resolve = resolve_func;
761761
}
762762

763-
void EXPop_init() {
763+
void EXPop_init(void) {
764764
EXPop_create( OP_AND, "AND", EXPresolve_op_logical );
765765
EXPop_create( OP_ANDOR, "ANDOR", EXPresolve_op_logical );
766766
EXPop_create( OP_ARRAY_ELEMENT, "[array element]", EXPresolve_op_array_like );

src/express/express.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ bool EXPRESSignore_duplicate_schemas = false;
106106

107107
Function funcdef(char *name, int pcount, Type ret_typ);
108108
void procdef(char *name, int pcount);
109-
void BUILTINSinitialize();
109+
void BUILTINSinitialize(void);
110110
Dictionary EXPRESSbuiltins; /* procedures/functions */
111111

112112

@@ -143,7 +143,7 @@ int EXPRESS_succeed( Express model ) {
143143
return 0;
144144
}
145145

146-
Express EXPRESScreate() {
146+
Express EXPRESScreate(void) {
147147
Express model = SCOPEcreate( OBJ_EXPRESS );
148148
model->u.express = ( struct Express_ * )calloc( 1, sizeof( struct Express_ ) );
149149
return model;
@@ -166,7 +166,7 @@ typedef struct Dir {
166166
char * leaf;
167167
} Dir;
168168

169-
static void EXPRESS_PATHinit() {
169+
static void EXPRESS_PATHinit(void) {
170170
char * p;
171171
Dir * dir;
172172

@@ -245,7 +245,7 @@ static void EXPRESS_PATHfree( void ) {
245245
}
246246

247247
/** inform object system about bit representation for handling pass diagnostics */
248-
void PASSinitialize() {
248+
void PASSinitialize(void) {
249249
}
250250

251251
/** Initialize the Express package. */
@@ -353,7 +353,7 @@ void EXPRESSparse( Express model, FILE * fp, char * filename ) {
353353
}
354354

355355
/* TODO LEMON ought to put this in expparse.h */
356-
void parserInitState();
356+
void parserInitState(void);
357357

358358
/** start parsing a new schema file */
359359
static Express PARSERrun( char * filename, FILE * fp ) {
@@ -798,7 +798,7 @@ void procdef(char *name, int pcount) {
798798
DICTdefine(EXPRESSbuiltins, name, p, 0, OBJ_PROCEDURE);
799799
}
800800

801-
void BUILTINSinitialize() {
801+
void BUILTINSinitialize(void) {
802802
EXPRESSbuiltins = DICTcreate( 35 );
803803
procdef("INSERT", 3 );
804804
procdef("REMOVE", 2 );

src/express/factory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Type Type_Set_Of_String;
3434
Type Type_Set_Of_Generic;
3535
Type Type_Bag_Of_Generic;
3636

37-
void FACTORYinitialize() {
37+
void FACTORYinitialize(void) {
3838
/* Very commonly-used read-only types */
3939
Type_Unknown = TYPEcreate( unknown_ );
4040
Type_Dont_Care = TYPEcreate( special_ );

0 commit comments

Comments
 (0)