stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/include/etlib dllist.h generic.h ...


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/include/etlib dllist.h generic.h ...
Date: 22 Dec 2003 12:36:27 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       03/12/22 12:36:27

Modified files:
        src/include/etlib: dllist.h generic.h hash.h xmalloc.h 

Log message:
        Tabs cleanup

Patches:
Index: stratagus/src/include/etlib/dllist.h
diff -u stratagus/src/include/etlib/dllist.h:1.7 
stratagus/src/include/etlib/dllist.h:1.8
--- stratagus/src/include/etlib/dllist.h:1.7    Thu Sep 18 21:59:21 2003
+++ stratagus/src/include/etlib/dllist.h        Mon Dec 22 12:36:26 2003
@@ -1,8 +1,8 @@
 /**
-**     @author Copyright by Edgar Toernig.
-**     @name   dllist.h                -       Double linked lists.
+**  @author Copyright by Edgar Toernig.
+**  @name   dllist.h - Double linked lists.
 **
-*      $Id: dllist.h,v 1.7 2003/09/18 11:59:21 mr-russ Exp $
+**  $Id: dllist.h,v 1.8 2003/12/22 01:36:26 wizzard Exp $
 */
 
 #ifndef ETLIB_DLLIST_H
@@ -12,50 +12,49 @@
 
 struct dl_node
 {
-    struct dl_node *next;
-    struct dl_node *prev;
+       struct dl_node* next;
+       struct dl_node* prev;
 };
 
 struct dl_head
 {
-    struct dl_node *first;
-    struct dl_node *null;
-    struct dl_node *last;
+       struct dl_node* first;
+       struct dl_node* null;
+       struct dl_node* last;
 };
 
-static inline struct dl_head *
-dl_init(struct dl_head *h)
+static inline struct dl_head*
+dl_init(struct dl_head* h)
 {
-    h->first = (struct dl_node *)&h->null;
-    h->null = 0;
-    h->last = (struct dl_node *)&h->first;
-    return h;
+       h->first = (struct dl_node*)&h->null;
+       h->null = 0;
+       h->last = (struct dl_node*)&h->first;
+       return h;
 }
 
-static inline struct dl_node *
-dl_remove(struct dl_node *n)
+static inline struct dl_node*
+dl_remove(struct dl_node* n)
 {
-    n->prev->next = n->next;
-    n->next->prev = n->prev;
-    return n;
+       n->prev->next = n->next;
+       n->next->prev = n->prev;
+       return n;
 }
 
-static inline struct dl_node *
-dl_insert_after(struct dl_node *p, struct dl_node *n)
+static inline struct dl_node*
+dl_insert_after(struct dl_node* p, struct dl_node* n)
 {
-    n->next = p->next;
-    n->prev = p;
-    p->next = n;
-    n->next->prev = n;
-    return n;
+       n->next = p->next;
+       n->prev = p;
+       p->next = n;
+       n->next->prev = n;
+       return n;
 }
 
-       /* A constructor for static list heads. */
-#define DL_LIST(id)    struct dl_head id[1] = {{               \
-                           (struct dl_node *)&id[0].null,      \
-                           0,                                  \
-                           (struct dl_node *)&id[0].first      \
-                       }}
+/* A constructor for static list heads. */
+#define DL_LIST(id) struct dl_head id[1] = {{ \
+       (struct dl_node *)&id[0].null, 0,\
+       (struct dl_node *)&id[0].first \
+       }}
 
 #define dl_empty(h)             ((h)->first->next == 0)
 #define dl_insert_before(p, n)  dl_insert_after((p)->prev, (n))
Index: stratagus/src/include/etlib/generic.h
diff -u stratagus/src/include/etlib/generic.h:1.6 
stratagus/src/include/etlib/generic.h:1.7
--- stratagus/src/include/etlib/generic.h:1.6   Mon Nov 19 04:14:49 2001
+++ stratagus/src/include/etlib/generic.h       Mon Dec 22 12:36:27 2003
@@ -1,10 +1,10 @@
 #ifndef ETLIB_GENERIC_H
 #define ETLIB_GENERIC_H
 
