Use (void) for functions taking no arguments.

runtime/mercury_deep_profiling.c:
runtime/mercury_memory_zones.c:
runtime/mercury_trace_base.c:
    As above. clang -Wstrict-prototypes warns about functions with a
    "()" argument list, even if there was a prototype declared with
    "(void)".
This commit is contained in:
Peter Wang
2024-08-29 11:43:31 +10:00
parent df2d5bd556
commit cbd8bf182e
3 changed files with 8 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
// vim: ts=4 sw=4 expandtab ft=c
// Copyright (C) 2001-2008, 2010-2011 The University of Melbourne.
// Copyright (C) 2016, 2018 The Mercury team.
// Copyright (C) 2016, 2018-2019, 2022, 2024 The Mercury team.
// This file is distributed under the terms specified in COPYING.LIB.
// Deep profiling module
@@ -228,7 +228,7 @@ MR_deep_profile_update_special_history(void)
}
void
MR_deep_profile_update_closure_history()
MR_deep_profile_update_closure_history(void)
{
if (MR_deep_prof_search_len < MR_MAX_CLOSURE_LIST_LENGTH) {
MR_closure_search_lengths[MR_deep_prof_search_len]++;
@@ -236,7 +236,7 @@ MR_deep_profile_update_closure_history()
}
void
MR_deep_profile_update_method_history()
MR_deep_profile_update_method_history(void)
{
if (MR_deep_prof_search_len < MR_MAX_CLOSURE_LIST_LENGTH) {
MR_method_search_lengths[MR_deep_prof_search_len]++;

View File

@@ -1,7 +1,7 @@
// vim: ts=4 sw=4 expandtab ft=c
// Copyright (C) 1998-2000, 2002-2007, 2010-2012 The University of Melbourne.
// Copyright (C) 2013-2016, 2018 The Mercury team.
// Copyright (C) 2013-2016, 2018, 2022, 2024 The Mercury team.
// This file is distributed under the terms specified in COPYING.LIB.
// This module defines the MR_MemoryZone data structure and operations
@@ -343,7 +343,7 @@ static MR_MemoryZone * MR_THREADSAFE_VOLATILE used_memory_zones = NULL;
#endif
void
MR_init_zones()
MR_init_zones(void)
{
#ifdef MR_THREAD_SAFE
pthread_mutex_init(&memory_zones_lock, MR_MUTEX_ATTR);
@@ -359,7 +359,7 @@ MR_init_zones()
}
static void
MR_init_offsets()
MR_init_offsets(void)
{
int i;
size_t fake_reg_offset;

View File

@@ -1,7 +1,7 @@
// vim: ts=4 sw=4 expandtab ft=c
// Copyright (C) 1997-2008, 2011 The University of Melbourne.
// Copyright (C) 2014-2016, 2018, 2022-2023 The Mercury team.
// Copyright (C) 2014-2016, 2018, 2022-2024 The Mercury team.
// This file is distributed under the terms specified in COPYING.LIB.
// mercury_trace_base.c implements the interface between the main part
@@ -588,7 +588,7 @@ MR_trace_write_label_exec_counts_for_file(FILE *fp,
}
void
MR_trace_name_count_port_ensure_init()
MR_trace_name_count_port_ensure_init(void)
{
static MR_bool done = MR_FALSE;