CIFread.h: fix struct cifrstyle.crs_layers type bool -> enum (unsigned char)

The type is actually an enum (assumed to be int by default) but relies
on the magic typedef to (unsigned char) so we make this explicit and
better document what the real type is.

I guess in the past it was really a bool with only 2 states NONE|TEXT.

C29 bool type compatibility
This commit is contained in:
Darryl L. Miles 2025-01-06 17:22:41 +00:00 committed by Tim Edwards
parent b1a9e10be7
commit 4887f71ca3
2 changed files with 9 additions and 4 deletions

View File

@ -131,8 +131,11 @@ typedef struct
/* Length of record header */
#define CALMAHEADERLENGTH 4
/* Label types */
typedef enum { LABEL_TYPE_NONE, LABEL_TYPE_TEXT, LABEL_TYPE_PORT, LABEL_TYPE_CELLID } labelType;
/* Label types
* The intention is all the values can be stored/converted with unsigned char type,
* C23 allows us to be explicit with the type but C99 does not, so a comment for now.
*/
typedef enum /* : unsigned char */ { LABEL_TYPE_NONE, LABEL_TYPE_TEXT, LABEL_TYPE_PORT, LABEL_TYPE_CELLID } labelType;
/* ------------------------- Input macros ----------------------------- */

View File

@ -104,8 +104,10 @@ typedef struct cifrstyle
/* Gives the Magic layer to use for labels
* on each possible CIF layer.
*/
bool crs_labelSticky[MAXCIFRLAYERS];
/* Marker if label layer makes sticky labels */
/* enum labelType */ unsigned char crs_labelSticky[MAXCIFRLAYERS];
/* Marker if label layer makes sticky labels
* enum labelType LABEL_TYPE_xxxxxx
*/
CIFReadLayer *crs_layers[MAXCIFRLAYERS];
HashTable cifCalmaToCif; /* Table mapping from Calma layer numbers to
* CIF layers