diff options
Diffstat (limited to 'src/my/my_query_helper.c')
-rw-r--r-- | src/my/my_query_helper.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/my/my_query_helper.c b/src/my/my_query_helper.c index c4516715a..b2a893a44 100644 --- a/src/my/my_query_helper.c +++ b/src/my/my_query_helper.c | |||
@@ -37,6 +37,7 @@ static void | |||
37 | my_clean_query (void *cls, | 37 | my_clean_query (void *cls, |
38 | MYSQL_BIND *qbind) | 38 | MYSQL_BIND *qbind) |
39 | { | 39 | { |
40 | (void) cls; | ||
40 | GNUNET_free (qbind[0].buffer); | 41 | GNUNET_free (qbind[0].buffer); |
41 | } | 42 | } |
42 | 43 | ||
@@ -54,6 +55,7 @@ my_conv_fixed_size (void *cls, | |||
54 | const struct GNUNET_MY_QueryParam *qp, | 55 | const struct GNUNET_MY_QueryParam *qp, |
55 | MYSQL_BIND *qbind) | 56 | MYSQL_BIND *qbind) |
56 | { | 57 | { |
58 | (void) cls; | ||
57 | GNUNET_assert (1 == qp->num_params); | 59 | GNUNET_assert (1 == qp->num_params); |
58 | qbind->buffer = (void *) qp->data; | 60 | qbind->buffer = (void *) qp->data; |
59 | qbind->buffer_length = qp->data_len; | 61 | qbind->buffer_length = qp->data_len; |
@@ -99,12 +101,11 @@ my_conv_string (void *cls, | |||
99 | const struct GNUNET_MY_QueryParam *qp, | 101 | const struct GNUNET_MY_QueryParam *qp, |
100 | MYSQL_BIND *qbind) | 102 | MYSQL_BIND *qbind) |
101 | { | 103 | { |
104 | (void) cls; | ||
102 | GNUNET_assert (1 == qp->num_params); | 105 | GNUNET_assert (1 == qp->num_params); |
103 | |||
104 | qbind->buffer = (void *) qp->data; | 106 | qbind->buffer = (void *) qp->data; |
105 | qbind->buffer_length = qp->data_len; | 107 | qbind->buffer_length = qp->data_len; |
106 | qbind->buffer_type = MYSQL_TYPE_STRING; | 108 | qbind->buffer_type = MYSQL_TYPE_STRING; |
107 | |||
108 | return 1; | 109 | return 1; |
109 | } | 110 | } |
110 | 111 | ||
@@ -142,10 +143,12 @@ my_conv_uint16 (void *cls, | |||
142 | const struct GNUNET_MY_QueryParam *qp, | 143 | const struct GNUNET_MY_QueryParam *qp, |
143 | MYSQL_BIND *qbind) | 144 | MYSQL_BIND *qbind) |
144 | { | 145 | { |
146 | (void) cls; | ||
145 | GNUNET_assert (1 == qp->num_params); | 147 | GNUNET_assert (1 == qp->num_params); |
146 | qbind->buffer = (void *) qp->data; | 148 | qbind->buffer = (void *) qp->data; |
147 | qbind->buffer_length = sizeof (uint16_t); | 149 | qbind->buffer_length = sizeof (uint16_t); |
148 | qbind->buffer_type = MYSQL_TYPE_SHORT; | 150 | qbind->buffer_type = MYSQL_TYPE_SHORT; |
151 | qbind->is_unsigned = 1; | ||
149 | return 1; | 152 | return 1; |
150 | } | 153 | } |
151 | 154 | ||
@@ -184,11 +187,12 @@ my_conv_uint32 (void *cls, | |||
184 | const struct GNUNET_MY_QueryParam *qp, | 187 | const struct GNUNET_MY_QueryParam *qp, |
185 | MYSQL_BIND *qbind) | 188 | MYSQL_BIND *qbind) |
186 | { | 189 | { |
190 | (void) cls; | ||
187 | GNUNET_assert (1 == qp->num_params); | 191 | GNUNET_assert (1 == qp->num_params); |
188 | qbind->buffer = (void *) qp->data; | 192 | qbind->buffer = (void *) qp->data; |
189 | qbind->buffer_length = sizeof(uint32_t); | 193 | qbind->buffer_length = sizeof(uint32_t); |
190 | qbind->buffer_type = MYSQL_TYPE_LONG; | 194 | qbind->buffer_type = MYSQL_TYPE_LONG; |
191 | 195 | qbind->is_unsigned = 1; | |
192 | return 1; | 196 | return 1; |
193 | } | 197 | } |
194 | 198 | ||
@@ -227,10 +231,12 @@ my_conv_uint64 (void *cls, | |||
227 | const struct GNUNET_MY_QueryParam *qp, | 231 | const struct GNUNET_MY_QueryParam *qp, |
228 | MYSQL_BIND * qbind) | 232 | MYSQL_BIND * qbind) |
229 | { | 233 | { |
234 | (void) cls; | ||
230 | GNUNET_assert (1 == qp->num_params); | 235 | GNUNET_assert (1 == qp->num_params); |
231 | qbind->buffer = (void *) qp->data; | 236 | qbind->buffer = (void *) qp->data; |
232 | qbind->buffer_length = sizeof (uint64_t); | 237 | qbind->buffer_length = sizeof (uint64_t); |
233 | qbind->buffer_type = MYSQL_TYPE_LONGLONG; | 238 | qbind->buffer_type = MYSQL_TYPE_LONGLONG; |
239 | qbind->is_unsigned = 1; | ||
234 | return 1; | 240 | return 1; |
235 | } | 241 | } |
236 | 242 | ||
@@ -273,14 +279,13 @@ my_conv_rsa_public_key (void *cls, | |||
273 | char *buf; | 279 | char *buf; |
274 | size_t buf_size; | 280 | size_t buf_size; |
275 | 281 | ||
282 | (void) cls; | ||
276 | GNUNET_assert(1 == qp->num_params); | 283 | GNUNET_assert(1 == qp->num_params); |
277 | 284 | buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa, | |
278 | buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa, &buf); | 285 | &buf); |
279 | |||
280 | qbind->buffer = (void *) buf; | 286 | qbind->buffer = (void *) buf; |
281 | qbind->buffer_length = buf_size; | 287 | qbind->buffer_length = buf_size; |
282 | qbind->buffer_type = MYSQL_TYPE_BLOB; | 288 | qbind->buffer_type = MYSQL_TYPE_BLOB; |
283 | |||
284 | return 1; | 289 | return 1; |
285 | } | 290 | } |
286 | 291 | ||
@@ -325,14 +330,13 @@ my_conv_rsa_signature (void *cls, | |||
325 | char *buf; | 330 | char *buf; |
326 | size_t buf_size; | 331 | size_t buf_size; |
327 | 332 | ||
333 | (void) cls; | ||
328 | GNUNET_assert(1 == qp->num_params); | 334 | GNUNET_assert(1 == qp->num_params); |
329 | |||
330 | buf_size = GNUNET_CRYPTO_rsa_signature_encode (sig, | 335 | buf_size = GNUNET_CRYPTO_rsa_signature_encode (sig, |
331 | &buf); | 336 | &buf); |
332 | qbind->buffer = (void *) buf; | 337 | qbind->buffer = (void *) buf; |
333 | qbind->buffer_length = buf_size; | 338 | qbind->buffer_length = buf_size; |
334 | qbind->buffer_type = MYSQL_TYPE_BLOB; | 339 | qbind->buffer_type = MYSQL_TYPE_BLOB; |
335 | |||
336 | return 1; | 340 | return 1; |
337 | } | 341 | } |
338 | 342 | ||