Skip to content

Commit

Permalink
main: use unsiged int as the return type of countFields
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <[email protected]>
  • Loading branch information
masatake committed May 5, 2023
1 parent 20fabfd commit aec0a1d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion main/field.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion main/field_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 1 addition & 3 deletions main/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion main/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit aec0a1d

Please sign in to comment.