From aec0a1d1509e968be325aeca86036afd0b7eef6c Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Sat, 6 May 2023 01:24:42 +0900 Subject: [PATCH] main: use unsiged int as the return type of countFields Signed-off-by: Masatake YAMATO --- main/field.c | 2 +- main/field_p.h | 2 +- main/options.c | 4 +--- main/parse.c | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/main/field.c b/main/field.c index c6c746f868..68b6546307 100644 --- a/main/field.c +++ b/main/field.c @@ -1285,7 +1285,7 @@ extern bool doesFieldHaveRenderer (fieldType type, bool noEscaping) return getFieldObject(type)->def->render? true: false; } -extern int countFields (void) +extern unsigned int countFields (void) { return fieldObjectUsed; } diff --git a/main/field_p.h b/main/field_p.h index fd56bd865f..7d94c6cbd1 100644 --- a/main/field_p.h +++ b/main/field_p.h @@ -64,7 +64,7 @@ extern const char* renderFieldNoEscaping (fieldType type, const tagEntryInfo *ta extern bool doesFieldHaveTabOrNewlineChar (fieldType type, const tagEntryInfo *tag, int index); extern void initFieldObjects (void); -extern int countFields (void); +extern unsigned int countFields (void); /* language should be typed to langType. Use int here to avoid circular dependency */ diff --git a/main/options.c b/main/options.c index 4a465aec68..6c5d2da019 100644 --- a/main/options.c +++ b/main/options.c @@ -1345,9 +1345,7 @@ static void processExtraTagsOption ( static void resetFieldsOption (langType lang, bool mode) { - int i; - - for (i = 0; i < countFields (); ++i) + for (unsigned int i = 0; i < countFields (); ++i) if ((lang == LANG_AUTO) || (lang == getFieldOwner (i))) enableField (i, mode); diff --git a/main/parse.c b/main/parse.c index 9c70b249db..9493487c37 100644 --- a/main/parse.c +++ b/main/parse.c @@ -4945,7 +4945,7 @@ extern bool makeFieldDescriptionsPseudoTags (const langType language, const ptagDesc *pdesc) { bool written = false; - for (int i = 0; i < countFields (); i++) + for (unsigned int i = 0; i < countFields (); i++) { if (getFieldOwner (i) == language && isFieldEnabled (i))