diff options
author | Vanilla I. Shu <vanilla@FreeBSD.org> | 2011-04-13 06:42:27 +0000 |
---|---|---|
committer | Vanilla I. Shu <vanilla@FreeBSD.org> | 2011-04-13 06:42:27 +0000 |
commit | 4f5951e312a36f2d8762a3a45bdb6113949f3b49 (patch) | |
tree | 8c9ec495750c15025d17af1f0f9d6416a4d5f41e /devel/jansson | |
parent | d288ae3d89d6943ab87e22e060c873d112d463f6 (diff) | |
download | ports-4f5951e312a36f2d8762a3a45bdb6113949f3b49.tar.gz ports-4f5951e312a36f2d8762a3a45bdb6113949f3b49.zip |
Notes
Diffstat (limited to 'devel/jansson')
-rw-r--r-- | devel/jansson/Makefile | 2 | ||||
-rw-r--r-- | devel/jansson/distinfo | 4 | ||||
-rw-r--r-- | devel/jansson/files/patch-src_hashtable.c | 56 | ||||
-rw-r--r-- | devel/jansson/files/patch-src_jansson.h | 39 | ||||
-rw-r--r-- | devel/jansson/files/patch-src_value.c | 107 |
5 files changed, 205 insertions, 3 deletions
diff --git a/devel/jansson/Makefile b/devel/jansson/Makefile index 4812f10430c1..ed14cba092f8 100644 --- a/devel/jansson/Makefile +++ b/devel/jansson/Makefile @@ -6,7 +6,7 @@ # PORTNAME= jansson -PORTVERSION= 2.0 +PORTVERSION= 2.0.1 PORTREVISION= 0 CATEGORIES= devel MASTER_SITES= http://www.digip.org/jansson/releases/ diff --git a/devel/jansson/distinfo b/devel/jansson/distinfo index 0c26a8c5383a..0ef6b3c0acba 100644 --- a/devel/jansson/distinfo +++ b/devel/jansson/distinfo @@ -1,2 +1,2 @@ -SHA256 (jansson-2.0.tar.gz) = d8b1e764507029de0d740f177d0ce112a948491b4943a36a873d8a19be22f2e8 -SIZE (jansson-2.0.tar.gz) = 357209 +SHA256 (jansson-2.0.1.tar.gz) = 198fac91f5f06177a6f734e91cb7637481c3beb57c195e1623ac68137421b554 +SIZE (jansson-2.0.1.tar.gz) = 360016 diff --git a/devel/jansson/files/patch-src_hashtable.c b/devel/jansson/files/patch-src_hashtable.c new file mode 100644 index 000000000000..285f7a454516 --- /dev/null +++ b/devel/jansson/files/patch-src_hashtable.c @@ -0,0 +1,56 @@ +--- src/hashtable.c.orig 2011-04-02 22:36:44.000000000 +0800 ++++ src/hashtable.c 2011-04-02 22:37:52.000000000 +0800 +@@ -101,10 +101,10 @@ static int hashtable_do_del(hashtable_t + { + pair_t *pair; + bucket_t *bucket; +- size_t index; ++ size_t my_index; + +- index = hash % num_buckets(hashtable); +- bucket = &hashtable->buckets[index]; ++ my_index = hash % num_buckets(hashtable); ++ bucket = &hashtable->buckets[my_index]; + + pair = hashtable_find_pair(hashtable, bucket, key, hash); + if(!pair) +@@ -153,7 +153,7 @@ static int hashtable_do_rehash(hashtable + { + list_t *list, *next; + pair_t *pair; +- size_t i, index, new_size; ++ size_t i, my_index, new_size; + + jsonp_free(hashtable->buckets); + +@@ -176,8 +176,8 @@ static int hashtable_do_rehash(hashtable + for(; list != &hashtable->list; list = next) { + next = list->next; + pair = list_to_pair(list); +- index = pair->hash % new_size; +- insert_to_bucket(hashtable, &hashtable->buckets[index], &pair->list); ++ my_index = pair->hash % new_size; ++ insert_to_bucket(hashtable, &hashtable->buckets[my_index], &pair->list); + } + + return 0; +@@ -244,7 +244,7 @@ int hashtable_set(hashtable_t *hashtable + { + pair_t *pair; + bucket_t *bucket; +- size_t hash, index; ++ size_t hash, my_index; + + /* rehash if the load ratio exceeds 1 */ + if(hashtable->size >= num_buckets(hashtable)) +@@ -252,8 +252,8 @@ int hashtable_set(hashtable_t *hashtable + return -1; + + hash = hashtable->hash_key(key); +- index = hash % num_buckets(hashtable); +- bucket = &hashtable->buckets[index]; ++ my_index = hash % num_buckets(hashtable); ++ bucket = &hashtable->buckets[my_index]; + pair = hashtable_find_pair(hashtable, bucket, key, hash); + + if(pair) diff --git a/devel/jansson/files/patch-src_jansson.h b/devel/jansson/files/patch-src_jansson.h new file mode 100644 index 000000000000..bb83dde8e4d1 --- /dev/null +++ b/devel/jansson/files/patch-src_jansson.h @@ -0,0 +1,39 @@ +--- src/jansson.h.orig 2011-04-02 22:38:00.000000000 +0800 ++++ src/jansson.h 2011-04-02 22:38:38.000000000 +0800 +@@ -152,18 +152,18 @@ int json_object_iter_set(json_t *object, + } + + size_t json_array_size(const json_t *array); +-json_t *json_array_get(const json_t *array, size_t index); +-int json_array_set_new(json_t *array, size_t index, json_t *value); ++json_t *json_array_get(const json_t *array, size_t my_index); ++int json_array_set_new(json_t *array, size_t my_index, json_t *value); + int json_array_append_new(json_t *array, json_t *value); +-int json_array_insert_new(json_t *array, size_t index, json_t *value); +-int json_array_remove(json_t *array, size_t index); ++int json_array_insert_new(json_t *array, size_t my_index, json_t *value); ++int json_array_remove(json_t *array, size_t my_index); + int json_array_clear(json_t *array); + int json_array_extend(json_t *array, json_t *other); + + static JSON_INLINE +-int json_array_set(json_t *array, size_t index, json_t *value) ++int json_array_set(json_t *array, size_t my_index, json_t *value) + { +- return json_array_set_new(array, index, json_incref(value)); ++ return json_array_set_new(array, my_index, json_incref(value)); + } + + static JSON_INLINE +@@ -173,9 +173,9 @@ int json_array_append(json_t *array, jso + } + + static JSON_INLINE +-int json_array_insert(json_t *array, size_t index, json_t *value) ++int json_array_insert(json_t *array, size_t my_index, json_t *value) + { +- return json_array_insert_new(array, index, json_incref(value)); ++ return json_array_insert_new(array, my_index, json_incref(value)); + } + + const char *json_string_value(const json_t *string); diff --git a/devel/jansson/files/patch-src_value.c b/devel/jansson/files/patch-src_value.c new file mode 100644 index 000000000000..cc0efbf628b5 --- /dev/null +++ b/devel/jansson/files/patch-src_value.c @@ -0,0 +1,107 @@ +--- src/value.c.orig 2011-04-02 22:38:44.000000000 +0800 ++++ src/value.c 2011-04-02 22:39:37.000000000 +0800 +@@ -401,20 +401,20 @@ size_t json_array_size(const json_t *jso + return json_to_array(json)->entries; + } + +-json_t *json_array_get(const json_t *json, size_t index) ++json_t *json_array_get(const json_t *json, size_t my_index) + { + json_array_t *array; + if(!json_is_array(json)) + return NULL; + array = json_to_array(json); + +- if(index >= array->entries) ++ if(my_index >= array->entries) + return NULL; + +- return array->table[index]; ++ return array->table[my_index]; + } + +-int json_array_set_new(json_t *json, size_t index, json_t *value) ++int json_array_set_new(json_t *json, size_t my_index, json_t *value) + { + json_array_t *array; + +@@ -428,14 +428,14 @@ int json_array_set_new(json_t *json, siz + } + array = json_to_array(json); + +- if(index >= array->entries) ++ if(my_index >= array->entries) + { + json_decref(value); + return -1; + } + +- json_decref(array->table[index]); +- array->table[index] = value; ++ json_decref(array->table[my_index]); ++ array->table[my_index] = value; + + return 0; + } +@@ -507,7 +507,7 @@ int json_array_append_new(json_t *json, + return 0; + } + +-int json_array_insert_new(json_t *json, size_t index, json_t *value) ++int json_array_insert_new(json_t *json, size_t my_index, json_t *value) + { + json_array_t *array; + json_t **old_table; +@@ -521,7 +521,7 @@ int json_array_insert_new(json_t *json, + } + array = json_to_array(json); + +- if(index > array->entries) { ++ if(my_index > array->entries) { + json_decref(value); + return -1; + } +@@ -533,21 +533,21 @@ int json_array_insert_new(json_t *json, + } + + if(old_table != array->table) { +- array_copy(array->table, 0, old_table, 0, index); +- array_copy(array->table, index + 1, old_table, index, +- array->entries - index); ++ array_copy(array->table, 0, old_table, 0, my_index); ++ array_copy(array->table, my_index + 1, old_table, my_index, ++ array->entries - my_index); + jsonp_free(old_table); + } + else +- array_move(array, index + 1, index, array->entries - index); ++ array_move(array, my_index + 1, my_index, array->entries - my_index); + +- array->table[index] = value; ++ array->table[my_index] = value; + array->entries++; + + return 0; + } + +-int json_array_remove(json_t *json, size_t index) ++int json_array_remove(json_t *json, size_t my_index) + { + json_array_t *array; + +@@ -555,12 +555,12 @@ int json_array_remove(json_t *json, size + return -1; + array = json_to_array(json); + +- if(index >= array->entries) ++ if(my_index >= array->entries) + return -1; + +- json_decref(array->table[index]); ++ json_decref(array->table[my_index]); + +- array_move(array, index, index + 1, array->entries - index); ++ array_move(array, my_index, my_index + 1, array->entries - my_index); + array->entries--; + + return 0; |