Skip to content

Conversation

@botder
Copy link
Member

@botder botder commented Jan 12, 2019

This is a pretty basic replacement of (void) with () in Server, Client and Shared directories. DLL exported functions shouldn't be in this change.

In the C++11 N3337 standard draft:

8.3.5 Functions section 4
"If the parameter-declaration-clause is empty, the function takes no arguments."
"The parameter list (void) is equivalent to the empty parameter list."

C.1.7 Clause 8: declarators
"In C++, a function declared with an empty parameter list takes no arguments. In C, an empty
parameter list means that the number and type of the function arguments are unknown."

StackOverflow: Is there a difference between foo(void) and foo() in C++ or C?

@qaisjp
Copy link
Contributor

qaisjp commented Jan 12, 2019

Is this enforceable via .clang-format?

If there isn't an attribute for this in .clang-format, maybe you could add your grep to win-apply-clang-format.bat?

@botder
Copy link
Member Author

botder commented Jan 12, 2019

Command-line:

find ./Client -type f \( -iname '*.c' -o -iname '*.h' -o -iname '*.cpp' -o -iname '*.hpp' \) -exec sed -i 's/(void)/()/i' "{}" +;

I think fnr.exe should be able to do it automatically.

@qaisjp qaisjp requested a review from a team January 13, 2019 00:18
@botder botder merged commit e11685c into multitheftauto:master Jan 13, 2019
@botder botder added this to the 1.5.7 milestone Jan 13, 2019
@botder botder deleted the refactor/void-in-parentheses branch January 13, 2019 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants