Commit e090c797bbed755ac3bc8e0b6e76493817d57450

Authored by Georg Hopp
1 parent ae5751fe

finalize definition and initialization macro for for cclass and add -Wall to all Makefiles

... ... @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4
3 3 bin_PROGRAMS = create_token
4 4 create_token_SOURCES = base64.c createToken.c
5 5 create_token_LDADD = src/libtoken.la $(LIBOBJS)
6   -create_token_CFLAGS = -I include
  6 +create_token_CFLAGS = -Wall -I include
7 7
8 8 EXTRA_DIST = base64.h
9 9
... ...
... ... @@ -242,7 +242,7 @@ top_srcdir = @top_srcdir@
242 242 ACLOCAL_AMFLAGS = -I m4
243 243 create_token_SOURCES = base64.c createToken.c
244 244 create_token_LDADD = src/libtoken.la $(LIBOBJS)
245   -create_token_CFLAGS = -I include
  245 +create_token_CFLAGS = -Wall -I include
246 246 EXTRA_DIST = base64.h
247 247 SUBDIRS = src include tests
248 248 all: config.h
... ...
... ... @@ -41,7 +41,7 @@
41 41 (jCtor)jsonConst, \
42 42 (dtor)__destruct, \
43 43 (jTo)toJson \
44   - }; const _CCLASS const __##class = &_class
  44 + }; const _CCLASS const __##class = (const _CCLASS const)&_class
45 45
46 46
47 47
... ... @@ -62,12 +62,12 @@ typedef struct CCLASS {
62 62 #define CCLASS_PTR_SIZE sizeof(struct CCLASS *)
63 63 #define CCLASS_SIZE sizeof(struct CCLASS)
64 64
65   -void * _new(const void * _class, ...);
66   -void * _newFromJson(const void * _class, struct json_object * json);
  65 +void * _new(const _CCLASS _class, ...);
  66 +void * _newFromJson(const _CCLASS _class, struct json_object * json);
67 67 void delete(void * _object);
68 68 struct json_object * toJson(void * _object);
69 69 int isObject(void * _object);
70   -int _instanceOf(const void * _class, void * _object);
  70 +int _instanceOf(const _CCLASS _class, void * _object);
71 71
72 72 #define new(class, ...) _new((__##class), __VA_ARGS__)
73 73 #define newFromJson(class, json) _newFromJson((__##class), (json))
... ...
... ... @@ -2,5 +2,5 @@ ACLOCAL_AMFLAGS = -I m4
2 2
3 3 lib_LTLIBRARIES = libtoken.la
4 4 libtoken_la_SOURCES = cclass.c crypt.c dyntype.c dyntype/hash.c packet.c
5   -libtoken_la_CFLAGS = -I ../include
  5 +libtoken_la_CFLAGS = -Wall -I ../include
6 6 libtoken_la_LDFLAGS = -version-info 0:0:0
... ...
... ... @@ -209,7 +209,7 @@ top_srcdir = @top_srcdir@
209 209 ACLOCAL_AMFLAGS = -I m4
210 210 lib_LTLIBRARIES = libtoken.la
211 211 libtoken_la_SOURCES = cclass.c crypt.c dyntype.c dyntype/hash.c packet.c
212   -libtoken_la_CFLAGS = -I ../include
  212 +libtoken_la_CFLAGS = -Wall -I ../include
213 213 libtoken_la_LDFLAGS = -version-info 0:0:0
214 214 all: all-am
215 215
... ...
... ... @@ -24,7 +24,7 @@
24 24
25 25
26 26 void *
27   -_new(const void * _class, ...)
  27 +_new(const _CCLASS _class, ...)
28 28 {
29 29 const _CCLASS class = _class;
30 30 void * object = calloc(1, class->size);
... ... @@ -43,7 +43,7 @@ _new(const void * _class, ...)
43 43 }
44 44
45 45 void *
46   -_newFromJson(const void * _class, struct json_object * json)
  46 +_newFromJson(const _CCLASS _class, struct json_object * json)
47 47 {
48 48 const struct CCLASS * class = _class;
49 49 void * object = calloc(1, class->size);
... ... @@ -91,7 +91,7 @@ isObject(void * _object)
91 91 }
92 92
93 93 int
94   -_instanceOf(const void * _class, void * _object)
  94 +_instanceOf(const _CCLASS _class, void * _object)
95 95 {
96 96 const struct CCLASS ** class = _object;
97 97
... ...
... ... @@ -6,14 +6,14 @@ check_PROGRAMS = cclassTest cryptTest packetTest
6 6
7 7 cclassTest_SOURCES = runtest.c cclassTest.c mock/class.c ../src/cclass.c
8 8 cclassTest_LDADD = $(LIBOBJS)
9   -cclassTest_CFLAGS = -I ../include -I .. -I .
  9 +cclassTest_CFLAGS = -Wall -I ../include -I .. -I .
10 10
11 11 cryptTest_SOURCES = runtest.c cryptTest.c ../src/cclass.c ../src/crypt.c
12 12 cryptTest_LDADD = $(LIBOBJS)
13   -cryptTest_CFLAGS = -I ../include -I .. -I .
  13 +cryptTest_CFLAGS = -Wall -I ../include -I .. -I .
14 14
15 15 packetTest_SOURCES = runtest.c packetTest.c ../src/cclass.c ../src/packet.c ../src/dyntype.c ../src/dyntype/hash.c
16 16 packetTest_LDADD = $(LIBOBJS)
17   -packetTest_CFLAGS = -I ../include -I .. -I .
  17 +packetTest_CFLAGS = -Wall -I ../include -I .. -I .
18 18
19 19 EXTRA_DIST = runtest.h mock/class.h
... ...
... ... @@ -210,13 +210,13 @@ ACLOCAL_AMFLAGS = -I m4
210 210 TESTS_ENVIRONMENT = valgrind --error-exitcode=123 --leak-check=full --quiet
211 211 cclassTest_SOURCES = runtest.c cclassTest.c mock/class.c ../src/cclass.c
212 212 cclassTest_LDADD = $(LIBOBJS)
213   -cclassTest_CFLAGS = -I ../include -I .. -I .
  213 +cclassTest_CFLAGS = -Wall -I ../include -I .. -I .
214 214 cryptTest_SOURCES = runtest.c cryptTest.c ../src/cclass.c ../src/crypt.c
215 215 cryptTest_LDADD = $(LIBOBJS)
216   -cryptTest_CFLAGS = -I ../include -I .. -I .
  216 +cryptTest_CFLAGS = -Wall -I ../include -I .. -I .
217 217 packetTest_SOURCES = runtest.c packetTest.c ../src/cclass.c ../src/packet.c ../src/dyntype.c ../src/dyntype/hash.c
218 218 packetTest_LDADD = $(LIBOBJS)
219   -packetTest_CFLAGS = -I ../include -I .. -I .
  219 +packetTest_CFLAGS = -Wall -I ../include -I .. -I .
220 220 EXTRA_DIST = runtest.h mock/class.h
221 221 all: all-am
222 222
... ...
Please register or login to post a comment