You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be interesting to modify the BLOSC_ERROR_NULL macro so that it gives more descriptive error messages in this way:
#define BLOSC_ERROR_NULL(pointer, rc)
do {
if (pointer == NULL) {
BLOSC_TRACE_ERROR("Pointer %s is NULL", #pointer "");
return rc;
}
} while (0)
It will actually print out the name of the pointer and should keep strings to a minimum.
This pattern also exists a lot in the code:
if (rc < 0) {
return rc;
}
So adding a helper for that might be nice too.
And possibly rename BLOSC_ERROR_NULL to match.
#define BLOSC_RETURN_NOTOK(rc)
do {
if (rc < 0) {
return rc;
}
} while (0)
#define BLOSC_ERROR_NULL(pointer, rc)
do {
if (pointer == NULL) {
BLOSC_TRACE_ERROR("Pointer %s is NULL", #pointer "");
return rc;
}
} while (0)
The text was updated successfully, but these errors were encountered:
nmoinvaz
changed the title
Improve BLOSC_ERROR_NULL macro (proposed by Nathan Moinvaziri)
Improve BLOSC_ERROR_NULL macro
Mar 30, 2021
#define BLOSC_ERROR_NULL(pointer, rc)
do {
if (pointer == NULL) {
BLOSC_TRACE_ERROR("Pointer %s is NULL", #pointer "");
return rc;
}
} while (0)
It will actually print out the name of the pointer and should keep strings to a minimum.
if (rc < 0) {
return rc;
}
So adding a helper for that might be nice too.
And possibly rename BLOSC_ERROR_NULL to match.
#define BLOSC_RETURN_NOTOK(rc)
do {
if (rc < 0) {
return rc;
}
} while (0)
#define BLOSC_ERROR_NULL(pointer, rc)
do {
if (pointer == NULL) {
BLOSC_TRACE_ERROR("Pointer %s is NULL", #pointer "");
return rc;
}
} while (0)
The text was updated successfully, but these errors were encountered: