Skip to content

Commit

Permalink
Add void to functions taking no parameters (resolves #208)
Browse files Browse the repository at this point in the history
  • Loading branch information
lindstro committed Aug 7, 2023
1 parent 300e77d commit c184581
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion examples/diffusionC.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ error(const double* u, const constants* c, double t)
}

static int
usage()
usage(void)
{
fprintf(stderr, "Usage: diffusionC [options]\n");
fprintf(stderr, "Options:\n");
Expand Down
2 changes: 1 addition & 1 deletion examples/iteratorC.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void print3(cfp_iter1d begin, cfp_iter1d end)
printf("%g\n", _.reference.get(_.iterator.ref(p)));
}

int main()
int main(void)
{
const cfp_array1d_api _1d = cfp.array1d;
const cfp_array2d_api _2d = cfp.array2d;
Expand Down
6 changes: 3 additions & 3 deletions include/zfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ zfp_stream_set_omp_chunk_size(

/* unspecified configuration */
zfp_config /* compression mode and parameter settings */
zfp_config_none();
zfp_config_none(void);

/* fixed-rate configuration */
zfp_config /* compression mode and parameter settings */
Expand All @@ -358,7 +358,7 @@ zfp_config_accuracy(

/* reversible (lossless) configuration */
zfp_config /* compression mode and parameter settings */
zfp_config_reversible();
zfp_config_reversible(void);

/* expert configuration */
zfp_config /* compression mode and parameter settings */
Expand All @@ -373,7 +373,7 @@ zfp_config_expert(

/* allocate field struct */
zfp_field* /* pointer to default initialized field */
zfp_field_alloc();
zfp_field_alloc(void);

/* allocate metadata for 1D field f[nx] */
zfp_field* /* allocated field metadata */
Expand Down
2 changes: 1 addition & 1 deletion include/zfp/bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void stream_close(bitstream* stream);
bitstream* stream_clone(const bitstream* stream);

/* word size in bits (equal to stream_word_bits) */
bitstream_count stream_alignment();
bitstream_count stream_alignment(void);

/* pointer to beginning of stream */
void* stream_data(const bitstream* stream);
Expand Down
2 changes: 1 addition & 1 deletion include/zfp/bitstream.inl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ stream_write_word(bitstream* s, bitstream_word value)

/* word size in bits (equals bitstream_word_bits) */
inline_ bitstream_count
stream_alignment()
stream_alignment(void)
{
return wsize;
}
Expand Down
2 changes: 1 addition & 1 deletion include/zfp/internal/cfp/array1d.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ typedef struct {
} cfp_header1d_api;

typedef struct {
cfp_array1d (*ctor_default)();
cfp_array1d (*ctor_default)(void);
cfp_array1d (*ctor)(size_t n, double rate, const double* p, size_t cache_size);
cfp_array1d (*ctor_copy)(const cfp_array1d src);
cfp_array1d (*ctor_header)(const cfp_header h, const void* buffer, size_t buffer_size_bytes);
Expand Down
2 changes: 1 addition & 1 deletion include/zfp/internal/cfp/array1f.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ typedef struct {
} cfp_header1f_api;

typedef struct {
cfp_array1f (*ctor_default)();
cfp_array1f (*ctor_default)(void);
cfp_array1f (*ctor)(size_t n, double rate, const float* p, size_t cache_size);
cfp_array1f (*ctor_copy)(const cfp_array1f src);
cfp_array1f (*ctor_header)(const cfp_header h, const void* buffer, size_t buffer_size_bytes);
Expand Down
2 changes: 1 addition & 1 deletion include/zfp/internal/cfp/array2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef struct {
} cfp_header2d_api;

typedef struct {
cfp_array2d (*ctor_default)();
cfp_array2d (*ctor_default)(void);
cfp_array2d (*ctor)(size_t nx, size_t ny, double rate, const double* p, size_t cache_size);
cfp_array2d (*ctor_copy)(const cfp_array2d src);
cfp_array2d (*ctor_header)(const cfp_header h, const void* buffer, size_t buffer_size_bytes);
Expand Down
2 changes: 1 addition & 1 deletion include/zfp/internal/cfp/array2f.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef struct {
} cfp_header2f_api;

typedef struct {
cfp_array2f (*ctor_default)();
cfp_array2f (*ctor_default)(void);
cfp_array2f (*ctor)(size_t nx, size_t ny, double rate, const float* p, size_t cache_size);
cfp_array2f (*ctor_copy)(const cfp_array2f src);
cfp_array2f (*ctor_header)(const cfp_header h, const void* buffer, size_t buffer_size_bytes);
Expand Down
2 changes: 1 addition & 1 deletion include/zfp/internal/cfp/array3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ typedef struct {
} cfp_header3d_api;

typedef struct {
cfp_array3d (*ctor_default)();
cfp_array3d (*ctor_default)(void);
cfp_array3d (*ctor)(size_t nx, size_t ny, size_t nz, double rate, const double* p, size_t cache_size);
cfp_array3d (*ctor_copy)(const cfp_array3d src);
cfp_array3d (*ctor_header)(const cfp_header h, const void* buffer, size_t buffer_size_bytes);
Expand Down
2 changes: 1 addition & 1 deletion include/zfp/internal/cfp/array3f.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ typedef struct {
} cfp_header3f_api;

typedef struct {
cfp_array3f (*ctor_default)();
cfp_array3f (*ctor_default)(void);
cfp_array3f (*ctor)(size_t nx, size_t ny, size_t nz, double rate, const float* p, size_t cache_size);
cfp_array3f (*ctor_copy)(const cfp_array3f src);
cfp_array3f (*ctor_header)(const cfp_header h, const void* buffer, size_t buffer_size_bytes);
Expand Down
2 changes: 1 addition & 1 deletion include/zfp/internal/cfp/array4d.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ typedef struct {
} cfp_header4d_api;

typedef struct {
cfp_array4d (*ctor_default)();
cfp_array4d (*ctor_default)(void);
cfp_array4d (*ctor)(size_t nx, size_t ny, size_t nz, size_t nw, double rate, const double* p, size_t cache_size);
cfp_array4d (*ctor_copy)(const cfp_array4d src);
cfp_array4d (*ctor_header)(const cfp_header h, const void* buffer, size_t buffer_size_bytes);
Expand Down
2 changes: 1 addition & 1 deletion include/zfp/internal/cfp/array4f.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ typedef struct {
} cfp_header4f_api;

typedef struct {
cfp_array4f (*ctor_default)();
cfp_array4f (*ctor_default)(void);
cfp_array4f (*ctor)(size_t nx, size_t ny, size_t nz, size_t nw, double rate, const float* p, size_t cache_size);
cfp_array4f (*ctor_copy)(const cfp_array4f src);
cfp_array4f (*ctor_header)(const cfp_header h, const void* buffer, size_t buffer_size_bytes);
Expand Down
6 changes: 3 additions & 3 deletions src/zfp.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ zfp_type_size(zfp_type type)
/* public functions: fields ------------------------------------------------ */

zfp_field*
zfp_field_alloc()
zfp_field_alloc(void)
{
zfp_field* field = (zfp_field*)malloc(sizeof(zfp_field));
if (field) {
Expand Down Expand Up @@ -465,7 +465,7 @@ zfp_field_set_metadata(zfp_field* field, uint64 meta)
/* public functions: compression mode and parameter settings --------------- */

zfp_config
zfp_config_none()
zfp_config_none(void)
{
zfp_config config;
config.mode = zfp_mode_null;
Expand Down Expand Up @@ -507,7 +507,7 @@ zfp_config_accuracy(
}

zfp_config
zfp_config_reversible()
zfp_config_reversible(void)
{
zfp_config config;
config.mode = zfp_mode_reversible;
Expand Down
2 changes: 1 addition & 1 deletion utils/zfp.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ print_error(const void* fin, const void* fout, zfp_type type, size_t n)
}

static void
usage()
usage(void)
{
fprintf(stderr, "%s\n", zfp_version_string);
fprintf(stderr, "Usage: zfp <options>\n");
Expand Down

0 comments on commit c184581

Please sign in to comment.