diff --git a/hashmap.h b/hashmap.h index 000efad..70cc33f 100644 --- a/hashmap.h +++ b/hashmap.h @@ -78,4 +78,4 @@ extern void hashmap_free(map_t in); */ extern int hashmap_length(map_t in); -#endif __HASHMAP_H__ \ No newline at end of file +#endif diff --git a/main.c b/main.c index 4c128e3..5b51d16 100644 --- a/main.c +++ b/main.c @@ -18,14 +18,14 @@ typedef struct data_struct_s int number; } data_struct_t; -int main(char* argv, int argc) +int main(int argc, char **argv) { int index; int error; map_t mymap; char key_string[KEY_MAX_LENGTH]; data_struct_t* value; - + mymap = hashmap_new(); /* First, populate the hash map with ascending values */ @@ -46,17 +46,17 @@ int main(char* argv, int argc) snprintf(key_string, KEY_MAX_LENGTH, "%s%d", KEY_PREFIX, index); error = hashmap_get(mymap, key_string, (void**)(&value)); - + /* Make sure the value was both found and the correct number */ assert(error==MAP_OK); assert(value->number==index); } - + /* Make sure that a value that wasn't in the map can't be found */ snprintf(key_string, KEY_MAX_LENGTH, "%s%d", KEY_PREFIX, KEY_COUNT); error = hashmap_get(mymap, key_string, (void**)(&value)); - + /* Make sure the value was not found */ assert(error==MAP_MISSING); @@ -71,11 +71,11 @@ int main(char* argv, int argc) error = hashmap_remove(mymap, key_string); assert(error==MAP_OK); - free(value); + free(value); } - + /* Now, destroy the map */ hashmap_free(mymap); return 1; -} \ No newline at end of file +}