Permalink
Browse files

refactoring types auxiliary functions.

  • Loading branch information...
1 parent cf0acae commit 22de40c9d92d7dfe9814b557c7c8405e7d5d12e2 @activesys committed May 4, 2012
View
@@ -979,3 +979,21 @@ on ActiveSys
config.status:1077: creating test/ut/Makefile
config.status:1305: executing depfiles commands
+
+## ---------------------- ##
+## Running config.status. ##
+## ---------------------- ##
+
+This file was extended by libcstl config.status 2.0.3, which was
+generated by GNU Autoconf 2.66. Invocation command line was
+
+ CONFIG_FILES =
+ CONFIG_HEADERS =
+ CONFIG_LINKS =
+ CONFIG_COMMANDS =
+ $ ./config.status test/ut/Makefile depfiles
+
+on ActiveSys
+
+config.status:1077: creating test/ut/Makefile
+config.status:1305: executing depfiles commands
View
@@ -83,10 +83,10 @@ void list_init_n(list_t* plist_list, size_t t_count)
plist_list->_pt_node->_pt_prev = plist_list->_pt_node;
if (t_count > 0) {
- size_t t_index = 0;
+ size_t i = 0;
_listnode_t* pt_node = NULL;
- for (t_index = 0; t_index < t_count; ++t_index) {
+ for (i = 0; i < t_count; ++i) {
pt_node = _alloc_allocate(&plist_list->_t_allocator, _LIST_NODE_SIZE(_GET_LIST_TYPE_SIZE(plist_list)), 1);
assert(pt_node != NULL);
_list_init_node_auxiliary(plist_list, pt_node);
View
@@ -125,11 +125,14 @@ _typeregister_t _gt_typeregister = {false, {NULL}, {0}};
size_t _type_hash(const char* s_typename)
{
size_t t_namesum = 0;
- size_t t_namelen = strlen(s_typename);
- size_t t_i = 0;
+ size_t t_namelen = 0;
+ size_t i = 0;
- for (t_i = 0; t_i < t_namelen; ++t_i) {
- t_namesum += (size_t)s_typename[t_i];
+ assert(s_typename != NULL);
+
+ t_namelen = strlen(s_typename);
+ for (i = 0; i < t_namelen; ++i) {
+ t_namesum += (size_t)s_typename[i];
}
return t_namesum % _TYPE_REGISTER_BUCKET_COUNT;
@@ -143,21 +146,21 @@ _type_t* _type_is_registered(const char* s_typename)
_type_t* pt_registered = NULL;
_typenode_t* pt_node = NULL;
+ assert(s_typename != NULL);
+
if (strlen(s_typename) > _TYPE_NAME_SIZE) {
return NULL;
}
/* get the registered type pointer */
pt_node = _gt_typeregister._apt_bucket[_type_hash(s_typename)];
- if (pt_node != NULL) {
- while (pt_node != NULL) {
- if (strncmp(s_typename, pt_node->_sz_typename, _TYPE_NAME_SIZE) == 0) {
- pt_registered = pt_node->_pt_type;
- assert(pt_registered != NULL);
- break;
- } else {
- pt_node = pt_node->_pt_next;
- }
+ while (pt_node != NULL) {
+ if (strncmp(s_typename, pt_node->_sz_typename, _TYPE_NAME_SIZE) == 0) {
+ pt_registered = pt_node->_pt_type;
+ assert(pt_registered != NULL);
+ break;
+ } else {
+ pt_node = pt_node->_pt_next;
}
}
@@ -169,11 +172,11 @@ _type_t* _type_is_registered(const char* s_typename)
*/
void _type_init(void)
{
- size_t t_i = 0;
+ size_t i = 0;
/* set register hash table */
- for (t_i = 0; t_i < _TYPE_REGISTER_BUCKET_COUNT; ++t_i) {
- _gt_typeregister._apt_bucket[t_i] = NULL;
+ for (i = 0; i < _TYPE_REGISTER_BUCKET_COUNT; ++i) {
+ _gt_typeregister._apt_bucket[i] = NULL;
}
/* init allocator */
_alloc_init(&_gt_typeregister._t_allocator);
@@ -236,7 +239,7 @@ void _type_register_c_builtin(void)
/* register bool_t */
_TYPE_REGISTER_TYPE(bool_t, _BOOL_TYPE, bool);
_TYPE_REGISTER_TYPE_NODE(bool_t, _BOOL_TYPE);
- /* register char* */
+ /* register char* */
_TYPE_REGISTER_TYPE(string_t, _C_STRING_TYPE, cstr);
_TYPE_REGISTER_TYPE_NODE(string_t, _C_STRING_TYPE);
View
@@ -210,7 +210,8 @@ am_libcstl_ut_OBJECTS = libcstl_ut-ut_main.$(OBJEXT) \
libcstl_ut-ut_cstl_iterator_private.$(OBJEXT) \
libcstl_ut-ut_cstl_iterator.$(OBJEXT) \
libcstl_ut-ut_cstl_types_builtin.$(OBJEXT) \
- libcstl_ut-ut_cstl_types_parse.$(OBJEXT)
+ libcstl_ut-ut_cstl_types_parse.$(OBJEXT) \
+ libcstl_ut-ut_cstl_types_aux.$(OBJEXT)
libcstl_ut_OBJECTS = $(am_libcstl_ut_OBJECTS)
libcstl_ut_LDADD = $(LDADD)
libcstl_ut_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -471,7 +472,8 @@ libcstl_ut_SOURCES = ut_main.c ut_def.c ut_def.h \
ut_cstl_iterator_private.c ut_cstl_iterator_private.h \
ut_cstl_iterator.c ut_cstl_iterator.h \
ut_cstl_types_builtin.c ut_cstl_types_builtin.h \
- ut_cstl_types_parse.c ut_cstl_types_parse.h
+ ut_cstl_types_parse.c ut_cstl_types_parse.h \
+ ut_cstl_types_aux.c ut_cstl_types_aux.h
libcstl_ut_CPPFLAGS = -D_CSTL_UNIT_TESTING -I$(srcdir)/../.. -I$(srcdir)/../../src
libcstl_ut_LDFLAGS = -lcmockery
@@ -691,6 +693,7 @@ include ./$(DEPDIR)/libcstl_ut-ut_cstl_stack.Po
include ./$(DEPDIR)/libcstl_ut-ut_cstl_stack_private.Po
include ./$(DEPDIR)/libcstl_ut-ut_cstl_string.Po
include ./$(DEPDIR)/libcstl_ut-ut_cstl_string_private.Po
+include ./$(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Po
include ./$(DEPDIR)/libcstl_ut-ut_cstl_types_builtin.Po
include ./$(DEPDIR)/libcstl_ut-ut_cstl_types_parse.Po
include ./$(DEPDIR)/libcstl_ut-ut_cstl_vector.Po
@@ -3087,6 +3090,20 @@ libcstl_ut-ut_cstl_types_parse.obj: ut_cstl_types_parse.c
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcstl_ut_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcstl_ut-ut_cstl_types_parse.obj `if test -f 'ut_cstl_types_parse.c'; then $(CYGPATH_W) 'ut_cstl_types_parse.c'; else $(CYGPATH_W) '$(srcdir)/ut_cstl_types_parse.c'; fi`
+libcstl_ut-ut_cstl_types_aux.o: ut_cstl_types_aux.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcstl_ut_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcstl_ut-ut_cstl_types_aux.o -MD -MP -MF $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Tpo -c -o libcstl_ut-ut_cstl_types_aux.o `test -f 'ut_cstl_types_aux.c' || echo '$(srcdir)/'`ut_cstl_types_aux.c
+ $(am__mv) $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Tpo $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Po
+# source='ut_cstl_types_aux.c' object='libcstl_ut-ut_cstl_types_aux.o' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcstl_ut_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcstl_ut-ut_cstl_types_aux.o `test -f 'ut_cstl_types_aux.c' || echo '$(srcdir)/'`ut_cstl_types_aux.c
+
+libcstl_ut-ut_cstl_types_aux.obj: ut_cstl_types_aux.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcstl_ut_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcstl_ut-ut_cstl_types_aux.obj -MD -MP -MF $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Tpo -c -o libcstl_ut-ut_cstl_types_aux.obj `if test -f 'ut_cstl_types_aux.c'; then $(CYGPATH_W) 'ut_cstl_types_aux.c'; else $(CYGPATH_W) '$(srcdir)/ut_cstl_types_aux.c'; fi`
+ $(am__mv) $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Tpo $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Po
+# source='ut_cstl_types_aux.c' object='libcstl_ut-ut_cstl_types_aux.obj' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcstl_ut_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcstl_ut-ut_cstl_types_aux.obj `if test -f 'ut_cstl_types_aux.c'; then $(CYGPATH_W) 'ut_cstl_types_aux.c'; else $(CYGPATH_W) '$(srcdir)/ut_cstl_types_aux.c'; fi`
+
mostlyclean-libtool:
-rm -f *.lo
View
@@ -125,7 +125,8 @@ libcstl_ut_SOURCES = ut_main.c ut_def.c ut_def.h \
ut_cstl_iterator_private.c ut_cstl_iterator_private.h \
ut_cstl_iterator.c ut_cstl_iterator.h \
ut_cstl_types_builtin.c ut_cstl_types_builtin.h \
- ut_cstl_types_parse.c ut_cstl_types_parse.h
+ ut_cstl_types_parse.c ut_cstl_types_parse.h \
+ ut_cstl_types_aux.c ut_cstl_types_aux.h
libcstl_ut_CPPFLAGS = -D_CSTL_UNIT_TESTING -I$(srcdir)/../.. -I$(srcdir)/../../src
libcstl_ut_LDFLAGS = -lcmockery
TESTS = $(check_PROGRAMS)
View
@@ -210,7 +210,8 @@ am_libcstl_ut_OBJECTS = libcstl_ut-ut_main.$(OBJEXT) \
libcstl_ut-ut_cstl_iterator_private.$(OBJEXT) \
libcstl_ut-ut_cstl_iterator.$(OBJEXT) \
libcstl_ut-ut_cstl_types_builtin.$(OBJEXT) \
- libcstl_ut-ut_cstl_types_parse.$(OBJEXT)
+ libcstl_ut-ut_cstl_types_parse.$(OBJEXT) \
+ libcstl_ut-ut_cstl_types_aux.$(OBJEXT)
libcstl_ut_OBJECTS = $(am_libcstl_ut_OBJECTS)
libcstl_ut_LDADD = $(LDADD)
libcstl_ut_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -471,7 +472,8 @@ libcstl_ut_SOURCES = ut_main.c ut_def.c ut_def.h \
ut_cstl_iterator_private.c ut_cstl_iterator_private.h \
ut_cstl_iterator.c ut_cstl_iterator.h \
ut_cstl_types_builtin.c ut_cstl_types_builtin.h \
- ut_cstl_types_parse.c ut_cstl_types_parse.h
+ ut_cstl_types_parse.c ut_cstl_types_parse.h \
+ ut_cstl_types_aux.c ut_cstl_types_aux.h
libcstl_ut_CPPFLAGS = -D_CSTL_UNIT_TESTING -I$(srcdir)/../.. -I$(srcdir)/../../src
libcstl_ut_LDFLAGS = -lcmockery
@@ -691,6 +693,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcstl_ut-ut_cstl_stack_private.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcstl_ut-ut_cstl_string.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcstl_ut-ut_cstl_string_private.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcstl_ut-ut_cstl_types_builtin.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcstl_ut-ut_cstl_types_parse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcstl_ut-ut_cstl_vector.Po@am__quote@
@@ -3087,6 +3090,20 @@ libcstl_ut-ut_cstl_types_parse.obj: ut_cstl_types_parse.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcstl_ut_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcstl_ut-ut_cstl_types_parse.obj `if test -f 'ut_cstl_types_parse.c'; then $(CYGPATH_W) 'ut_cstl_types_parse.c'; else $(CYGPATH_W) '$(srcdir)/ut_cstl_types_parse.c'; fi`
+libcstl_ut-ut_cstl_types_aux.o: ut_cstl_types_aux.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcstl_ut_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcstl_ut-ut_cstl_types_aux.o -MD -MP -MF $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Tpo -c -o libcstl_ut-ut_cstl_types_aux.o `test -f 'ut_cstl_types_aux.c' || echo '$(srcdir)/'`ut_cstl_types_aux.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Tpo $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ut_cstl_types_aux.c' object='libcstl_ut-ut_cstl_types_aux.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcstl_ut_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcstl_ut-ut_cstl_types_aux.o `test -f 'ut_cstl_types_aux.c' || echo '$(srcdir)/'`ut_cstl_types_aux.c
+
+libcstl_ut-ut_cstl_types_aux.obj: ut_cstl_types_aux.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcstl_ut_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libcstl_ut-ut_cstl_types_aux.obj -MD -MP -MF $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Tpo -c -o libcstl_ut-ut_cstl_types_aux.obj `if test -f 'ut_cstl_types_aux.c'; then $(CYGPATH_W) 'ut_cstl_types_aux.c'; else $(CYGPATH_W) '$(srcdir)/ut_cstl_types_aux.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Tpo $(DEPDIR)/libcstl_ut-ut_cstl_types_aux.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ut_cstl_types_aux.c' object='libcstl_ut-ut_cstl_types_aux.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcstl_ut_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libcstl_ut-ut_cstl_types_aux.obj `if test -f 'ut_cstl_types_aux.c'; then $(CYGPATH_W) 'ut_cstl_types_aux.c'; else $(CYGPATH_W) '$(srcdir)/ut_cstl_types_aux.c'; fi`
+
mostlyclean-libtool:
-rm -f *.lo
Oops, something went wrong.

0 comments on commit 22de40c

Please sign in to comment.