diff --git a/.gitignore b/.gitignore index 6fa5db3..c5bc82a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ example/Out/perf_counter.lib *.iex *.crf *.lst +example/example.uvguix.gabriel diff --git a/example/example.uvoptx b/example/example.uvoptx index 7ec5b77..9365131 100644 --- a/example/example.uvoptx +++ b/example/example.uvoptx @@ -75,7 +75,7 @@ 1 0 - 0 + 1 7 @@ -325,7 +325,7 @@ 1 0 - 1 + 0 7 diff --git a/example/main.c b/example/main.c index fa65b62..ce2c4eb 100644 --- a/example/main.c +++ b/example/main.c @@ -77,20 +77,20 @@ int main (void) /*! demo of __cycleof__() operation */ __cycleof__() { foreach(example_lv0_t, s_tItem) { - printf("Processing item with ID = %d\r\n", _.chID); + printf("Processing item with ID = %d\r\n", _->chID); } } /*! demo of with block */ with(example_lv0_t, &s_tItem[0], pitem) { - _.wA = 1; - _.hwB = 2; - _.chC = 3; + _->wA = 1; + _->hwB = 2; + _->chC = 3; with(example_lv1_t, &pitem->tLV1) { - _.wLV1A = 4; - _.hwLV1B = 5; - _.chLV1C = 6; + _->wLV1A = 4; + _->hwLV1B = 5; + _->chLV1C = 6; } } diff --git a/lib/perf_counter.h b/lib/perf_counter.h index 61cde2e..14fdb44 100644 --- a/lib/perf_counter.h +++ b/lib/perf_counter.h @@ -96,32 +96,31 @@ __set_PRIMASK(CONNECT2(temp,__LINE__))) #define __with2(__type, __addr) \ - using(__type *_p=(__addr)) + using(__type *_=(__addr)) #define __with3(__type, __addr, __item) \ - using(__type *_p=(__addr), *__item = _p, _p=_p, ) + using(__type *_=(__addr), *__item = _, _=_, ) #define with(...) \ CONNECT2(__with, __PLOOC_VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__) #undef _ -#define _ (*_p) #ifndef dimof # define dimof(__array) (sizeof(__array)/sizeof(__array[0])) #endif #define foreach2(__type, __array) \ - using(__type *_p = __array) \ + using(__type *_ = __array) \ for ( uint_fast32_t CONNECT2(count,__LINE__) = dimof(__array); \ CONNECT2(count,__LINE__) > 0; \ - _p++, CONNECT2(count,__LINE__)-- \ + _++, CONNECT2(count,__LINE__)-- \ ) #define foreach3(__type, __array, __item) \ - using(__type *_p = __array, *__item = _p, _p = _p, ) \ + using(__type *_ = __array, *__item = _, _ = _, ) \ for ( uint_fast32_t CONNECT2(count,__LINE__) = dimof(__array); \ CONNECT2(count,__LINE__) > 0; \ - _p++, __item = _p, CONNECT2(count,__LINE__)-- \ + _++, __item = _, CONNECT2(count,__LINE__)-- \ ) #define foreach(...) \ diff --git a/perf_counter.h b/perf_counter.h index 61cde2e..14fdb44 100644 --- a/perf_counter.h +++ b/perf_counter.h @@ -96,32 +96,31 @@ __set_PRIMASK(CONNECT2(temp,__LINE__))) #define __with2(__type, __addr) \ - using(__type *_p=(__addr)) + using(__type *_=(__addr)) #define __with3(__type, __addr, __item) \ - using(__type *_p=(__addr), *__item = _p, _p=_p, ) + using(__type *_=(__addr), *__item = _, _=_, ) #define with(...) \ CONNECT2(__with, __PLOOC_VA_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__) #undef _ -#define _ (*_p) #ifndef dimof # define dimof(__array) (sizeof(__array)/sizeof(__array[0])) #endif #define foreach2(__type, __array) \ - using(__type *_p = __array) \ + using(__type *_ = __array) \ for ( uint_fast32_t CONNECT2(count,__LINE__) = dimof(__array); \ CONNECT2(count,__LINE__) > 0; \ - _p++, CONNECT2(count,__LINE__)-- \ + _++, CONNECT2(count,__LINE__)-- \ ) #define foreach3(__type, __array, __item) \ - using(__type *_p = __array, *__item = _p, _p = _p, ) \ + using(__type *_ = __array, *__item = _, _ = _, ) \ for ( uint_fast32_t CONNECT2(count,__LINE__) = dimof(__array); \ CONNECT2(count,__LINE__) > 0; \ - _p++, __item = _p, CONNECT2(count,__LINE__)-- \ + _++, __item = _, CONNECT2(count,__LINE__)-- \ ) #define foreach(...) \