mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-21 14:56:18 +00:00
lib: Add swap() macro
swap() will swap its two arguments while keeping the required tmp variable hidden. Makes for neater code. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
parent
b32b5327a2
commit
1658edceee
@ -90,4 +90,10 @@ void intel_require_memory(uint32_t count, uint32_t size, unsigned mode);
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
#define swap(a, b) do { \
|
||||
typeof(a) _tmp = (a); \
|
||||
(a) = (b); \
|
||||
(b) = _tmp; \
|
||||
} while (0)
|
||||
|
||||
#endif /* IGT_AUX_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user