Browse Source

Make dictionary the first param of HIPACK_DICT_FOREACH

For coherence, first parameter must always be the object the function/macro
operates on.
Adrian Perez de Castro 6 years ago
parent
commit
34ffec402e
2 changed files with 2 additions and 2 deletions
  1. 1 1
      hipack-misc.c
  2. 1 1
      hipack.h

+ 1 - 1
hipack-misc.c

@@ -68,7 +68,7 @@ hipack_dict_equal (const hipack_dict_t *a,
 
     const hipack_string_t *key;
     hipack_value_t *a_value;
-    HIPACK_DICT_FOREACH (key, a_value, a) {
+    HIPACK_DICT_FOREACH (a, key, a_value) {
         hipack_value_t *b_value = hipack_dict_get (b, key);
         if (!b_value || !hipack_value_equal (a_value, b_value)) {
             return false;

+ 1 - 1
hipack.h

@@ -132,7 +132,7 @@ extern hipack_value_t* hipack_dict_first (const hipack_dict_t    *dict,
 extern hipack_value_t* hipack_dict_next (hipack_value_t         *value,
                                          const hipack_string_t **key);
 
-#define HIPACK_DICT_FOREACH(_k, _v, _d)          \
+#define HIPACK_DICT_FOREACH(_d, _k, _v)          \
     for ((_v) = hipack_dict_first ((_d), &(_k)); \
          (_v) != NULL;                           \
          (_v) = hipack_dict_next ((_v), &(_k)))