// ChangeBS.cpp: implementation of the CChangeBS class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Change.h"
#include "ChangeBS.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CChangeBS::CChangeBS()
{
}
CChangeBS::~CChangeBS()
{
}
void CChangeBS::OnChange(short InParam, short &OutParam)
{
union
{
char ch[2];
unsigned short iTemp;
}u,r;
u.iTemp = InParam;
r.ch[0] = u.ch[1];
r.ch[1] = u.ch[0];
OutParam = r.iTemp;
}
void CChangeBS::OnChange(int InParam, int &OutParam)
{
union
{
char ch[4];
int iTemp;
}u,r;
u.iTemp = InParam;
r.ch[0] = u.ch[3];
r.ch[1] = u.ch[2];
r.ch[2] = u.ch[1];
r.ch[3] = u.ch[0];
OutParam = r.iTemp;
}
void CChangeBS::OnChange(float InParam, float &OutParam)
{
union
{
char ch[4];
float iTemp;
}u,r;
u.iTemp = InParam;
r.ch[0] = u.ch[3];
r.ch[1] = u.ch[2];
r.ch[2] = u.ch[1];
r.ch[3] = u.ch[0];
OutParam = r.iTemp;
}
void CChangeBS::OnChange(double InParam, double &OutParam)
{
union
{
char ch[8];
double iTemp;
}u,r;
u.iTemp = InParam;
r.ch[0] = u.ch[7];
r.ch[1] = u.ch[6];
r.ch[2] = u.ch[5];
r.ch[3] = u.ch[4];
r.ch[4] = u.ch[3];
r.ch[5] = u.ch[2];
r.ch[6] = u.ch[1];
r.ch[7] = u.ch[0];
OutParam = r.iTemp;
}
双鱼理
- 粉丝: 6
- 资源: 20
最新资源
- ta-lib-0.5.1-cp311-cp311-win32.whl
- ta-lib-0.5.1-cp311-cp311-win-arm64.whl
- ta-lib-0.5.1-cp311-cp311-win-amd64.whl
- 微信小程序开发-地图定位.zip
- ta-lib-0.5.1-cp310-cp310-win32.whl
- ta-lib-0.5.1-cp313-cp313-win32.whl
- ta-lib-0.5.1-cp313-cp313-win-amd64.whl
- 这是一个基于html的心形代码.zip
- 安卓系统开发的全部教程
- ta-lib-0.5.1-cp312-cp312-win32.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
前往页