summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/cleanup.c4
-rw-r--r--lib/cleanup.h2
-rw-r--r--lib/encodings.c8
-rw-r--r--src/check_mandirs.c4
-rw-r--r--src/decompress.c2
-rw-r--r--src/decompress.h2
-rw-r--r--src/mandb.c6
-rw-r--r--src/ult_src.c4
-rw-r--r--src/whatis.c10
9 files changed, 21 insertions, 21 deletions
diff --git a/lib/cleanup.c b/lib/cleanup.c
index 02bef2ab..58749f22 100644
--- a/lib/cleanup.c
+++ b/lib/cleanup.c
@@ -125,7 +125,7 @@ trap_abnormal_exits (void)
/* Restore signo's action from oldact if its current handler is
sighandler, return 0 on success, -1 on failure. */
static int
-untrap_signal (int signo, struct sigaction *oldact)
+untrap_signal (int signo, const struct sigaction *oldact)
{
struct sigaction act;
if (sigaction (signo, NULL, &act)) {
@@ -251,7 +251,7 @@ push_cleanup (cleanup_fun fun, void *arg, int sigsafe)
* given values.
*/
void
-pop_cleanup (cleanup_fun fun, void *arg)
+pop_cleanup (cleanup_fun fun, const void *arg)
{
unsigned i, j;
diff --git a/lib/cleanup.h b/lib/cleanup.h
index 5415b7f1..9fd4e932 100644
--- a/lib/cleanup.h
+++ b/lib/cleanup.h
@@ -29,7 +29,7 @@ typedef void (*cleanup_fun) (void *);
extern void do_cleanups_sigsafe (bool);
extern void do_cleanups (void);
extern int push_cleanup (cleanup_fun, void *, int);
-extern void pop_cleanup (cleanup_fun, void *);
+extern void pop_cleanup (cleanup_fun, const void *);
extern void pop_all_cleanups (void);
#endif /* _CLEANUP_H */
diff --git a/lib/encodings.c b/lib/encodings.c
index 68c06c65..dbec49d6 100644
--- a/lib/encodings.c
+++ b/lib/encodings.c
@@ -748,9 +748,9 @@ const char * ATTRIBUTE_PURE get_output_encoding (const char *device)
/* Return the value of LESSCHARSET appropriate for this locale. */
const char * ATTRIBUTE_PURE get_less_charset (const char *charset_from_locale)
{
- const struct less_charset_entry *entry;
-
if (charset_from_locale) {
+ const struct less_charset_entry *entry;
+
for (entry = less_charset_table; entry->charset_from_locale;
++entry)
if (STREQ (entry->charset_from_locale,
@@ -766,9 +766,9 @@ const char * ATTRIBUTE_PURE get_less_charset (const char *charset_from_locale)
*/
const char * ATTRIBUTE_PURE get_jless_charset (const char *charset_from_locale)
{
- const struct less_charset_entry *entry;
-
if (charset_from_locale) {
+ const struct less_charset_entry *entry;
+
for (entry = less_charset_table; entry->charset_from_locale;
++entry)
if (STREQ (entry->charset_from_locale,
diff --git a/src/check_mandirs.c b/src/check_mandirs.c
index 75c6f5e2..0c0db15d 100644
--- a/src/check_mandirs.c
+++ b/src/check_mandirs.c
@@ -383,9 +383,9 @@ void chown_if_possible (const char *path MAYBE_UNUSED)
/* create the catman hierarchy if it doesn't exist */
static void mkcatdirs (const char *mandir, const char *catdir)
{
- char *manname, *catname;
-
if (catdir) {
+ char *manname, *catname;
+
int oldmask = umask (022);
/* first the base catdir */
if (is_directory (catdir) != 1) {
diff --git a/src/decompress.c b/src/decompress.c
index c4832410..f64d88b7 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -277,7 +277,7 @@ decompress *decompress_fdopen (int fd)
return decompress_new_pipeline (p);
}
-bool ATTRIBUTE_PURE decompress_is_pipeline (decompress *d)
+bool ATTRIBUTE_PURE decompress_is_pipeline (const decompress *d)
{
return d->tag == DECOMPRESS_PIPELINE;
}
diff --git a/src/decompress.h b/src/decompress.h
index f10ab889..ee1bf22f 100644
--- a/src/decompress.h
+++ b/src/decompress.h
@@ -58,7 +58,7 @@ decompress *decompress_open (const char *filename, int flags);
decompress *decompress_fdopen (int fd);
/* Return true if and only if this is a pipeline-based decompressor. */
-bool decompress_is_pipeline (decompress *d);
+bool decompress_is_pipeline (const decompress *d);
/* Get the pipeline corresponding to a decompressor. Raises an assertion
* failure if this is not a pipeline-based decompressor.
diff --git a/src/mandb.c b/src/mandb.c
index 07ea923c..467a944c 100644
--- a/src/mandb.c
+++ b/src/mandb.c
@@ -330,7 +330,7 @@ static void dbpaths_init (struct dbpaths *dbpaths,
#endif /* NDBM */
}
-static int dbpaths_copy_to_tmp (struct dbpaths *dbpaths)
+static int dbpaths_copy_to_tmp (const struct dbpaths *dbpaths)
{
#ifdef NDBM
# ifdef BERKELEY_DB
@@ -346,7 +346,7 @@ static int dbpaths_copy_to_tmp (struct dbpaths *dbpaths)
#endif /* NDBM */
}
-static void dbpaths_remove_tmp (struct dbpaths *dbpaths)
+static void dbpaths_remove_tmp (const struct dbpaths *dbpaths)
{
#ifdef NDBM
# ifdef BERKELEY_DB
@@ -403,7 +403,7 @@ static void dbpaths_chown_if_possible (struct dbpaths *dbpaths)
#endif /* MAN_OWNER */
/* Remove incomplete databases. This is async-signal-safe. */
-static void dbpaths_unlink_tmp (struct dbpaths *dbpaths)
+static void dbpaths_unlink_tmp (const struct dbpaths *dbpaths)
{
#ifdef NDBM
# ifdef BERKELEY_DB
diff --git a/src/ult_src.c b/src/ult_src.c
index c21aa514..130919f9 100644
--- a/src/ult_src.c
+++ b/src/ult_src.c
@@ -289,8 +289,8 @@ static struct ult_key *ult_key_new (const char *name, int flags)
static bool ATTRIBUTE_PURE ult_key_equals (const void *key1, const void *key2)
{
- struct ult_key *ukey1 = (struct ult_key *) key1;
- struct ult_key *ukey2 = (struct ult_key *) key2;
+ const struct ult_key *ukey1 = (const struct ult_key *) key1;
+ const struct ult_key *ukey2 = (const struct ult_key *) key2;
return ukey1->flags == ukey2->flags &&
STREQ (ukey1->name, ukey2->name);
}
diff --git a/src/whatis.c b/src/whatis.c
index 7306ad71..87ed15c5 100644
--- a/src/whatis.c
+++ b/src/whatis.c
@@ -563,7 +563,7 @@ static void do_whatis (MYDBM_FILE dbf,
}
}
-static bool any_set (int num_pages, bool *found_here)
+static bool any_set (int num_pages, const bool *found_here)
{
int i;
@@ -573,7 +573,7 @@ static bool any_set (int num_pages, bool *found_here)
return false;
}
-static bool all_set (int num_pages, bool *found_here)
+static bool all_set (int num_pages, const bool *found_here)
{
int i;
@@ -622,8 +622,8 @@ static bool ATTRIBUTE_PURE match (const char *page, const char *whatis)
/* check for string match, then see if it is a _word_ */
while (whatis && (p = strcasestr (whatis, page))) {
- char *left = p - 1;
- char *right = p + len;
+ const char *left = p - 1;
+ const char *right = p + len;
if ((p == begin || (!CTYPE (isalpha, *left) && *left != '_')) &&
(!*right || (!CTYPE (isalpha, *right) && *right != '_')))
@@ -678,7 +678,7 @@ static void do_apropos (MYDBM_FILE dbf,
{
datum key, cont;
bool *found_here;
- bool (*combine) (int, bool *);
+ bool (*combine) (int, const bool *);
#ifndef BTREE
datum nextkey;
#else /* BTREE */