Skip to content

Commit

Permalink
explicitly state parameters are (void), #787 (#788)
Browse files Browse the repository at this point in the history
* explicitly state parameters are `(void)`, #787

* additional cases to mark void

* fix2
  • Loading branch information
isaacbrodsky authored Oct 16, 2023
1 parent ff6067e commit a8f2a8a
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/apps/miscapps/generateBaseCellNeighbors.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static void auditBaseCellNeighbors(int baseCellNeighbors[NUM_BASE_CELLS][7],
/**
* Generates and prints the baseCellNeighbors and baseCellRotations tables.
*/
static void generate() {
static void generate(void) {
int baseCellNeighbors[NUM_BASE_CELLS][7];
int baseCellRotations[NUM_BASE_CELLS][7];

Expand Down
2 changes: 1 addition & 1 deletion src/apps/miscapps/generateFaceCenterPoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const LatLng faceCenterGeoCopy[NUM_ICOSA_FACES] = {
/**
* Generates and prints the faceCenterPoint table.
*/
static void generate() {
static void generate(void) {
printf("static const Vec3d faceCenterPoint[NUM_ICOSA_FACES] = {\n");
for (int i = 0; i < NUM_ICOSA_FACES; i++) {
LatLng centerCoords = faceCenterGeoCopy[i];
Expand Down
2 changes: 1 addition & 1 deletion src/apps/miscapps/generatePentagonDirectionFaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "baseCells.h"
#include "h3Index.h"

static void generate() {
static void generate(void) {
H3Index pentagons[NUM_PENTAGONS] = {0};
// Get the res 2 pentagons, whose neighbors have the same base cell
// and are unambiguously on the correct faces
Expand Down
4 changes: 2 additions & 2 deletions src/h3lib/include/h3api.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ DECLSPEC H3Error H3_EXPORT(getNumCells)(int res, int64_t *out);
* @{
*/
/** @brief returns the number of resolution 0 cells (hexagons and pentagons) */
DECLSPEC int H3_EXPORT(res0CellCount)();
DECLSPEC int H3_EXPORT(res0CellCount)(void);

/** @brief provides all base cells in H3Index format*/
DECLSPEC H3Error H3_EXPORT(getRes0Cells)(H3Index *out);
Expand All @@ -448,7 +448,7 @@ DECLSPEC H3Error H3_EXPORT(getRes0Cells)(H3Index *out);
* @{
*/
/** @brief returns the number of pentagons per resolution */
DECLSPEC int H3_EXPORT(pentagonCount)();
DECLSPEC int H3_EXPORT(pentagonCount)(void);

/** @brief generates all pentagons at the specified resolution */
DECLSPEC H3Error H3_EXPORT(getPentagons)(int res, H3Index *out);
Expand Down
2 changes: 1 addition & 1 deletion src/h3lib/lib/baseCells.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ Direction _getBaseCellDirection(int originBaseCell, int neighboringBaseCell) {
*
* @return int count of resolution 0 cells
*/
int H3_EXPORT(res0CellCount)() { return NUM_BASE_CELLS; }
int H3_EXPORT(res0CellCount)(void) { return NUM_BASE_CELLS; }

/**
* getRes0Cells generates all base cells storing them into the provided
Expand Down
2 changes: 1 addition & 1 deletion src/h3lib/lib/h3Index.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ H3Error H3_EXPORT(getIcosahedronFaces)(H3Index h3, int *out) {
*
* @return int count of pentagon indexes
*/
int H3_EXPORT(pentagonCount)() { return NUM_PENTAGONS; }
int H3_EXPORT(pentagonCount)(void) { return NUM_PENTAGONS; }

/**
* Generates all pentagons at the specified resolution
Expand Down
2 changes: 1 addition & 1 deletion src/h3lib/lib/iterators.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void _incrementResDigit(IterCellsChildren *it, int res) {
* internal state after it's exhausted, like the child resolution, for
* example.
*/
static IterCellsChildren _null_iter() {
static IterCellsChildren _null_iter(void) {
return (IterCellsChildren){
.h = H3_NULL, ._parentRes = -1, ._skipDigit = -1};
}
Expand Down
4 changes: 2 additions & 2 deletions website/docs/api/misc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ parents of all other cell indexes in the H3 grid system. The returned indexes co
<TabItem value="c">

```c
int res0CellCount();
int res0CellCount(void);
```
</TabItem>
Expand Down Expand Up @@ -864,7 +864,7 @@ Returns 0 (`E_SUCCESS`) on success.
<TabItem value="c">

```c
int pentagonCount();
int pentagonCount(void);
```
</TabItem>
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-3.x/api/misc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ All the resolution 0 H3 indexes.
<TabItem value="c">

```c
int res0IndexCount();
int res0IndexCount(void);
```
</TabItem>
Expand Down Expand Up @@ -807,7 +807,7 @@ All the pentagon H3 indexes at the specified resolution.
<TabItem value="c">

```c
int pentagonIndexCount();
int pentagonIndexCount(void);
```
</TabItem>
Expand Down

0 comments on commit a8f2a8a

Please sign in to comment.