mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-17 13:01:41 +00:00
Changed: #825 Remove all warnings when compiling Ryzom
This commit is contained in:
parent
de5b52f7f1
commit
026657b28c
8 changed files with 21 additions and 12 deletions
|
@ -52,7 +52,7 @@ public:
|
|||
*/
|
||||
struct CPtrInfoBase
|
||||
{
|
||||
CRefCount const* Ptr; // to know if the instance is valid.
|
||||
const CRefCount* Ptr; // to know if the instance is valid.
|
||||
sint RefCount; // RefCount of ptrinfo (!= instance)
|
||||
bool IsNullPtrInfo; // For dll problems, must use a flag to mark NullPtrInfo.
|
||||
};
|
||||
|
|
|
@ -75,6 +75,7 @@ sint WINAPI WinMain(HINSTANCE /* hInstance */, HINSTANCE /* hPrevInstance */, LP
|
|||
sint main(int argc, char **argv)
|
||||
{
|
||||
#endif
|
||||
NLMISC::CApplicationContext myApplicationContext;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -2,6 +2,10 @@ FILE(GLOB SRC *.cpp)
|
|||
|
||||
ADD_EXECUTABLE(nl_sample_command ${SRC})
|
||||
|
||||
IF(WITH_STLPORT)
|
||||
TARGET_LINK_LIBRARIES(nl_sample_command ${CMAKE_THREAD_LIBS_INIT})
|
||||
ENDIF(WITH_STLPORT)
|
||||
|
||||
TARGET_LINK_LIBRARIES(nl_sample_command nelmisc)
|
||||
NL_DEFAULT_PROPS(nl_sample_command "NeL, Samples, Misc: Commands")
|
||||
NL_ADD_RUNTIME_FLAGS(nl_sample_command)
|
||||
|
|
|
@ -1290,7 +1290,7 @@ template <class T> bool raytrace(T &packedZone, const NLMISC::CVector &start, co
|
|||
CTriangle tri;
|
||||
CPlane triPlane;
|
||||
float bestInterDist = FLT_MAX;
|
||||
NLMISC::CVector bestNormal;
|
||||
CVector bestNormal(0.f, 0.f, 0.f);
|
||||
CVector currInter;
|
||||
do
|
||||
{
|
||||
|
|
|
@ -1741,7 +1741,7 @@ bool CSkeletonModel::computeRenderedBBoxWithBoneSphere(NLMISC::CAABBox &bbox, b
|
|||
updateSkinRenderLists();
|
||||
|
||||
// **** Compute The BBox with Bones of the skeleton
|
||||
CVector minBB, maxBB;
|
||||
CVector minBB(0.f, 0.f, 0.f), maxBB(0.f, 0.f, 0.f);
|
||||
for(uint i=0;i<_BoneToCompute.size();i++)
|
||||
{
|
||||
CBone *bone= _BoneToCompute[i].Bone;
|
||||
|
@ -2225,7 +2225,7 @@ bool CSkeletonModel::computeWorldBBoxForShadow(NLMISC::CAABBox &worldBB)
|
|||
return false;
|
||||
|
||||
// **** Compute The BBox with Bones of the skeleton
|
||||
CVector minBB, maxBB;
|
||||
CVector minBB(0.f, 0.f, 0.f), maxBB(0.f, 0.f, 0.f);
|
||||
for(i=0;i<_BoneToCompute.size();i++)
|
||||
{
|
||||
CBone *bone= _BoneToCompute[i].Bone;
|
||||
|
|
|
@ -33,12 +33,16 @@ namespace NLMISC
|
|||
|
||||
static void readPNGData(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
((IStream*) png_ptr->io_ptr)->serialBuffer((uint8*)data, (uint)length);
|
||||
IStream *stream = static_cast<IStream*>(png_get_io_ptr(png_ptr));
|
||||
if (stream)
|
||||
stream->serialBuffer((uint8*)data, (uint)length);
|
||||
}
|
||||
|
||||
static void writePNGData(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
((IStream*) png_ptr->io_ptr)->serialBuffer((uint8*)data, (uint)length);
|
||||
IStream *stream = static_cast<IStream*>(png_get_io_ptr(png_ptr));
|
||||
if (stream)
|
||||
stream->serialBuffer((uint8*)data, (uint)length);
|
||||
}
|
||||
|
||||
static void setPNGWarning(png_struct * /* png_ptr */, const char* message)
|
||||
|
@ -50,7 +54,7 @@ static void setPNGError(png_struct *png_ptr, const char* message)
|
|||
{
|
||||
setPNGWarning(png_ptr, message);
|
||||
|
||||
longjmp(png_ptr->jmpbuf, 1);
|
||||
longjmp(png_jmpbuf(png_ptr), 1);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------*\
|
||||
|
@ -79,7 +83,7 @@ uint8 CBitmap::readPNG( NLMISC::IStream &f )
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (setjmp(png_ptr->jmpbuf))
|
||||
if (setjmp(png_jmpbuf(png_ptr)))
|
||||
{
|
||||
// free all of the memory associated with the png_ptr and info_ptr
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
|
@ -237,7 +241,7 @@ bool CBitmap::writePNG( NLMISC::IStream &f, uint32 d)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (setjmp(png_ptr->jmpbuf))
|
||||
if (setjmp(png_jmpbuf(png_ptr)))
|
||||
{
|
||||
png_destroy_write_struct( &png_ptr, (png_info**)NULL );
|
||||
nlwarning("couldn't set setjmp");
|
||||
|
|
|
@ -61,7 +61,7 @@ CTaskManager::~CTaskManager()
|
|||
void CTaskManager::run(void)
|
||||
{
|
||||
IRunnable *runnableTask;
|
||||
float priorityTask;
|
||||
float priorityTask = 0.f;
|
||||
while(_ThreadRunning)
|
||||
{
|
||||
{
|
||||
|
|
|
@ -178,11 +178,11 @@ TTicks CTime::getPerformanceTime ()
|
|||
return mach_absolute_time();
|
||||
#else
|
||||
#if defined(HAVE_X86_64)
|
||||
unsigned long long int hi, lo;
|
||||
uint64 hi, lo;
|
||||
__asm__ volatile (".byte 0x0f, 0x31" : "=a" (lo), "=d" (hi));
|
||||
return (hi << 32) | (lo & 0xffffffff);
|
||||
#elif defined(HAVE_X86) and !defined(NL_OS_MAC)
|
||||
unsigned long long int x;
|
||||
uint64 x;
|
||||
// RDTSC - Read time-stamp counter into EDX:EAX.
|
||||
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
|
||||
return x;
|
||||
|
|
Loading…
Reference in a new issue