gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: [pq] make out-parameter num optional for


From: gnunet
Subject: [gnunet] branch master updated: [pq] make out-parameter num optional for arrays
Date: Tue, 20 Jun 2023 15:52:41 +0200

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

oec pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 3b8d94fe9 [pq] make out-parameter num optional for arrays
3b8d94fe9 is described below

commit 3b8d94fe9f82bbbfe664188e89470deec5beb7c1
Author: Özgür Kesim <oec-taler@kesim.org>
AuthorDate: Tue Jun 20 15:52:33 2023 +0200

    [pq] make out-parameter num optional for arrays
---
 src/pq/pq_result_helper.c | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/pq/pq_result_helper.c b/src/pq/pq_result_helper.c
index 808445b3b..f849ffde1 100644
--- a/src/pq/pq_result_helper.c
+++ b/src/pq/pq_result_helper.c
@@ -1214,43 +1214,45 @@ extract_array_generic (
     FAIL_IF (info->oid != header.oid);
   }
 
-  *info->num = header.dim;
+  if (NULL != info->num)
+    *info->num = header.dim;
+
   switch (info->typ)
   {
   case array_of_bool:
     if (NULL != dst_size)
-      *dst_size = sizeof(bool) * (*info->num);
-    out = GNUNET_new_array (*info->num, bool);
+      *dst_size = sizeof(bool) * (header.dim);
+    out = GNUNET_new_array (header.dim, bool);
     break;
   case array_of_uint16:
     if (NULL != dst_size)
-      *dst_size = sizeof(uint16_t) * (*info->num);
-    out = GNUNET_new_array (*info->num, uint16_t);
+      *dst_size = sizeof(uint16_t) * (header.dim);
+    out = GNUNET_new_array (header.dim, uint16_t);
     break;
   case array_of_uint32:
     if (NULL != dst_size)
-      *dst_size = sizeof(uint32_t) * (*info->num);
-    out = GNUNET_new_array (*info->num, uint32_t);
+      *dst_size = sizeof(uint32_t) * (header.dim);
+    out = GNUNET_new_array (header.dim, uint32_t);
     break;
   case array_of_uint64:
     if (NULL != dst_size)
-      *dst_size = sizeof(uint64_t) * (*info->num);
-    out = GNUNET_new_array (*info->num, uint64_t);
+      *dst_size = sizeof(uint64_t) * (header.dim);
+    out = GNUNET_new_array (header.dim, uint64_t);
     break;
   case array_of_abs_time:
     if (NULL != dst_size)
-      *dst_size = sizeof(struct GNUNET_TIME_Absolute) * (*info->num);
-    out = GNUNET_new_array (*info->num, struct GNUNET_TIME_Absolute);
+      *dst_size = sizeof(struct GNUNET_TIME_Absolute) * (header.dim);
+    out = GNUNET_new_array (header.dim, struct GNUNET_TIME_Absolute);
     break;
   case array_of_rel_time:
     if (NULL != dst_size)
-      *dst_size = sizeof(struct GNUNET_TIME_Relative) * (*info->num);
-    out = GNUNET_new_array (*info->num, struct GNUNET_TIME_Relative);
+      *dst_size = sizeof(struct GNUNET_TIME_Relative) * (header.dim);
+    out = GNUNET_new_array (header.dim, struct GNUNET_TIME_Relative);
     break;
   case array_of_timestamp:
     if (NULL != dst_size)
-      *dst_size = sizeof(struct GNUNET_TIME_Timestamp) * (*info->num);
-    out = GNUNET_new_array (*info->num, struct GNUNET_TIME_Timestamp);
+      *dst_size = sizeof(struct GNUNET_TIME_Timestamp) * (header.dim);
+    out = GNUNET_new_array (header.dim, struct GNUNET_TIME_Timestamp);
     break;
   case array_of_byte:
     if (0 == info->same_size)

-- 
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]