Skip to content

Commit 298f1fa

Browse files
authored
Fix C warnings (#2064)
Rewrite `... f() { ... }` to `... f(void) { ... }`.
1 parent 17873d8 commit 298f1fa

File tree

14 files changed

+31
-31
lines changed

14 files changed

+31
-31
lines changed

ocaml/otherlibs/systhreads4/st_stubs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ struct caml_locking_scheme caml_default_locking_scheme =
186186
default_can_skip_yield,
187187
(void (*)(void*))&st_thread_yield };
188188

189-
static void acquire_runtime_lock()
189+
static void acquire_runtime_lock(void)
190190
{
191191
struct caml_locking_scheme* s;
192192

@@ -205,7 +205,7 @@ static void acquire_runtime_lock()
205205
}
206206
}
207207

208-
static void release_runtime_lock()
208+
static void release_runtime_lock(void)
209209
{
210210
/* There is no tricky case here like in acquire, as only the holder
211211
of the lock can change it. (Here, that's us) */
@@ -616,7 +616,7 @@ CAMLprim value caml_thread_initialize(value unit) /* ML */
616616
}
617617

618618
/* Start tick thread, if not already running */
619-
static st_retcode start_tick_thread()
619+
static st_retcode start_tick_thread(void)
620620
{
621621
st_retcode err;
622622
if (caml_tick_thread_running) return 0;
@@ -626,7 +626,7 @@ static st_retcode start_tick_thread()
626626
}
627627

628628
/* Stop tick thread, if currently running */
629-
static void stop_tick_thread()
629+
static void stop_tick_thread(void)
630630
{
631631
if (!caml_tick_thread_running) return;
632632
caml_tick_thread_stop = 1;

ocaml/runtime4/afl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static void afl_write(uint32_t msg)
6666
caml_fatal_error("writing to afl-fuzz");
6767
}
6868

69-
static uint32_t afl_read()
69+
static uint32_t afl_read(void)
7070
{
7171
uint32_t msg;
7272
if (read(FORKSRV_FD_READ, &msg, 4) != 4)

ocaml/runtime4/domain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
CAMLexport caml_domain_state* Caml_state;
2323

24-
void caml_init_domain ()
24+
void caml_init_domain (void)
2525
{
2626
if (Caml_state != NULL)
2727
return;

ocaml/runtime4/eventlog.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static int64_t time_counter(void)
120120
#endif
121121
}
122122

123-
static void setup_evbuf()
123+
static void setup_evbuf(void)
124124
{
125125
CAMLassert(!evbuf);
126126
evbuf = caml_stat_alloc_noexc(sizeof(*evbuf));
@@ -132,7 +132,7 @@ static void setup_evbuf()
132132
}
133133

134134
#define OUTPUT_FILE_LEN 4096
135-
static void setup_eventlog_file()
135+
static void setup_eventlog_file(void)
136136
{
137137
char_os output_file[OUTPUT_FILE_LEN];
138138
char_os *eventlog_filename = NULL;
@@ -239,7 +239,7 @@ static void teardown_eventlog(void)
239239
}
240240
}
241241

242-
void caml_eventlog_init()
242+
void caml_eventlog_init(void)
243243
{
244244
char_os *toggle = caml_secure_getenv(T("OCAML_EVENTLOG_ENABLED"));
245245

@@ -330,7 +330,7 @@ void caml_ev_alloc(uint64_t sz)
330330
/* Note that this function does not trigger an actual disk flush, it just
331331
pushes events in the event buffer.
332332
*/
333-
void caml_ev_alloc_flush()
333+
void caml_ev_alloc_flush(void)
334334
{
335335
int i;
336336

@@ -345,7 +345,7 @@ void caml_ev_alloc_flush()
345345
}
346346
}
347347

348-
void caml_ev_flush()
348+
void caml_ev_flush(void)
349349
{
350350
if (!Caml_state->eventlog_enabled) return;
351351
if (Caml_state->eventlog_paused) return;
@@ -357,7 +357,7 @@ void caml_ev_flush()
357357
};
358358
}
359359

360-
void caml_eventlog_disable()
360+
void caml_eventlog_disable(void)
361361
{
362362
Caml_state->eventlog_enabled = 0;
363363
teardown_eventlog();

ocaml/runtime4/extern.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ intnat reachable_words_once(value root, intnat identifier, value sizes_by_root_i
13011301
return size;
13021302
}
13031303

1304-
void reachable_words_init()
1304+
void reachable_words_init(void)
13051305
{
13061306
obj_counter = 0;
13071307
extern_flags = 0;
@@ -1315,7 +1315,7 @@ void reachable_words_mark_root(value v)
13151315
extern_record_location_with_data(v, h, RootUnprocessed);
13161316
}
13171317

1318-
void reachable_words_cleanup()
1318+
void reachable_words_cleanup(void)
13191319
{
13201320
extern_free_stack();
13211321
extern_free_position_table();

ocaml/runtime4/finalise.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ static void generic_final_update (struct finalisable * final, int darken_value)
152152
}
153153
}
154154

