diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-08 11:54:50 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-08 11:54:50 +0000 |
commit | e04e8965d95b5e2e8331140e204b578cdb2d74ba (patch) | |
tree | b4a47ce1c5c09ba702b6ee15a2e9b24cfeed49a6 /src | |
parent | adc4031ecb1942d33f6bf889c8ddb14197863d2e (diff) | |
download | gnunet-e04e8965d95b5e2e8331140e204b578cdb2d74ba.tar.gz gnunet-e04e8965d95b5e2e8331140e204b578cdb2d74ba.zip |
-make code nicer
Diffstat (limited to 'src')
-rw-r--r-- | src/set/gnunet-service-set_union_strata_estimator.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/set/gnunet-service-set_union_strata_estimator.c b/src/set/gnunet-service-set_union_strata_estimator.c index ad1dda100..59d81e134 100644 --- a/src/set/gnunet-service-set_union_strata_estimator.c +++ b/src/set/gnunet-service-set_union_strata_estimator.c | |||
@@ -47,8 +47,8 @@ size_t | |||
47 | strata_estimator_write (const struct StrataEstimator *se, | 47 | strata_estimator_write (const struct StrataEstimator *se, |
48 | void *buf) | 48 | void *buf) |
49 | { | 49 | { |
50 | char *sbuf = buf; | ||
50 | unsigned int i; | 51 | unsigned int i; |
51 | void *sbuf = buf; | ||
52 | size_t osize; | 52 | size_t osize; |
53 | 53 | ||
54 | GNUNET_assert (NULL != se); | 54 | GNUNET_assert (NULL != se); |
@@ -57,8 +57,7 @@ strata_estimator_write (const struct StrataEstimator *se, | |||
57 | ibf_write_slice (se->strata[i], | 57 | ibf_write_slice (se->strata[i], |
58 | 0, | 58 | 0, |
59 | se->ibf_size, | 59 | se->ibf_size, |
60 | buf); | 60 | &sbuf[se->ibf_size * IBF_BUCKET_SIZE * i]); |
61 | buf += se->ibf_size * IBF_BUCKET_SIZE; | ||
62 | } | 61 | } |
63 | osize = se->ibf_size * IBF_BUCKET_SIZE * se->strata_count; | 62 | osize = se->ibf_size * IBF_BUCKET_SIZE * se->strata_count; |
64 | #if FAIL_10_1_COMPATIBILTIY | 63 | #if FAIL_10_1_COMPATIBILTIY |
@@ -67,12 +66,12 @@ strata_estimator_write (const struct StrataEstimator *se, | |||
67 | size_t nsize; | 66 | size_t nsize; |
68 | 67 | ||
69 | if (GNUNET_YES == | 68 | if (GNUNET_YES == |
70 | GNUNET_try_compression (sbuf, | 69 | GNUNET_try_compression (buf, |
71 | osize, | 70 | osize, |
72 | &cbuf, | 71 | &cbuf, |
73 | &nsize)) | 72 | &nsize)) |
74 | { | 73 | { |
75 | memcpy (sbuf, cbuf, nsize); | 74 | memcpy (buf, cbuf, nsize); |
76 | osize = nsize; | 75 | osize = nsize; |
77 | GNUNET_free (cbuf); | 76 | GNUNET_free (cbuf); |
78 | } | 77 | } |