=================================================================== RCS file: /cvs/mandoc/mansearch.c,v retrieving revision 1.40 retrieving revision 1.43 diff -u -p -r1.40 -r1.43 --- mandoc/mansearch.c 2014/08/05 12:34:08 1.40 +++ mandoc/mansearch.c 2014/08/10 23:54:41 1.43 @@ -1,4 +1,4 @@ -/* $Id: mansearch.c,v 1.40 2014/08/05 12:34:08 schwarze Exp $ */ +/* $Id: mansearch.c,v 1.43 2014/08/10 23:54:41 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013, 2014 Ingo Schwarze @@ -15,11 +15,11 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include +#include + #include #include #include @@ -123,7 +123,8 @@ mansearch_setup(int start) } pagecache = mmap(NULL, PC_PAGESIZE * PC_NUMPAGES, - PROT_READ | PROT_WRITE, MAP_ANON, -1, 0); + PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANON, -1, 0); if (MAP_FAILED == pagecache) { perror("mmap"); @@ -302,7 +303,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 +407,9 @@ buildnames(struct manpage *mpage, sqlite3 *db, sqlite3 /* 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 +498,7 @@ buildoutput(sqlite3 *db, sqlite3_stmt *s, uint64_t pag 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);