source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Absurdly, the return value of sqlite3_column_text() is "const
@ 2014-08-05 14:43 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-08-05 14:43 UTC (permalink / raw)
  To: source

Log Message:
-----------
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@.

Modified Files:
--------------
    mdocml:
        mandocdb.c
        mansearch.c

Revision Data
-------------
Index: mansearch.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mansearch.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -Lmansearch.c -Lmansearch.c -u -p -r1.40 -r1.41
--- mansearch.c
+++ 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, sqlite
 
 		/* 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
 			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);
Index: mandocdb.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v
retrieving revision 1.153
retrieving revision 1.154
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.153 -r1.154
--- mandocdb.c
+++ 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);
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-05 14:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-05 14:43 mdocml: Absurdly, the return value of sqlite3_column_text() is "const schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).