mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-16 16:29:18 +01:00
* minor optimization - make LIMIT not evaluate stuff like "atoi(balbla+strlen(stuff))" 3 times
This commit is contained in:
parent
20a34e93d6
commit
a14051ecca
@ -2,8 +2,8 @@
|
||||
<app version="1">
|
||||
<name> USB Loader GX</name>
|
||||
<coder>USB Loader GX Team</coder>
|
||||
<version>2.3 r1131</version>
|
||||
<release_date>201111170248</release_date>
|
||||
<version>2.3 r1132</version>
|
||||
<release_date>201111170321</release_date>
|
||||
<!-- // remove this line to enable arguments
|
||||
<arguments>
|
||||
<arg>--ios=250</arg>
|
||||
|
@ -2,7 +2,13 @@
|
||||
#define TOOLS_H_
|
||||
|
||||
#define ABS(x) ( (x) >= (0) ? (x) : (-(x)) )
|
||||
#define LIMIT(x, min, max) ( ((x) < (min)) ? (min) : ((x) > (max)) ? (max) : (x) )
|
||||
#define LIMIT(x, min, max) \
|
||||
({ \
|
||||
typeof( x ) _x = x; \
|
||||
typeof( min ) _min = min; \
|
||||
typeof( max ) _max = max; \
|
||||
( ( ( _x ) < ( _min ) ) ? ( _min ) : ( ( _x ) > ( _max ) ) ? ( _max) : ( _x ) ); \
|
||||
})
|
||||
#define ALIGN(x) (((x) + 3) & ~3)
|
||||
#define ALIGN32(x) (((x) + 31) & ~31)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user