summaryrefslogtreecommitdiffstats
path: root/collection
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-04-06 15:31:41 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-04-06 15:59:21 -0400
commit8fc0b32ffa899a5cf33bee498388ed452042ccd2 (patch)
tree99de838b63ea8a2d08d7223cf6be935fa36f2c2a /collection
parente54786d970c3a4643644b99f7b5f0d4332d7db5d (diff)
downloadding-libs2-8fc0b32ffa899a5cf33bee498388ed452042ccd2.tar.gz
ding-libs2-8fc0b32ffa899a5cf33bee498388ed452042ccd2.tar.xz
ding-libs2-8fc0b32ffa899a5cf33bee498388ed452042ccd2.zip
Clean up a lot of warnings in Collection and INI parser
Diffstat (limited to 'collection')
-rw-r--r--collection/collection.c7
-rw-r--r--collection/collection.h5
-rw-r--r--collection/collection_tools.c1
-rw-r--r--collection/collection_tools.h3
-rw-r--r--collection/collection_ut.c5
5 files changed, 9 insertions, 12 deletions
diff --git a/collection/collection.c b/collection/collection.c
index e393ae3..4a5b504 100644
--- a/collection/collection.c
+++ b/collection/collection.c
@@ -303,7 +303,7 @@ static struct collection_item *add_property(struct collection_item *collection,
int type,
int *error)
{
- struct collection_item *item;
+ struct collection_item *item = (struct collection_item *) NULL;
struct collection_item *acceptor = (struct collection_item *)(NULL);
TRACE_FLOW_STRING("add_property","Entry.");
@@ -734,7 +734,6 @@ static int find_item_and_do(struct collection_item *ci,
static int update_current_item(struct collection_item *current,
struct update_property *update_data)
{
- int error = EOK;
TRACE_FLOW_STRING("update_current_item","Entry");
/* If type is different or same but it is string or binary we need to replace the storage */
@@ -1468,7 +1467,6 @@ int get_reference_from_item(struct collection_item *ci,
{
struct collection_header *header;
struct collection_item *subcollection = (struct collection_item *)(NULL);
- int error = EOK;
TRACE_FLOW_STRING("get_reference_from_item","Entry.");
@@ -1878,8 +1876,6 @@ int modify_item(struct collection_item *item,
void *data,
int length)
{
- int error = EOK;
-
TRACE_FLOW_STRING("modify_item","Entry");
if((item == (struct collection_item *)(NULL)) ||
@@ -2054,7 +2050,6 @@ inline int modify_double_item(struct collection_item *item,
/* Grow iteration stack */
static int grow_stack(struct collection_iterator *iterator, unsigned desired)
{
- int error;
int grow_by = 0;
struct collection_item **temp;
diff --git a/collection/collection.h b/collection/collection.h
index 2a88f82..bccf3e3 100644
--- a/collection/collection.h
+++ b/collection/collection.h
@@ -105,7 +105,7 @@ struct collection_item;
struct collection_iterator;
#endif /* COLLECTION_PRIV_H */
-/* IMPORATNAT - the collection is a set of items of different types.
+/* IMPORTANT - the collection is a set of items of different types.
* There is always a header item in any collection that starts the collection.
* Most of the functions in the interface (unless it is explicitly mentioned
* otherwise) assume that the collection_item * argument points to the header element.
@@ -113,7 +113,7 @@ struct collection_iterator;
* that expect header elements is illegal. There might be not enough checking
* at the moment but this will be enforced in future versions of the library.
-/* IMPORTANT - To better understand how collections work imagine travel bags.
+ * IMPORTANT - To better understand how collections work imagine travel bags.
* They usually come in different sizes and one can put a bag in a bag when they put away
* to the shelf in a garage or closet. Collection is such bag except that you
* can put other bags into each other even if they are not empty.
@@ -144,6 +144,7 @@ struct collection_iterator;
* to destroy the collection after it is used.
* By extracting reference from an internal collection the caller gains access to the
* collection directly and thus has responsibility to destroy it after use.
+ */
/* Function that creates an named collection */
int create_collection(struct collection_item **ci,char *name,unsigned class);
diff --git a/collection/collection_tools.c b/collection/collection_tools.c
index 1c96f6f..ed44707 100644
--- a/collection/collection_tools.c
+++ b/collection/collection_tools.c
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <malloc.h>
#include <errno.h>
+#include <string.h>
#include "trace.h"
#include "collection_priv.h"
#include "collection.h"
diff --git a/collection/collection_tools.h b/collection/collection_tools.h
index 726f21c..d2ae238 100644
--- a/collection/collection_tools.h
+++ b/collection/collection_tools.h
@@ -91,6 +91,9 @@ int debug_collection(struct collection_item *handle,int flag);
/* Print the collection using default serialization */
int print_collection(struct collection_item *handle);
+/* Print the collection using iterator */
+int print_collection2(struct collection_item *handle);
+
/* Find and print one item using default serialization */
int print_item(struct collection_item *handle, char *name);
diff --git a/collection/collection_ut.c b/collection/collection_ut.c
index ec38d55..6d27db6 100644
--- a/collection/collection_ut.c
+++ b/collection/collection_ut.c
@@ -34,7 +34,6 @@ int ref_collection_test()
struct collection_item *peer;
struct collection_item *socket;
char binary_dump[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
- int found = 0;
int error = EOK;
@@ -169,7 +168,6 @@ int add_collection_test()
struct collection_item *peer;
struct collection_item *socket;
char binary_dump[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
- int found = 0;
int error = EOK;
@@ -227,12 +225,11 @@ int mixed_collection_test()
struct collection_item *peer;
struct collection_item *socket1;
struct collection_item *socket2;
- struct collection_item *packet;
struct collection_item *event;
struct collection_item *host;
char binary_dump[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
int found = 0;
- int class = 0;
+ unsigned int class = 0;
int error = EOK;