[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 36/75: tell mysql that our integers are unsigned
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 36/75: tell mysql that our integers are unsigned |
Date: |
Thu, 09 Aug 2018 23:58:33 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 3e5842e44aac604c505edd60a4f3dd8a360ff45b
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Jun 12 14:57:51 2018 +0200
tell mysql that our integers are unsigned
---
src/my/my.c | 26 +++++++++++---------------
src/my/my_query_helper.c | 22 +++++++++++++---------
2 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/src/my/my.c b/src/my/my.c
index b9d5c8424..2f4cd3ba3 100644
--- a/src/my/my.c
+++ b/src/my/my.c
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet
- Copyright (C) 2016 Inria & GNUnet e.V.
+ Copyright (C) 2016, 2018 GNUnet e.V.
GNUnet is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published
@@ -43,19 +43,20 @@ GNUNET_MY_exec_prepared (struct GNUNET_MYSQL_Context *mc,
{
const struct GNUNET_MY_QueryParam *p;
unsigned int num;
- unsigned int i;
MYSQL_STMT *stmt;
num = 0;
- for (i=0;NULL != params[i].conv;i++)
+ for (unsigned int i=0;NULL != params[i].conv;i++)
num += params[i].num_params;
{
MYSQL_BIND qbind[num];
unsigned int off;
- memset (qbind, 0, sizeof(qbind));
+ memset (qbind,
+ 0,
+ sizeof(qbind));
off = 0;
- for (i=0;NULL != (p = ¶ms[i])->conv;i++)
+ for (unsigned int i=0;NULL != (p = ¶ms[i])->conv;i++)
{
if (GNUNET_OK !=
p->conv (p->conv_cls,
@@ -111,9 +112,7 @@ void
GNUNET_MY_cleanup_query (struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND *qbind)
{
- unsigned int i;
-
- for (i=0; NULL != qp[i].conv ;i++)
+ for (unsigned int i=0; NULL != qp[i].conv ;i++)
if (NULL != qp[i].cleaner)
qp[i].cleaner (qp[i].conv_cls,
&qbind[i]);
@@ -136,7 +135,6 @@ GNUNET_MY_extract_result (struct
GNUNET_MYSQL_StatementHandle *sh,
struct GNUNET_MY_ResultSpec *rs)
{
unsigned int num_fields;
- unsigned int i;
int ret;
MYSQL_STMT *stmt;
@@ -153,7 +151,7 @@ GNUNET_MY_extract_result (struct
GNUNET_MYSQL_StatementHandle *sh,
}
num_fields = 0;
- for (i=0;NULL != rs[i].pre_conv;i++)
+ for (unsigned int i=0;NULL != rs[i].pre_conv;i++)
num_fields += rs[i].num_fields;
if (mysql_stmt_field_count (stmt) != num_fields)
@@ -169,7 +167,7 @@ GNUNET_MY_extract_result (struct
GNUNET_MYSQL_StatementHandle *sh,
memset (result, 0, sizeof (MYSQL_BIND) * num_fields);
field_off = 0;
- for (i=0;NULL != rs[i].pre_conv;i++)
+ for (unsigned int i=0;NULL != rs[i].pre_conv;i++)
{
struct GNUNET_MY_ResultSpec *rp = &rs[i];
@@ -221,7 +219,7 @@ GNUNET_MY_extract_result (struct
GNUNET_MYSQL_StatementHandle *sh,
return GNUNET_SYSERR;
}
field_off = 0;
- for (i=0;NULL != rs[i].post_conv;i++)
+ for (unsigned int i=0;NULL != rs[i].post_conv;i++)
{
struct GNUNET_MY_ResultSpec *rp = &rs[i];
@@ -256,9 +254,7 @@ GNUNET_MY_extract_result (struct
GNUNET_MYSQL_StatementHandle *sh,
void
GNUNET_MY_cleanup_result (struct GNUNET_MY_ResultSpec *rs)
{
- unsigned int i;
-
- for (i=0;NULL != rs[i].post_conv;i++)
+ for (unsigned int i=0;NULL != rs[i].post_conv;i++)
if (NULL != rs[i].cleaner)
rs[i].cleaner (rs[i].conv_cls,
&rs[i]);
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
my_clean_query (void *cls,
MYSQL_BIND *qbind)
{
+ (void) cls;
GNUNET_free (qbind[0].buffer);
}
@@ -54,6 +55,7 @@ my_conv_fixed_size (void *cls,
const struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND *qbind)
{
+ (void) cls;
GNUNET_assert (1 == qp->num_params);
qbind->buffer = (void *) qp->data;
qbind->buffer_length = qp->data_len;
@@ -99,12 +101,11 @@ my_conv_string (void *cls,
const struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND *qbind)
{
+ (void) cls;
GNUNET_assert (1 == qp->num_params);
-
qbind->buffer = (void *) qp->data;
qbind->buffer_length = qp->data_len;
qbind->buffer_type = MYSQL_TYPE_STRING;
-
return 1;
}
@@ -142,10 +143,12 @@ my_conv_uint16 (void *cls,
const struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND *qbind)
{
+ (void) cls;
GNUNET_assert (1 == qp->num_params);
qbind->buffer = (void *) qp->data;
qbind->buffer_length = sizeof (uint16_t);
qbind->buffer_type = MYSQL_TYPE_SHORT;
+ qbind->is_unsigned = 1;
return 1;
}
@@ -184,11 +187,12 @@ my_conv_uint32 (void *cls,
const struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND *qbind)
{
+ (void) cls;
GNUNET_assert (1 == qp->num_params);
qbind->buffer = (void *) qp->data;
qbind->buffer_length = sizeof(uint32_t);
qbind->buffer_type = MYSQL_TYPE_LONG;
-
+ qbind->is_unsigned = 1;
return 1;
}
@@ -227,10 +231,12 @@ my_conv_uint64 (void *cls,
const struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND * qbind)
{
+ (void) cls;
GNUNET_assert (1 == qp->num_params);
qbind->buffer = (void *) qp->data;
qbind->buffer_length = sizeof (uint64_t);
qbind->buffer_type = MYSQL_TYPE_LONGLONG;
+ qbind->is_unsigned = 1;
return 1;
}
@@ -273,14 +279,13 @@ my_conv_rsa_public_key (void *cls,
char *buf;
size_t buf_size;
+ (void) cls;
GNUNET_assert(1 == qp->num_params);
-
- buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa, &buf);
-
+ buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa,
+ &buf);
qbind->buffer = (void *) buf;
qbind->buffer_length = buf_size;
qbind->buffer_type = MYSQL_TYPE_BLOB;
-
return 1;
}
@@ -325,14 +330,13 @@ my_conv_rsa_signature (void *cls,
char *buf;
size_t buf_size;
+ (void) cls;
GNUNET_assert(1 == qp->num_params);
-
buf_size = GNUNET_CRYPTO_rsa_signature_encode (sig,
&buf);
qbind->buffer = (void *) buf;
qbind->buffer_length = buf_size;
qbind->buffer_type = MYSQL_TYPE_BLOB;
-
return 1;
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 23/75: config: file name expansion in all -f cases, (continued)
- [GNUnet-SVN] [gnunet] 23/75: config: file name expansion in all -f cases, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 26/75: doc: create system specific folder and move files into it, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 25/75: rps profiler: add correct make rule, util, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 37/75: ensure DHT never accepts or passes along expired blocks, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 39/75: rps profiler: cleaned debug output, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 30/75: remove crypto_bug.c, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 28/75: README: Mention further reading material, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 34/75: complain if datacache returns expired values, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 21/75: avoid looping on listing of zone, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 31/75: -wip error gns, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 36/75: tell mysql that our integers are unsigned,
gnunet <=
- [GNUnet-SVN] [gnunet] 40/75: doc: Add new files to Makefile., gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 38/75: rps profiler: generate output for randomness tests, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 45/75: fix, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 41/75: some changes and work in user handbook., gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 46/75: mariadb, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 51/75: -Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 47/75: remove dead file, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 56/75: -Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 48/75: Expanding libgnunetcurl., gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 13/75: doc: stagging file 'FROM_SOURCE' with old repetive instructions, gnunet, 2018/08/09