Skip to content

Commit

Permalink
Use void as parameter when no parameter exists
Browse files Browse the repository at this point in the history
  • Loading branch information
usr42 committed Jan 26, 2017
1 parent 4e7451a commit 7888b6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions fakegen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ def output_variables(arg_count, has_varargs, is_value_function)

#example: ARG0_TYPE arg0, ARG1_TYPE arg1
def arg_val_list(args_count)
return "void" if (args_count == 0)
arguments = []
args_count.times { |i| arguments << "ARG#{i}_TYPE arg#{i}" }
arguments.join(", ")
Expand Down
12 changes: 6 additions & 6 deletions fff.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ FFF_END_EXTERN_C \
typedef struct FUNCNAME##_Fake { \
DECLARE_ALL_FUNC_COMMON \
DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \
void(*custom_fake)(); \
void(**custom_fake_seq)(); \
void(*custom_fake)(void); \
void(**custom_fake_seq)(void); \
} FUNCNAME##_Fake;\
extern FUNCNAME##_Fake FUNCNAME##_fake;\
void FUNCNAME##_reset(); \
Expand All @@ -143,7 +143,7 @@ FFF_END_EXTERN_C \
#define DEFINE_FAKE_VOID_FUNC0(FUNCNAME) \
FFF_EXTERN_C \
FUNCNAME##_Fake FUNCNAME##_fake;\
void FUNCNAME(){ \
void FUNCNAME(void){ \
if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){\
}\
else{\
Expand Down Expand Up @@ -1625,8 +1625,8 @@ FFF_END_EXTERN_C \
DECLARE_ALL_FUNC_COMMON \
DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \
DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \
RETURN_TYPE(*custom_fake)(); \
RETURN_TYPE(**custom_fake_seq)(); \
RETURN_TYPE(*custom_fake)(void); \
RETURN_TYPE(**custom_fake_seq)(void); \
} FUNCNAME##_Fake;\
extern FUNCNAME##_Fake FUNCNAME##_fake;\
void FUNCNAME##_reset(); \
Expand All @@ -1635,7 +1635,7 @@ FFF_END_EXTERN_C \
#define DEFINE_FAKE_VALUE_FUNC0(RETURN_TYPE, FUNCNAME) \
FFF_EXTERN_C \
FUNCNAME##_Fake FUNCNAME##_fake;\
RETURN_TYPE FUNCNAME(){ \
RETURN_TYPE FUNCNAME(void){ \
if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){\
}\
else{\
Expand Down

0 comments on commit 7888b6e

Please sign in to comment.