remove some warnings

This commit is contained in:
Erwin Coumans
2014-08-21 13:31:12 -07:00
parent 590504bf72
commit 4af9c5a4c9
24 changed files with 1136 additions and 1104 deletions

View File

@@ -124,7 +124,8 @@ static int loadCurrentDemoEntry(const char* startFileName)
FILE* f = fopen(startFileName,"r");
if (f)
{
fscanf(f,"%d",&currentEntry);
int result;
result = fscanf(f,"%d",&currentEntry);
fclose(f);
}
return currentEntry;

View File

@@ -5,7 +5,7 @@
#include "Bullet3OpenCL/Initialize/b3OpenCLUtils.h"
#define MSTRINGIFY(A) #A
static char* particleKernelsString =
static const char* particleKernelsString =
#include "ParticleKernels.cl"
#define INTEROPKERNEL_SRC_PATH "demo/gpudemo/ParticleKernels.cl"
@@ -256,7 +256,7 @@ void ParticleDemo::setupScene(const ConstructionInfo& ci)
int id = m_instancingRenderer->registerGraphicsInstance(shapeId,position,quaternion,color,scaling);
void* userPtr = (void*)userIndex;
int collidableIndex = userIndex;
b3Vector3 aabbMin,aabbMax;
b3Vector3 particleRadius=b3MakeVector3(rad,rad,rad);

View File

