?? jtypes_h.h
字號:
//---------------------------------------------------------------------------
// Jtypes_H.h
//---------------------------------------------------------------------------
#ifndef Jtypes_H.h // 防止被重復(fù)引用
#define Jtypes_H.h
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
typedef signed char int8; // -127 ~ 128
typedef unsigned char int8u; // 0 ~ 255
typedef signed short int16; // -32768 ~ 32767
typedef unsigned short int16u; // 0 ~ 65535
typedef signed long int32; // - 21M ~ + 21M
typedef unsigned long int32u; // 0 ~ + 42M
typedef unsigned __int64 int64u; // 0 ~ +oo
typedef signed __int64 int64; // -oo ~ +oo
typedef int8 boolean; // only have 0 & 1, but can be -1 too.
typedef int8u ERR; // 0 = No error; 1 ~ 255 = Have error.
typedef int16 Status; // 狀態(tài) ( -32768 ~ 32767 )
//--------------------------------------------------------------------------
const ERR OK_no_Err = 0;
const ERR Have_Errs = 1;
const boolean Undefined_value = -1;
const boolean B_false = 0;
const boolean B_true = 1;
//---------------------------------------------------------------------------
union pool_8 // 8-bit池
{ int8u pot8; // 1 byte
struct
{ int8u potl :4; // half byte
int8u poth :4;
}; // end struct
struct
{ int8u bit0 :1; // 1 bit
int8u bit1 :1;
int8u bit2 :1;
int8u bit3 :1;
int8u bit4 :1;
int8u bit5 :1;
int8u bit6 :1;
int8u bit7 :1;
}; // end struct
}; // end union
//---------------------------------------------------------------------------
union pool_16 // 16-bit池
{ int16u pot16; // 1 word
int8u pot8[2]; // 2 bytes
pool_8 pool8[2]; // 8-bit池(2)
struct
{ pool_8 pool8l; //
pool_8 pool8h; //
}; // end struct
struct
{ int8u lowbyte; // 低字節(jié)
int8u highbyte; // 高字節(jié)
}; // end struct
struct
{ int8u bit0 :1; // 1 bit
int8u bit1 :1;
int8u bit2 :1;
int8u bit3 :1;
int8u bit4 :1;
int8u bit5 :1;
int8u bit6 :1;
int8u bit7 :1;
int8u bit8 :1; // 1 bit
int8u bit9 :1;
int8u bita :1;
int8u bitb :1;
int8u bitc :1;
int8u bitd :1;
int8u bite :1;
int8u bitf :1;
}; // end struct
}; // end union
//---------------------------------------------------------------------------
union pool_32 // 32-bit池
{ int32u pot32; // 1 double word
int16u pot16[2]; // 2 words
int8u pot8[4]; // 4 bytes
pool_16 pool16[2]; // 16-bit池(2)
pool_8 pool8[4]; // 8-bit池(4)
struct
{ pool_16 pool16l; //
pool_16 pool16h; //
}; // end struct
}; // end union
//---------------------------------------------------------------------------
union pool_64 // 64-bit池
{ int64u pot64; // 1 quarter word
int32u pot32[2]; // 2 double word
int16u pot16[4]; // 4 words
int8u pot8[8]; // 8 bytes
pool_32 pool32[2]; // 32-bit池(2)
pool_16 pool16[4]; // 16-bit池(4)
pool_8 pool8[8]; // 8-bit池(8)
struct
{ pool_32 pool32l; //
pool_32 pool32h; //
}; // end struct
}; // end union
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#define UseAssertion(str) str
#define Jassert(p) UseAssertion( (p)?(void)0:J_assert(#p,__FILE__,__LINE__); )
//---------------------------------------------------------------------------
void J_assert(char* cond, char* f, int l);
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// 最高抽象類,所有的類都有它派生。它抽象了所有對象的共性。
//---------------------------------------------------------------------------
class JObject // Everything is an object.
{ private:
// int ID;
public:
// If you choose to use show(), then every JObject take 4 more bytes.
// #include <stdio.h>
// virtual void show()const { puts(" [JObject]"); } //
}; // end JObject
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
// Written by JamesyFront. ZLGmcu Dev.Co.Ltd. 2002.
//---------------------------------------------------------------------------
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -