summaryrefslogtreecommitdiffstats
path: root/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.cpp')
-rw-r--r--opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.cpp34
1 files changed, 13 insertions, 21 deletions
diff --git a/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.cpp b/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.cpp
index 5441d66..dd656b6 100644
--- a/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.cpp
+++ b/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.cpp
@@ -1,27 +1,19 @@
-#include <string.h>
+#include <stdlib.h>
/* void glGetShaderInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */
-static
-jstring
-android_glGetShaderInfoLog (JNIEnv *_env, jobject _this, jint shader) {
+static jstring android_glGetShaderInfoLog(JNIEnv *_env, jobject, jint shader) {
GLint infoLen = 0;
- jstring _result = 0;
- char* buf = 0;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
- if (infoLen) {
- char* buf = (char*) malloc(infoLen);
- if (buf == 0) {
- _env->ThrowNew(IAEClass, "out of memory");
- goto exit;
- }
- glGetShaderInfoLog(shader, infoLen, NULL, buf);
- _result = _env->NewStringUTF(buf);
- } else {
- _result = _env->NewStringUTF("");
+ if (!infoLen) {
+ return _env->NewStringUTF("");
}
-exit:
- if (buf) {
- free(buf);
+ char* buf = (char*) malloc(infoLen);
+ if (buf == NULL) {
+ jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
+ return NULL;
}
- return _result;
-} \ No newline at end of file
+ glGetShaderInfoLog(shader, infoLen, NULL, buf);
+ jstring result = _env->NewStringUTF(buf);
+ free(buf);
+ return result;
+}