Removing unnecessary headers and fixing examples

This commit is contained in:
Leonardo committed 2019-03-24 15:59:37 -03:00
1 parent 9e8b7aa269
commit 9277264089
8 files changed
+6 -12

No files matched your search

+5 -5
View File
@@ -41,16 +41,16 @@ int main(int argc, char const *argv[])
FOR_EACH(l, list, , int, l, {
if (index == 0)
printf("[ %d, ", var);
else if (index == l_count(l) - 1)
else if (index == iter.target->count - 1)
printf("%d ]\n", var);
else
printf("%d, ", var);
})
FOR_EACH(s, stack, , int, s, {
if (index == 0)
if (index == iter.target->count - 1)
printf("[ %d, ", var);
else if (index == s_count(s) - 1)
else if (index == 0)
printf("%d ]\n", var);
else
printf("%d, ", var);
@@ -59,7 +59,7 @@ int main(int argc, char const *argv[])
FOR_EACH(q, queue, , int, q, {
if (index == 0)
printf("[ %d, ", var);
else if (index == q_count(q) - 1)
else if (index == iter.target->count - 1)
printf("%d ]\n", var);
else
printf("%d, ", var);
@@ -68,7 +68,7 @@ int main(int argc, char const *argv[])
FOR_EACH(d, deque, , int, d, {
if (index == 0)
printf("[ %d, ", var);
else if (index == d_count(d) - 1)
else if (index == iter.target->count - 1)
printf("%d ]\n", var);
else
printf("%d, ", var);
+1 -1
View File
@@ -13,7 +13,7 @@ int main(int argc, char const *argv[])
// Initliazie linked list and add some elements
linked *ll = ll_new();
for (int i = 0; i < 100; i++)
for (int i = 0; i < 20; i++)
ll_push_back(ll, i);
// Initialize iterator
-1
View File
@@ -17,7 +17,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#define DEQUE_GENERATE(PFX, SNAME, FMOD, K, T) \
DEQUE_GENERATE_STRUCT(PFX, SNAME, FMOD, K, T) \
-1
View File
@@ -13,7 +13,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#define FOR_EACH(PFX, SNAME, K, T, TARGET, BODY) \
do \
-1
View File
@@ -17,7 +17,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#define LINKEDLIST_GENERATE(PFX, SNAME, FMOD, K, T) \
LINKEDLIST_GENERATE_STRUCT(PFX, SNAME, FMOD, K, T) \
-1
View File
@@ -17,7 +17,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#define LIST_GENERATE(PFX, SNAME, FMOD, K, T) \
LIST_GENERATE_STRUCT(PFX, SNAME, FMOD, K, T) \
-1
View File
@@ -17,7 +17,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#define QUEUE_GENERATE(PFX, SNAME, FMOD, K, T) \
QUEUE_GENERATE_STRUCT(PFX, SNAME, FMOD, K, T) \
-1
View File
@@ -17,7 +17,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#define STACK_GENERATE(PFX, SNAME, FMOD, K, T) \
STACK_GENERATE_STRUCT(PFX, SNAME, FMOD, K, T) \