gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated (9135ab24b -> cb7d9ba50)


From: gnunet
Subject: [gnunet] branch master updated (9135ab24b -> cb7d9ba50)
Date: Sun, 14 May 2023 19:19:47 +0200

This is an automated email from the git hooks/post-receive script.

oec pushed a change to branch master
in repository gnunet.

    from 9135ab24b pq: simplify logic for array query type conversion
     new 862cb8466 synchronize uncrustify.cfg with taler-exchange
     new cb7d9ba50 -pq: slight optimization

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 contrib/conf/uncrustify.cfg | 19 ++++++++++++++++++-
 src/pq/pq_query_helper.c    |  8 ++++----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/contrib/conf/uncrustify.cfg b/contrib/conf/uncrustify.cfg
index b02ebc4a5..af2d8e69c 100644
--- a/contrib/conf/uncrustify.cfg
+++ b/contrib/conf/uncrustify.cfg
@@ -4,7 +4,7 @@ output_tab_size = 2
 indent_columns = 2
 indent_with_tabs = 0
 indent_case_brace = 2
-indent_label=0
+indent_label=-16
 
 code_width=80
 #cmd_width=80
@@ -49,8 +49,12 @@ nl_assign_brace=remove
 
 # No extra newlines that cause noisy diffs
 nl_start_of_file=remove
+nl_after_func_proto = 2
+nl_after_func_body = 3
 # If there's no new line, it's not a text file!
 nl_end_of_file=add
+nl_max_blank_in_func = 3
+nl_max = 3
 
 sp_inside_paren = remove
 
@@ -69,6 +73,7 @@ sp_between_ptr_star = remove
 sp_before_sparen = add
 
 sp_inside_fparen = remove
+sp_inside_sparen = remove
 
 # add space before function call and decl: "foo (x)"
 sp_func_call_paren = add
@@ -76,3 +81,15 @@ sp_func_proto_paren = add
 sp_func_proto_paren_empty = add
 sp_func_def_paren = add
 sp_func_def_paren_empty = add
+
+# We'd want it for "if ( (foo) || (bar) )", but not for "if (m())",
+# so as uncrustify doesn't give exactly what we want => ignore
+sp_paren_paren = ignore
+sp_inside_paren = remove
+sp_bool = force
+
+nl_func_type_name = force
+#nl_branch_else = add
+nl_else_brace = add
+nl_elseif_brace = add
+nl_for_brace = add
diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c
index 1f13270c3..1a31333d9 100644
--- a/src/pq/pq_query_helper.c
+++ b/src/pq/pq_query_helper.c
@@ -782,6 +782,7 @@ qconv_array (
   {
     char *in = (char *) data;
     char *out = elements;
+    size_t nullbyte = (array_of_string == meta->typ) ? 1 : 0;
     struct pq_array_header h = {
       .ndim = htonl (1),        /* We only support one-dimensional arrays */
       .has_null = htonl (0),    /* We do not support NULL entries in arrays */
@@ -794,6 +795,7 @@ qconv_array (
     GNUNET_memcpy (out, &h, sizeof(h));
     out += sizeof(h);
 
+
     /* Write elements */
     for (unsigned int i = 0; i < num; i++)
     {
@@ -840,9 +842,7 @@ qconv_array (
           if (meta->continuous)
           {
             ptr = in;
-            in += sz;
-            if (array_of_string == meta->typ)
-              in += 1;    /* NULL-byte */
+            in += sz + nullbyte;
           }
           else
             ptr = ((const void **) data)[i];
@@ -933,7 +933,7 @@ qconv_array (
   param_formats[0] = 1;
   scratch[0] = elements;
 
-  DONE:
+DONE:
   GNUNET_free (string_lengths);
 
   if (noerror)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]