diff --git a/src/eccodes.h b/src/eccodes.h index d0af8ee09..41d32cbd4 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -44,37 +44,37 @@ Log mode for information for processing information /* Types */ #define CODES_TYPE_UNDEFINED GRIB_TYPE_UNDEFINED -#define CODES_TYPE_LONG GRIB_TYPE_LONG -#define CODES_TYPE_DOUBLE GRIB_TYPE_DOUBLE -#define CODES_TYPE_STRING GRIB_TYPE_STRING -#define CODES_TYPE_BYTES GRIB_TYPE_BYTES -#define CODES_TYPE_SECTION GRIB_TYPE_SECTION -#define CODES_TYPE_LABEL GRIB_TYPE_LABEL -#define CODES_TYPE_MISSING GRIB_TYPE_MISSING +#define CODES_TYPE_LONG GRIB_TYPE_LONG +#define CODES_TYPE_DOUBLE GRIB_TYPE_DOUBLE +#define CODES_TYPE_STRING GRIB_TYPE_STRING +#define CODES_TYPE_BYTES GRIB_TYPE_BYTES +#define CODES_TYPE_SECTION GRIB_TYPE_SECTION +#define CODES_TYPE_LABEL GRIB_TYPE_LABEL +#define CODES_TYPE_MISSING GRIB_TYPE_MISSING /* Missing values */ -#define CODES_MISSING_LONG GRIB_MISSING_LONG +#define CODES_MISSING_LONG GRIB_MISSING_LONG #define CODES_MISSING_DOUBLE GRIB_MISSING_DOUBLE /*set spec flags*/ #define CODES_UTIL_SET_SPEC_FLAGS_ONLY_PACKING GRIB_UTIL_SET_SPEC_FLAGS_ONLY_PACKING /* Dump option flags*/ -#define CODES_DUMP_FLAG_READ_ONLY GRIB_DUMP_FLAG_READ_ONLY -#define CODES_DUMP_FLAG_DUMP_OK GRIB_DUMP_FLAG_DUMP_OK -#define CODES_DUMP_FLAG_VALUES GRIB_DUMP_FLAG_VALUES -#define CODES_DUMP_FLAG_CODED GRIB_DUMP_FLAG_CODED -#define CODES_DUMP_FLAG_OCTECT GRIB_DUMP_FLAG_OCTECT -#define CODES_DUMP_FLAG_ALIASES GRIB_DUMP_FLAG_ALIASES -#define CODES_DUMP_FLAG_TYPE GRIB_DUMP_FLAG_TYPE -#define CODES_DUMP_FLAG_HEXADECIMAL GRIB_DUMP_FLAG_HEXADECIMAL -#define CODES_DUMP_FLAG_NO_DATA GRIB_DUMP_FLAG_NO_DATA -#define CODES_DUMP_FLAG_ALL_DATA GRIB_DUMP_FLAG_ALL_DATA +#define CODES_DUMP_FLAG_READ_ONLY GRIB_DUMP_FLAG_READ_ONLY +#define CODES_DUMP_FLAG_DUMP_OK GRIB_DUMP_FLAG_DUMP_OK +#define CODES_DUMP_FLAG_VALUES GRIB_DUMP_FLAG_VALUES +#define CODES_DUMP_FLAG_CODED GRIB_DUMP_FLAG_CODED +#define CODES_DUMP_FLAG_OCTET GRIB_DUMP_FLAG_OCTET +#define CODES_DUMP_FLAG_ALIASES GRIB_DUMP_FLAG_ALIASES +#define CODES_DUMP_FLAG_TYPE GRIB_DUMP_FLAG_TYPE +#define CODES_DUMP_FLAG_HEXADECIMAL GRIB_DUMP_FLAG_HEXADECIMAL +#define CODES_DUMP_FLAG_NO_DATA GRIB_DUMP_FLAG_NO_DATA +#define CODES_DUMP_FLAG_ALL_DATA GRIB_DUMP_FLAG_ALL_DATA #define CODES_DUMP_FLAG_ALL_ATTRIBUTES GRIB_DUMP_FLAG_ALL_ATTRIBUTES /* codes_nearest flags */ -#define CODES_NEAREST_SAME_GRID GRIB_NEAREST_SAME_GRID -#define CODES_NEAREST_SAME_DATA GRIB_NEAREST_SAME_DATA +#define CODES_NEAREST_SAME_GRID GRIB_NEAREST_SAME_GRID +#define CODES_NEAREST_SAME_DATA GRIB_NEAREST_SAME_DATA #define CODES_NEAREST_SAME_POINT GRIB_NEAREST_SAME_POINT /*! Iteration is carried out on all the keys available in the message diff --git a/src/grib_api.h b/src/grib_api.h index 58c91a72d..7be7faaad 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -104,7 +104,7 @@ Log mode for information for processing information #define GRIB_DUMP_FLAG_DUMP_OK (1 << 1) #define GRIB_DUMP_FLAG_VALUES (1 << 2) #define GRIB_DUMP_FLAG_CODED (1 << 3) -#define GRIB_DUMP_FLAG_OCTECT (1 << 4) +#define GRIB_DUMP_FLAG_OCTET (1 << 4) #define GRIB_DUMP_FLAG_ALIASES (1 << 5) #define GRIB_DUMP_FLAG_TYPE (1 << 6) #define GRIB_DUMP_FLAG_HEXADECIMAL (1 << 7) @@ -700,9 +700,9 @@ int grib_nearest_find(grib_nearest* nearest, const grib_handle* h, double inlat, double* values, double* distances, int* indexes, size_t* len); /** -* Frees an nearest from memory +* Frees a nearest neighbour object from memory * -* @param nearest : the nearest +* @param nearest : the nearest * @return 0 if OK, integer value on error */ int grib_nearest_delete(grib_nearest* nearest); @@ -766,7 +766,7 @@ int grib_get_size(const grib_handle* h, const char* key, size_t* size); * * @param h : the handle to get the offset from * @param key : the key to be searched -* @param length : the address of a size_t where the length will be set +* @param length : the address of a size_t where the length will be set * @return 0 if OK, integer value on error */ int grib_get_length(const grib_handle* h, const char* key, size_t* length); diff --git a/src/grib_dumper_class_debug.c b/src/grib_dumper_class_debug.c index 58c7bf1b4..15d6463af 100644 --- a/src/grib_dumper_class_debug.c +++ b/src/grib_dumper_class_debug.c @@ -511,7 +511,7 @@ static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accesso static void set_begin_end(grib_dumper* d, grib_accessor* a) { grib_dumper_debug* self = (grib_dumper_debug*)d; - if ((d->option_flags & GRIB_DUMP_FLAG_OCTECT) != 0) { + if ((d->option_flags & GRIB_DUMP_FLAG_OCTET) != 0) { self->begin = a->offset - self->section_offset + 1; self->theEnd = grib_get_next_position_offset(a) - self->section_offset; } diff --git a/src/grib_dumper_class_wmo.c b/src/grib_dumper_class_wmo.c index c1431c101..e8ba82488 100644 --- a/src/grib_dumper_class_wmo.c +++ b/src/grib_dumper_class_wmo.c @@ -569,7 +569,7 @@ static void dump_section(grib_dumper* d, grib_accessor* a, grib_block_of_accesso static void set_begin_end(grib_dumper* d, grib_accessor* a) { grib_dumper_wmo* self = (grib_dumper_wmo*)d; - if ((d->option_flags & GRIB_DUMP_FLAG_OCTECT) != 0) { + if ((d->option_flags & GRIB_DUMP_FLAG_OCTET) != 0) { self->begin = a->offset - self->section_offset + 1; self->theEnd = grib_get_next_position_offset(a) - self->section_offset; } diff --git a/tools/bufr_dump.c b/tools/bufr_dump.c index 53b5d4800..fb13aad89 100644 --- a/tools/bufr_dump.c +++ b/tools/bufr_dump.c @@ -125,7 +125,7 @@ int grib_tool_init(grib_runtime_options* options) if (grib_options_on("O")) { options->dump_mode = "wmo"; json = 0; - options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTECT | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTET | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("p")) { diff --git a/tools/grib_dump.c b/tools/grib_dump.c index 2a53ef351..fc358d726 100644 --- a/tools/grib_dump.c +++ b/tools/grib_dump.c @@ -90,7 +90,7 @@ int grib_tool_init(grib_runtime_options* options) if (grib_options_on("O")) { options->dump_mode = "wmo"; - options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTECT | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTET | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("D")) { diff --git a/tools/grib_merge.c b/tools/grib_merge.c index 16ee48c0f..ac74019db 100644 --- a/tools/grib_merge.c +++ b/tools/grib_merge.c @@ -131,21 +131,13 @@ static grib_handle* merge(grib_handle* h1, grib_handle* h2) long Ni1, Nj1, Ni2, Nj2; grib_handle* h = NULL; int err = 0; - /* - int dump_flags= GRIB_DUMP_FLAG_CODED - | GRIB_DUMP_FLAG_OCTECT - | GRIB_DUMP_FLAG_VALUES - | GRIB_DUMP_FLAG_READ_ONLY; - */ - - /* same products? */ + /* Same products? */ if (grib_key_equal(h1, h2, md5Key, GRIB_TYPE_STRING, &err) == 0 && err == 0) { return NULL; } - /* can we do it?*/ - + /* Can we do it? */ len2 = sizeof(s2) / sizeof(*s2); err = grib_get_string(h2, "gridType", s2, &len2); if (strcmp(s2, "regular_ll")) { @@ -187,21 +179,17 @@ static grib_handle* merge(grib_handle* h1, grib_handle* h2) return NULL; } - /* yes we can!*/ - - /* do we have something to do?*/ - + /* Yes we can! Do we have something to do? */ if (grib_key_equal(h1, h2, "latitudeOfFirstGridPointInDegrees", GRIB_TYPE_DOUBLE, &err) && grib_key_equal(h1, h2, "latitudeOfLastGridPointInDegrees", GRIB_TYPE_DOUBLE, &err) && grib_key_equal(h1, h2, "longitudeOfFirstGridPointInDegrees", GRIB_TYPE_DOUBLE, &err) && grib_key_equal(h1, h2, "longitudeOfLastGridPointInDegrees", GRIB_TYPE_DOUBLE, &err)) { - /* no we don't */ + /* No we don't */ return NULL; } - /* yes we do! */ - - /* check scanning mode */ + /* Yes we do! */ + /* Check scanning mode */ grib_get_long(h1, "iScansNegatively", &iscan); if (iscan) grib_set_long(h1, "swapScanningLon", 1); @@ -258,7 +246,7 @@ static grib_handle* merge(grib_handle* h1, grib_handle* h2) lonLast = 360 - di; } - /* create new grib for bigger area*/ + /* Create new grib for bigger area*/ h = grib_handle_clone(h1); grib_set_double(h, "latitudeOfFirstGridPointInDegrees", latFirst); grib_set_double(h, "longitudeOfFirstGridPointInDegrees", lonFirst); diff --git a/tools/gts_dump.c b/tools/gts_dump.c index 13b302c80..c8fe98eb3 100644 --- a/tools/gts_dump.c +++ b/tools/gts_dump.c @@ -68,7 +68,7 @@ int grib_tool_init(grib_runtime_options* options) if (grib_options_on("O")) { options->dump_mode = "wmo"; - options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTECT | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTET | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("D")) { diff --git a/tools/metar_dump.c b/tools/metar_dump.c index 1c496c5a8..2dcfe14b9 100644 --- a/tools/metar_dump.c +++ b/tools/metar_dump.c @@ -65,7 +65,7 @@ int grib_tool_init(grib_runtime_options* options) if (grib_options_on("O")) { options->dump_mode = "wmo"; - options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTECT | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTET | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("D")) { diff --git a/tools/taf_dump.c b/tools/taf_dump.c index a6cdb704e..346a6b1cc 100644 --- a/tools/taf_dump.c +++ b/tools/taf_dump.c @@ -59,7 +59,7 @@ int grib_tool_init(grib_runtime_options* options) if (grib_options_on("O")) { options->dump_mode = "wmo"; - options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTECT | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; + options->dump_flags = GRIB_DUMP_FLAG_CODED | GRIB_DUMP_FLAG_OCTET | GRIB_DUMP_FLAG_VALUES | GRIB_DUMP_FLAG_READ_ONLY; } if (grib_options_on("D")) {