mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-22 02:06:42 +00:00
Fix compiler warnings, Linux gcc 4.7.2
This commit is contained in:
parent
09617b9ce0
commit
b0f0262e18
@ -1,6 +1,7 @@
|
||||
#include "serval.h"
|
||||
#include "rhizome.h"
|
||||
#include "conf.h"
|
||||
#include "strlcpy.h"
|
||||
|
||||
#define RHIZOME_BUFFER_MAXIMUM_SIZE (1024*1024)
|
||||
|
||||
@ -40,19 +41,18 @@ int rhizome_open_write(struct rhizome_write *write, char *expectedFileHash, int6
|
||||
int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);
|
||||
*/
|
||||
|
||||
sqlite3_stmt *statement = NULL;
|
||||
int ret=sqlite_exec_void_retry(&retry,
|
||||
"INSERT OR REPLACE INTO FILES(id,length,highestpriority,datavalid,inserttime) VALUES('%s',%lld,%d,0,%lld);",
|
||||
write->id, (long long)file_length, priority, (long long)gettime_ms());
|
||||
if (ret!=SQLITE_OK) {
|
||||
WHYF("Failed to insert into files: %s",
|
||||
sqlite3_errmsg(rhizome_db));
|
||||
WHYF("Failed to insert into files: %s", sqlite3_errmsg(rhizome_db));
|
||||
goto insert_row_fail;
|
||||
}
|
||||
|
||||
sqlite3_stmt *statement = sqlite_prepare(&retry,"INSERT OR REPLACE INTO FILEBLOBS(id,data) VALUES('%s',?)",write->id);
|
||||
statement = sqlite_prepare(&retry,"INSERT OR REPLACE INTO FILEBLOBS(id,data) VALUES('%s',?)",write->id);
|
||||
if (!statement) {
|
||||
WHYF("Failed to insert into fileblobs: %s",
|
||||
sqlite3_errmsg(rhizome_db));
|
||||
WHYF("Failed to insert into fileblobs: %s", sqlite3_errmsg(rhizome_db));
|
||||
goto insert_row_fail;
|
||||
}
|
||||
|
||||
@ -67,7 +67,6 @@ int rhizome_open_write(struct rhizome_write *write, char *expectedFileHash, int6
|
||||
int stepcode;
|
||||
while ((stepcode = _sqlite_step_retry(__WHENCE__, LOG_LEVEL_ERROR, &retry, statement)) == SQLITE_ROW)
|
||||
++rowcount;
|
||||
|
||||
if (rowcount)
|
||||
WARNF("void query unexpectedly returned %d row%s", rowcount, rowcount == 1 ? "" : "s");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user