Changed: #825 Remove all warnings when compiling Ryzom

This commit is contained in:
kervala 2011-02-09 14:34:05 +01:00
parent ac68e188ab
commit ec9ab9106a
8 changed files with 21 additions and 12 deletions

View file

@ -52,7 +52,7 @@ public:
*/ */
struct CPtrInfoBase 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) sint RefCount; // RefCount of ptrinfo (!= instance)
bool IsNullPtrInfo; // For dll problems, must use a flag to mark NullPtrInfo. bool IsNullPtrInfo; // For dll problems, must use a flag to mark NullPtrInfo.
}; };

View file

@ -75,6 +75,7 @@ sint WINAPI WinMain(HINSTANCE /* hInstance */, HINSTANCE /* hPrevInstance */, LP
sint main(int argc, char **argv) sint main(int argc, char **argv)
{ {
#endif #endif
NLMISC::CApplicationContext myApplicationContext;
try try
{ {

View file

@ -2,6 +2,10 @@ FILE(GLOB SRC *.cpp)
ADD_EXECUTABLE(nl_sample_command ${SRC}) 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) TARGET_LINK_LIBRARIES(nl_sample_command nelmisc)
NL_DEFAULT_PROPS(nl_sample_command "NeL, Samples, Misc: Commands") NL_DEFAULT_PROPS(nl_sample_command "NeL, Samples, Misc: Commands")
NL_ADD_RUNTIME_FLAGS(nl_sample_command) NL_ADD_RUNTIME_FLAGS(nl_sample_command)

View file

@ -1290,7 +1290,7 @@ template <class T> bool raytrace(T &packedZone, const NLMISC::CVector &start, co
CTriangle tri; CTriangle tri;
CPlane triPlane; CPlane triPlane;
float bestInterDist = FLT_MAX; float bestInterDist = FLT_MAX;
NLMISC::CVector bestNormal; CVector bestNormal(0.f, 0.f, 0.f);
CVector currInter; CVector currInter;
do do
{ {

View file

@ -1741,7 +1741,7 @@ bool CSkeletonModel::computeRenderedBBoxWithBoneSphere(NLMISC::CAABBox &bbox, b
updateSkinRenderLists(); updateSkinRenderLists();
// **** Compute The BBox with Bones of the skeleton // **** 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++) for(uint i=0;i<_BoneToCompute.size();i++)
{ {
CBone *bone= _BoneToCompute[i].Bone; CBone *bone= _BoneToCompute[i].Bone;
@ -2225,7 +2225,7 @@ bool CSkeletonModel::computeWorldBBoxForShadow(NLMISC::CAABBox &worldBB)
return false; return false;
// **** Compute The BBox with Bones of the skeleton // **** 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++) for(i=0;i<_BoneToCompute.size();i++)
{ {
CBone *bone= _BoneToCompute[i].Bone; CBone *bone= _BoneToCompute[i].Bone;

View file

@ -33,12 +33,16 @@ namespace NLMISC
static void readPNGData(png_structp png_ptr, png_bytep data, png_size_t length) 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) 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) 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); 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; 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 // free all of the memory associated with the png_ptr and info_ptr
png_destroy_read_struct(&png_ptr, &info_ptr, NULL); png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
@ -237,7 +241,7 @@ bool CBitmap::writePNG( NLMISC::IStream &f, uint32 d)
return false; return false;
} }
if (setjmp(png_ptr->jmpbuf)) if (setjmp(png_jmpbuf(png_ptr)))
{ {
png_destroy_write_struct( &png_ptr, (png_info**)NULL ); png_destroy_write_struct( &png_ptr, (png_info**)NULL );
nlwarning("couldn't set setjmp"); nlwarning("couldn't set setjmp");

View file

@ -61,7 +61,7 @@ CTaskManager::~CTaskManager()
void CTaskManager::run(void) void CTaskManager::run(void)
{ {
IRunnable *runnableTask; IRunnable *runnableTask;
float priorityTask; float priorityTask = 0.f;
while(_ThreadRunning) while(_ThreadRunning)
{ {
{ {

View file

@ -178,11 +178,11 @@ TTicks CTime::getPerformanceTime ()
return mach_absolute_time(); return mach_absolute_time();
#else #else
#if defined(HAVE_X86_64) #if defined(HAVE_X86_64)
unsigned long long int hi, lo; uint64 hi, lo;
__asm__ volatile (".byte 0x0f, 0x31" : "=a" (lo), "=d" (hi)); __asm__ volatile (".byte 0x0f, 0x31" : "=a" (lo), "=d" (hi));
return (hi << 32) | (lo & 0xffffffff); return (hi << 32) | (lo & 0xffffffff);
#elif defined(HAVE_X86) and !defined(NL_OS_MAC) #elif defined(HAVE_X86) and !defined(NL_OS_MAC)
unsigned long long int x; uint64 x;
// RDTSC - Read time-stamp counter into EDX:EAX. // RDTSC - Read time-stamp counter into EDX:EAX.
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x)); __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x; return x;