Skip to content

Commit

Permalink
Convert even more int parameters and return values to boolean
Browse files Browse the repository at this point in the history
This commit fixes functions that were missed in #181 and d6b0694.
  • Loading branch information
Spasi committed Jan 18, 2017
1 parent d7e1168 commit 8b55292
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
9 changes: 8 additions & 1 deletion doc/notes/3.1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ This build includes the following changes:
- Assimp: Struct member nullability fixes
- Linux: Removed dependencies to newer GLIBC versions.
- LibOVR: Fixed layout of the `ovrInputState` struct.
- OpenAL: Removed buffer auto-sizing from `alcCaptureSamples`. The number of samples must now be specified explicitly, similar to `alcRenderSamplesSOFT`.
- OpenAL: Removed buffer auto-sizing from `alcCaptureSamples`. The number of samples must now be specified explicitly, similar to `alcRenderSamplesSOFT`.

### Breaking Changes

- Mapped more integer parameters and return values to Java `boolean`, that were missed while working on #181.
* Xlib's `Bool`
* OpenCL's `cl_bool`
* DynCall's `DCbool`
2 changes: 1 addition & 1 deletion modules/core/src/main/java/org/lwjgl/opengl/GL.java
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public static GLXCapabilities createCapabilitiesGLX(long display, int screen) {
IntBuffer piMajor = stack.ints(0);
IntBuffer piMinor = stack.ints(0);

if ( glXQueryVersion(display, piMajor, piMinor) == 0 )
if ( !glXQueryVersion(display, piMajor, piMinor) )
throw new IllegalStateException("Failed to query GLX version");

majorVersion = piMajor.get(0);
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/test/java/org/lwjgl/opencl/CLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void testNativeKernel() {
for ( int i = 0; i < bufferContents.capacity(); i++ )
bufferContents.put(i, (byte)i);

checkCLError(clEnqueueWriteBuffer(queue, buffer, CL_TRUE, 0, bufferContents, null, null));
checkCLError(clEnqueueWriteBuffer(queue, buffer, true, 0, bufferContents, null, null));

// Prepare enqueue arguments

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,7 @@ ${access.modifier}interface ${className}I extends CallbackI.${returns.mapping.jn
print("return ")
print("""invoke(
${signature.asSequence().map {
"\t\t\tdcbArg${it.nativeType.argType}(args)${when (it.nativeType.mapping) {
PrimitiveMapping.BOOLEAN,
PrimitiveMapping.BOOLEAN4 -> " != 0"
else -> ""
}}"
"\t\t\tdcbArg${it.nativeType.argType}(args)${if (it.nativeType.mapping === PrimitiveMapping.BOOLEAN4)" != 0" else ""}"
}.joinToString(",\n")}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ val cl_sampler_p = cl_sampler.p

// typedefs

val cl_bool = typedef(cl_uint, "cl_bool")
val cl_bool = typedef(intb, "cl_bool")
val cl_bitfield = typedef(cl_ulong, "cl_bitfield")
val cl_device_type = typedef(cl_bitfield, "cl_device_type")
val cl_platform_info = typedef(cl_uint, "cl_platform_info")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ val DCstruct_p = "DCstruct".p

val DCvoid = NativeType("DCvoid", TypeMapping.VOID)

val DCbool = typedef(int, "DCbool")
val DCbool = typedef(intb, "DCbool")
val DCchar = typedef(char, "DCchar")
val DCuchar = typedef(unsigned_char, "DCuchar")
val DCshort = typedef(short, "DCshort")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package org.lwjgl.system.linux

import org.lwjgl.generator.*

val Bool = typedef(int, "Bool")
val Bool = typedef(intb, "Bool")

val XID = typedef(unsigned_long, "XID")
val VisualID = typedef(unsigned_long, "VisualID")
Expand Down

0 comments on commit 8b55292

Please sign in to comment.