From: <eli...@us...> - 2006-07-15 21:01:23
|
Revision: 2524 Author: elias_naur Date: 2006-07-15 14:01:11 -0700 (Sat, 15 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2524&view=rev Log Message: ----------- Windows: Replace _WIN32 macro with _MSC_VER since the conditionals are really for the MSVC compiler, not for the windows platform in general. Code cleanup. Modified Paths: -------------- trunk/LWJGL/src/native/common/common_tools.c trunk/LWJGL/src/native/common/common_tools.h trunk/LWJGL/src/native/windows/org_lwjgl_input_Cursor.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2006-07-15 20:25:56 UTC (rev 2523) +++ trunk/LWJGL/src/native/common/common_tools.c 2006-07-15 21:01:11 UTC (rev 2524) @@ -39,11 +39,6 @@ #include <jni.h> #include <stdlib.h> - -#ifdef _WIN32 -#include <wtypes.h> -#endif - #include "common_tools.h" #include "org_lwjgl_DefaultSysImplementation.h" @@ -81,7 +76,7 @@ #define BUFFER_SIZE 4000 char buffer[BUFFER_SIZE]; jstring str; -#ifdef _WIN32 +#ifdef _MSC_VER vsnprintf_s(buffer, BUFFER_SIZE, _TRUNCATE, format, ap); #else vsnprintf(buffer, BUFFER_SIZE, format, ap); Modified: trunk/LWJGL/src/native/common/common_tools.h =================================================================== --- trunk/LWJGL/src/native/common/common_tools.h 2006-07-15 20:25:56 UTC (rev 2523) +++ trunk/LWJGL/src/native/common/common_tools.h 2006-07-15 21:01:11 UTC (rev 2524) @@ -57,7 +57,7 @@ #endif #endif -#ifdef _WIN32 +#ifdef _MSC_VER #define inline __inline #include <Basetsd.h> #else Modified: trunk/LWJGL/src/native/windows/org_lwjgl_input_Cursor.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_input_Cursor.c 2006-07-15 20:25:56 UTC (rev 2523) +++ trunk/LWJGL/src/native/windows/org_lwjgl_input_Cursor.c 2006-07-15 21:01:11 UTC (rev 2524) @@ -88,7 +88,7 @@ colorDIB = CreateDIBSection(GetDC(NULL), (BITMAPINFO*)&(bitmapInfo), DIB_RGB_COLORS, - (void**)&(ptrCursorImage), + (void*)&(ptrCursorImage), NULL, 0); srcPtr = pixels; dstPtr = ptrCursorImage; Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2006-07-15 20:25:56 UTC (rev 2523) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2006-07-15 21:01:11 UTC (rev 2524) @@ -119,7 +119,7 @@ message_time = GetMessageTime(); handleMessage_method = (*env)->GetStaticMethodID(env, display_class_global, "handleMessage", "(JIJJJ)Z"); if (handleMessage_method != NULL) - if ((*env)->CallStaticBooleanMethod(env, display_class_global, handleMessage_method, (jlong)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)message_time)) + if ((*env)->CallStaticBooleanMethod(env, display_class_global, handleMessage_method, (jlong)(intptr_t)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)message_time)) return 0; } } @@ -190,7 +190,6 @@ jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I"); int width = (*env)->GetIntField(env, mode, fid_width); int height = (*env)->GetIntField(env, mode, fid_height); - BOOL result; bool isUndecorated; // Whether we're undecorated or not static bool oneShotInitialised = false; if (!oneShotInitialised) { @@ -321,8 +320,6 @@ char *ptrCursorImage; int x, y; char *dstPtr; - int pixelCount; - int scanlinePad; int wordAlignedWidth; int imageSize; unsigned char *maskPixels; @@ -332,8 +329,6 @@ int scanlineWidth; HBITMAP colorDIB; - jsize pixelsLen = width * height; - memset(&bitmapInfo, 0, sizeof(BITMAPINFO)); bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bitmapInfo.bmiHeader.biWidth = width; @@ -343,7 +338,7 @@ bitmapInfo.bmiHeader.biCompression = BI_RGB; colorDIB = CreateDIBSection(GetDC(NULL), (BITMAPINFO*)&(bitmapInfo), - DIB_RGB_COLORS, (void**)&(ptrCursorImage), NULL, 0); + DIB_RGB_COLORS, (void*)&(ptrCursorImage), NULL, 0); if (!ptrCursorImage) { throwException(env, "Could not allocate DIB section."); } @@ -435,7 +430,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIcon16 (JNIEnv *env, jclass clazz, jobject iconBuffer) { - int *imgData = (int *)(*env)->GetDirectBufferAddress(env, iconBuffer); + jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer); freeSmallIcon(); small_icon = createWindowIcon(env, imgData, 16, 16); @@ -453,7 +448,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIcon32 (JNIEnv *env, jclass clazz, jobject iconBuffer) { - int *imgData = (int *)(*env)->GetDirectBufferAddress(env, iconBuffer); + jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer); freeLargeIcon(); large_icon = createWindowIcon(env, imgData, 32, 32); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |