Update examples.

This commit is contained in:
TryExceptElse committed 2019-11-22 00:11:01 -08:00
1 parent f388ed6808
commit db7af704a6
39 files changed
+278 -169

No files matched your search

+4 -2
View File
@@ -32,7 +32,9 @@ int intcmp(int a, int b)
}
// Creates a hashset of integers
HASHSET_GENERATE(hs, hashset, /* FMOD */, int)
CMC_GENERATE_HASHSET(hs, hashset, int)
typedef struct hashset hashset;
typedef struct hashset_iter hashset_iter;
int main(int argc, char const *argv[])
{
@@ -188,7 +190,7 @@ int main(int argc, char const *argv[])
// Dispose the iterator called by hs_iter_new()
hs_iter_free(iter);
// Dispose the hashset created
hs_free(my_hashset);
hs_free(my_hashset, NULL);
return 0;
}
+10 -7
View File
@@ -18,7 +18,10 @@
#include <stdio.h>
#include <stdlib.h>
HASHSET_GENERATE(set, set, /* static */, int)
CMC_GENERATE_HASHSET(set, set, int)
typedef struct set set;
typedef struct set_iter set_iter;
void print_set(set *s)
{
@@ -104,12 +107,12 @@ int main(int argc, char const *argv[])
printf("=\n");
print_set(set6);
set_free(set1);
set_free(set2);
set_free(set3);
set_free(set4);
set_free(set5);
set_free(set6);
set_free(set1, NULL);
set_free(set2, NULL);
set_free(set3, NULL);
set_free(set4, NULL);
set_free(set5, NULL);
set_free(set6, NULL);
return 0;
}