~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/sys/sys_gen.h

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /src/sys/sys_gen.h (Architecture i386) and /src/sys/sys_gen.h (Architecture mips)


  1 /*                                                  1 /*
  2 *                                                   2 *
  3 * sys_gen.h                                         3 * sys_gen.h
  4 *                                                   4 * 
  5 * general data types and macros                     5 * general data types and macros
  6 *                                                   6 * 
  7 */                                                  7 */ 
  8                                                     8 
  9 #ifndef SYSGEN_HEADS_DEFINED                        9 #ifndef SYSGEN_HEADS_DEFINED
 10 #define SYSGEN_HEADS_DEFINED                       10 #define SYSGEN_HEADS_DEFINED
 11                                                    11 
 12 #ifdef IBM                                         12 #ifdef IBM
 13 #undef NULL                                        13 #undef NULL
 14 #define NULL 0                                     14 #define NULL 0
 15 #elif _PCC                                         15 #elif _PCC
 16 #undef NULL                                        16 #undef NULL
 17 #define NULL 0                                     17 #define NULL 0
 18 #endif                                             18 #endif
 19                                                    19 
 20 /* next line added by JULIAN 19/10/93 to ensur     20 /* next line added by JULIAN 19/10/93 to ensure NULL alway 0 NOT (void*)0 */
 21 /* quelle twat. removed                            21 /* quelle twat. removed
 22 #undef NULL                                        22 #undef NULL
 23 #ifndef NULL                                       23 #ifndef NULL
 24 #define NULL 0                                     24 #define NULL 0
 25 #endif                                             25 #endif
 26 */                                                 26 */
 27                                                    27 
 28 /** absolute value macro */                        28 /** absolute value macro */
 29                                                    29 
 30 #ifndef ABS                                        30 #ifndef ABS
 31 #define ABS(x) ((x) < 0 ? -(x): (x))               31 #define ABS(x) ((x) < 0 ? -(x): (x))
 32 #endif                                             32 #endif
 33                                                    33 
 34 /** sign macros */                                 34 /** sign macros */
 35                                                    35 
 36 #ifndef SGN                                        36 #ifndef SGN
 37 #define SGN(x) ((x) < 0 ? -1: 1)                   37 #define SGN(x) ((x) < 0 ? -1: 1)
 38 #endif                                             38 #endif
 39                                                    39 
 40 #ifndef SAME_SIGN                                  40 #ifndef SAME_SIGN
 41 #define SAME_SIGN(x, y) ((x)<0 ? (y)<0 : (y)>=     41 #define SAME_SIGN(x, y) ((x)<0 ? (y)<0 : (y)>=0)
 42 #endif                                             42 #endif
 43                                                    43 
 44 #ifndef DIFF_SIGN                                  44 #ifndef DIFF_SIGN
 45 #define DIFF_SIGN(x, y) ((x)<0 ? (y)>=0 : (y)<     45 #define DIFF_SIGN(x, y) ((x)<0 ? (y)>=0 : (y)<0)
 46 #endif                                             46 #endif
 47                                                    47 
 48 /** round to nearest integer **/                   48 /** round to nearest integer **/
 49 #define ROUND(x) ((x) > 0? (int) ((x)+0.5): -(     49 #define ROUND(x) ((x) > 0? (int) ((x)+0.5): -(int)(0.5-(x)))
 50                                                    50 
 51 /** sqr macro */                                   51 /** sqr macro */
 52                                                    52 
 53 #ifndef SQR                                        53 #ifndef SQR
 54 #define SQR(x) ((x)*(x))                           54 #define SQR(x) ((x)*(x))
 55 #endif                                             55 #endif
 56                                                    56 
 57 /** macro to swap arbitrary types **/              57 /** macro to swap arbitrary types **/
 58                                                    58 
 59 #ifndef SWAP                                       59 #ifndef SWAP    
 60 #define SWAP(var,x,y) { var temp; temp = (x);      60 #define SWAP(var,x,y) { var temp; temp = (x); (x) = (y); (y) = temp; }
 61 #endif                                             61 #endif
 62                                                    62 
 63 /** macro to order arbitrary types **/             63 /** macro to order arbitrary types **/
 64                                                    64 
 65 #ifndef ORDER                                      65 #ifndef ORDER
 66 #define ORDER(var,x,y) if ((y)<(x)) { var temp     66 #define ORDER(var,x,y) if ((y)<(x)) { var temp; temp = (x); (x) = (y); (y) = temp; }
 67 #endif                                             67 #endif
 68                                                    68 
 69 /** maximum and minimum macros for pairs and t     69 /** maximum and minimum macros for pairs and triples **/
 70                                                    70 
 71 #ifndef MAX                                        71 #ifndef MAX
 72 #define MAX(x, y) ((x) >= (y) ? (x) : (y))         72 #define MAX(x, y) ((x) >= (y) ? (x) : (y))
 73 #endif                                             73 #endif
 74                                                    74 
 75 #ifndef MIN                                        75 #ifndef MIN
 76 #define MIN(x, y) ((x) <= (y) ? (x) : (y))         76 #define MIN(x, y) ((x) <= (y) ? (x) : (y))
 77 #endif                                             77 #endif
 78                                                    78 
 79 #define MAX3(x, y, z) MAX((x), MAX((y), (z)))      79 #define MAX3(x, y, z) MAX((x), MAX((y), (z)))
 80 #define MIN3(x, y, z) MIN((x), MIN((y), (z)))      80 #define MIN3(x, y, z) MIN((x), MIN((y), (z)))
 81                                                    81 
 82 #define MAX4(x, y, z, w) MAX(MAX((x), (y)), MA     82 #define MAX4(x, y, z, w) MAX(MAX((x), (y)), MAX((z), (w)))
 83 #define MIN4(x, y, z, w) MIN(MIN((x), (y)), MI     83 #define MIN4(x, y, z, w) MIN(MIN((x), (y)), MIN((z), (w)))
 84                                                    84 
 85 /** macros to allow switches over pairs of -sm     85 /** macros to allow switches over pairs of -small- ints or enums **/
 86                                                    86 
 87 #define OPAIR(s1, s2)    (1000*(int) (s1)+(int     87 #define OPAIR(s1, s2)    (1000*(int) (s1)+(int) (s2))
 88 #define PAIR(s1, s2)     MIN(OPAIR(s1, s2), OP     88 #define PAIR(s1, s2)     MIN(OPAIR(s1, s2), OPAIR(s2, s1))
 89                                                    89 
 90 /** between macros **/                             90 /** between macros **/
 91                                                    91 
 92 #define BETWEEN(x,a,b) ( ((x)>(a) && (x)<(b))      92 #define BETWEEN(x,a,b) ( ((x)>(a) && (x)<(b)) || ((x)<(a) && (x)>(b)) )
 93                                                    93 
 94 #define OVERLAPPED(a1,a2,b1,b2) ((a2)>=(b1) &&     94 #define OVERLAPPED(a1,a2,b1,b2) ((a2)>=(b1) && (a1)<=(b2))
 95                                                    95 
 96 #endif /* SYSGEN_HEADS_DEFINED */                  96 #endif /* SYSGEN_HEADS_DEFINED */
 97                                                    97 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.