@@ -94,7 +94,8 @@ static int loadCurrentDemoEntry(const char* startFileName)
FILE* f = fopen(startFileName,"r");
if (f)
{
fscanf(f,"%d",&currentEntry);
int bytesScanned;
bytesScanned = fscanf(f,"%d",&currentEntry);
fclose(f);
}
return currentEntry;
@@ -534,7 +535,7 @@ FILE* defaultOutput = stdout;
void myprintf(const char* msg)
{
fprintf(defaultOutput,msg);
fprintf(defaultOutput,"%s",msg);
}
@@ -820,7 +821,7 @@ int main(int argc, char* argv[])
for (int i=0;i<nummsg;i++)
{
char txt[512];
sprintf(txt,msg[i]);
sprintf(txt,"%s",msg[i]);
//sth_draw_text(stash, droidRegular,i, 10, dy-spacing, txt, &dx,g_OpenGLWidth,g_OpenGLHeight);
sth_draw_text(stash, droidRegular,fontSize, 10, spacing, txt, &dx,g_OpenGLWidth,g_OpenGLHeight);
spacing+=fontSize;

View File

@@ -569,7 +569,7 @@ int b3BulletDataExtractor::createSphereShape( float radius, const Bullet3Seriali
int b3BulletDataExtractor::createPlaneShape( const Bullet3SerializeBullet2::b3Vector3FloatData& planeNormal, float planeConstant, const Bullet3SerializeBullet2::b3Vector3FloatData& localScaling)
{
printf("createPlaneShape with normal %f,%f,%f and planeConstant\n",planeNormal.m_floats[0], planeNormal.m_floats[1],planeNormal.m_floats[2],planeConstant);
printf("createPlaneShape with normal %f,%f,%f and planeConstant %f\n",planeNormal.m_floats[0], planeNormal.m_floats[1],planeNormal.m_floats[2],planeConstant);
return -1;
}

View File

@@ -218,7 +218,7 @@ void ConcaveScene::setupScene(const ConstructionInfo& ci)
//char* fileName = "teddy.obj";//"plane.obj";
// char* fileName = "sponza_closed.obj";//"plane.obj";
//char* fileName = "leoTest1.obj";
char* fileName = "samurai_monastry.obj";
const char* fileName = "samurai_monastry.obj";
// char* fileName = "teddy2_VHACD_CHs.obj";
b3Vector3 shift1=b3MakeVector3(0,0,0);//0,230,80);//150,-100,-120);
@@ -377,7 +377,7 @@ void ConcaveCompoundScene::setupScene(const ConstructionInfo& ci)
void ConcaveCompound2Scene::createDynamicObjects(const ConstructionInfo& ci)
{
char* fileName = "teddy2_VHACD_CHs.obj";
const char* fileName = "teddy2_VHACD_CHs.obj";
//char* fileName = "cube_offset.obj";

View File

@@ -365,7 +365,7 @@ void ImportUrdfDemo::initPhysics(GraphicsPhysicsBridge& gfxBridge)
m_dynamicsWorld->setGravity(gravity);
int argc=0;
char* filename="somefile.urdf";
const char* filename="somefile.urdf";
std::string xml_string;

View File

@@ -14,7 +14,7 @@ extern "C" {
}
char* sLuaFileName = "init_physics.lua";
const char* sLuaFileName = "init_physics.lua";
static const float scaling=0.35f;
static LuaPhysicsSetup* sLuaDemo = 0;

View File

@@ -229,7 +229,8 @@ int sth_add_font(struct sth_stash* stash, const char* path)
fseek(fp,0,SEEK_SET);
data = (unsigned char*)malloc(datasize);
if (data == NULL) goto error;
fread(data, 1, datasize, fp);
int bytesRead;
bytesRead = fread(data, 1, datasize, fp);
fclose(fp);
fp = 0;

View File

@@ -63,6 +63,7 @@ typedef Status (*PFNXGETWINDOWATTRIBUTES) (Display* a,Window b,XWindowAttributes
#define X11_LIBRARY "libX11.so.6"
#define MyXSync m_data->m_x11_XSync
#define MyXGetKeyboardMapping m_data->m_x11_XGetKeyboardMapping
#define MyXSetErrorHandler m_data->m_x11_XSetErrorHandler
#define MyXOpenDisplay m_data->m_x11_XOpenDisplay
#define MyXCreateColormap m_data->m_x11_XCreateColormap
@@ -87,6 +88,7 @@ typedef Status (*PFNXGETWINDOWATTRIBUTES) (Display* a,Window b,XWindowAttributes
#else
#define MyXSync XSync
#define MyXGetKeyboardMapping XGetKeyboardMapping
#define MyXSetErrorHandler XSetErrorHandler
#define MyXOpenDisplay XOpenDisplay
#define MyXCreateColormap XCreateColormap
@@ -612,9 +614,21 @@ void X11OpenGLWindow::closeWindow()
int X11OpenGLWindow::getAsciiCodeFromVirtualKeycode(int keycode)
{
int result = 0;
KeySym key, key_lc, key_uc;
key = MyXKeycodeToKeysym( m_data->m_dpy, keycode, 0 );
int keysyms_per_keycode_return;
KeySym *keysym = MyXGetKeyboardMapping(m_data->m_dpy,
keycode,
1,
&keysyms_per_keycode_return);
key = keysym[0];
//key = MyXKeycodeToKeysym( m_data->m_dpy, keycode, 0 );
switch( key )
{
case XK_Escape: return B3G_ESCAPE;
@@ -660,9 +674,12 @@ int X11OpenGLWindow::getAsciiCodeFromVirtualKeycode(int keycode)
{
return (int) key;
}
return -1;
result = -1;
}
return 0;
MyXFree(keysym);
return result;
}
void X11OpenGLWindow::pumpMessage()

View File

@@ -5,9 +5,15 @@
--flags {}
defines { "LUA_COMPAT_ALL"}
if os.is("Linux") then
defines {"LUA_USE_LINUX"}
end
if os.is("MacOSX") then
defines {"LUA_USE_MACOSX"}
end
targetdir "../../lib"
includedirs {
"src"

View File

@@ -115,6 +115,7 @@ static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym);
#if defined(LUA_USE_DLOPEN)
/*
** {========================================================================
** This is an implementation of loadlib based on the dlfcn interface.

View File

@@ -42,8 +42,8 @@
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
#define LUA_USE_READLINE /* needs some extra libraries */
//#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
//#define LUA_USE_READLINE /* needs some extra libraries */
#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */
#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */
#define LUA_USE_LONGLONG /* assume support for long long */
@@ -51,8 +51,8 @@
#if defined(LUA_USE_MACOSX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* does not need -ldl */
#define LUA_USE_READLINE /* needs an extra library: -lreadline */
//#define LUA_USE_DLOPEN /* does not need -ldl */
//#define LUA_USE_READLINE /* needs an extra library: -lreadline */
#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */
#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */
#define LUA_USE_LONGLONG /* assume support for long long */

View File

@@ -26,6 +26,8 @@
http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
Encryption is not supported.
*/
#define NOCRYPT
#define NOUNCRYPT
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))

View File

@@ -277,7 +277,8 @@ void b3GpuGridBroadphase::calculateOverlappingPairs(int maxPairs)
b3AlignedObjectArray<b3Int4> pairsCpu;
m_gpuPairs.copyToHost(pairsCpu);
printf("m_gpuPairs.size()=%d\n",m_gpuPairs.size());
int sz = m_gpuPairs.size();
printf("m_gpuPairs.size()=%d\n",sz);
for (int i=0;i<m_gpuPairs.size();i++)
{
printf("pair %d = %d,%d\n",i,pairsCpu[i].x,pairsCpu[i].y);

View File

@@ -782,7 +782,8 @@ cl_program b3OpenCLUtils_compileCLProgramFromString(cl_context clContext, cl_dev
binarySize = ftell( file );
rewind( file );
binary = (char*)malloc(sizeof(char)*binarySize);
fread( binary, sizeof(char), binarySize, file );
int bytesRead;
bytesRead = fread( binary, sizeof(char), binarySize, file );
fclose( file );
m_cpProgram = clCreateProgramWithBinary( clContext, 1,&device, &binarySize, (const unsigned char**)&binary, 0, &status );

View File

@@ -74,7 +74,8 @@ bFile::bFile(const char *filename, const char headerString[7])
fseek(fp, 0L, SEEK_SET);
mFileBuffer = (char*)malloc(mFileLen+1);
fread(mFileBuffer, mFileLen, 1, fp);
int bytesRead;
bytesRead = fread(mFileBuffer, mFileLen, 1, fp);
fclose(fp);
@@ -1268,7 +1269,7 @@ int bFile::resolvePointersStructRecursive(char *strcPtr, int dna_nr, int verbose
}
//skip the *
printf("<%s type=\"pointer\"> ",&memName[1]);
printf("%d ", array[a]);
printf("%p ", array[a]);
printf("</%s>\n",&memName[1]);
}
@@ -1286,7 +1287,7 @@ int bFile::resolvePointersStructRecursive(char *strcPtr, int dna_nr, int verbose
printf(" ");
}
printf("<%s type=\"pointer\"> ",&memName[1]);
printf("%d ", ptr);
printf("%p ", ptr);
printf("</%s>\n",&memName[1]);
}
ptr = findLibPointer(ptr);
@@ -1467,7 +1468,7 @@ void bFile::resolvePointers(int verboseMode)
char* oldType = fileDna->getType(oldStruct[0]);
if (verboseMode & FD_VERBOSE_EXPORT_XML)
printf(" <%s pointer=%d>\n",oldType,dataChunk.oldPtr);
printf(" <%s pointer=%p>\n",oldType,dataChunk.oldPtr);
resolvePointersChunk(dataChunk, verboseMode);

View File

@@ -47,6 +47,7 @@ class btIDebugDraw
DBG_DrawConstraintLimits = (1 << 12),
DBG_FastWireframe = (1<<13),
DBG_DrawNormals = (1<<14),
DBG_DrawFrames = (1<<15),
DBG_MAX_DEBUG_DRAW_MODE
};
@@ -147,7 +148,7 @@ class btIDebugDraw
const btVector3& vx = axis;
btVector3 vy = normal.cross(axis);
btScalar step = stepDegrees * SIMD_RADS_PER_DEG;
int nSteps = (int)((maxAngle - minAngle) / step);
int nSteps = (int)btFabs((maxAngle - minAngle) / step);
if(!nSteps) nSteps = 1;
btVector3 prev = center + radiusA * vx * btCos(minAngle) + radiusB * vy * btSin(minAngle);
if(drawSect)
@@ -441,7 +442,6 @@ class btIDebugDraw
virtual void flushLines()
{
}
};

0
src/LinearMath/btPoolAllocator.h Executable file → Normal file
View File

View File

@@ -97,7 +97,7 @@ inline int btGetVersion()
#ifdef BT_DEBUG
#ifdef _MSC_VER
#include <stdio.h>
#define btAssert(x) { if(!(x)){printf("Assert " __FILE__ ":%u ("#x")\n", __LINE__);__debugbreak(); }}
#define btAssert(x) { if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);__debugbreak(); }}
#else//_MSC_VER
#include <assert.h>
#define btAssert assert
@@ -125,7 +125,7 @@ inline int btGetVersion()
#ifdef __SPU__
#include <spu_printf.h>
#define printf spu_printf
#define btAssert(x) {if(!(x)){printf("Assert " __FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
#define btAssert(x) {if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
#else
#define btAssert assert
#endif

View File

@@ -272,7 +272,7 @@ namespace
unzFile zipfile = unzOpen( relativeFileName);
if ( zipfile == NULL )
{
printf( "%s: not found\n" );
printf( "%s: not found\n" ,relativeFileName);
}

View File

@@ -111,7 +111,7 @@ __kernel void testKernel( __global int* testData, __global b3Contact4Data_t* c
void myprintf(const char* msg)
{
//OutputDebugStringA(msg);
printf(msg);
printf("%s",msg);
}
int main(int argc, char* argv[])