-#define NELEM(x) ((int)(sizeof(x)/sizeof(*(x))))
+#define NELEM(x)    ((int)(sizeof(x)/sizeof(*(x))))
 #define NORETURN(x) void x __attribute__((__noreturn__))
-#define DEFINE(x) typeof(x) x
-#define OFFSET_OF(type, elem) ((u8 *)&((type *)0)->elem - (u8 *)0)
+#define DEFINE(x)   typeof(x) x
+#define OFFSET_OF(type, elem)  ((u8 *)&((type *)0)->elem - (u8 *)0)
 #define BASE_OF(type, elem, p) ((type *)((u8 *)(p) - OFFSET_OF(type, elem)))
 
 #define not !
@@ -24,7 +24,7 @@
 #define min(a,b) ({ typeof(a) _a = a; typeof(b) _b = b; _a < _b ? _a : _b; })
 #else
 #define min min
-static inline min(int a,int b) { return a<b ? a : b; }
+static inline min(int a, int b) { return a < b ? a : b; }
 #endif
 #endif
 
@@ -33,23 +33,25 @@
 #define max(a,b) ({ typeof(a) _a = a; typeof(b) _b = b; _a > _b ? _a : _b; })
 #else
 #define max max
-static inline max(int a,int b) { return a>b ? a : b; }
+static inline max(int a, int b) { return a > b ? a : b; }
 #endif
 #endif
 
 #ifdef __GNUC__
 #define bound(a,b,c) ({ typeof(a) _a = a; typeof(b) _b = b; typeof(c) _c = c; \
-                       _b < _a ? _a : _b > _c ? _c : _b; })
+       _b < _a ? _a : _b > _c ? _c : _b; })
 #else
-//#warning "// FIXME: bound not written!"
+#if 0
+#warning "// FIXME: bound not written!"
+#endif
 #endif
 
-typedef unsigned char u8;
+typedef unsigned char  u8;
 typedef unsigned short u16;
-typedef unsigned long u32;
+typedef unsigned long  u32;
 
-typedef signed char s8;
+typedef signed char  s8;
 typedef signed short s16;
-typedef signed long s32;
+typedef signed long  s32;
 
 #endif /* ETLIB_GENERIC_H */
Index: stratagus/src/include/etlib/hash.h
diff -u stratagus/src/include/etlib/hash.h:1.6 
stratagus/src/include/etlib/hash.h:1.7
--- stratagus/src/include/etlib/hash.h:1.6      Tue Aug 20 04:12:40 2002
+++ stratagus/src/include/etlib/hash.h  Mon Dec 22 12:36:27 2003
@@ -7,10 +7,10 @@
 
 struct hash_st
 {
-    int nelem;
-    int hashsize;
-    int maxdepth;
-    int middepth;
+       int nelem;
+       int hashsize;
+       int maxdepth;
+       int middepth;
 };
 
 #ifdef _MSC_VER
@@ -19,45 +19,44 @@
 typedef struct { } hash_no_data;
 #endif
 
-extern void *_hash_get(const u8 *id, void *table, int size, int usize);
-extern const void *_hash_find(const u8 *id, const void *table, int size, int 
usize);
-extern void  _hash_del(const u8 *id, void *table, int size, int usize);
-extern void _hash_stat(void *table, int size, struct hash_st *stat_buffer);
+extern void* _hash_get(const u8* id, void* table, int size, int usize);
+extern const void* _hash_find(const u8* id, const void* table, int size, int 
usize);
+extern void  _hash_del(const u8* id, void* table, int size, int usize);
+extern void  _hash_stat(void* table, int size, struct hash_st* stat_buffer);
 
