This commit is contained in:
2022-03-05 00:23:07 +03:00
parent 6cc3acea1d
commit 46e7991867
4 changed files with 90 additions and 151 deletions

View File

@@ -19,14 +19,16 @@ declare_Autoarr(Unitype)
void Autoarr_Unitype_clear(Autoarr(Unitype)* ar);
#define Autoarr_foreach(ar,elem,codeblock)({\
typeof(**ar->values) elem;\
for(uint32 blockI=0;blockI<ar->blocks_count-1;blockI++)\
for(uint32 elemI=0;elemI<ar->max_block_length;elemI++){\
elem=ar->values[blockI][elemI];\
if(ar->blocks_count>0) {\
typeof(**ar->values) elem;\
for(uint32 blockI=0;blockI<ar->blocks_count-1;blockI++)\
for(uint32 elemI=0;elemI<ar->max_block_length;elemI++){dbg(5);\
elem=ar->values[blockI][elemI];\
(codeblock);\
}\
for(uint32 elemI=0;elemI<ar->block_length;elemI++){\
elem=ar->values[ar->blocks_count-1][elemI];\
(codeblock);\
}\
for(uint32 elemI=0;elemI<ar->block_length;elemI++){\
elem=ar->values[ar->blocks_count-1][elemI];\
(codeblock);\
}\
})