Code refactoring: remove unneeded variables
BUG=angleproject:1996
Change-Id: If635bf836251f90ec40d791b5f80d43f751aad9b
Reviewed-on: https://chromium-review.googlesource.com/476079
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 97ef52b..a4609a5 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -5232,7 +5232,10 @@
GLsizei *numParams)
{
// Only one parameter is returned from glGetFramebufferAttachmentParameteriv
- *numParams = 1;
+ if (numParams)
+ {
+ *numParams = 1;
+ }
if (!ValidFramebufferTarget(target))
{
@@ -5546,7 +5549,10 @@
bool ValidateGetProgramiv(Context *context, GLuint program, GLenum pname, GLsizei *numParams)
{
// Currently, all GetProgramiv queries return 1 parameter
- *numParams = 1;
+ if (numParams)
+ {
+ *numParams = 1;
+ }
Program *programObject = GetValidProgram(context, program);
if (!programObject)
diff --git a/src/libGLESv2/entry_points_gles_2_0.cpp b/src/libGLESv2/entry_points_gles_2_0.cpp
index d5c2975..5716833 100644
--- a/src/libGLESv2/entry_points_gles_2_0.cpp
+++ b/src/libGLESv2/entry_points_gles_2_0.cpp
@@ -1091,10 +1091,9 @@
Context *context = GetValidGlobalContext();
if (context)
{
- GLsizei numParams = 0;
if (!context->skipValidation() &&
!ValidateGetFramebufferAttachmentParameteriv(context, target, attachment, pname,
- &numParams))
+ nullptr))
{
return;
}
@@ -1126,9 +1125,8 @@
Context *context = GetValidGlobalContext();
if (context)
{
- GLsizei numParams = 0;
if (!context->skipValidation() &&
- !ValidateGetProgramiv(context, program, pname, &numParams))
+ !ValidateGetProgramiv(context, program, pname, nullptr))
{
return;
}