00001
00010 #ifndef _MACROS_H_
00011 #define _MACROS_H_
00012
00017 #define MTOI(val) ((val)>>1)
00018
00023 #define MTOP(val) ((val)>>1)
00024
00029 #define ITOM(val) ((val)<<1)
00030
00035 #define PTOM(val) (((val)<<1)+1)
00036
00037
00038 #define SEW2I(w) ((w)>>1)
00039 #define SEW2P(w) ((w)>>1)
00040 #define SEI2W(n) ((n)<<1)
00041 #define SEP2W(p) ((p)<<1 | _SEPTRBIT)
00042
00043 #ifndef SCOL_FLOAT_DEFINITION
00044
00048 #ifdef __cplusplus
00049 _inline float MTOF(int val) { return *(float*)&(val); }
00050 #else
00051 static inline float MTOF (int mot)
00052
00053 { return (float) (mot); }
00054 #endif
00055
00060 #ifdef __cplusplus
00061 _inline int FTOM(float val) { return ((*(int*)&(val)) & 0xfffffffe); }
00062 #else
00063 extern inline int FTOM (float mot)
00064
00065 { return ((int) (mot) & 0xfffffffe); }
00066 #endif
00067
00068 #define SCOL_FLOAT_DEFINITION
00069 #endif
00070
00077 #define INVERT(m, a, b) {tmp_res=MMget(m,a);MMset(m,a,MMget(m,b));MMset(m,b,tmp_res);}
00078
00083 #define SEDROP(m, n) ((m)->pp += (n))
00084
00087 #define STR_SIZE(size) (2+((size)>>2))
00088 #define SIZE(t) ((sizeof(t)+3)>>2)
00089 #define CHECK(m) if ((tmp_res=m)) return tmp_res
00090
00091 #endif