NCEPLIBS-g2c icon indicating copy to clipboard operation
NCEPLIBS-g2c copied to clipboard

should section 1 values be stored as unsigned ints?

Open edwardhartnett opened this issue 3 years ago • 1 comments
trafficstars

We have:

    int num_fields; /**< Number of fields in the message. */
    int num_local; /**< Number of local sections in the message. */
    int bytes_to_local; /**< Number of bytes in the message before the (first) local section. */
    int bytes_to_bms; /**< Number of bytes in the message to the bitmap section. */
    int bytes_to_data; /**< Number of bytes in the message to the (first) data section. */
    int num_sections; /**< Number of sections in the file. */

Should these be unsigned ints?

edwardhartnett avatar Nov 11 '22 16:11 edwardhartnett

Looking at info here: https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect1.shtml and the code in grib2_int.h and I see the following that need to be size_t:

    int bytes_to_local; /**< Number of bytes in the message before the (first) local section. */
    int bytes_to_bms; /**< Number of bytes in the message to the bitmap section. */
    int bytes_to_data; /**< Number of bytes in the message to the (first) data section. */

edwardhartnett avatar Jun 17 '24 08:06 edwardhartnett

OK, I made all the necessary changes to types as part of the reading > 2GB file changes.

I will close this issue.

edwardhartnett avatar Oct 29 '24 11:10 edwardhartnett