Skip to content

Commit

Permalink
Is codec_info_defaults useful?
Browse files Browse the repository at this point in the history
If it is useful:
- Make it const in addition to static, use uppercase for const values.
- No need to initialise a struct with static storage, it is implictly
  initialised to zero of the appropriate type.
  • Loading branch information
DimitriPapadopoulos authored and FrancescAlted committed Jun 13, 2024
1 parent e6d337c commit fb5be70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/blosc2.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ extern "C" {
do { \
if ((pointer) == NULL) { \
BLOSC_TRACE_ERROR("Pointer is null"); \
return rc; \
return (rc); \
} \
} while (0)
#define BLOSC_ERROR(rc) \
do { \
int rc_ = rc; \
int rc_ = (rc); \
if (rc_ < BLOSC2_ERROR_SUCCESS) { \
char *error_msg = print_error(rc_); \
BLOSC_TRACE_ERROR("%s", error_msg); \
Expand Down
5 changes: 0 additions & 5 deletions include/blosc2/codecs-registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#ifndef BLOSC_BLOSC2_CODECS_REGISTRY_H
#define BLOSC_BLOSC2_CODECS_REGISTRY_H

#include "blosc2.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -45,9 +43,6 @@ typedef struct {
char *decoder;
} codec_info;

// Silence unused codec_info typedef warning
static codec_info codec_info_defaults BLOSC_ATTRIBUTE_UNUSED = {0};

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit fb5be70

Please sign in to comment.