Commit 3b3ad1fe by Geoff Lang

Remove excess dereferences and casts.

The behaviour of dereferencing an array on the stack is the same as simply using the array but it is counter-intuitive, error prone and requires a cast to fit the required type. Change-Id: Ib14e902293cf6dc71aaf944d57f53ea895a680ab Reviewed-on: https://chromium-review.googlesource.com/188875Tested-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent 98705b7d
...@@ -5253,7 +5253,7 @@ void __stdcall glUniform2f(GLint location, GLfloat x, GLfloat y) ...@@ -5253,7 +5253,7 @@ void __stdcall glUniform2f(GLint location, GLfloat x, GLfloat y)
{ {
GLfloat xy[2] = {x, y}; GLfloat xy[2] = {x, y};
glUniform2fv(location, 1, (GLfloat*)&xy); glUniform2fv(location, 1, xy);
} }
void __stdcall glUniform2fv(GLint location, GLsizei count, const GLfloat* v) void __stdcall glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
...@@ -5296,9 +5296,9 @@ void __stdcall glUniform2fv(GLint location, GLsizei count, const GLfloat* v) ...@@ -5296,9 +5296,9 @@ void __stdcall glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
void __stdcall glUniform2i(GLint location, GLint x, GLint y) void __stdcall glUniform2i(GLint location, GLint x, GLint y)
{ {
GLint xy[4] = {x, y}; GLint xy[2] = {x, y};
glUniform2iv(location, 1, (GLint*)&xy); glUniform2iv(location, 1, xy);
} }
void __stdcall glUniform2iv(GLint location, GLsizei count, const GLint* v) void __stdcall glUniform2iv(GLint location, GLsizei count, const GLint* v)
...@@ -5343,7 +5343,7 @@ void __stdcall glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) ...@@ -5343,7 +5343,7 @@ void __stdcall glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
{ {
GLfloat xyz[3] = {x, y, z}; GLfloat xyz[3] = {x, y, z};
glUniform3fv(location, 1, (GLfloat*)&xyz); glUniform3fv(location, 1, xyz);
} }
void __stdcall glUniform3fv(GLint location, GLsizei count, const GLfloat* v) void __stdcall glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
...@@ -5388,7 +5388,7 @@ void __stdcall glUniform3i(GLint location, GLint x, GLint y, GLint z) ...@@ -5388,7 +5388,7 @@ void __stdcall glUniform3i(GLint location, GLint x, GLint y, GLint z)
{ {
GLint xyz[3] = {x, y, z}; GLint xyz[3] = {x, y, z};
glUniform3iv(location, 1, (GLint*)&xyz); glUniform3iv(location, 1, xyz);
} }
void __stdcall glUniform3iv(GLint location, GLsizei count, const GLint* v) void __stdcall glUniform3iv(GLint location, GLsizei count, const GLint* v)
...@@ -5433,7 +5433,7 @@ void __stdcall glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfl ...@@ -5433,7 +5433,7 @@ void __stdcall glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfl
{ {
GLfloat xyzw[4] = {x, y, z, w}; GLfloat xyzw[4] = {x, y, z, w};
glUniform4fv(location, 1, (GLfloat*)&xyzw); glUniform4fv(location, 1, xyzw);
} }
void __stdcall glUniform4fv(GLint location, GLsizei count, const GLfloat* v) void __stdcall glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
...@@ -5478,7 +5478,7 @@ void __stdcall glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) ...@@ -5478,7 +5478,7 @@ void __stdcall glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
{ {
GLint xyzw[4] = {x, y, z, w}; GLint xyzw[4] = {x, y, z, w};
glUniform4iv(location, 1, (GLint*)&xyzw); glUniform4iv(location, 1, xyzw);
} }
void __stdcall glUniform4iv(GLint location, GLsizei count, const GLint* v) void __stdcall glUniform4iv(GLint location, GLsizei count, const GLint* v)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment