Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Update uthash to their lastest versions
Baptiste Daroussin committed 12 years ago
commit 66fca4ec792756b47ffb64867cdd7d07ea59f052
parent 6dab70b
2 files changed +54 -10
modified external/uthash/uthash.h
@@ -1,5 +1,5 @@
/*
-
Copyright (c) 2003-2013, Troy D. Hanson     http://uthash.sourceforge.net
+
Copyright (c) 2003-2013, Troy D. Hanson     http://troydhanson.github.com/uthash/
All rights reserved.

Redistribution and use in source and binary forms, with or without
@@ -135,6 +135,7 @@ do {
#define HASH_BLOOM_FREE(tbl) 
#define HASH_BLOOM_ADD(tbl,hashv) 
#define HASH_BLOOM_TEST(tbl,hashv) (1)
+
#define HASH_BLOOM_BYTELEN 0
#endif

#define HASH_MAKE_TABLE(hh,head)                                                 \
@@ -750,18 +751,22 @@ do {
                      _hs_qsize--;                                               \
                  } else if ( (_hs_qsize == 0) || !(_hs_q) ) {                   \
                      _hs_e = _hs_p;                                             \
-
                      _hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \
-
                              ((void*)((char*)(_hs_p->next) +                    \
-
                              (head)->hh.tbl->hho)) : NULL);                     \
+
                      if (_hs_p){                                                \
+
                        _hs_p = (UT_hash_handle*)((_hs_p->next) ?                \
+
                                ((void*)((char*)(_hs_p->next) +                  \
+
                                (head)->hh.tbl->hho)) : NULL);                   \
+
                       }                                                         \
                      _hs_psize--;                                               \
                  } else if ((                                                   \
                      cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \
                             DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \
                             ) <= 0) {                                           \
                      _hs_e = _hs_p;                                             \
-
                      _hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \
-
                              ((void*)((char*)(_hs_p->next) +                    \
-
                              (head)->hh.tbl->hho)) : NULL);                     \
+
                      if (_hs_p){                                                \
+
                        _hs_p = (UT_hash_handle*)((_hs_p->next) ?                \
+
                               ((void*)((char*)(_hs_p->next) +                   \
+
                               (head)->hh.tbl->hho)) : NULL);                    \
+
                       }                                                         \
                      _hs_psize--;                                               \
                  } else {                                                       \
                      _hs_e = _hs_q;                                             \
@@ -776,13 +781,17 @@ do {
                  } else {                                                       \
                      _hs_list = _hs_e;                                          \
                  }                                                              \
+
                  if (_hs_e) {                                                   \
                  _hs_e->prev = ((_hs_tail) ?                                    \
                     ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL);              \
+
                  }                                                              \
                  _hs_tail = _hs_e;                                              \
              }                                                                  \
              _hs_p = _hs_q;                                                     \
          }                                                                      \
-
          _hs_tail->next = NULL;                                                 \
+
          if (_hs_tail){                                                         \
+
            _hs_tail->next = NULL;                                               \
+
          }                                                                      \
          if ( _hs_nmerges <= 1 ) {                                              \
              _hs_looping=0;                                                     \
              (head)->hh.tbl->tail = _hs_tail;                                   \
@@ -848,6 +857,12 @@ do {
  }                                                                              \
} while(0)

+
#define HASH_OVERHEAD(hh,head)                                                   \
+
 (size_t)((((head)->hh.tbl->num_items   * sizeof(UT_hash_handle))   +            \
+
           ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket))   +            \
+
            (sizeof(UT_hash_table))                                 +            \
+
            (HASH_BLOOM_BYTELEN)))
+

#ifdef NO_DECLTYPE
#define HASH_ITER(hh,head,el,tmp)                                                \
for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL);       \
modified external/uthash/utlist.h
@@ -1,5 +1,5 @@
/*
-
Copyright (c) 2007-2013, Troy D. Hanson   http://uthash.sourceforge.net
+
Copyright (c) 2007-2013, Troy D. Hanson   http://troydhanson.github.com/uthash/
All rights reserved.

Redistribution and use in source and binary forms, with or without
@@ -70,6 +70,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define NO_DECLTYPE
#define LDECLTYPE(x) char*
#endif
+
#elif defined(__ICCARM__)
+
#define NO_DECLTYPE
+
#define LDECLTYPE(x) char*
#else                      /* GNU, Sun and other compilers */
#define LDECLTYPE(x) __typeof(x)
#endif
@@ -405,7 +408,7 @@ do {
#undef LL_DELETE
#define LL_DELETE LL_DELETE_VS2008
#undef LL_DELETE2
-
#define LL_DELETE2_VS2008
+
#define LL_DELETE2 LL_DELETE2_VS2008
#undef LL_APPEND2
#define LL_APPEND2 LL_APPEND2_VS2008
#undef LL_CONCAT /* no LL_CONCAT_VS2008 */
@@ -413,6 +416,15 @@ do {
#endif
/* end VS2008 replacements */

+
#define LL_COUNT(head,el,counter)                                                              \
+
    LL_COUNT2(head,el,counter,next)                                                            \
+

+
#define LL_COUNT2(head,el,counter,next)                                                        \
+
{                                                                                              \
+
    counter = 0;                                                                               \
+
    LL_FOREACH2(head,el,next){ ++counter; }                                                    \
+
}
+

#define LL_FOREACH(head,el)                                                                    \
    LL_FOREACH2(head,el,next)

@@ -560,6 +572,14 @@ do {
  }                                                                                            \
} while (0) 

+
#define DL_COUNT(head,el,counter)                                                              \
+
    DL_COUNT2(head,el,counter,next)                                                            \
+

+
#define DL_COUNT2(head,el,counter,next)                                                        \
+
{                                                                                              \
+
    counter = 0;                                                                               \
+
    DL_FOREACH2(head,el,next){ ++counter; }                                                    \
+
}

#define DL_FOREACH(head,el)                                                                    \
    DL_FOREACH2(head,el,next)
@@ -656,6 +676,15 @@ do {
  }                                                                                            \
} while (0) 

+
#define CDL_COUNT(head,el,counter)                                                             \
+
    CDL_COUNT2(head,el,counter,next)                                                           \
+

+
#define CDL_COUNT2(head, el, counter,next)                                                     \
+
{                                                                                              \
+
    counter = 0;                                                                               \
+
    CDL_FOREACH2(head,el,next){ ++counter; }                                                   \
+
}
+

#define CDL_FOREACH(head,el)                                                                   \
    CDL_FOREACH2(head,el,next)