[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r13418 - gnunet/src/datacache
From: |
gnunet |
Subject: |
[GNUnet-SVN] r13418 - gnunet/src/datacache |
Date: |
Wed, 27 Oct 2010 11:38:04 +0200 |
Author: wachs
Date: 2010-10-27 11:38:04 +0200 (Wed, 27 Oct 2010)
New Revision: 13418
Modified:
gnunet/src/datacache/perf_datacache.c
gnunet/src/datacache/plugin_datacache_mysql.c
gnunet/src/datacache/plugin_datacache_postgres.c
gnunet/src/datacache/plugin_datacache_sqlite.c
gnunet/src/datacache/test_datacache.c
gnunet/src/datacache/test_datacache_quota.c
Log:
Refactoring gnunet time
Modified: gnunet/src/datacache/perf_datacache.c
===================================================================
--- gnunet/src/datacache/perf_datacache.c 2010-10-27 09:35:32 UTC (rev
13417)
+++ gnunet/src/datacache/perf_datacache.c 2010-10-27 09:38:04 UTC (rev
13418)
@@ -84,7 +84,7 @@
}
exp = GNUNET_TIME_absolute_get ();
start = exp;
- exp.value += 5 * 60 * 1000;
+ exp.abs_value += 5 * 60 * 1000;
memset (&k, 0, sizeof (GNUNET_HashCode));
for (i = 0; i < ITERATIONS; i++)
{
@@ -102,7 +102,7 @@
fprintf (stderr, "\n");
fprintf (stdout, "Stored %u items in %llums\n",
ITERATIONS,
- (unsigned long long) GNUNET_TIME_absolute_get_duration(start).value);
+ (unsigned long long)
GNUNET_TIME_absolute_get_duration(start).rel_value);
start = GNUNET_TIME_absolute_get ();
memset (&k, 0, sizeof (GNUNET_HashCode));
for (i = 0; i < ITERATIONS; i++)
@@ -117,7 +117,7 @@
fprintf (stderr, "\n");
fprintf (stdout, "Found %u/%u items in %llums (%u were deleted during
storage processing)\n",
found, ITERATIONS,
- (unsigned long long) GNUNET_TIME_absolute_get_duration(start).value,
+ (unsigned long long)
GNUNET_TIME_absolute_get_duration(start).rel_value,
ITERATIONS - found);
GNUNET_DATACACHE_destroy (h);
Modified: gnunet/src/datacache/plugin_datacache_mysql.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_mysql.c 2010-10-27 09:35:32 UTC
(rev 13417)
+++ gnunet/src/datacache/plugin_datacache_mysql.c 2010-10-27 09:38:04 UTC
(rev 13418)
@@ -750,8 +750,8 @@
k_length = sizeof (GNUNET_HashCode);
v_length = size;
v_type = type;
- v_now = (unsigned long long) now.value;
- v_discard_time = (unsigned long long) discard_time.value;
+ v_now = (unsigned long long) now.abs_value;
+ v_discard_time = (unsigned long long) discard_time.abs_value;
if (GNUNET_OK ==
prepared_statement_run (plugin,
plugin->update_value,
@@ -862,7 +862,7 @@
rbind[0].buffer = &total;
rbind[0].is_unsigned = GNUNET_YES;
v_type = type;
- v_now = (unsigned long long) now.value;
+ v_now = (unsigned long long) now.abs_value;
if ((GNUNET_OK !=
(ret = prepared_statement_run_select (plugin,
plugin->count_value,
@@ -930,7 +930,7 @@
return GNUNET_SYSERR;
}
cnt++;
- expire.value = v_expire;
+ expire.abs_value = v_expire;
if (GNUNET_OK != iter (iter_cls,
expire,
key,
Modified: gnunet/src/datacache/plugin_datacache_postgres.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_postgres.c 2010-10-27 09:35:32 UTC
(rev 13417)
+++ gnunet/src/datacache/plugin_datacache_postgres.c 2010-10-27 09:38:04 UTC
(rev 13418)
@@ -422,7 +422,7 @@
}
for (i=0;i<cnt;i++)
{
- expiration_time.value = GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, i,
0));
+ expiration_time.abs_value = GNUNET_ntohll (*(uint64_t *) PQgetvalue
(res, i, 0));
type = ntohl (*(uint32_t *) PQgetvalue (res, i, 1));
size = PQgetlength (res, i, 2);
#if DEBUG_POSTGRES
Modified: gnunet/src/datacache/plugin_datacache_sqlite.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_sqlite.c 2010-10-27 09:35:32 UTC
(rev 13417)
+++ gnunet/src/datacache/plugin_datacache_sqlite.c 2010-10-27 09:38:04 UTC
(rev 13418)
@@ -112,9 +112,9 @@
"PUT",
(unsigned int) size,
GNUNET_h2s (key),
- (unsigned long long) GNUNET_TIME_absolute_get_remaining
(discard_time).value);
+ (unsigned long long) GNUNET_TIME_absolute_get_remaining
(discard_time).rel_value);
#endif
- dval = (int64_t) discard_time.value;
+ dval = (int64_t) discard_time.abs_value;
if (dval < 0)
dval = INT64_MAX;
if (sq_prepare (plugin->dbh,
@@ -206,9 +206,9 @@
sqlite3_bind_blob (stmt, 1, key, sizeof (GNUNET_HashCode),
SQLITE_TRANSIENT);
sqlite3_bind_int (stmt, 2, type);
- ntime = (int64_t) now.value;
+ ntime = (int64_t) now.abs_value;
GNUNET_assert (ntime >= 0);
- sqlite3_bind_int64 (stmt, 3, now.value);
+ sqlite3_bind_int64 (stmt, 3, now.abs_value);
if (SQLITE_ROW != sqlite3_step (stmt))
{
LOG_SQLITE (plugin->dbh,
@@ -242,13 +242,13 @@
sqlite3_bind_blob (stmt, 1, key, sizeof (GNUNET_HashCode),
SQLITE_TRANSIENT);
sqlite3_bind_int (stmt, 2, type);
- sqlite3_bind_int64 (stmt, 3, now.value);
+ sqlite3_bind_int64 (stmt, 3, now.abs_value);
if (sqlite3_step (stmt) != SQLITE_ROW)
break;
size = sqlite3_column_bytes (stmt, 0);
dat = sqlite3_column_blob (stmt, 0);
- exp.value = sqlite3_column_int64 (stmt, 1);
- ntime = (int64_t) exp.value;
+ exp.abs_value = sqlite3_column_int64 (stmt, 1);
+ ntime = (int64_t) exp.abs_value;
if (ntime == INT64_MAX)
exp = GNUNET_TIME_UNIT_FOREVER_ABS;
cnt++;
Modified: gnunet/src/datacache/test_datacache.c
===================================================================
--- gnunet/src/datacache/test_datacache.c 2010-10-27 09:35:32 UTC (rev
13417)
+++ gnunet/src/datacache/test_datacache.c 2010-10-27 09:38:04 UTC (rev
13418)
@@ -84,7 +84,7 @@
return;
}
exp = GNUNET_TIME_absolute_get ();
- exp.value += 5 * 60 * 1000;
+ exp.abs_value += 5 * 60 * 1000;
memset (&k, 0, sizeof (GNUNET_HashCode));
for (i = 0; i < 100; i++)
{
Modified: gnunet/src/datacache/test_datacache_quota.c
===================================================================
--- gnunet/src/datacache/test_datacache_quota.c 2010-10-27 09:35:32 UTC (rev
13417)
+++ gnunet/src/datacache/test_datacache_quota.c 2010-10-27 09:38:04 UTC (rev
13418)
@@ -70,7 +70,7 @@
return;
}
exp = GNUNET_TIME_absolute_get ();
- exp.value += 20 * 60 * 1000;
+ exp.abs_value += 20 * 60 * 1000;
memset (buf, 1, sizeof (buf));
memset (&k, 0, sizeof (GNUNET_HashCode));
for (i = 0; i < 10; i++)
@@ -79,7 +79,7 @@
GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n);
for (j = i; j < sizeof (buf); j += 10)
{
- exp.value++;
+ exp.abs_value++;
buf[j] = i;
ASSERT (GNUNET_OK ==
GNUNET_DATACACHE_put (h,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r13418 - gnunet/src/datacache,
gnunet <=