some fixes
This commit is contained in:
parent
2ad5790a67
commit
03b9ede382
@ -21,7 +21,7 @@ BUILD_TEST_CPP_ARGS="$BUILD_TEST_C_ARGS"
|
|||||||
BUILD_TEST_LINKER_ARGS=""
|
BUILD_TEST_LINKER_ARGS=""
|
||||||
|
|
||||||
# build_test_dbg
|
# build_test_dbg
|
||||||
TEST_DBG_FILE=$TEST_FILE
|
TEST_DBG_FILE=$TEST_FILE.dbg
|
||||||
BUILD_TEST_DBG_C_ARGS="-O0 -g"
|
BUILD_TEST_DBG_C_ARGS="-O0 -g"
|
||||||
BUILD_TEST_DBG_CPP_ARGS="$BUILD_TEST_DBG_C_ARGS"
|
BUILD_TEST_DBG_CPP_ARGS="$BUILD_TEST_DBG_C_ARGS"
|
||||||
BUILD_TEST_DBG_LINKER_ARGS=""
|
BUILD_TEST_DBG_LINKER_ARGS=""
|
||||||
|
|||||||
@ -46,6 +46,6 @@ kerepTypeId_define(kerepTypeId_AutoarrUnitypePtr);
|
|||||||
// right func to clear array of unitype values
|
// right func to clear array of unitype values
|
||||||
void __Autoarr_free_Unitype_(Autoarr(Unitype)* ar, bool freePtr){
|
void __Autoarr_free_Unitype_(Autoarr(Unitype)* ar, bool freePtr){
|
||||||
Autoarr_foreach(ar, u,Unitype_free(u));
|
Autoarr_foreach(ar, u,Unitype_free(u));
|
||||||
if(freePtr) Autoarr_free(ar, freePtr);
|
__Autoarr_free_Unitype(ar, freePtr);
|
||||||
}
|
}
|
||||||
void ____Autoarr_free_Unitype_(void* ar) { __Autoarr_free_Unitype_((Autoarr(Unitype)*)ar, false); }
|
void ____Autoarr_free_Unitype_(void* ar) { __Autoarr_free_Unitype_((Autoarr(Unitype)*)ar, false); }
|
||||||
@ -29,6 +29,7 @@ typedef struct Autoarr_##type{\
|
|||||||
} Autoarr_##type;\
|
} Autoarr_##type;\
|
||||||
\
|
\
|
||||||
Autoarr_##type* __Autoarr_create_##type(uint16 max_blocks_count, uint16 max_block_length);\
|
Autoarr_##type* __Autoarr_create_##type(uint16 max_blocks_count, uint16 max_block_length);\
|
||||||
|
void __Autoarr_free_##type(Autoarr_##type* ar, bool freePtr);\
|
||||||
void ____Autoarr_free_##type(void* ar);
|
void ____Autoarr_free_##type(void* ar);
|
||||||
|
|
||||||
#define Autoarr(type) Autoarr_##type
|
#define Autoarr(type) Autoarr_##type
|
||||||
|
|||||||
@ -50,7 +50,8 @@ void Hashtable_expand(Hashtable* ht){
|
|||||||
Autoarr(KVPair)* newar=newrows[newrown];
|
Autoarr(KVPair)* newar=newrows[newrown];
|
||||||
Autoarr_add(newar,p);
|
Autoarr_add(newar,p);
|
||||||
}
|
}
|
||||||
Autoarr_free(ar, true);
|
// there is no need to free array values, because they are copied into new array
|
||||||
|
__Autoarr_free_KVPair(ar, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(ht->rows);
|
free(ht->rows);
|
||||||
|
|||||||
@ -17,7 +17,7 @@ void __KVPair_free(void* p){ KVPair_free(*(KVPair*)p); }
|
|||||||
// func for KVP array clearing
|
// func for KVP array clearing
|
||||||
void __Autoarr_free_KVPair_(Autoarr_KVPair* ar, bool freePtr){
|
void __Autoarr_free_KVPair_(Autoarr_KVPair* ar, bool freePtr){
|
||||||
Autoarr_foreach(ar,k,KVPair_free(k));
|
Autoarr_foreach(ar,k,KVPair_free(k));
|
||||||
Autoarr_free(ar, freePtr);
|
__Autoarr_free_KVPair(ar, freePtr);
|
||||||
}
|
}
|
||||||
void ____Autoarr_free_KVPair_(void* ar){
|
void ____Autoarr_free_KVPair_(void* ar){
|
||||||
__Autoarr_free_KVPair_((Autoarr_KVPair*)ar, false);
|
__Autoarr_free_KVPair_((Autoarr_KVPair*)ar, false);
|
||||||
|
|||||||
@ -36,7 +36,6 @@ void __STNode_free(void* _node){
|
|||||||
}
|
}
|
||||||
if(node->value.VoidPtr)
|
if(node->value.VoidPtr)
|
||||||
Unitype_free(node->value);
|
Unitype_free(node->value);
|
||||||
free(node);
|
|
||||||
}
|
}
|
||||||
void STNode_free(STNode* node){
|
void STNode_free(STNode* node){
|
||||||
__STNode_free(node);
|
__STNode_free(node);
|
||||||
|
|||||||
@ -19,17 +19,17 @@ char* sprintuni(Unitype v){
|
|||||||
if(v.typeId==kerepTypeId_Null)
|
if(v.typeId==kerepTypeId_Null)
|
||||||
sprintf_s(buf, BUFSIZE, "{Null}");
|
sprintf_s(buf, BUFSIZE, "{Null}");
|
||||||
else if(v.typeId==kerepTypeId_Float64)
|
else if(v.typeId==kerepTypeId_Float64)
|
||||||
sprintf_s(buf, BUFSIZE, "{%s ) %lf}", type.name,v.Float64);
|
sprintf_s(buf, BUFSIZE, "{%s : %lf}", type.name,v.Float64);
|
||||||
else if(v.typeId==kerepTypeId_Bool || v.typeId==kerepTypeId_UInt64)
|
else if(v.typeId==kerepTypeId_Bool || v.typeId==kerepTypeId_UInt64)
|
||||||
sprintf_s(buf, BUFSIZE, "{%s ) " IFWIN("%llu", "%lu") "}", type.name,v.UInt64);
|
sprintf_s(buf, BUFSIZE, "{%s : " IFWIN("%llu", "%lu") "}", type.name,v.UInt64);
|
||||||
else if(v.typeId==kerepTypeId_Int64)
|
else if(v.typeId==kerepTypeId_Int64)
|
||||||
sprintf_s(buf, BUFSIZE, "{%s ) " IFWIN("%lld", "%ld") "}", type.name,v.Int64);
|
sprintf_s(buf, BUFSIZE, "{%s : " IFWIN("%lld", "%ld") "}", type.name,v.Int64);
|
||||||
else if(v.typeId==kerepTypeId_CharPtr){
|
else if(v.typeId==kerepTypeId_CharPtr){
|
||||||
size_t newBUFSIZE=cptr_length(v.VoidPtr) + BUFSIZE/2;
|
size_t newBUFSIZE=cptr_length(v.VoidPtr) + BUFSIZE/2;
|
||||||
buf=realloc(buf, newBUFSIZE);
|
buf=realloc(buf, newBUFSIZE);
|
||||||
sprintf_s(buf, BUFSIZE, "{%s ) \"%s\"}", type.name,(char*)v.VoidPtr);
|
sprintf_s(buf, BUFSIZE, "{%s : \"%s\"}", type.name,(char*)v.VoidPtr);
|
||||||
}
|
}
|
||||||
else sprintf_s(buf, BUFSIZE, "{%s ) %p}", type.name,v.VoidPtr);
|
else sprintf_s(buf, BUFSIZE, "{%s : %p}", type.name,v.VoidPtr);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user