NOAA-EMC / NCEPLIBS-g2c

This library contains C decoder/encoder routines for GRIB edition 2.
Other
18 stars 11 forks source link

should section 1 values be stored as unsigned ints? #375

Open edwardhartnett opened 1 year ago

edwardhartnett commented 1 year ago

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 commented 2 months ago

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. */