I have a question for a quick workaround to take advantage of non-standard gnu argument ranges . For example, non-standard:
case 1 ... 5:
It can be replaced by:
case 1: case 2: case 3: case 4: case 5:
Perhaps some macro solution might be ok. From my memory, macro loops cannot loop into a large number of iterations. For this reason, if the range is "large", say, in thousands?
, , boost. , , , , , 255 "". , - ( ). , .
boost
255
, , if - else if - else. , () , , , ( ).
if
else if
else
, switch - case , default if-else if-else .
switch
case
default
if-else if-else
script, case , , case , , , ... . ( ) , case-range .
...
case-range
if/else. , , .
, "" , , Duff (, ), .
, , "". . while C , .
python awk script. , - -. , , , .
, . ( script), STATE_10 STATE_20, , ? - GNU .
case , , , :
, () :
switch(state) { case STATE_1: xxx; break; case STATE_2 ... STATE_10: yyy; break; }
. . if/else , , . :
#if !defined(__GNUC__) #define STATE_RANGE_2_10 101 if(state >= 2 && state <= 10) state2 = STATE_RANGE_2_10 else if(...) state2 = STATE_RANGE_x_y else state2 = state; #else /* GNU */ #define STATE_RANGE_2_10 STATE_2 ... STATE_10 state2 = state; #endif switch(state2) { case STATE_1: xxx; break; case STATE_RANGE_2_10: yyy; break; }
GNUC C, , GNUC - . . state2 , . , .
Source: https://habr.com/ru/post/1617567/More articles:Telegram Bot API Webhooks Self-Signing Certification - sslJava is obviously a cost pass, but needs clarification - javaOpenSSL bot telegram - opensslHow to pass date parameter inside oracle procedure? - sqlFind a JSON property name that starts with something using JSON Path - javascriptNecessary basic work in production - javaHow to have files without extensions processed as php in Apache - apachePrevent Android Chrome Launch in Standby / Auto Lock / Sleep Phone? - androidDraw a set of negative data in the "positive" Y axis - matlabIBOutlet is nil Xcode 7 for ViewControllers - xcodeAll Articles