uber / h3

Hexagonal hierarchical geospatial indexing system

Home Page:https://h3geo.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace empty function parameters with `void`

dcooley opened this issue · comments

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; }

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