From 84872640293e67c6e47c4c2ca3489d05e2c2c8cc Mon Sep 17 00:00:00 2001 From: Gleb Belov Date: Mon, 27 Nov 2023 13:12:55 +1100 Subject: [PATCH] () -> (void) in C #30 --- include/mp/nl-header-c.h | 2 +- nl-writer2/examples/c/nlsol_ex_c_model.c | 2 +- nl-writer2/examples/c/nlsol_ex_c_model.h | 2 +- nl-writer2/examples/c/nlsol_ex_c_nlutils.c | 2 +- nl-writer2/examples/c/nlsol_ex_c_nlutils.h | 2 +- nl-writer2/include/api/c/nl-feeder2-c.h | 2 +- nl-writer2/include/api/c/nl-writer2-misc-c.h | 2 +- nl-writer2/include/api/c/sol-handler2-c.h | 2 +- nl-writer2/src/c_api.cc | 6 +++--- nl-writer2/src/nl-writer2.cc | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/mp/nl-header-c.h b/include/mp/nl-header-c.h index 50643a9a6..01d61d121 100644 --- a/include/mp/nl-header-c.h +++ b/include/mp/nl-header-c.h @@ -329,7 +329,7 @@ typedef struct NLHeader_C { /// Default NLHeader_C -NLHeader_C MakeNLHeader_C_Default(); +NLHeader_C MakeNLHeader_C_Default(void); #ifdef __cplusplus diff --git a/nl-writer2/examples/c/nlsol_ex_c_model.c b/nl-writer2/examples/c/nlsol_ex_c_model.c index 704c3ba0c..9ee51f567 100644 --- a/nl-writer2/examples/c/nlsol_ex_c_model.c +++ b/nl-writer2/examples/c/nlsol_ex_c_model.c @@ -5,7 +5,7 @@ #include "nlsol_ex_c_model.h" -CAPIExample MakeCAPIExample_Linear_01() { +CAPIExample MakeCAPIExample_Linear_01(void) { /// Variables. /// Put y first because continuous variables /// come before integer ones. diff --git a/nl-writer2/examples/c/nlsol_ex_c_model.h b/nl-writer2/examples/c/nlsol_ex_c_model.h index bcf7b8936..ef92dc78e 100644 --- a/nl-writer2/examples/c/nlsol_ex_c_model.h +++ b/nl-writer2/examples/c/nlsol_ex_c_model.h @@ -109,7 +109,7 @@ typedef struct CAPIExample { } CAPIExample; /// Create linear example data -CAPIExample MakeCAPIExample_Linear_01(); +CAPIExample MakeCAPIExample_Linear_01(void); /// Destroy linear example data void DestroyCAPIExample_Linear_01(CAPIExample* ); diff --git a/nl-writer2/examples/c/nlsol_ex_c_nlutils.c b/nl-writer2/examples/c/nlsol_ex_c_nlutils.c index 3429f01cc..753cbfda6 100644 --- a/nl-writer2/examples/c/nlsol_ex_c_nlutils.c +++ b/nl-writer2/examples/c/nlsol_ex_c_nlutils.c @@ -1,6 +1,6 @@ #include "nlsol_ex_c_nlutils.h" -NLW2_NLUtils_C MakeNLUtils_C() { +NLW2_NLUtils_C MakeNLUtils_C(void) { // Just return the API's default config: return NLW2_MakeNLUtils_C_Default(); } diff --git a/nl-writer2/examples/c/nlsol_ex_c_nlutils.h b/nl-writer2/examples/c/nlsol_ex_c_nlutils.h index 56d96b684..ee3a32ec6 100644 --- a/nl-writer2/examples/c/nlsol_ex_c_nlutils.h +++ b/nl-writer2/examples/c/nlsol_ex_c_nlutils.h @@ -8,7 +8,7 @@ #include "api/c/nl-writer2-misc-c.h" /// Fill NLUtils_C for the C API example -NLW2_NLUtils_C MakeNLUtils_C(); +NLW2_NLUtils_C MakeNLUtils_C(void); /// Destroy custom NLUtils_C void DestroyNLUtils_C(NLW2_NLUtils_C* ); diff --git a/nl-writer2/include/api/c/nl-feeder2-c.h b/nl-writer2/include/api/c/nl-feeder2-c.h index 57f732cec..1f811fbba 100644 --- a/nl-writer2/include/api/c/nl-feeder2-c.h +++ b/nl-writer2/include/api/c/nl-feeder2-c.h @@ -494,7 +494,7 @@ typedef struct NLW2_NLFeeder2_C { /// Return NLFeeder2_C with default options / methods -NLW2_NLFeeder2_C NLW2_MakeNLFeeder2_C_Default(); +NLW2_NLFeeder2_C NLW2_MakeNLFeeder2_C_Default(void); /// Destroy NLFeeder2_C created by NLW2_MakeNLFeeder2_C_default() void NLW2_DestroyNLFeeder2_C_Default(NLW2_NLFeeder2_C* ); diff --git a/nl-writer2/include/api/c/nl-writer2-misc-c.h b/nl-writer2/include/api/c/nl-writer2-misc-c.h index 517bbf43d..aaa69cbfa 100644 --- a/nl-writer2/include/api/c/nl-writer2-misc-c.h +++ b/nl-writer2/include/api/c/nl-writer2-misc-c.h @@ -45,7 +45,7 @@ typedef struct NLW2_NLUtils_C { /// Create a default NLUtils_C wrapper object. /// User application might change some methods /// and use the p_user_data_ pointer. -NLW2_NLUtils_C NLW2_MakeNLUtils_C_Default(); +NLW2_NLUtils_C NLW2_MakeNLUtils_C_Default(void); /// Destroy the NLUtils_C object created by the API void NLW2_DestroyNLUtils_C_Default(NLW2_NLUtils_C*); diff --git a/nl-writer2/include/api/c/sol-handler2-c.h b/nl-writer2/include/api/c/sol-handler2-c.h index 8eaa8f2c8..31adc7088 100644 --- a/nl-writer2/include/api/c/sol-handler2-c.h +++ b/nl-writer2/include/api/c/sol-handler2-c.h @@ -140,7 +140,7 @@ typedef struct NLW2_SOLHandler2_C { } NLW2_SOLHandler2_C; /// Create an SOLHandler2_C with default methods -NLW2_SOLHandler2_C NLW2_MakeSOLHandler2_C_Default(); +NLW2_SOLHandler2_C NLW2_MakeSOLHandler2_C_Default(void); /// Destroy an SOLHandler2_C /// created with NLW2_Make...Default() diff --git a/nl-writer2/src/c_api.cc b/nl-writer2/src/c_api.cc index 336708569..eab750c6e 100644 --- a/nl-writer2/src/c_api.cc +++ b/nl-writer2/src/c_api.cc @@ -253,7 +253,7 @@ static void NLW2_FeedColumnSizes_C_Default(void* , void* ) // void FeedObjAdj(ObjOffsetWriter& ) { } -NLW2_NLFeeder2_C NLW2_MakeNLFeeder2_C_Default() { +NLW2_NLFeeder2_C NLW2_MakeNLFeeder2_C_Default(void) { NLW2_NLFeeder2_C result; std::memset(&result, 0, sizeof(result)); // all 0 @@ -484,7 +484,7 @@ static void NLW2_myexit_C_Default( } -NLW2_NLUtils_C NLW2_MakeNLUtils_C_Default() { +NLW2_NLUtils_C NLW2_MakeNLUtils_C_Default(void) { NLW2_NLUtils_C result; result.p_user_data_ = NULL; @@ -532,7 +532,7 @@ static void NLW2_OnSolveCode_C_Default(void* p_user_data, int ) { } // void OnDblSuffix(SuffixReader& ) { } -NLW2_SOLHandler2_C NLW2_MakeSOLHandler2_C_Default() { +NLW2_SOLHandler2_C NLW2_MakeSOLHandler2_C_Default(void) { NLW2_SOLHandler2_C result; std::memset(&result, 0, sizeof(result)); // all 0 diff --git a/nl-writer2/src/nl-writer2.cc b/nl-writer2/src/nl-writer2.cc index a57828f77..4e4839288 100644 --- a/nl-writer2/src/nl-writer2.cc +++ b/nl-writer2/src/nl-writer2.cc @@ -79,7 +79,7 @@ void gfmt(char*, size_t, double, int); namespace mp { extern "C" -NLHeader_C MakeNLHeader_C_Default() { +NLHeader_C MakeNLHeader_C_Default(void) { NLHeader nlh; NLHeader_C nlh_c; nlh_c.pi = *(NLProblemInfo_C*)(&nlh);