diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-12 19:07:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-12 19:07:40 +0000 |
commit | 6c471eeb15e27f8226492b4860a3c2acb94c5f25 (patch) | |
tree | a3a9dcba12ee5356c03056c10b7aba5367b2ef34 /src/datacache/perf_datacache.c | |
parent | 16bcbbea7133fd2265d46bd2ae1dc70e8c9ba96f (diff) | |
download | gnunet-6c471eeb15e27f8226492b4860a3c2acb94c5f25.tar.gz gnunet-6c471eeb15e27f8226492b4860a3c2acb94c5f25.zip |
-consistently use struct GNUNET_HashCode
Diffstat (limited to 'src/datacache/perf_datacache.c')
-rw-r--r-- | src/datacache/perf_datacache.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c index 94cd7a58e..fd3891116 100644 --- a/src/datacache/perf_datacache.c +++ b/src/datacache/perf_datacache.c | |||
@@ -45,10 +45,10 @@ static const char *plugin_name; | |||
45 | 45 | ||
46 | static int | 46 | static int |
47 | checkIt (void *cls, struct GNUNET_TIME_Absolute exp, | 47 | checkIt (void *cls, struct GNUNET_TIME_Absolute exp, |
48 | const GNUNET_HashCode * key, size_t size, const char *data, | 48 | const struct GNUNET_HashCode * key, size_t size, const char *data, |
49 | enum GNUNET_BLOCK_Type type) | 49 | enum GNUNET_BLOCK_Type type) |
50 | { | 50 | { |
51 | if ((size == sizeof (GNUNET_HashCode)) && (0 == memcmp (data, cls, size))) | 51 | if ((size == sizeof (struct GNUNET_HashCode)) && (0 == memcmp (data, cls, size))) |
52 | found++; | 52 | found++; |
53 | return GNUNET_OK; | 53 | return GNUNET_OK; |
54 | } | 54 | } |
@@ -59,8 +59,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
59 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 59 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
60 | { | 60 | { |
61 | struct GNUNET_DATACACHE_Handle *h; | 61 | struct GNUNET_DATACACHE_Handle *h; |
62 | GNUNET_HashCode k; | 62 | struct GNUNET_HashCode k; |
63 | GNUNET_HashCode n; | 63 | struct GNUNET_HashCode n; |
64 | struct GNUNET_TIME_Absolute exp; | 64 | struct GNUNET_TIME_Absolute exp; |
65 | struct GNUNET_TIME_Absolute start; | 65 | struct GNUNET_TIME_Absolute start; |
66 | unsigned int i; | 66 | unsigned int i; |
@@ -76,14 +76,14 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
76 | } | 76 | } |
77 | exp = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS); | 77 | exp = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS); |
78 | start = GNUNET_TIME_absolute_get (); | 78 | start = GNUNET_TIME_absolute_get (); |
79 | memset (&k, 0, sizeof (GNUNET_HashCode)); | 79 | memset (&k, 0, sizeof (struct GNUNET_HashCode)); |
80 | for (i = 0; i < ITERATIONS; i++) | 80 | for (i = 0; i < ITERATIONS; i++) |
81 | { | 81 | { |
82 | if (0 == i % (ITERATIONS / 80)) | 82 | if (0 == i % (ITERATIONS / 80)) |
83 | FPRINTF (stderr, "%s", "."); | 83 | FPRINTF (stderr, "%s", "."); |
84 | GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n); | 84 | GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); |
85 | ASSERT (GNUNET_OK == | 85 | ASSERT (GNUNET_OK == |
86 | GNUNET_DATACACHE_put (h, &k, sizeof (GNUNET_HashCode), | 86 | GNUNET_DATACACHE_put (h, &k, sizeof (struct GNUNET_HashCode), |
87 | (const char *) &n, 1 + i % 16, exp)); | 87 | (const char *) &n, 1 + i % 16, exp)); |
88 | k = n; | 88 | k = n; |
89 | } | 89 | } |
@@ -96,12 +96,12 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
96 | GNUNET_TIME_absolute_get_duration (start).rel_value / ITERATIONS, | 96 | GNUNET_TIME_absolute_get_duration (start).rel_value / ITERATIONS, |
97 | "ms/item"); | 97 | "ms/item"); |
98 | start = GNUNET_TIME_absolute_get (); | 98 | start = GNUNET_TIME_absolute_get (); |
99 | memset (&k, 0, sizeof (GNUNET_HashCode)); | 99 | memset (&k, 0, sizeof (struct GNUNET_HashCode)); |
100 | for (i = 0; i < ITERATIONS; i++) | 100 | for (i = 0; i < ITERATIONS; i++) |
101 | { | 101 | { |
102 | if (0 == i % (ITERATIONS / 80)) | 102 | if (0 == i % (ITERATIONS / 80)) |
103 | FPRINTF (stderr, "%s", "."); | 103 | FPRINTF (stderr, "%s", "."); |
104 | GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n); | 104 | GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); |
105 | GNUNET_DATACACHE_get (h, &k, 1 + i % 16, &checkIt, &n); | 105 | GNUNET_DATACACHE_get (h, &k, 1 + i % 16, &checkIt, &n); |
106 | k = n; | 106 | k = n; |
107 | } | 107 | } |