gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r5190 - GNUnet/src/applications/sqstore_sqlite


From: gnunet
Subject: [GNUnet-SVN] r5190 - GNUnet/src/applications/sqstore_sqlite
Date: Sat, 30 Jun 2007 18:33:27 -0600 (MDT)

Author: grothoff
Date: 2007-06-30 18:33:26 -0600 (Sat, 30 Jun 2007)
New Revision: 5190

Modified:
   GNUnet/src/applications/sqstore_sqlite/sqlite.c
Log:
double to unsigned long long


Modified: GNUnet/src/applications/sqstore_sqlite/sqlite.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlite.c     2007-07-01 00:26:14 UTC 
(rev 5189)
+++ GNUnet/src/applications/sqstore_sqlite/sqlite.c     2007-07-01 00:33:26 UTC 
(rev 5190)
@@ -347,7 +347,7 @@
   if (stats)
     stats->set(stat_size, ret);
   MUTEX_UNLOCK(db->DATABASE_Lock_);
-  return ret * 1.06;
+  return (unsigned long long) (ret * 1.06);
   /* benchmarking shows 2-12% overhead */
 }
 
@@ -440,14 +440,14 @@
  * @param key kind of stat to retrieve
  * @return SYSERR on error, the value otherwise
  */
-static double getStat(sqliteHandle * handle,
-                     const char * key) {
+static unsigned long long getStat(sqliteHandle * handle,
+                                 const char * key) {
   int i;
   sqlite3_stmt *stmt;
-  double ret = SYSERR;
+  unsigned long long ret = SYSERR;
 
   i = sq_prepare(handle->dbh,
-                "SELECT anonLevel FROM gn070 WHERE hash = ?",
+                "SELECT expire FROM gn070 WHERE hash = ?",
                 &stmt);
   if (i == SQLITE_OK) {
     sqlite3_bind_text(stmt,
@@ -461,7 +461,7 @@
       ret = 0;
       i = SQLITE_OK;
     } else if (i == SQLITE_ROW) {
-      ret = sqlite3_column_double(stmt, 0);
+      ret = sqlite3_column_int64(stmt, 0);
       i = SQLITE_OK;
     }
   }
@@ -502,7 +502,7 @@
   }
 
   if (sq_prepare(dbh,
-                "INSERT INTO gn070(hash, anonLevel, type) VALUES (?, ?, ?)",
+                "INSERT INTO gn070(hash, expire, type) VALUES (?, ?, ?)",
                 &stmt) != SQLITE_OK)
     return SYSERR;
   sqlite3_bind_text(stmt,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]