summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2022-04-11 18:07:38 +0000
committerChristos Zoulas <christos@zoulas.com>2022-04-11 18:07:38 +0000
commit00dc93170dcc569166ae7eb7aa501fab439b5daa (patch)
tree0e90216602fa52c71172d4ccbdc9a63ad84841dc
parent360cec7946d8f1d408187d68aebcd68f3eec68a6 (diff)
downloadfile-git-00dc93170dcc569166ae7eb7aa501fab439b5daa.tar.gz
fix unused warnings
-rw-r--r--src/file.h5
-rw-r--r--src/funcs.c9
2 files changed, 9 insertions, 5 deletions
diff --git a/src/file.h b/src/file.h
index de2413f7..51caa599 100644
--- a/src/file.h
+++ b/src/file.h
@@ -27,7 +27,7 @@
*/
/*
* file.h - definitions for file(1) program
- * @(#)$File: file.h,v 1.230 2022/03/19 19:52:09 christos Exp $
+ * @(#)$File: file.h,v 1.231 2022/04/11 18:07:38 christos Exp $
*/
#ifndef __file_h__
@@ -497,6 +497,9 @@ struct magic_set {
#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE) && defined(HAVE_FREELOCALE)
#define USE_C_LOCALE
locale_t c_lc_ctype;
+#define file_locale_used
+#else
+#define file_locale_used __attribute__((__unused__))
#endif
};
diff --git a/src/funcs.c b/src/funcs.c
index 5c642a79..2c1b2164 100644
--- a/src/funcs.c
+++ b/src/funcs.c
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: funcs.c,v 1.126 2022/03/19 19:52:09 christos Exp $")
+FILE_RCSID("@(#)$File: funcs.c,v 1.127 2022/04/11 18:07:38 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -659,7 +659,8 @@ out:
}
protected int
-file_regcomp(struct magic_set *ms, file_regex_t *rx, const char *pat, int flags)
+file_regcomp(struct magic_set *ms file_locale_used, file_regex_t *rx,
+ const char *pat, int flags)
{
#ifdef USE_C_LOCALE
locale_t old = uselocale(ms->c_lc_ctype);
@@ -682,8 +683,8 @@ file_regcomp(struct magic_set *ms, file_regex_t *rx, const char *pat, int flags)
}
protected int
-file_regexec(struct magic_set *ms, file_regex_t *rx, const char *str,
- size_t nmatch, regmatch_t* pmatch, int eflags)
+file_regexec(struct magic_set *ms file_locale_used, file_regex_t *rx,
+ const char *str, size_t nmatch, regmatch_t* pmatch, int eflags)
{
#ifdef USE_C_LOCALE
locale_t old = uselocale(ms->c_lc_ctype);