diff --git a/src/bufr_util.c b/src/bufr_util.c index 575ab60c0..87e86a6b5 100644 --- a/src/bufr_util.c +++ b/src/bufr_util.c @@ -234,19 +234,19 @@ static int bufr_decode_extra_rdb_keys(const void* message, long offset_section2, if (hdr->isSatellite) { unsigned char* pKeyMoreLong = (unsigned char*)message + offset_keyMore; /* as an integer */ unsigned char* pKeySat = (unsigned char*)message + offset_keySat; - long lValue = 0; + unsigned long lValue = 0; start = 40; - lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 26); + lValue = grib_decode_unsigned_long(pKeyData, &start, 26); hdr->localLongitude1 = (lValue - 18000000.0) / 100000.0; start = 72; - lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 25); + lValue = grib_decode_unsigned_long(pKeyData, &start, 25); hdr->localLatitude1 = (lValue - 9000000.0) / 100000.0; start = 0; - lValue = (long)grib_decode_unsigned_long(pKeyMoreLong, &start, 26); + lValue = grib_decode_unsigned_long(pKeyMoreLong, &start, 26); hdr->localLongitude2 = (lValue - 18000000.0) / 100000.0; start = 32; - lValue = (long)grib_decode_unsigned_long(pKeyMoreLong, &start, 25); - hdr->localLatitude2 = (lValue - 9000000) / 100000.0; + lValue = grib_decode_unsigned_long(pKeyMoreLong, &start, 25); + hdr->localLatitude2 = (lValue - 9000000.0) / 100000.0; if (hdr->oldSubtype == 255 || hdr->numberOfSubsets > 255 || (hdr->oldSubtype >= 121 && hdr->oldSubtype <= 130) || @@ -265,15 +265,15 @@ static int bufr_decode_extra_rdb_keys(const void* message, long offset_section2, } else { size_t i = 0; - long lValue = 0; + unsigned long lValue = 0; char* pTemp = NULL; char temp[IDENT_LEN] = {0,}; start = 72; - lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 25); + lValue = grib_decode_unsigned_long(pKeyData, &start, 25); hdr->localLatitude = (lValue - 9000000.0) / 100000.0; start = 40; - lValue = (long)grib_decode_unsigned_long(pKeyData, &start, 26); + lValue = grib_decode_unsigned_long(pKeyData, &start, 26); hdr->localLongitude = (lValue - 18000000.0) / 100000.0; /* interpret keyMore as a string. Copy to a temporary */