summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-08-05 14:43:10 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-08-05 14:43:10 +0000
commit5100c90860025df47e42d8bd45c9b8162c9aa8d0 (patch)
treef235462aad9d4f8f8b1ff6de4f2a70cde616b9de
parente78c9199f3e64722b422088627cfd89d0a1dd5cf (diff)
downloadmandoc-5100c90860025df47e42d8bd45c9b8162c9aa8d0.tar.gz
Absurdly, the return value of sqlite3_column_text()
is "const unsigned char *", which causes warnings with GCC on Linux. Explicitly cast to "const char *" to avoid this. Issue noticed by kristaps@.
-rw-r--r--mandocdb.c8
-rw-r--r--mansearch.c10
2 files changed, 9 insertions, 9 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 2cbf0e9e..a2f1c884 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1306,10 +1306,10 @@ names_check(void)
say("", "%s", sqlite3_errmsg(db));
while (SQLITE_ROW == (irc = sqlite3_step(stmt))) {
- name = sqlite3_column_text(stmt, 0);
- sec = sqlite3_column_text(stmt, 1);
- arch = sqlite3_column_text(stmt, 2);
- key = sqlite3_column_text(stmt, 3);
+ name = (const char *)sqlite3_column_text(stmt, 0);
+ sec = (const char *)sqlite3_column_text(stmt, 1);
+ arch = (const char *)sqlite3_column_text(stmt, 2);
+ key = (const char *)sqlite3_column_text(stmt, 3);
say("", "%s(%s%s%s) lacks mlink \"%s\"", name, sec,
'\0' == *arch ? "" : "/",
'\0' == *arch ? "" : arch, key);
diff --git a/mansearch.c b/mansearch.c
index b6e552e6..f9a8b39b 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -302,7 +302,7 @@ mansearch(const struct mansearch *search,
mp->pageid = pageid;
mp->form = sqlite3_column_int(s, 1);
if (TYPE_Nd == outbit)
- mp->desc = mandoc_strdup(
+ mp->desc = mandoc_strdup((const char *)
sqlite3_column_text(s, 0));
ohash_insert(&htab, idx, mp);
}
@@ -406,9 +406,9 @@ buildnames(struct manpage *mpage, sqlite3 *db, sqlite3_stmt *s,
/* Fetch the next name. */
- sec = sqlite3_column_text(s, 0);
- arch = sqlite3_column_text(s, 1);
- name = sqlite3_column_text(s, 2);
+ sec = (const char *)sqlite3_column_text(s, 0);
+ arch = (const char *)sqlite3_column_text(s, 1);
+ name = (const char *)sqlite3_column_text(s, 2);
/* Remember the first section found. */
@@ -497,7 +497,7 @@ buildoutput(sqlite3 *db, sqlite3_stmt *s, uint64_t pageid, uint64_t outbit)
oldoutput = output;
sep1 = " # ";
}
- data = sqlite3_column_text(s, 1);
+ data = (const char *)sqlite3_column_text(s, 1);
mandoc_asprintf(&newoutput, "%s%s%s",
oldoutput, sep1, data);
free(output);