Skip to content

Commit

Permalink
() -> (void) in C #30
Browse files Browse the repository at this point in the history
  • Loading branch information
glebbelov committed Nov 27, 2023
1 parent fa193a3 commit 8487264
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/mp/nl-header-c.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ typedef struct NLHeader_C {


/// Default NLHeader_C
NLHeader_C MakeNLHeader_C_Default();
NLHeader_C MakeNLHeader_C_Default(void);


#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion nl-writer2/examples/c/nlsol_ex_c_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion nl-writer2/examples/c/nlsol_ex_c_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -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* );
Expand Down
2 changes: 1 addition & 1 deletion nl-writer2/examples/c/nlsol_ex_c_nlutils.c
Original file line number Diff line number Diff line change
@@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion nl-writer2/examples/c/nlsol_ex_c_nlutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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* );
Expand Down
2 changes: 1 addition & 1 deletion nl-writer2/include/api/c/nl-feeder2-c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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* );
Expand Down
2 changes: 1 addition & 1 deletion nl-writer2/include/api/c/nl-writer2-misc-c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*);
Expand Down
2 changes: 1 addition & 1 deletion nl-writer2/include/api/c/sol-handler2-c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions nl-writer2/src/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nl-writer2/src/nl-writer2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8487264

Please sign in to comment.