libsheepy

C lib for handling text files, strings and json like data structure with an object oriented system
git clone https://spartatek.se/git/libsheepy.git
Log | Files | Refs | README | LICENSE

commit 1b2393bd77100a301514a086794e7f1ed16fbe25
parent e0bba32dbe43a728bc7b3f33024149b1ec393f3d
Author: Remy Noulin <loader2x@gmail.com>
Date:   Fri,  2 Aug 2019 13:48:55 +0200

Revert "add rangeM macro (range for macros)"

This reverts commit e0bba32dbe43a728bc7b3f33024149b1ec393f3d.

rangeM is not really necessary, the bug I was working on was due to
hardware failures.

Diffstat:
Mrelease/libsheepy.h | 13++-----------
Msrc/libsheepy.h | 13++-----------
2 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/release/libsheepy.h b/release/libsheepy.h @@ -2358,15 +2358,6 @@ int listPrintS(char **list); for (size_t index = 0 ; index < UNIQVAR(maxCnt) ; index++) /** - * range macro loop - * same as range, but doesnt define UNIQVAR(maxCnt) so the maxCount parameter is evaluated mutiple times (one time per loop) - * rangeM is to be used in macros where all the code is on one line since range uses UNIQVAR which appends the line number to maxCnt - * and variable name collision happen (for example: range() { range(){} }). - */ -#define rangeM(index, maxCount) \ - for (size_t index = 0 ; index < (size_t)(maxCount) ; index++) - -/** * infinity loop * increase the index infinitly */ @@ -2404,7 +2395,7 @@ int listPrintS(char **list); * u32 array[20]; * arange(i, array) {} */ -#define arange(index, array) rangeM(index, ARRAY_SIZE(array)) +#define arange(index, array) range(index, ARRAY_SIZE(array)) /** * loop on the elements of C static array of any type from highest index down to 0 @@ -3401,7 +3392,7 @@ void **iListDel(void ***list, intmax_t start, intmax_t end); * sliceAt(vec, i) = 0; * } */ -#define forEachSc(name, index) rangeM(index, (name)->count) +#define forEachSc(name, index) range(index, (name)->count) /** * insert an element at index diff --git a/src/libsheepy.h b/src/libsheepy.h @@ -2358,15 +2358,6 @@ int listPrintS(char **list); for (size_t index = 0 ; index < UNIQVAR(maxCnt) ; index++) /** - * range macro loop - * same as range, but doesnt define UNIQVAR(maxCnt) so the maxCount parameter is evaluated mutiple times (one time per loop) - * rangeM is to be used in macros where all the code is on one line since range uses UNIQVAR which appends the line number to maxCnt - * and variable name collision happen (for example: range() { range(){} }). - */ -#define rangeM(index, maxCount) \ - for (size_t index = 0 ; index < (size_t)(maxCount) ; index++) - -/** * infinity loop * increase the index infinitly */ @@ -2404,7 +2395,7 @@ int listPrintS(char **list); * u32 array[20]; * arange(i, array) {} */ -#define arange(index, array) rangeM(index, ARRAY_SIZE(array)) +#define arange(index, array) range(index, ARRAY_SIZE(array)) /** * loop on the elements of C static array of any type from highest index down to 0 @@ -3401,7 +3392,7 @@ void **iListDel(void ***list, intmax_t start, intmax_t end); * sliceAt(vec, i) = 0; * } */ -#define forEachSc(name, index) rangeM(index, (name)->count) +#define forEachSc(name, index) range(index, (name)->count) /** * insert an element at index