Get rid of most of the compiler warnings in the store

This commit is contained in:
alexhudson
2007-09-21 19:10:03 +00:00
parent f9acd5e5e9
commit a5f99d3393
8 changed files with 16 additions and 25 deletions
+1 -1
View File
@@ -269,7 +269,7 @@ void BongoHashtableDelete(BongoHashtable *table);
#define BongoHashTableCount(_tableptr) ((_tableptr)->itemcount)
#define BongoCreateStringHashTable(buckets) \
BongoHashtableCreate(buckets, BongoStringHash, strcmp)
BongoHashtableCreate(buckets, (HashFunction)BongoStringHash, (CompareFunction)strcmp)
/* handy string hasher */
uint32_t BongoStringHash (char *s);
+3 -3
View File
@@ -163,9 +163,9 @@ AlarmDBOpen(BongoMemStack *memstack)
create = access(path, 0);
if (!(handle = MemMalloc(sizeof(struct _AlarmDBHandle))) ||
memset(handle, 0, sizeof(struct _AlarmDBHandle)), 0 ||
SQLITE_OK != sqlite3_open(path, &handle->db))
if (!(handle = MemMalloc(sizeof(struct _AlarmDBHandle))) ||
(memset(handle, 0, sizeof(struct _AlarmDBHandle)), 0) ||
(SQLITE_OK != sqlite3_open(path, &handle->db)))
{
printf("bongostore: Failed to open alarm store \"%s\".\r\n", path);
goto fail;
+2 -4
View File
@@ -826,7 +826,7 @@ ParseHeaderList(StoreClient *client,
return ccode;
}
/* FIXME: Unused, deprecated?
static CCode
ParseConversationSource(StoreClient *client,
char *token,
@@ -835,7 +835,7 @@ ParseConversationSource(StoreClient *client,
GetConversationSourceMask(token, outflags);
return TOKEN_OK;
}
*/
static CCode
ParseStoreName(StoreClient *client,
@@ -4751,8 +4751,6 @@ StoreCommandRESET(StoreClient *client)
CCode
StoreCommandSTORE(StoreClient *client, char *user)
{
struct sockaddr_in serv;
if (!user) {
UnselectStore(client);
return ConnWriteStr(client->conn, MSG1000OK);
-1
View File
@@ -83,7 +83,6 @@ StoreCommandCOOKIEDELETE(StoreClient *client, const char *token)
ccode = ConnWriteStr(client->conn, MSG5004INTERNALERR);
}
finish:
PurgeNLockRelease(lock);
ReadNLockRelease(lock);
+7 -7
View File
@@ -515,9 +515,9 @@ DStoreOpen(char *basepath, BongoMemStack *memstack, int locktimeoutms)
create = access(path, 0);
if (!(handle = MemMalloc(sizeof(struct _DStoreHandle))) ||
memset(handle, 0, sizeof(struct _DStoreHandle)), 0 ||
SQLITE_OK != sqlite3_open(path, &handle->db))
if (!(handle = MemMalloc(sizeof(struct _DStoreHandle))) ||
(memset(handle, 0, sizeof(struct _DStoreHandle)), 0) ||
(SQLITE_OK != sqlite3_open(path, &handle->db)))
{
XplConsolePrintf("NMAP: Failed to open dstore \"%s\".\r\n",
path);
@@ -1600,15 +1600,15 @@ DStoreSetProperty(DStoreHandle *handle,
int
DStoreSetPropertySimple(DStoreHandle *handle,
uint64_t guid,
char *name,
char *value)
const char *name,
const char *value)
{
StorePropInfo prop;
prop.type = STORE_PROP_EXTERNAL;
prop.name = name;
prop.value = value;
prop.name = (char *)name;
prop.value = (char *)value;
prop.valueLen = strlen(value);
return DStoreSetProperty(handle, guid, &prop);
+2 -2
View File
@@ -161,8 +161,8 @@ int DStoreSetProperty(DStoreHandle *handle,
int DStoreSetPropertySimple(DStoreHandle *handle,
uint64_t guid,
char *name,
char *value);
const char *name,
const char *value);
/* Conversations table */
DStoreStmt *DStoreListConversations(DStoreHandle *handle,
-1
View File
@@ -245,7 +245,6 @@ StoreProcessIncomingMail(StoreClient *client,
IncomingParseData data = {0, };
DStoreDocInfo oldConversation;
BOOL haveOldConversation;
BOOL isNewConversation;
FILE *fh;
+1 -6
View File
@@ -268,7 +268,6 @@ CreateDatFile(char *path, int n, size_t len, char *name)
int
SetupStore(const char *user, const char **storeRoot, char *path, size_t len)
{
const char *root;
int n;
struct stat sb;
@@ -303,7 +302,7 @@ SetupStore(const char *user, const char **storeRoot, char *path, size_t len)
path[n] = 0;
*storeRoot = root;
*storeRoot = NULL;
return 0;
}
@@ -1211,10 +1210,6 @@ SelectUser(StoreClient *client, char *user, char *password, int nouser)
// FIXME: I think we're supposed to refer to the correct store IP?
strncpy(buf, "127.0.0.1", INET_ADDRSTRLEN);
//ccode = ConnWriteStr(client->conn, MSG5004INTERNALERR);
//goto finish;
success:
ccode = ConnWriteF(client->conn, "1000 %s\r\n", buf);
if (nouser) {