struct gl2_shader_intf **x = (struct gl2_shader_intf **)\
lookup_handle (ctx, handle, UIID_SHADER, function);
-#define GET_LINKED_PROGRAM(x, handle, function)\
- GET_PROGRAM(x, handle, function);\
- if (x != NULL && (**x).GetLinkStatus (x) == GL_FALSE) {\
- RELEASE_PROGRAM(x);\
- x = NULL;\
- _mesa_error (ctx, GL_INVALID_OPERATION, function);\
+
+#define GET_LINKED_PROGRAM(x, handle, function) \
+ GET_PROGRAM(x, handle, function); \
+ if (x && (**x).GetLinkStatus(x) == GL_FALSE) { \
+ RELEASE_PROGRAM(x); \
+ _mesa_error(ctx, GL_INVALID_OPERATION, function); \
+ x = NULL; \
}
-#define GET_CURRENT_LINKED_PROGRAM(x, function)\
- struct gl2_program_intf **x = NULL;\
- if (ctx->ShaderObjects.CurrentProgram == NULL)\
- _mesa_error (ctx, GL_INVALID_OPERATION, function);\
- else {\
- x = ctx->ShaderObjects.CurrentProgram;\
- if (x != NULL && (**x).GetLinkStatus (x) == GL_FALSE) {\
- x = NULL;\
- _mesa_error (ctx, GL_INVALID_OPERATION, function);\
- }\
+#define GET_CURRENT_LINKED_PROGRAM(x, function) \
+ struct gl2_program_intf **x = ctx->ShaderObjects.CurrentProgram; \
+ if (!x || (**x).GetLinkStatus(x) == GL_FALSE) { \
+ _mesa_error(ctx, GL_INVALID_OPERATION, function); \
+ return; \
}
+
+
#define IS_NAME_WITH_GL_PREFIX(x) ((x)[0] == 'g' && (x)[1] == 'l' && (x)[2] == '_')
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (!pro)
- return;
-
if (!(**pro).WriteUniform(pro, location, count, values, type))
_mesa_error(ctx, GL_INVALID_OPERATION, caller);
}
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- if (!pro)
- return; /* no error? */
-
if (transpose) {
GLfloat *trans, *pt;
const GLfloat *pv;
GLint loc = -1;
GET_LINKED_PROGRAM(pro, programObj, "glGetUniformLocationARB");
- if (pro == NULL)
+ if (!pro)
return -1;
if (name == NULL)
GET_CURRENT_CONTEXT(ctx);
GET_LINKED_PROGRAM(pro, programObj, "glGetUniformfvARB");
- if (pro != NULL) {
- if (!(**pro).ReadUniform(pro, location, 1, params, GL_FLOAT))
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfvARB");
- RELEASE_PROGRAM(pro);
- }
+ if (!pro)
+ return;
+
+ if (!(**pro).ReadUniform(pro, location, 1, params, GL_FLOAT))
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformfvARB");
+
+ RELEASE_PROGRAM(pro);
}
GLvoid GLAPIENTRY
GET_CURRENT_CONTEXT(ctx);
GET_LINKED_PROGRAM(pro, programObj, "glGetUniformivARB");
- if (pro != NULL) {
- if (!(**pro).ReadUniform(pro, location, 1, params, GL_INT))
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformivARB");
- RELEASE_PROGRAM(pro);
- }
+ if (!pro)
+ return;
+
+ if (!(**pro).ReadUniform(pro, location, 1, params, GL_INT))
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetUniformivARB");
+ RELEASE_PROGRAM(pro);
}
GLvoid GLAPIENTRY
GLint loc = -1;
GET_LINKED_PROGRAM(pro, programObj, "glGetAttribLocationARB");
- if (pro == NULL)
+ if (!pro)
return -1;
if (name == NULL)