summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-02-21 23:26:29 +0100
committerRichard Braun <rbraun@sceen.net>2018-02-21 23:26:29 +0100
commit4936ed64ed91721229d5ef5965f80428759f9c3c (patch)
tree354aa4c28a1be25c23ab9d0faf06b1f669ad00ca
parenta484ccff7df6300378a0a62238fa6082879a3888 (diff)
Don't use reserved identifiers
-rw-r--r--src/avltree.h100
-rw-r--r--src/avltree_i.h6
-rw-r--r--src/bitmap.h6
-rw-r--r--src/bitmap_i.h6
-rw-r--r--src/cbuf.h6
-rw-r--r--src/check.h6
-rw-r--r--src/cpu.h6
-rw-r--r--src/fmt.h6
-rw-r--r--src/hash.h6
-rw-r--r--src/hlist.h34
-rw-r--r--src/list.h18
-rw-r--r--src/macros.h6
-rw-r--r--src/plist.h6
-rw-r--r--src/rbtree.h100
-rw-r--r--src/rbtree_i.h6
-rw-r--r--src/rdxtree.h6
-rw-r--r--src/rdxtree_i.h6
-rw-r--r--src/shell.h18
-rw-r--r--src/slist.h40
19 files changed, 194 insertions, 194 deletions
diff --git a/src/avltree.h b/src/avltree.h
index ce6c49f..4d78b5b 100644
--- a/src/avltree.h
+++ b/src/avltree.h
@@ -31,8 +31,8 @@
* provide better average performance.
*/
-#ifndef _AVLTREE_H
-#define _AVLTREE_H
+#ifndef AVLTREE_H
+#define AVLTREE_H
#include <assert.h>
#include <stddef.h>
@@ -128,22 +128,22 @@ avltree_empty(const struct avltree *tree)
*/
#define avltree_lookup(tree, key, cmp_fn) \
MACRO_BEGIN \
- struct avltree_node *___cur; \
- int ___diff; \
+ struct avltree_node *cur___; \
+ int diff___; \
\
- ___cur = (tree)->root; \
+ cur___ = (tree)->root; \
\
- while (___cur != NULL) { \
- ___diff = cmp_fn(key, ___cur); \
+ while (cur___ != NULL) { \
+ diff___ = cmp_fn(key, cur___); \
\
- if (___diff == 0) { \
+ if (diff___ == 0) { \
break; \
} \
\
- ___cur = ___cur->children[avltree_d2i(___diff)]; \
+ cur___ = cur___->children[avltree_d2i(diff___)]; \
} \
\
- ___cur; \
+ cur___; \
MACRO_END
/*
@@ -158,30 +158,30 @@ MACRO_END
*/
#define avltree_lookup_nearest(tree, key, cmp_fn, dir) \
MACRO_BEGIN \
- struct avltree_node *___cur, *___prev; \
- int ___diff, ___index; \
+ struct avltree_node *cur___, *prev___; \
+ int diff___, index___; \
\
- ___prev = NULL; \
- ___index = 0; \
- ___cur = (tree)->root; \
+ prev___ = NULL; \
+ index___ = 0; \
+ cur___ = (tree)->root; \
\
- while (___cur != NULL) { \
- ___diff = cmp_fn(key, ___cur); \
+ while (cur___ != NULL) { \
+ diff___ = cmp_fn(key, cur___); \
\
- if (___diff == 0) { \
+ if (diff___ == 0) { \
break; \
} \
\
- ___prev = ___cur; \
- ___index = avltree_d2i(___diff); \
- ___cur = ___cur->children[___index]; \
+ prev___ = cur___; \
+ index___ = avltree_d2i(diff___); \
+ cur___ = cur___->children[index___]; \
} \
\
- if (___cur == NULL) { \
- ___cur = avltree_nearest(___prev, ___index, dir); \
+ if (cur___ == NULL) { \
+ cur___ = avltree_nearest(prev___, index___, dir); \
} \
\
- ___cur; \
+ cur___; \
MACRO_END
/*
@@ -200,22 +200,22 @@ MACRO_END
*/
#define avltree_insert(tree, node, cmp_fn) \
MACRO_BEGIN \
- struct avltree_node *___cur, *___prev; \
- int ___diff, ___index; \
+ struct avltree_node *cur___, *prev___; \
+ int diff___, index___; \
\
- ___prev = NULL; \
- ___index = 0; \
- ___cur = (tree)->root; \
+ prev___ = NULL; \
+ index___ = 0; \
+ cur___ = (tree)->root; \
\
- while (___cur != NULL) { \
- ___diff = cmp_fn(node, ___cur); \
- assert(___diff != 0); \
- ___prev = ___cur; \
- ___index = avltree_d2i(___diff); \
- ___cur = ___cur->children[___index]; \
+ while (cur___ != NULL) { \
+ diff___ = cmp_fn(node, cur___); \
+ assert(diff___ != 0); \
+ prev___ = cur___; \
+ index___ = avltree_d2i(diff___); \
+ cur___ = cur___->children[index___]; \
} \
\
- avltree_insert_rebalance(tree, ___prev, ___index, node); \
+ avltree_insert_rebalance(tree, prev___, index___, node); \
MACRO_END
/*
@@ -231,27 +231,27 @@ MACRO_END
*/
#define avltree_lookup_slot(tree, key, cmp_fn, slot) \
MACRO_BEGIN \
- struct avltree_node *___cur, *___prev; \
- int ___diff, ___index; \
+ struct avltree_node *cur___, *prev___; \
+ int diff___, index___; \
\
- ___prev = NULL; \
- ___index = 0; \
- ___cur = (tree)->root; \
+ prev___ = NULL; \
+ index___ = 0; \
+ cur___ = (tree)->root; \
\
- while (___cur != NULL) { \
- ___diff = cmp_fn(key, ___cur); \
+ while (cur___ != NULL) { \
+ diff___ = cmp_fn(key, cur___); \
\
- if (___diff == 0) { \
+ if (diff___ == 0) { \
break; \
} \
\
- ___prev = ___cur; \
- ___index = avltree_d2i(___diff); \
- ___cur = ___cur->children[___index]; \
+ prev___ = cur___; \
+ index___ = avltree_d2i(diff___); \
+ cur___ = cur___->children[index___]; \
} \
\
- (slot) = avltree_slot(___prev, ___index); \
- ___cur; \
+ (slot) = avltree_slot(prev___, index___); \
+ cur___; \
MACRO_END
/*
@@ -326,4 +326,4 @@ for (node = avltree_postwalk_deepest(tree), \
node != NULL; \
node = tmp, tmp = avltree_postwalk_unlink(node))
-#endif /* _AVLTREE_H */
+#endif /* AVLTREE_H */
diff --git a/src/avltree_i.h b/src/avltree_i.h
index 37baa61..8e0ac2a 100644
--- a/src/avltree_i.h
+++ b/src/avltree_i.h
@@ -23,8 +23,8 @@
* http://git.sceen.net/rbraun/librbraun.git/
*/
-#ifndef _AVLTREE_I_H
-#define _AVLTREE_I_H
+#ifndef AVLTREE_I_H
+#define AVLTREE_I_H
#include <assert.h>
#include <stddef.h>
@@ -200,4 +200,4 @@ struct avltree_node * avltree_postwalk_deepest(const struct avltree *tree);
*/
struct avltree_node * avltree_postwalk_unlink(struct avltree_node *node);
-#endif /* _AVLTREE_I_H */
+#endif /* AVLTREE_I_H */
diff --git a/src/bitmap.h b/src/bitmap.h
index 7d5db63..b464228 100644
--- a/src/bitmap.h
+++ b/src/bitmap.h
@@ -29,8 +29,8 @@
* is the responsibility of the caller.
*/
-#ifndef _BITMAP_H
-#define _BITMAP_H
+#ifndef BITMAP_H
+#define BITMAP_H
#include <limits.h>
#include <stdatomic.h>
@@ -211,4 +211,4 @@ for ((bit) = 0; \
&& (((bit) = bitmap_find_next_zero(bm, nr_bits, bit)) != -1); \
(bit)++)
-#endif /* _BITMAP_H */
+#endif /* BITMAP_H */
diff --git a/src/bitmap_i.h b/src/bitmap_i.h
index 2607141..b643d52 100644
--- a/src/bitmap_i.h
+++ b/src/bitmap_i.h
@@ -23,8 +23,8 @@
* http://git.sceen.net/rbraun/librbraun.git/
*/
-#ifndef _BITMAP_I_H
-#define _BITMAP_I_H
+#ifndef BITMAP_I_H
+#define BITMAP_I_H
#include <limits.h>
@@ -66,4 +66,4 @@ bitmap_mask(int bit)
int bitmap_find_next_bit(const unsigned long *bm, int nr_bits, int bit,
int complement);
-#endif /* _BITMAP_I_H */
+#endif /* BITMAP_I_H */
diff --git a/src/cbuf.h b/src/cbuf.h
index 8b46cd4..83975db 100644
--- a/src/cbuf.h
+++ b/src/cbuf.h
@@ -26,8 +26,8 @@
* Circular byte buffer.
*/
-#ifndef _CBUF_H
-#define _CBUF_H
+#ifndef CBUF_H
+#define CBUF_H
#include <stdbool.h>
#include <stddef.h>
@@ -147,4 +147,4 @@ int cbuf_write(struct cbuf *cbuf, size_t index, const void *buf, size_t size);
*/
int cbuf_read(const struct cbuf *cbuf, size_t index, void *buf, size_t *sizep);
-#endif /* _CBUF_H */
+#endif /* CBUF_H */
diff --git a/src/check.h b/src/check.h
index e22a879..4efa917 100644
--- a/src/check.h
+++ b/src/check.h
@@ -23,8 +23,8 @@
* http://git.sceen.net/rbraun/librbraun.git/
*/
-#ifndef _CHECK_H
-#define _CHECK_H
+#ifndef CHECK_H
+#define CHECK_H
#include <stdlib.h>
@@ -44,4 +44,4 @@ MACRO_BEGIN \
} \
MACRO_END
-#endif /* _CHECK_H */
+#endif /* CHECK_H */
diff --git a/src/cpu.h b/src/cpu.h
index 0445a00..2bc2645 100644
--- a/src/cpu.h
+++ b/src/cpu.h
@@ -23,8 +23,8 @@
* http://git.sceen.net/rbraun/librbraun.git/
*/
-#ifndef _CPU_H
-#define _CPU_H
+#ifndef CPU_H
+#define CPU_H
#include <sched.h>
@@ -81,4 +81,4 @@ cpu_id(void)
#endif
}
-#endif /* _CPU_H */
+#endif /* CPU_H */
diff --git a/src/fmt.h b/src/fmt.h
index babaa52..24ca7b0 100644
--- a/src/fmt.h
+++ b/src/fmt.h
@@ -42,8 +42,8 @@
* - specifiers: d i o u x X c s p n %
*/
-#ifndef _FMT_H
-#define _FMT_H
+#ifndef FMT_H
+#define FMT_H
#include <stdarg.h>
#include <stddef.h>
@@ -66,4 +66,4 @@ int fmt_sscanf(const char *str, const char *format, ...)
int fmt_vsscanf(const char *str, const char *format, va_list ap)
__attribute__((format(scanf, 2, 0)));
-#endif /* _FMT_H */
+#endif /* FMT_H */
diff --git a/src/hash.h b/src/hash.h
index 2af2de1..a5b1de0 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -44,8 +44,8 @@
* HASH_ALLBITS macro.
*/
-#ifndef _HASH_H
-#define _HASH_H
+#ifndef HASH_H
+#define HASH_H
#include <assert.h>
#include <stdint.h>
@@ -121,4 +121,4 @@ hash_str(const char *str, unsigned int bits)
return hash & ((1UL << bits) - 1);
}
-#endif /* _HASH_H */
+#endif /* HASH_H */
diff --git a/src/hlist.h b/src/hlist.h
index ec2fba1..1fb4324 100644
--- a/src/hlist.h
+++ b/src/hlist.h
@@ -26,8 +26,8 @@
* Doubly-linked list specialized for forward traversals and O(1) removals.
*/
-#ifndef _HLIST_H
-#define _HLIST_H
+#ifndef HLIST_H
+#define HLIST_H
#include <stdbool.h>
#include <stddef.h>
@@ -218,10 +218,10 @@ hlist_remove(struct hlist_node *node)
*/
#define hlist_first_entry(list, type, member) \
MACRO_BEGIN \
- struct hlist_node *___first; \
+ struct hlist_node *first___; \
\
- ___first = (list)->first; \
- hlist_end(___first) ? NULL : hlist_entry(___first, type, member); \
+ first___ = (list)->first; \
+ hlist_end(first___) ? NULL : hlist_entry(first___, type, member); \
MACRO_END
/*
@@ -229,12 +229,12 @@ MACRO_END
*/
#define hlist_next_entry(entry, member) \
MACRO_BEGIN \
- struct hlist_node *___next; \
+ struct hlist_node *next___; \
\
- ___next = (entry)->member.next; \
- hlist_end(___next) \
+ next___ = (entry)->member.next; \
+ hlist_end(next___) \
? NULL \
- : hlist_entry(___next, typeof(*entry), member); \
+ : hlist_entry(next___, typeof(*entry), member); \
MACRO_END
/*
@@ -380,10 +380,10 @@ hlist_llsync_remove(struct hlist_node *node)
*/
#define hlist_llsync_first_entry(list, type, member) \
MACRO_BEGIN \
- struct hlist_node *___first; \
+ struct hlist_node *first___; \
\
- ___first = hlist_llsync_first(list); \
- hlist_end(___first) ? NULL : hlist_entry(___first, type, member); \
+ first___ = hlist_llsync_first(list); \
+ hlist_end(first___) ? NULL : hlist_entry(first___, type, member); \
MACRO_END
/*
@@ -391,12 +391,12 @@ MACRO_END
*/
#define hlist_llsync_next_entry(entry, member) \
MACRO_BEGIN \
- struct hlist_node *___next; \
+ struct hlist_node *next___; \
\
- ___next = hlist_llsync_next(&entry->member); \
- hlist_end(___next) \
+ next___ = hlist_llsync_next(&entry->member); \
+ hlist_end(next___) \
? NULL \
- : hlist_entry(___next, typeof(*entry), member); \
+ : hlist_entry(next___, typeof(*entry), member); \
MACRO_END
/*
@@ -415,4 +415,4 @@ for (entry = hlist_llsync_first_entry(list, typeof(*entry), member); \
entry != NULL; \
entry = hlist_llsync_next_entry(entry, member))
-#endif /* _HLIST_H */
+#endif /* HLIST_H */
diff --git a/src/list.h b/src/list.h
index 18a2206..895e4cb 100644
--- a/src/list.h
+++ b/src/list.h
@@ -26,8 +26,8 @@
* Doubly-linked list.
*/
-#ifndef _LIST_H
-#define _LIST_H
+#ifndef LIST_H
+#define LIST_H
#include <stdbool.h>
#include <stddef.h>
@@ -505,14 +505,14 @@ list_llsync_remove(struct list *node)
*/
#define list_llsync_first_entry(list, type, member) \
MACRO_BEGIN \
- struct list *___list; \
- struct list *___first; \
+ struct list *list___; \
+ struct list *first___; \
\
- ___list = (list); \
- ___first = list_llsync_first(___list); \
- list_end(___list, ___first) \
+ list___ = (list); \
+ first___ = list_llsync_first(list___); \
+ list_end(list___, first___) \
? NULL \
- : list_entry(___first, type, member); \
+ : list_entry(first___, type, member); \
MACRO_END
/*
@@ -552,4 +552,4 @@ for (entry = list_llsync_entry(list_first(list), \
*/
void list_sort(struct list *list, list_sort_cmp_fn_t cmp_fn);
-#endif /* _LIST_H */
+#endif /* LIST_H */
diff --git a/src/macros.h b/src/macros.h
index 466efd9..beda78d 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -28,8 +28,8 @@
* TODO Improve documentation.
*/
-#ifndef _MACROS_H
-#define _MACROS_H
+#ifndef MACROS_H
+#define MACROS_H
#if !defined(__GNUC__) || (__GNUC__ < 4)
#error "GCC 4+ required"
@@ -101,4 +101,4 @@
#endif /* __GNUC__ >= 7 */
#endif
-#endif /* _MACROS_H */
+#endif /* MACROS_H */
diff --git a/src/plist.h b/src/plist.h
index 9328d27..f648fcc 100644
--- a/src/plist.h
+++ b/src/plist.h
@@ -31,8 +31,8 @@
* among the entries.
*/
-#ifndef _PLIST_H
-#define _PLIST_H
+#ifndef PLIST_H
+#define PLIST_H
#include <stdbool.h>
@@ -293,4 +293,4 @@ for (pnode = plist_last(plist), tmp = plist_prev(pnode); \
#define plist_for_each_entry_reverse_safe(plist, entry, tmp, member) \
list_for_each_entry_reverse_safe(&(plist)->list, entry, tmp, member.node)
-#endif /* _PLIST_H */
+#endif /* PLIST_H */
diff --git a/src/rbtree.h b/src/rbtree.h
index 1838c27..afc8551 100644
--- a/src/rbtree.h
+++ b/src/rbtree.h
@@ -26,8 +26,8 @@
* Red-black tree.
*/
-#ifndef _RBTREE_H
-#define _RBTREE_H
+#ifndef RBTREE_H
+#define RBTREE_H
#include <assert.h>
#include <stddef.h>
@@ -125,22 +125,22 @@ rbtree_empty(const struct rbtree *tree)
*/
#define rbtree_lookup(tree, key, cmp_fn) \
MACRO_BEGIN \
- struct rbtree_node *___cur; \
- int ___diff; \
+ struct rbtree_node *cur___; \
+ int diff___; \
\
- ___cur = (tree)->root; \
+ cur___ = (tree)->root; \
\
- while (___cur != NULL) { \
- ___diff = cmp_fn(key, ___cur); \
+ while (cur___ != NULL) { \
+ diff___ = cmp_fn(key, cur___); \
\
- if (___diff == 0) { \
+ if (diff___ == 0) { \
break; \
} \
\
- ___cur = ___cur->children[rbtree_d2i(___diff)]; \
+ cur___ = cur___->children[rbtree_d2i(diff___)]; \
} \
\
- ___cur; \
+ cur___; \
MACRO_END
/*
@@ -155,30 +155,30 @@ MACRO_END
*/
#define rbtree_lookup_nearest(tree, key, cmp_fn, dir) \
MACRO_BEGIN \
- struct rbtree_node *___cur, *___prev; \
- int ___diff, ___index; \
+ struct rbtree_node *cur___, *prev___; \
+ int diff___, index___; \
\
- ___prev = NULL; \
- ___index = -1; \
- ___cur = (tree)->root; \
+ prev___ = NULL; \
+ index___ = -1; \
+ cur___ = (tree)->root; \
\
- while (___cur != NULL) { \
- ___diff = cmp_fn(key, ___cur); \
+ while (cur___ != NULL) { \
+ diff___ = cmp_fn(key, cur___); \
\
- if (___diff == 0) { \
+ if (diff___ == 0) { \
break; \
} \
\
- ___prev = ___cur; \
- ___index = rbtree_d2i(___diff); \
- ___cur = ___cur->children[___index]; \
+ prev___ = cur___; \
+ index___ = rbtree_d2i(diff___); \
+ cur___ = cur___->children[index___]; \
} \
\
- if (___cur == NULL) { \
- ___cur = rbtree_nearest(___prev, ___index, dir); \
+ if (cur___ == NULL) { \
+ cur___ = rbtree_nearest(prev___, index___, dir); \
} \
\
- ___cur; \
+ cur___; \
MACRO_END
/*
@@ -199,22 +199,22 @@ MACRO_END
*/
#define rbtree_insert(tree, node, cmp_fn) \
MACRO_BEGIN \
- struct rbtree_node *___cur, *___prev; \
- int ___diff, ___index; \
+ struct rbtree_node *cur___, *prev___; \
+ int diff___, index___; \
\
- ___prev = NULL; \
- ___index = -1; \
- ___cur = (tree)->root; \
+ prev___ = NULL; \
+ index___ = -1; \
+ cur___ = (tree)->root; \
\
- while (___cur != NULL) { \
- ___diff = cmp_fn(node, ___cur); \
- assert(___diff != 0); \
- ___prev = ___cur; \
- ___index = rbtree_d2i(___diff); \
- ___cur = ___cur->children[___index]; \
+ while (cur___ != NULL) { \
+ diff___ = cmp_fn(node, cur___); \
+ assert(diff___ != 0); \
+ prev___ = cur___; \
+ index___ = rbtree_d2i(diff___); \
+ cur___ = cur___->children[index___]; \
} \
\
- rbtree_insert_rebalance(tree, ___prev, ___index, node); \
+ rbtree_insert_rebalance(tree, prev___, index___, node); \
MACRO_END
/*
@@ -230,27 +230,27 @@ MACRO_END
*/
#define rbtree_lookup_slot(tree, key, cmp_fn, slot) \
MACRO_BEGIN \
- struct rbtree_node *___cur, *___prev; \
- int ___diff, ___index; \
+ struct rbtree_node *cur___, *prev___; \
+ int diff___, index___; \
\
- ___prev = NULL; \
- ___index = 0; \
- ___cur = (tree)->root; \
+ prev___ = NULL; \
+ index___ = 0; \
+ cur___ = (tree)->root; \
\
- while (___cur != NULL) { \
- ___diff = cmp_fn(key, ___cur); \
+ while (cur___ != NULL) { \
+ diff___ = cmp_fn(key, cur___); \
\
- if (___diff == 0) { \
+ if (diff___ == 0) { \
break; \
} \
\
- ___prev = ___cur; \
- ___index = rbtree_d2i(___diff); \
- ___cur = ___cur->children[___index]; \
+ prev___ = cur___; \
+ index___ = rbtree_d2i(diff___); \
+ cur___ = cur___->children[index___]; \
} \
\
- (slot) = rbtree_slot(___prev, ___index); \
- ___cur; \
+ (slot) = rbtree_slot(prev___, index___); \
+ cur___; \
MACRO_END
/*
@@ -325,4 +325,4 @@ for (node = rbtree_postwalk_deepest(tree), \
node != NULL; \
node = tmp, tmp = rbtree_postwalk_unlink(node))
-#endif /* _RBTREE_H */
+#endif /* RBTREE_H */
diff --git a/src/rbtree_i.h b/src/rbtree_i.h
index f794373..c5000bf 100644
--- a/src/rbtree_i.h
+++ b/src/rbtree_i.h
@@ -23,8 +23,8 @@
* http://git.sceen.net/rbraun/librbraun.git/
*/
-#ifndef _RBTREE_I_H
-#define _RBTREE_I_H
+#ifndef RBTREE_I_H
+#define RBTREE_I_H
#include <assert.h>
#include <stddef.h>
@@ -194,4 +194,4 @@ struct rbtree_node * rbtree_postwalk_deepest(const struct rbtree *tree);
*/
struct rbtree_node * rbtree_postwalk_unlink(struct rbtree_node *node);
-#endif /* _RBTREE_I_H */
+#endif /* RBTREE_I_H */
diff --git a/src/rdxtree.h b/src/rdxtree.h
index 24e8c0a..97a96ee 100644
--- a/src/rdxtree.h
+++ b/src/rdxtree.h
@@ -29,8 +29,8 @@
* can allocate keys for the caller at insertion time.
*/
-#ifndef _RDXTREE_H
-#define _RDXTREE_H
+#ifndef RDXTREE_H
+#define RDXTREE_H
#include <stddef.h>
#include <stdint.h>
@@ -221,4 +221,4 @@ rdxtree_iter_key(const struct rdxtree_iter *iter)
*/
void rdxtree_remove_all(struct rdxtree *tree);
-#endif /* _RDXTREE_H */
+#endif /* RDXTREE_H */
diff --git a/src/rdxtree_i.h b/src/rdxtree_i.h
index 99b9f9c..fabf17f 100644
--- a/src/rdxtree_i.h
+++ b/src/rdxtree_i.h
@@ -23,8 +23,8 @@
* http://git.sceen.net/rbraun/librbraun.git/
*/
-#ifndef _RDXTREE_I_H
-#define _RDXTREE_I_H
+#ifndef RDXTREE_I_H
+#define RDXTREE_I_H
/*
* Radix tree.
@@ -68,4 +68,4 @@ void * rdxtree_lookup_common(const struct rdxtree *tree, rdxtree_key_t key,
void * rdxtree_walk(struct rdxtree *tree, struct rdxtree_iter *iter);
-#endif /* _RDXTREE_I_H */
+#endif /* RDXTREE_I_H */
diff --git a/src/shell.h b/src/shell.h
index 54a3b7a..57439b1 100644
--- a/src/shell.h
+++ b/src/shell.h
@@ -26,8 +26,8 @@
* Minimalist shell for embedded systems.
*/
-#ifndef _SHELL_H
-#define _SHELL_H
+#ifndef SHELL_H
+#define SHELL_H
#include <stddef.h>
#include <stdio.h>
@@ -38,14 +38,14 @@
#define SHELL_REGISTER_CMDS(cmds) \
MACRO_BEGIN \
- size_t ___i; \
- int ___error; \
+ size_t i___; \
+ int error___; \
\
- for (___i = 0; ___i < ARRAY_SIZE(cmds); ___i++) { \
- ___error = shell_cmd_register(&(cmds)[___i]); \
+ for (i___ = 0; i___ < ARRAY_SIZE(cmds); i___++) { \
+ error___ = shell_cmd_register(&(cmds)[i___]); \
\
- if (___error) { \
- fprintf(stderr, "%s: %s\n", __func__, strerror(___error)); \
+ if (error___) { \
+ fprintf(stderr, "%s: %s\n", __func__, strerror(error___)); \
abort(); \
} \
} \
@@ -103,4 +103,4 @@ int shell_cmd_register(struct shell_cmd *cmd);
*/
void shell_run(void);
-#endif /* _SHELL_H */
+#endif /* SHELL_H */
diff --git a/src/slist.h b/src/slist.h
index f6138e2..a53bbf3 100644
--- a/src/slist.h
+++ b/src/slist.h
@@ -26,8 +26,8 @@
* Singly-linked list.
*/
-#ifndef _SLIST_H
-#define _SLIST_H
+#ifndef SLIST_H
+#define SLIST_H
#include <stdbool.h>
#include <stddef.h>
@@ -240,10 +240,10 @@ slist_remove(struct slist *list, struct slist_node *prev)
*/
#define slist_first_entry(list, type, member) \
MACRO_BEGIN \
- struct slist_node *___first; \
+ struct slist_node *first___; \
\
- ___first = (list)->first; \
- slist_end(___first) ? NULL : slist_entry(___first, type, member); \
+ first___ = (list)->first; \
+ slist_end(first___) ? NULL : slist_entry(first___, type, member); \
MACRO_END
/*
@@ -251,10 +251,10 @@ MACRO_END
*/
#define slist_last_entry(list, type, member) \
MACRO_BEGIN \
- struct slist_node *___last; \
+ struct slist_node *last___; \
\
- ___last = (list)->last; \
- slist_end(___last) ? NULL : slist_entry(___last, type, member); \
+ last___ = (list)->last; \
+ slist_end(last___) ? NULL : slist_entry(last___, type, member); \
MACRO_END
/*
@@ -262,12 +262,12 @@ MACRO_END
*/
#define slist_next_entry(entry, member) \
MACRO_BEGIN \
- struct slist_node *___next; \
+ struct slist_node *next___; \
\
- ___next = (entry)->member.next; \
- slist_end(___next) \
+ next___ = (entry)->member.next; \
+ slist_end(next___) \
? NULL \
- : slist_entry(___next, typeof(*entry), member); \
+ : slist_entry(next___, typeof(*entry), member); \
MACRO_END
/*
@@ -430,10 +430,10 @@ slist_llsync_remove(struct slist *list, struct slist_node *prev)
*/
#define slist_llsync_first_entry(list, type, member) \
MACRO_BEGIN \
- struct slist_node *___first; \
+ struct slist_node *first___; \
\
- ___first = slist_llsync_first(list); \
- slist_end(___first) ? NULL : slist_entry(___first, type, member); \
+ first___ = slist_llsync_first(list); \
+ slist_end(first___) ? NULL : slist_entry(first___, type, member); \
MACRO_END
/*
@@ -441,12 +441,12 @@ MACRO_END
*/
#define slist_llsync_next_entry(entry, member) \
MACRO_BEGIN \
- struct slist_node *___next; \
+ struct slist_node *next___; \
\
- ___next = slist_llsync_next(&entry->member); \
- slist_end(___next) \
+ next___ = slist_llsync_next(&entry->member); \
+ slist_end(next___) \
? NULL \
- : slist_entry(___next, typeof(*entry), member); \
+ : slist_entry(next___, typeof(*entry), member); \
MACRO_END
/*
@@ -465,4 +465,4 @@ for (entry = slist_llsync_first_entry(list, typeof(*entry), member); \
entry != NULL; \
entry = slist_llsync_next_entry(entry, member))
-#endif /* _SLIST_H */
+#endif /* SLIST_H */