clearing compilation warning

parent 90125706
tools/_infotojson/infotojson: tools/_infotojson/infotojson.o tools/_infotojson/sqlite3_database.o tools/_infotojson/utils.o
tools/_infotojson/infotojson: tools/_infotojson/infotojson.o tools/_infotojson/sqlite3_database.o tools/_infotojson/utils.o ccan/string/string.o ccan/talloc/talloc.o
$(CC) $(LDFLAGS) -o $@ $^ -lsqlite3
......@@ -112,7 +112,6 @@ int storejsontodb(struct json *jsonobj, char *db)
{
char *cmd, *query;
sqlite3 *handle;
char *errstr;
struct db_query *q;
handle = db_open(db);
......
......@@ -70,31 +70,6 @@ void db_command(void *h, const char *command)
printf("Failed sqlite3 command '%s': %s", command, err);
}
/* Starts transaction. Doesn't need to nest. */
/*void db_transaction_start(void *h)
{
char *err;
if (sqlite3_exec(h, "BEGIN EXCLUSIVE TRANSACTION", NULL, NULL, &err)!=SQLITE_OK)
printf("Starting sqlite3 transaction: %s\n", err);
}
/* Finishes transaction, or rolls it back and caller needs to start again. */
/*
bool db_transaction_finish(void *h)
{
switch (sqlite3_exec(h, "COMMIT TRANSACTION;", NULL, NULL, NULL)) {
case SQLITE_OK:
return true;
case SQLITE_BUSY:
if (sqlite3_exec(h, "ROLLBACK TRANSACTION;", NULL, NULL, NULL)
!= SQLITE_OK)
printf("Ending sqlite3 busy rollback failed");
return false;
default:
printf("Strange sqlite3 error return from COMMIT");
}
}*/
/* Closes database (only called when everything OK). */
void db_close(void *h)
{
......
#include "utils.h"
#define _GNU_SOURCE
#include <stdio.h>
#include "utils.h"
#include <string.h>
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <err.h>
#include <assert.h>
#include "utils.h"
......@@ -31,7 +33,7 @@ char *aprintf(const char *fmt, ...)
return ret;
}
int strreplace(char * str, char src, char dest)
void strreplace(char * str, char src, char dest)
{
int i;
for(i = 0; str[i]; i++)
......@@ -51,5 +53,5 @@ void *realloc_nofail(void *ptr, size_t size)
ptr = realloc(ptr, size);
if (ptr)
return ptr;
printf("realloc of %zu failed", size);
err(1, "realloc of %zu failed", size);
}
......@@ -14,4 +14,4 @@ void * palloc(int size);
char *aprintf(const char *fmt, ...);
int strreplace(char * str, char src, char dest);
void strreplace(char * str, char src, char dest);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment