mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Some fixes for the Win32 branch of pnUtils.
This commit is contained in:
@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
#include "../../Pch.h"
|
||||
#pragma hdrstop
|
||||
#include "../pnUtils.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
#include "../../Pch.h"
|
||||
#pragma hdrstop
|
||||
#include "../pnUtils.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
#include "../../Pch.h"
|
||||
#pragma hdrstop
|
||||
#include "../pnUtils.h"
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
|
@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
#include "../../Pch.h"
|
||||
#pragma hdrstop
|
||||
#include "../pnUtils.h"
|
||||
#include "pnProduct/pnProduct.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
#include "../../Pch.h"
|
||||
#pragma hdrstop
|
||||
#include "../pnUtils.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
#include "../../Pch.h"
|
||||
#pragma hdrstop
|
||||
#include "../pnUtils.h"
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
#include "../../Pch.h"
|
||||
#pragma hdrstop
|
||||
#include "../pnUtils.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -45,8 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
#include "../../Pch.h"
|
||||
#pragma hdrstop
|
||||
#include "../pnUtils.h"
|
||||
#include <rpc.h>
|
||||
#include <rpcdce.h>
|
||||
|
||||
#if 0
|
||||
|
||||
@ -162,12 +163,12 @@ bool GuidIsNil (const Uuid & uuid) {
|
||||
const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars) {
|
||||
wchar_t * src;
|
||||
RPC_STATUS s;
|
||||
s = UuidToStringW( (GUID *) &uuid, (RPC_WSTR*)&src );
|
||||
s = UuidToStringW( (GUID *) &uuid, (unsigned short**)&src );
|
||||
if (RPC_S_OK == s)
|
||||
StrCopy(dst, src, chars);
|
||||
else
|
||||
StrCopy(dst, L"", chars);
|
||||
RpcStringFreeW( (RPC_WSTR *)&src );
|
||||
RpcStringFreeW( (unsigned short**)&src );
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
@ -55,42 +55,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
#ifndef _M_IX86
|
||||
|
||||
unsigned MathHighBitPos (uint32_t val) {
|
||||
ASSERT(val);
|
||||
double f = (double)val;
|
||||
return (*((uint32_t *)&f + 1) >> 20) - 1023;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
__declspec(naked) unsigned __fastcall MathHighBitPos (uint32_t) {
|
||||
__asm {
|
||||
bsr eax, ecx
|
||||
ret 0
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//===========================================================================
|
||||
#ifndef _M_IX86
|
||||
|
||||
unsigned MathLowBitPos (uint32_t val) {
|
||||
val &= ~(val - 1); // clear all but the low bit
|
||||
ASSERT(val);
|
||||
double f = (double)val;
|
||||
return (*((uint32_t *)&f + 1) >> 20) - 1023;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
__declspec(naked) unsigned __fastcall MathLowBitPos (uint32_t) {
|
||||
__asm {
|
||||
bsf eax, ecx
|
||||
ret 0
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -50,27 +50,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "Pch.h"
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Calling conventions
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef _M_IX86
|
||||
#define MATHCALL __fastcall
|
||||
#else
|
||||
#define MATHCALL
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Bit manipulation functions
|
||||
*
|
||||
***/
|
||||
|
||||
unsigned MATHCALL MathLowBitPos (uint32_t val);
|
||||
unsigned MATHCALL MathHighBitPos (uint32_t val);
|
||||
unsigned MathHighBitPos (uint32_t val);
|
||||
|
||||
//===========================================================================
|
||||
inline unsigned MathBitCount (uint32_t val) {
|
||||
|
@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILSEXE_PCH_H
|
||||
|
||||
|
||||
#include "pnUtils/Pch.h"
|
||||
#include "pnUtils/pnUtils.h"
|
||||
#include "Intern.h"
|
||||
|
||||
#include <malloc.h>
|
||||
|
Reference in New Issue
Block a user