summaryrefslogtreecommitdiff
path: root/testing/misc_tools.h
diff options
context:
space:
mode:
authorKonstantin Kowalski <kostyakow42@gmail.com>2013-08-09 15:45:34 +0000
committerKonstantin Kowalski <kostyakow42@gmail.com>2013-08-09 15:45:34 +0000
commit4f2ecd20e9de4305bdf37f1205966bb7db7588e7 (patch)
tree49769e5079924d14481089c3b6c1cfb424efc825 /testing/misc_tools.h
parent5f41c30d66f0902d5151663da67c7d6a9995c098 (diff)
Minor style changes.
Diffstat (limited to 'testing/misc_tools.h')
-rw-r--r--testing/misc_tools.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/testing/misc_tools.h b/testing/misc_tools.h
index 550465f4..27174592 100644
--- a/testing/misc_tools.h
+++ b/testing/misc_tools.h
@@ -24,7 +24,7 @@
24#ifndef MISC_TOOLS_H 24#ifndef MISC_TOOLS_H
25#define MISC_TOOLS_H 25#define MISC_TOOLS_H
26 26
27unsigned char * hex_string_to_bin(char hex_string[]); 27unsigned char* hex_string_to_bin(char hex_string[]);
28 28
29/*********************Debugging Macros******************** 29/*********************Debugging Macros********************
30 * wiki.tox.im/index.php/Internal_functions_and_data_structures#Debugging 30 * wiki.tox.im/index.php/Internal_functions_and_data_structures#Debugging
@@ -82,12 +82,14 @@ typedef struct tox_list {
82} tox_list_t; 82} tox_list_t;
83 83
84/* Returns a new tox_list_t. */ 84/* Returns a new tox_list_t. */
85static inline void tox_list_new(tox_list_t* lst) { 85static inline void tox_list_new(tox_list_t* lst)
86{
86 lst->prev = lst->next = lst; 87 lst->prev = lst->next = lst;
87} 88}
88 89
89/* Inserts a new tox_lst after lst and returns it. */ 90/* Inserts a new tox_lst after lst and returns it. */
90static inline void tox_list_add(tox_list_t* lst, tox_list_t* new_lst) { 91static inline void tox_list_add(tox_list_t* lst, tox_list_t* new_lst)
92{
91 tox_list_new(new_lst); 93 tox_list_new(new_lst);
92 94
93 new_lst->next = lst->next; 95 new_lst->next = lst->next;
@@ -97,10 +99,8 @@ static inline void tox_list_add(tox_list_t* lst, tox_list_t* new_lst) {
97 new_lst->prev = lst; 99 new_lst->prev = lst;
98} 100}
99 101
100static inline void tox_list_remove(tox_list_t* lst) { 102static inline void tox_list_remove(tox_list_t* lst)
101#ifdef DEBUG /* TODO: check how debugging is done in Tox. */ 103{
102 assert(lst->next != lst && lst->prev != lst);
103#endif
104 lst->prev->next = lst->next; 104 lst->prev->next = lst->next;
105 lst->next->prev = lst->prev; 105 lst->next->prev = lst->prev;
106} 106}