Accessors: Refactoring

This commit is contained in:
Shahram Najm 2024-02-19 14:43:23 +00:00
parent fcd51754fc
commit b85b85348b
4 changed files with 2 additions and 14 deletions

View File

@ -115,13 +115,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
int ret = GRIB_SUCCESS;
double value = 0;
if (*len < 1) {
*len = 1;
return GRIB_ARRAY_TOO_SMALL;
}
ret = grib_get_double_internal(grib_handle_of_accessor(a), self->val, &value);
if (ret != GRIB_SUCCESS)
return ret;

View File

@ -116,13 +116,7 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
int ret = GRIB_SUCCESS;
double value = 0;
if (*len < 1) {
*len = 1;
return GRIB_ARRAY_TOO_SMALL;
}
ret = grib_get_double_internal(grib_handle_of_accessor(a), self->val, &value);
if (ret != GRIB_SUCCESS)
return ret;

View File

@ -256,7 +256,7 @@ int grib_process_runtime_options(grib_context* context, int argc, char** argv, g
#ifndef ECCODES_ON_WINDOWS
/* Check at compile time to ensure our file offset is at least 64 bits */
COMPILE_TIME_ASSERT(sizeof(options->infile_offset) >= 8);
static_assert(sizeof(options->infile_offset) >= 8);
#endif
has_output = grib_options_on("U");

View File

@ -340,7 +340,7 @@ static int grib_tool_without_orderby(grib_runtime_options* options)
if (options->infile_offset) {
#ifndef ECCODES_ON_WINDOWS
/* Check at compile time to ensure our file offset is at least 64 bits */
COMPILE_TIME_ASSERT(sizeof(options->infile_offset) >= 8);
static_assert(sizeof(options->infile_offset) >= 8);
#endif
err = fseeko(infile->file, options->infile_offset, SEEK_SET);
if (err) {