summaryrefslogtreecommitdiff
path: root/common/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
commit2f2e7ac94c86ced957a0232e368985ba8c8f59e7 (patch)
treecbdad3ea5876678669c0f472c4f06b2a95326e7d /common/collection
parent29f9384e70029ebe72ad6199eb8f04c0c92a8981 (diff)
downloadsssd-2f2e7ac94c86ced957a0232e368985ba8c8f59e7.tar.gz
sssd-2f2e7ac94c86ced957a0232e368985ba8c8f59e7.tar.bz2
sssd-2f2e7ac94c86ced957a0232e368985ba8c8f59e7.zip
Clean up a lot of warnings in Collection and INI parser
Diffstat (limited to 'common/collection')
-rw-r--r--common/collection/collection.c7
-rw-r--r--common/collection/collection.h5
-rw-r--r--common/collection/collection_tools.c1
-rw-r--r--common/collection/collection_tools.h3
-rw-r--r--common/collection/collection_ut.c5
5 files changed, 9 insertions, 12 deletions
diff --git a/common/collection/collection.c b/common/collection/collection.c
index e393ae3d..4a5b5044 100644
--- a/common/collection/collection.c
+++ b/common/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/common/collection/collection.h b/common/collection/collection.h
index 2a88f82c..bccf3e3c 100644
--- a/common/collection/collection.h
+++ b/common/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/common/collection/collection_tools.c b/common/collection/collection_tools.c
index 1c96f6f8..ed44707d 100644
--- a/common/collection/collection_tools.c
+++ b/common/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/common/collection/collection_tools.h b/common/collection/collection_tools.h
index 726f21c7..d2ae238f 100644
--- a/common/collection/collection_tools.h
+++ b/common/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/common/collection/collection_ut.c b/common/collection/collection_ut.c
index ec38d556..6d27db66 100644
--- a/common/collection/collection_ut.c
+++ b/common/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;