Skip to content

Commit f1589d1

Browse files
Ramsay Jonesgitster
authored andcommitted
ctype.c: Fix a sparse warning
In particular, sparse complains as follows: SP ctype.c ctype.c:30:12: warning: symbol 'tolower_trans_tbl' was not declared.\ Should it be static? An appropriate extern declaration for the 'tolower_trans_tbl' symbol is included in the "cache.h" header file. In order to suppress the warning, therefore, we could replace the "git-compat-util.h" header inclusion with "cache.h", since "cache.h" includes "git-compat-util.h" in turn. Here, however, we choose to move the extern declaration for 'tolower_trans_tbl' into "git-compat-util.h", alongside the other extern declaration from ctype.c for 'sane_ctype'. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent accccde commit f1589d1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cache.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,4 @@ extern struct startup_info *startup_info;
12581258
/* builtin/merge.c */
12591259
int checkout_fast_forward(const unsigned char *from, const unsigned char *to);
12601260

1261-
/* in ctype.c, for kwset users */
1262-
extern const char tolower_trans_tbl[256];
1263-
12641261
#endif /* CACHE_H */

git-compat-util.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,9 @@ static inline int has_extension(const char *filename, const char *ext)
457457
return len > extlen && !memcmp(filename + len - extlen, ext, extlen);
458458
}
459459

460+
/* in ctype.c, for kwset users */
461+
extern const char tolower_trans_tbl[256];
462+
460463
/* Sane ctype - no locale, and works with signed chars */
461464
#undef isascii
462465
#undef isspace

0 commit comments

Comments
 (0)