-#ifdef __GNUC__                        // { GNU feature
+#ifdef __GNUC__  // { GNU feature
 
-#define hash_get(tab, id)      (typeof((tab).table[0]->user)*) \
-    _hash_get(id, (tab).table, NELEM((tab).table), 
sizeof((tab).table[0]->user))
+#define hash_get(tab, id)  (typeof((tab).table[0]->user)*) \
+       _hash_get(id, (tab).table, NELEM((tab).table), 
sizeof((tab).table[0]->user))
 
-#define hash_find(tab, id)     (typeof((tab).table[0]->user)*) \
-    _hash_find(id,(tab).table, NELEM((tab).table), 
sizeof((tab).table[0]->user))
+#define hash_find(tab, id)  (typeof((tab).table[0]->user)*) \
+       _hash_find(id,(tab).table, NELEM((tab).table), 
sizeof((tab).table[0]->user))
 
-#else                          // }{ GNU feature
+#else // }{ GNU feature
 
-#define hash_get(tab, id)      _hash_get(id, (tab).table, NELEM((tab).table), 
sizeof((tab).table[0]->user))
+#define hash_get(tab, id)  _hash_get(id, (tab).table, NELEM((tab).table), 
sizeof((tab).table[0]->user))
 
-#define hash_find(tab, id)     _hash_find(id,(tab).table, NELEM((tab).table), 
sizeof((tab).table[0]->user))
+#define hash_find(tab, id)  _hash_find(id,(tab).table, NELEM((tab).table), 
sizeof((tab).table[0]->user))
 
-#endif                         // } !GNU feature
+#endif // } !GNU feature
 
-#define hash_del(tab, id)      \
-    _hash_del(id, (tab).table, NELEM((tab).table), 
sizeof((tab).table[0]->user))
+#define hash_del(tab, id) \
+       _hash_del(id, (tab).table, NELEM((tab).table), 
sizeof((tab).table[0]->user))
 
-#define hash_name(tab, sym) (((u8 *)sym) + sizeof((tab).table[0]->user) + 1)
+#define hash_name(tab, sym) (((u8*)sym) + sizeof((tab).table[0]->user) + 1)
 
 #define hash_stat(tab, st) _hash_stat((tab).table, NELEM((tab).table), st)
 
 #define hash_add(tab, id) hash_get(tab, id)
 
-#define hashtable(type, size) struct   \
-{                                      \
-    struct                             \
-    {                                  \
-       void *left;                     \
-       void *right;                    \
-       type user;                      \
-       u8 name[2];                     \
-    } *table[size];                    \
+#define hashtable(type, size) struct \
+{ \
+       struct { \
+       void* left; \
+       void* right; \
+       type user; \
+       u8 name[2]; \
+       } *table[size]; \
 }
 
 #endif /* ETLIB_HASH_H */
Index: stratagus/src/include/etlib/xmalloc.h
diff -u stratagus/src/include/etlib/xmalloc.h:1.3 
stratagus/src/include/etlib/xmalloc.h:1.4
--- stratagus/src/include/etlib/xmalloc.h:1.3   Sat Jul 28 08:37:35 2001
+++ stratagus/src/include/etlib/xmalloc.h       Mon Dec 22 12:36:27 2003
@@ -4,10 +4,10 @@
 #include <sys/types.h>
 #endif
 
-extern void *xmalloc(size_t size);
-extern void *xcalloc(size_t nelem, size_t elem_size);
-extern void *xrealloc(void *ptr, size_t new_size);
-extern void *xfree(void *ptr);
-extern void *xstrdup(void *str);
+extern void* xmalloc(size_t size);
+extern void* xcalloc(size_t nelem, size_t elem_size);
+extern void* xrealloc(void* ptr, size_t new_size);
+extern void* xfree(void* ptr);
+extern void* xstrdup(void* str);
 
 #endif /* ETLIB_XMALLOC_H */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]