From ab0f3cd03f1c66894b34211aa0d45eb20cb2c42c Mon Sep 17 00:00:00 2001 From: nkorslund Date: Wed, 2 Jul 2008 14:59:05 +0000 Subject: [PATCH] Changed "int" to "int32_t" in all extern "C" calls in C++. git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@6 ea6a568a-9f4f-0410-981a-c910a81bb256 --- ogre/cpp_bsaarchive.cpp | 6 +++--- ogre/cpp_framelistener.cpp | 8 ++++---- ogre/cpp_interface.cpp | 16 ++++++++-------- ogre/cpp_overlay.cpp | 2 +- sound/cpp_audiere.cpp | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ogre/cpp_bsaarchive.cpp b/ogre/cpp_bsaarchive.cpp index bb63bcdfa..e2e903a46 100644 --- a/ogre/cpp_bsaarchive.cpp +++ b/ogre/cpp_bsaarchive.cpp @@ -29,11 +29,11 @@ // Callbacks to D code // Does the file exist in the archives? -extern "C" int d_bsaExists(const char *filename); +extern "C" int32_t d_bsaExists(const char *filename); // Open a file. Return the pointer and size. extern "C" void d_bsaOpenFile(const char *filename, - void **retPtr, unsigned int *retSize); + void **retPtr, uint32_t *retSize); // This archive does not cover one .bsa file, instead it interacts @@ -57,7 +57,7 @@ public: { //std::cout << "open(" << filename << ")\n"; void *ptr; - unsigned int size; + uint32_t size; // Open the file d_bsaOpenFile(filename.c_str(), &ptr, &size); diff --git a/ogre/cpp_framelistener.cpp b/ogre/cpp_framelistener.cpp index 818e180fa..2440140aa 100644 --- a/ogre/cpp_framelistener.cpp +++ b/ogre/cpp_framelistener.cpp @@ -25,12 +25,12 @@ // Callbacks to D code. // Called once each frame -extern "C" int d_frameStarted(float time); +extern "C" int32_t d_frameStarted(float time); // Handle events -extern "C" void d_handleKey(int keycode, unsigned int text); +extern "C" void d_handleKey(int keycode, uint32_t text); extern "C" void d_handleMouseMove(const OIS::MouseState *state); -extern "C" void d_handleMouseButton(const OIS::MouseState *state, int button); +extern "C" void d_handleMouseButton(const OIS::MouseState *state, int32_t button); // Frame listener, passed to Ogre. The only thing we use this for is // to capture input and pass control to D code. @@ -101,7 +101,7 @@ InputListener mInput; // Functions called from D during event handling -extern "C" int cpp_isPressed(int keysym) +extern "C" int32_t cpp_isPressed(int32_t keysym) { return mKeyboard->isKeyDown((OIS::KeyCode)keysym); } diff --git a/ogre/cpp_interface.cpp b/ogre/cpp_interface.cpp index bf2486d59..3e6968ad2 100644 --- a/ogre/cpp_interface.cpp +++ b/ogre/cpp_interface.cpp @@ -41,7 +41,7 @@ extern "C" void cpp_cleanup() } } -extern "C" int cpp_configure() +extern "C" int32_t cpp_configure() { mRoot = new Root(); @@ -345,13 +345,13 @@ String LASTNAME; // Load the contents of a mesh extern "C" void cpp_createMesh( char* name, // Name of the mesh - int numVerts, // Number of vertices + int32_t numVerts, // Number of vertices float* vertices, // Vertex list float* normals, // Normal list float* colors, // Vertex colors float* uvs, // Texture coordinates - int numFaces, // Number of faces*3 - unsigned short* faces, // Faces + int32_t numFaces, // Number of faces*3 + uint16_t* faces, // Faces float radius, // Bounding sphere char* material, // Material // Bounding box @@ -560,7 +560,7 @@ extern "C" SceneNode* cpp_createNode( char *name, float *trafo, SceneNode *parent, - int noRot) + int32_t noRot) { //std::cout << "cpp_createNode(" << name << ")"; SceneNode *node = parent->createChildSceneNode(name); @@ -650,7 +650,7 @@ extern "C" void cpp_loadMemImage( char* name, // Name to give the resource char* type, // Image type (eg. "dds") void* data, // Pointer to file data - unsigned int size, // Size + uint32_t size,// Size Texture* txt)// Texture { @@ -704,7 +704,7 @@ extern "C" void* cpp_setupSkeleton(char* name) } // Use this later when loading textures directly from NIF files -extern "C" void cpp_createTexture(char* name, uint width, uint height) +extern "C" void cpp_createTexture(char* name, uint32_t width, uint32_t height) { TexturePtr texture = TextureManager::getSingleton().createManual( name, // name @@ -748,7 +748,7 @@ extern "C" void cpp_createTexture(char* name, uint width, uint height) material->getTechnique(0)->getPass(0)->setSceneBlending(SBT_TRANSPARENT_ALPHA); } -extern "C" void *cpp_insertBone(char* name, void* rootBone, int index) +extern "C" void *cpp_insertBone(char* name, void* rootBone, int32_t index) { return (void*) ( ((Bone*)rootBone)->createChild(index) ); } diff --git a/ogre/cpp_overlay.cpp b/ogre/cpp_overlay.cpp index 4db52df95..f5eccb77d 100644 --- a/ogre/cpp_overlay.cpp +++ b/ogre/cpp_overlay.cpp @@ -32,7 +32,7 @@ void crap(char *p, ColourValue v) std::cerr << p << ": " << v.getAsRGBA() << "\n"; } -extern "C" void cpp_debug(int i) +extern "C" void cpp_debug(int32_t i) { std::cerr << "Running cpp_debug(" << i << ")\n"; diff --git a/sound/cpp_audiere.cpp b/sound/cpp_audiere.cpp index 64abdabcf..e4e1620ae 100644 --- a/sound/cpp_audiere.cpp +++ b/sound/cpp_audiere.cpp @@ -33,7 +33,7 @@ using namespace std; AudioDevicePtr device; -extern "C" int cpp_openDevice() +extern "C" int32_t cpp_openDevice() { device = OpenDevice(""); if (!device) return 1; @@ -86,7 +86,7 @@ extern "C" void cpp_destroyInstance(OutputStream *sound) sound->unref(); } -extern "C" int cpp_isPlaying(OutputStream *sound) +extern "C" int32_t cpp_isPlaying(OutputStream *sound) { if(sound && sound->isPlaying()) return 1; return 0;