uber / h3

Hexagonal hierarchical geospatial indexing system
https://h3geo.org
Apache License 2.0
4.83k stars 459 forks source link

Replace empty function parameters with `void` #787

Closed dcooley closed 11 months ago

dcooley commented 11 months ago

from: http://port70.net/~nsz/c/c99/n1256.html#6.11.6

The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature.

and this SO answer suggest you should use void in the function parameter definition to explicitly say the function does not take any arguments.

Therefore, should these two functions be changed to use void, as in:

//h3Index.c
int H3_EXPORT(pentagonCount)(void) { return NUM_PENTAGONS; }

//baseCells.c
int H3_EXPORT(res0CellCount)(void) { return NUM_BASE_CELLS; }

isaacbrodsky commented 11 months ago

Thanks for flagging this. I agree, it looks like they should be defined as (void). I opened a PR, #788 to change that.