Browse Source

force 'const' on type

Christian Grothoff 5 years ago
parent
commit
3f2205a65f
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/include/gnunet_common.h

+ 3 - 3
src/include/gnunet_common.h

@@ -919,8 +919,8 @@ GNUNET_ntoh_double (double d);
  * the same pointer type.
  */
 #define GNUNET_memcmp(a,b) ({ \
-  typeof(b) _a = (a); \
-  typeof(a) _b = (b); \
+  const typeof(b) _a = (a); \
+  const typeof(a) _b = (b); \
   memcmp(_a, \
          _b, \
          sizeof (*a)); })
@@ -933,7 +933,7 @@ GNUNET_ntoh_double (double d);
  *          entire memory being zero'ed out.
  */
 #define GNUNET_is_zero(a) ({ \
-  typeof(*a) _z = { 0 };      \
+  const typeof(*a) _z = { 0 };      \
   memcmp(a, \
          &_z, \
          sizeof (_z)); })