2
3
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:
Darryl Pogue
2012-02-04 19:13:58 -08:00
parent 2493cf8f73
commit b27fc17b00
11 changed files with 15 additions and 67 deletions

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
* *
***/ ***/
#include "../../Pch.h" #include "../pnUtils.h"
#pragma hdrstop
/***************************************************************************** /*****************************************************************************

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
* *
***/ ***/
#include "../../Pch.h" #include "../pnUtils.h"
#pragma hdrstop
/***************************************************************************** /*****************************************************************************

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
* *
***/ ***/
#include "../../Pch.h" #include "../pnUtils.h"
#pragma hdrstop
/***************************************************************************** /*****************************************************************************
* *

View File

@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
* *
***/ ***/
#include "../../Pch.h" #include "../pnUtils.h"
#pragma hdrstop #include "pnProduct/pnProduct.h"
/***************************************************************************** /*****************************************************************************

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
* *
***/ ***/
#include "../../Pch.h" #include "../pnUtils.h"
#pragma hdrstop
/***************************************************************************** /*****************************************************************************

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
* *
***/ ***/
#include "../../Pch.h" #include "../pnUtils.h"
#pragma hdrstop
/**************************************************************************** /****************************************************************************

View File

@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
* *
***/ ***/
#include "../../Pch.h" #include "../pnUtils.h"
#pragma hdrstop
/***************************************************************************** /*****************************************************************************

View File

@ -45,8 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
* *
***/ ***/
#include "../../Pch.h" #include "../pnUtils.h"
#pragma hdrstop #include <rpc.h>
#include <rpcdce.h>
#if 0 #if 0
@ -162,12 +163,12 @@ bool GuidIsNil (const Uuid & uuid) {
const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars) { const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars) {
wchar_t * src; wchar_t * src;
RPC_STATUS s; RPC_STATUS s;
s = UuidToStringW( (GUID *) &uuid, (RPC_WSTR*)&src ); s = UuidToStringW( (GUID *) &uuid, (unsigned short**)&src );
if (RPC_S_OK == s) if (RPC_S_OK == s)
StrCopy(dst, src, chars); StrCopy(dst, src, chars);
else else
StrCopy(dst, L"", chars); StrCopy(dst, L"", chars);
RpcStringFreeW( (RPC_WSTR *)&src ); RpcStringFreeW( (unsigned short**)&src );
return dst; return dst;
} }

View File

@ -55,42 +55,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
***/ ***/
//=========================================================================== //===========================================================================
#ifndef _M_IX86
unsigned MathHighBitPos (uint32_t val) { unsigned MathHighBitPos (uint32_t val) {
ASSERT(val); ASSERT(val);
double f = (double)val; double f = (double)val;
return (*((uint32_t *)&f + 1) >> 20) - 1023; 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

View File

@ -50,27 +50,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "Pch.h" #include "Pch.h"
/*****************************************************************************
*
* Calling conventions
*
***/
#ifdef _M_IX86
#define MATHCALL __fastcall
#else
#define MATHCALL
#endif
/***************************************************************************** /*****************************************************************************
* *
* Bit manipulation functions * Bit manipulation functions
* *
***/ ***/
unsigned MATHCALL MathLowBitPos (uint32_t val); unsigned MathHighBitPos (uint32_t val);
unsigned MATHCALL MathHighBitPos (uint32_t val);
//=========================================================================== //===========================================================================
inline unsigned MathBitCount (uint32_t val) { inline unsigned MathBitCount (uint32_t val) {

View File

@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILSEXE_PCH_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILSEXE_PCH_H
#include "pnUtils/Pch.h" #include "pnUtils/pnUtils.h"
#include "Intern.h" #include "Intern.h"
#include <malloc.h> #include <malloc.h>