Browse Source

Some fixes for the Win32 branch of pnUtils.

Darryl Pogue 13 years ago
parent
commit
b27fc17b00
  1. 3
      Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp
  2. 3
      Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp
  3. 3
      Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp
  4. 4
      Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp
  5. 3
      Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp
  6. 3
      Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp
  7. 3
      Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp
  8. 9
      Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp
  9. 33
      Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp
  10. 16
      Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h
  11. 2
      Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h

3
Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp

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

3
Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp

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

3
Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp

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

4
Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp

@ -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"
/*****************************************************************************

3
Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp

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

3
Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp

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

3
Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp

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

9
Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp

@ -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;
}

33
Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp

@ -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

16
Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h

@ -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) {

2
Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h

@ -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>

Loading…
Cancel
Save