Fixed some native compilation warnings.

This commit is contained in:
Ioannis Tsakpinis 2014-08-04 22:25:12 +03:00
parent 4aac231951
commit cb759158e7
3 changed files with 7 additions and 5 deletions

View File

@ -398,7 +398,7 @@ public class NativeMethodStubsGenerator {
writer.println("\twhile ( " + n + "_i < " + pointerArray_annotation.value() + " ) {");
if ( lengths.length() == 0 ) {
writer.println("\t\t" + param.getSimpleName() + n + "[" + n + "_i++] = " + n + "_address;");
writer.println("\t\t" + n + "_address += strlen(" + n + "_address) + 1;");
writer.println("\t\t" + n + "_address += strlen((const char *)" + n + "_address) + 1;");
} else {
writer.println("\t\t" + param.getSimpleName() + n + "[" + n + "_i] = " + n + "_address;");
writer.println("\t\t" + n + "_address += " + lengths + BUFFER_ADDRESS_POSTFIX + "[" + n + "_i++];");

View File

@ -188,8 +188,8 @@ static void setWindowTitle(Display *disp, Window window, jlong title, jint len)
static void setClassHint(Display *disp, Window window, jlong wm_name, jlong wm_class) {
XClassHint* hint = XAllocClassHint();
hint->res_name = (const unsigned char *)(intptr_t)wm_name;
hint->res_class = (const unsigned char *)(intptr_t)wm_class;
hint->res_name = (char *)(intptr_t)wm_name;
hint->res_class = (char *)(intptr_t)wm_class;
XSetClassHint(disp, window, hint);

View File

@ -101,6 +101,8 @@ NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool g
bpp = 16;
else if(CFStringCompare(pixEnc, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
bpp = 8;
else
bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
} else {
bpp = CGDisplayBitsPerPixel(kCGDirectMainDisplay);
}
@ -118,9 +120,9 @@ NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool g
bool stereo = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "stereo", "Z"));
bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z"));
// TODO: Add floating_point_packed attribute below
bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
//bool floating_point_packed = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point_packed", "Z"));
// TODO: Add sRGB attribute below
bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
//bool sRGB = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "sRGB", "Z"));
attrib_list_t attribs;
jboolean allow_software_acceleration = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");