From 3a9213ab03091cdea33f9dbef014d768623e5617 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 21 Apr 2023 11:16:06 +0100 Subject: [PATCH] Compiler warnings: Microsoft Visual --- src/grib_accessor_class_g2level.cc | 4 ++-- src/grib_accessor_class_g2lon.cc | 2 +- src/grib_accessor_class_global_gaussian.cc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/grib_accessor_class_g2level.cc b/src/grib_accessor_class_g2level.cc index 0d84e8e45..417a31dfc 100644 --- a/src/grib_accessor_class_g2level.cc +++ b/src/grib_accessor_class_g2level.cc @@ -303,8 +303,8 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) //value_first = value_first + 0.5; //round up // TODO(masn): These maxima should come from the respective accessors - const int64_t scaled_value_max = (1UL << 32) - 1; // scaledValueOf*FixedSurface is 4 octets - const int64_t scale_factor_max = (1UL << 8) - 1; // scaleFactorOf*FixedSurface is 1 octet + const int64_t scaled_value_max = (1ULL << 32) - 1; // scaledValueOf*FixedSurface is 4 octets + const int64_t scale_factor_max = (1ULL << 8) - 1; // scaleFactorOf*FixedSurface is 1 octet int64_t lscaled_value=0, lscale_factor=0; ret = compute_scaled_value_and_scale_factor(value_first, scaled_value_max, scale_factor_max, &lscaled_value, &lscale_factor); diff --git a/src/grib_accessor_class_g2lon.cc b/src/grib_accessor_class_g2lon.cc index 03baff9bf..7ffed21d9 100644 --- a/src/grib_accessor_class_g2lon.cc +++ b/src/grib_accessor_class_g2lon.cc @@ -184,7 +184,7 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) else { if (value < 0) value += 360; - longitude = value * 1000000; + longitude = (long)(value * 1000000); } return grib_set_long(grib_handle_of_accessor(a), self->longitude, longitude); } diff --git a/src/grib_accessor_class_global_gaussian.cc b/src/grib_accessor_class_global_gaussian.cc index 90d69655b..3596dae17 100644 --- a/src/grib_accessor_class_global_gaussian.cc +++ b/src/grib_accessor_class_global_gaussian.cc @@ -373,8 +373,8 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) ddi = (360.0 * dfactor) / dNi; dlonlast = (360.0 * dfactor) - ddi + 0.5; ddi = ddi + 0.5; - di = ddi; - lonlast = dlonlast; + di = (long)ddi; + lonlast = (long)dlonlast; grib_context_free(c, lats);