155-
void caml_final_update_mark_phase (){
155+
void caml_final_update_mark_phase (void){
156156
generic_final_update(&finalisable_first, /* darken_value */ 1);
157157
}
158158

159-
void caml_final_update_clean_phase (){
159+
void caml_final_update_clean_phase (void){
160160
generic_final_update(&finalisable_last, /* darken_value */ 0);
161161
}
162162

@@ -227,7 +227,7 @@ void caml_final_do_roots (scanning_action f)
227227
/* Call caml_invert_root on the values of the finalisable set. This is called
228228
directly by the compactor.
229229
*/
230-
void caml_final_invert_finalisable_values ()
230+
void caml_final_invert_finalisable_values (void)
231231
{
232232
uintnat i;
233233

@@ -247,7 +247,7 @@ void caml_final_invert_finalisable_values ()
247247
/* Call [caml_oldify_one] on the closures and values of the recent set.
248248
This is called by the minor GC through [caml_oldify_local_roots].
249249
*/
250-
void caml_final_oldify_young_roots ()
250+
void caml_final_oldify_young_roots (void)
251251
{
252252
uintnat i;
253253

@@ -337,7 +337,7 @@ static void generic_final_minor_update (struct finalisable * final)
337337
minor heap when moved to major heap or moved them to the finalising
338338
set when dead.
339339
*/
340-
void caml_final_update_minor_roots ()
340+
void caml_final_update_minor_roots (void)
341341
{
342342
generic_final_minor_update(&finalisable_last);
343343
}

ocaml/runtime4/fix_code.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void caml_thread_code (code_t code, asize_t len)
158158

159159
#else
160160

161-
int* caml_init_opcode_nargs()
161+
int* caml_init_opcode_nargs(void)
162162
{
163163
return NULL;
164164
}

ocaml/runtime4/gc_ctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ CAMLprim value caml_gc_quick_stat(value v)
329329
CAMLreturn (res);
330330
}
331331

332-
double caml_gc_minor_words_unboxed()
332+
double caml_gc_minor_words_unboxed(void)
333333
{
334334
return (Caml_state->stat_minor_words
335335
+ (double) (Caml_state->young_alloc_end - Caml_state->young_ptr));

ocaml/runtime4/instrtrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern code_t caml_start_code;
3636

3737
intnat caml_icount = 0;
3838

39-
void caml_stop_here () {}
39+
void caml_stop_here (void) {}
4040

4141
void caml_disasm_instr(code_t pc)
4242
{

ocaml/runtime4/major_gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ void caml_darken (value v, value *p)
314314
/* This function shrinks the mark stack back to the MARK_STACK_INIT_SIZE size
315315
and is called at the end of a GC compaction to avoid a mark stack greater
316316
than 1/32th of the heap. */
317-
void caml_shrink_mark_stack () {
317+
void caml_shrink_mark_stack (void) {
318318
struct mark_stack* stk = Caml_state->mark_stack;
319319
intnat init_stack_bsize = MARK_STACK_INIT_SIZE * sizeof(mark_entry);
320320
mark_entry* shrunk_stack;

ocaml/runtime4/memory.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ CAMLexport void caml_modify_local (value obj, intnat i, value val)
706706
}
707707
}
708708

709-
CAMLexport intnat caml_local_region_begin()
709+
CAMLexport intnat caml_local_region_begin(void)
710710
{
711711
return Caml_state->local_sp;
712712
}
@@ -716,7 +716,7 @@ CAMLexport void caml_local_region_end(intnat reg)
716716
Caml_state->local_sp = reg;
717717
}
718718

719-
CAMLexport caml_local_arenas* caml_get_local_arenas()
719+
CAMLexport caml_local_arenas* caml_get_local_arenas(void)
720720
{
721721
caml_local_arenas* s = Caml_state->local_arenas;
722722
if (s != NULL)
@@ -739,7 +739,7 @@ CAMLexport void caml_set_local_arenas(caml_local_arenas* s)
739739
}
740740
}
741741

742-
void caml_local_realloc()
742+
void caml_local_realloc(void)
743743
{
744744
caml_local_arenas* s = caml_get_local_arenas();
745745
intnat i;

ocaml/runtime4/memprof.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static uintnat rand_binom(uintnat len)
340340
which may call the GC, but prefer using [caml_alloc_shr], which
341341
gives this guarantee. The return value is either a valid callstack
342342
or 0 in out-of-memory scenarios. */
343-
static value capture_callstack_postponed()
343+
static value capture_callstack_postponed(void)
344344
{
345345
value res;
346346
intnat callstack_len =
@@ -1098,7 +1098,7 @@ static void th_ctx_iter_default(th_ctx_action f, void* data) {
10981098
CAMLexport void (*caml_memprof_th_ctx_iter_hook)(th_ctx_action, void*)
10991099
= th_ctx_iter_default;
11001100

1101-
CAMLexport struct caml_memprof_th_ctx* caml_memprof_new_th_ctx()
1101+
CAMLexport struct caml_memprof_th_ctx* caml_memprof_new_th_ctx(void)
11021102
{
11031103
struct caml_memprof_th_ctx* ctx =
11041104
caml_stat_alloc(sizeof(struct caml_memprof_th_ctx));

ocaml/runtime4/minor_gc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
struct generic_table CAML_TABLE_STRUCT(char);
6565

66-
void caml_alloc_minor_tables ()
66+
void caml_alloc_minor_tables (void)
6767
{
6868
Caml_state->ref_table =
6969
caml_stat_alloc_noexc(sizeof(struct caml_ref_table));
@@ -359,7 +359,7 @@ void caml_oldify_mopup (void)
359359
}
360360

361361
#ifdef DEBUG
362-
static void verify_minor_heap()
362+
static void verify_minor_heap(void)
363363
{
364364
header_t* p;
365365
struct caml_local_arena* arena = Caml_state->local_arenas ?

ocaml/runtime4/signals.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ Caml_inline value process_pending_actions_with_root_exn(value extra_root)
339339
}
340340

341341
CAMLno_tsan /* The access to [caml_something_to_do] is not synchronized. */
342-
int caml_check_pending_actions()
342+
int caml_check_pending_actions(void)
343343
{
344344
return caml_something_to_do;
345345
}

0 commit comments

Comments
 (0)