diff options
author | Dmitri Pal <dpal@redhat.com> | 2012-12-23 15:14:08 -0500 |
---|---|---|
committer | Ondrej Kos <okos@redhat.com> | 2013-01-04 14:04:18 +0100 |
commit | e984e914b6aced5dabe250ad769c63186f21f8b8 (patch) | |
tree | 437bfd3657b02c033f9e9bafb654cb394bcb57a5 /collection | |
parent | 89243948c4f0499e70ca5bdbad62f03fd3cfb6a4 (diff) | |
download | ding-libs2-e984e914b6aced5dabe250ad769c63186f21f8b8.tar.gz ding-libs2-e984e914b6aced5dabe250ad769c63186f21f8b8.tar.xz ding-libs2-e984e914b6aced5dabe250ad769c63186f21f8b8.zip |
Make CLANG happy
Address CLANG issues in the main code.
Diffstat (limited to 'collection')
-rw-r--r-- | collection/collection.c | 2 | ||||
-rw-r--r-- | collection/collection_ut.c | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/collection/collection.c b/collection/collection.c index ce0bbec..d836aa4 100644 --- a/collection/collection.c +++ b/collection/collection.c @@ -574,7 +574,7 @@ int col_insert_item_into_current(struct collection_item *collection, /* Move to the right position counting */ while (idx > 0) { idx--; - parent = parent->next; + if (parent->next) parent = parent->next; } item->next = parent->next; parent->next = item; diff --git a/collection/collection_ut.c b/collection/collection_ut.c index abf0f11..1b48fc0 100644 --- a/collection/collection_ut.c +++ b/collection/collection_ut.c @@ -1354,6 +1354,9 @@ int insert_extract_test(void) (error = col_insert_str_property(col, NULL, COL_DSP_END, NULL, 0, COL_INSERT_NOCHECK, "property1", "value1", 0)) || + (error = col_insert_str_property(col, NULL, COL_DSP_INDEX, + NULL, 1, COL_INSERT_NOCHECK, + "second", "second", 0)) || (error = col_insert_str_property(col, NULL, COL_DSP_END, NULL, 0, COL_INSERT_NOCHECK, "property2", "value2", 0)) || @@ -1437,6 +1440,14 @@ int insert_extract_test(void) ((verbose) && (error = col_debug_collection(col2, COL_TRAVERSE_DEFAULT))) || + (error = col_extract_item(col, NULL, COL_DSP_FRONT, + NULL, 0, 0, &item)) || + + (error = col_insert_item(col2, NULL, item, COL_DSP_FRONT, + NULL, 0, COL_INSERT_NOCHECK)) || + + ((verbose) && (error = col_debug_collection(col2, COL_TRAVERSE_DEFAULT))) || + (error = col_extract_item(col, NULL, COL_DSP_END, NULL, 0, 0, &item)) || |