diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-08-05 14:43:10 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-08-05 14:43:10 +0000 |
commit | 5b9e9b450ca5147ea763268e5d5e896083eedec7 (patch) | |
tree | b94b3d347ebe201cf397ed922e323f60cd6053f5 /mansearch.c | |
parent | 99660883f075bacb16d7284523a36f8e6c69a665 (diff) | |
download | mandoc-5b9e9b450ca5147ea763268e5d5e896083eedec7.tar.gz mandoc-5b9e9b450ca5147ea763268e5d5e896083eedec7.tar.zst mandoc-5b9e9b450ca5147ea763268e5d5e896083eedec7.zip |
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@.
Diffstat (limited to 'mansearch.c')
-rw-r--r-- | mansearch.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mansearch.c b/mansearch.c index 86a046f8..6e6961b9 100644 --- a/mansearch.c +++ b/mansearch.c @@ -1,4 +1,4 @@ -/* $Id: mansearch.c,v 1.40 2014/08/05 12:34:08 schwarze Exp $ */ +/* $Id: mansearch.c,v 1.41 2014/08/05 14:43:10 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -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); |