#ifndef _MWORD_H_INCLUDE
#define _MWORD_H_INCLUDE
#ifndef INT64
#if defined(WIN32)
typedef unsigned __int64 UINT64;
typedef __int64 INT64;
#else
typedef unsigned long long UINT64;
typedef long long INT64;
#endif
#endifstruct MWORD
{
enum
{
MAXBASE = 0x1FFFFFFF,
}; int m_nBase:30;
unsigned int m_nMul:2; MWORD(){};
MWORD(int n);
MWORD(int nBase,DWORD dwMul);
operator INT64() const { return GetValue();}
INT64 GetValue() const;
MWORD operator-=(const MWORD& d);
MWORD operator-=(const INT64 d);
MWORD operator+=(const MWORD& d);
MWORD operator+=(const INT64 d);
MWORD operator*=(const MWORD& d);
MWORD operator*=(const INT64 d);
MWORD operator/=(const MWORD& d);
MWORD operator/=(const INT64 d);
INT64 operator+(const MWORD& d) const;
INT64 operator-(const MWORD& d) const;
INT64 operator*(const MWORD& d) const;
INT64 operator/(const MWORD& d) const;
INT64 operator+(const int d) const;
INT64 operator-(const int d) const;
INT64 operator*(const int d) const;
INT64 operator/(const int d) const;
MWORD operator=(const MWORD& d);
MWORD operator=(const INT64 d);
BOOL operator==(const MWORD& d) const;
BOOL operator==(const INT64 d) const;
BOOL operator==(const int d) const;
BOOL operator!=(const MWORD& d) const;
BOOL operator!=(const INT64 d) const;
BOOL operator!=(const int d) const;
BOOL operator>(int d) const;
BOOL operator>(MWORD d) const;
BOOL operator<(int d) const;
BOOL operator<(MWORD d) const;
BOOL IsZero() const {return m_nBase==0;}
unsigned int GetMul(){return m_nMul;}
unsigned int GetBase(){return m_nBase;}
DWORD GetRawData(){return *(DWORD*)this;}
void SetRawData(DWORD dw){*(DWORD*)this = dw;}
};#endif //_MWORD_H_INCLUDE我只能看懂部分,这个数据的长度是32位,但是具体如何按位计算数据值就看不懂了,请指点
#define _MWORD_H_INCLUDE
#ifndef INT64
#if defined(WIN32)
typedef unsigned __int64 UINT64;
typedef __int64 INT64;
#else
typedef unsigned long long UINT64;
typedef long long INT64;
#endif
#endifstruct MWORD
{
enum
{
MAXBASE = 0x1FFFFFFF,
}; int m_nBase:30;
unsigned int m_nMul:2; MWORD(){};
MWORD(int n);
MWORD(int nBase,DWORD dwMul);
operator INT64() const { return GetValue();}
INT64 GetValue() const;
MWORD operator-=(const MWORD& d);
MWORD operator-=(const INT64 d);
MWORD operator+=(const MWORD& d);
MWORD operator+=(const INT64 d);
MWORD operator*=(const MWORD& d);
MWORD operator*=(const INT64 d);
MWORD operator/=(const MWORD& d);
MWORD operator/=(const INT64 d);
INT64 operator+(const MWORD& d) const;
INT64 operator-(const MWORD& d) const;
INT64 operator*(const MWORD& d) const;
INT64 operator/(const MWORD& d) const;
INT64 operator+(const int d) const;
INT64 operator-(const int d) const;
INT64 operator*(const int d) const;
INT64 operator/(const int d) const;
MWORD operator=(const MWORD& d);
MWORD operator=(const INT64 d);
BOOL operator==(const MWORD& d) const;
BOOL operator==(const INT64 d) const;
BOOL operator==(const int d) const;
BOOL operator!=(const MWORD& d) const;
BOOL operator!=(const INT64 d) const;
BOOL operator!=(const int d) const;
BOOL operator>(int d) const;
BOOL operator>(MWORD d) const;
BOOL operator<(int d) const;
BOOL operator<(MWORD d) const;
BOOL IsZero() const {return m_nBase==0;}
unsigned int GetMul(){return m_nMul;}
unsigned int GetBase(){return m_nBase;}
DWORD GetRawData(){return *(DWORD*)this;}
void SetRawData(DWORD dw){*(DWORD*)this = dw;}
};#endif //_MWORD_H_INCLUDE我只能看懂部分,这个数据的长度是32位,但是具体如何按位计算数据值就看不懂了,请指点
解决方案 »
- ~~~~~弱弱的问一下:怎样给topgrid设置自动编号功能?~~~~~
- ado 连接 sql server后,会自动断开连接
- 触发器
- DELPHI中如何获取随机数?
- 请高手们帮我看看我写的这段程序到底是哪里错了
- 局网用Socket传送文件12.1M用了1分3秒,还能快吗?
- 离开 论坛 散分【三】
- AdjustTokenPrivileges这个函数起什么作用?还请专家指点!
- 高手请教!!c/s两层结构安装到没有delphi环境的地方,提示 BDE初始化错误如何解决?
- 50分简单问题?
- 为什么TLabel控件的文字会显示不全了,有没有解决的好办法?请各位指点
- 我的ReadWorld聚合新闻阅读器2.0发布了,欢迎下载源码
#ifndef INT64
#if defined(WIN32)
typedef unsigned __int64 UINT64;
typedef __int64 INT64;
#else
typedef unsigned long long UINT64;
typedef long long INT64;
#endif
#endif
#if defined(WIN32)
typedef unsigned __int64 UINT64;
typedef __int64 INT64;
#else
typedef unsigned long long UINT64;
typedef long long INT64;
#endif
#endif
条件编译Delphi也支持。不过,我不知道用什么方法代替typedef。
typedef void abc(void); 后,abc就是一个类型了(函数指针类型).
等于下面:
type
abc = function; stdcall;
#if defined(WIN32)
typedef unsigned __int64 UINT64;
typedef __int64 INT64;
#else
typedef unsigned long long UINT64;
typedef long long INT64;
#endif
#endif