Copy project

This commit is contained in:
schmelczerandras 2020-04-19 12:48:06 +02:00
commit 26a0fd884f
173 changed files with 157458 additions and 1 deletions

View file

@ -0,0 +1,11 @@
#ifndef BITWISE_H
#define BITWISE_H
#define BV(x) (1 << (x))
#define modifyBit(P, B, V) ((P) = ((P) & ~BV(B)) | ((V) << B))
#define setBit(P, B) ((P) |= BV(B))
#define clearBit(P, B) ((P) &= ~BV(B))
#define toggleBit(P, B) ((P) ^= BV(B))
#define getBit(P, B) (((P) & BV(B)) >> (B))
#endif

View file

@ -0,0 +1,9 @@
#ifndef MATH_H
#define MATH_H
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) > (b) ? (b) : (a))
#define abs(a, b) ((a) > 0 ? (a) : (-a))
#endif

View file

@ -0,0 +1,3 @@
#ifndef NULL
#define NULL ((void*)0)
#endif