From 4daeadd13d730f8dfa590137b8281cd53f2d4b66 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 6 Apr 2022 13:22:24 +0100 Subject: [PATCH] Tools: Fix broken test for GRIB-971 --- tools/bufr_compare.c | 12 ++++++------ tools/grib_compare.c | 2 +- tools/gts_compare.c | 13 ++++++------- tools/metar_compare.c | 4 ++-- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/tools/bufr_compare.c b/tools/bufr_compare.c index 2070ef382..f4a7b7807 100644 --- a/tools/bufr_compare.c +++ b/tools/bufr_compare.c @@ -100,11 +100,11 @@ static int onlyListed = 1; static int headerMode = 0; static int morein1 = 0; static int morein2 = 0; -static int listFromCommandLine; -static int verbose = 0; -static int tolerance_factor = 1; -static int write_error = 0; -static int write_count = 0; +static int listFromCommandLine = 0; +static int verbose = 0; +static double tolerance_factor = 1; +static int write_error = 0; +static int write_count = 0; static grib_handle* global_handle = NULL; static int counter = 0; @@ -360,7 +360,7 @@ int grib_tool_init(grib_runtime_options* options) } if (grib_options_on("t:")) - tolerance_factor = atoi(grib_options_get_option("t:")); + tolerance_factor = atof(grib_options_get_option("t:")); if (grib_options_on("R:")) { char* sarg = grib_options_get_option("R:"); diff --git a/tools/grib_compare.c b/tools/grib_compare.c index b23be95f8..0b9285e8d 100644 --- a/tools/grib_compare.c +++ b/tools/grib_compare.c @@ -321,7 +321,7 @@ int grib_tool_init(grib_runtime_options* options) } if (grib_options_on("T:")) - tolerance_factor = atoi(grib_options_get_option("T:")); + tolerance_factor = atof(grib_options_get_option("T:")); if (grib_options_on("R:")) { char* sarg = grib_options_get_option("R:"); diff --git a/tools/gts_compare.c b/tools/gts_compare.c index 35e9e439f..39b13d507 100644 --- a/tools/gts_compare.c +++ b/tools/gts_compare.c @@ -83,12 +83,11 @@ int onlyListed = 1; int headerMode = 0; int morein1 = 0; int morein2 = 0; -int listFromCommandLine; -int verbose = 0; -int tolerance_factor = 1; -static int write_error = 0; - -static int write_count = 0; +int listFromCommandLine = 0; +int verbose = 0; +double tolerance_factor = 1; +static int write_error = 0; +static int write_count = 0; grib_handle* global_handle = NULL; int counter = 0; @@ -242,7 +241,7 @@ int grib_tool_init(grib_runtime_options* options) } if (grib_options_on("t:")) - tolerance_factor = atoi(grib_options_get_option("t:")); + tolerance_factor = atof(grib_options_get_option("t:")); { /* Check for 2nd file being a directory. If so, we assume user is comparing to a file */ diff --git a/tools/metar_compare.c b/tools/metar_compare.c index 0dcd8a07f..847a3a206 100644 --- a/tools/metar_compare.c +++ b/tools/metar_compare.c @@ -89,7 +89,7 @@ static int morein1 = 0; static int morein2 = 0; static int listFromCommandLine; static int verbose = 0; -static int tolerance_factor = 1; +static double tolerance_factor = 1; static int write_error = 0; static grib_handle* global_handle = NULL; static int global_counter = 0; @@ -312,7 +312,7 @@ int grib_tool_init(grib_runtime_options* options) } if (grib_options_on("t:")) - tolerance_factor = atoi(grib_options_get_option("t:")); + tolerance_factor = atof(grib_options_get_option("t:")); { /* Check for 2nd file being a directory. If so, we assume user is comparing to a file */