summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-04-02 21:07:50 +1100
committerTimothy Arceri <[email protected]>2016-04-03 09:55:19 +1000
commit6d54096fa6cde0ebc7da29468071fe2c34aec0cf (patch)
treeabdf1abc91e4fb4c03007378182f3efe41b527c8 /src
parentd64134ecaec46f95189e355de65f631b1b7f7007 (diff)
mesa: remove unrequired else
The if always returns so no need for an else. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/program/prog_parameter.c81
1 files changed, 39 insertions, 42 deletions
diff --git a/src/mesa/program/prog_parameter.c b/src/mesa/program/prog_parameter.c
index 02d84f20cd8..c294b005b85 100644
--- a/src/mesa/program/prog_parameter.c
+++ b/src/mesa/program/prog_parameter.c
@@ -248,54 +248,51 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList,
paramList->Size = 0;
return -1;
}
- else {
- GLuint i, j;
-
- paramList->NumParameters = oldNum + sz4;
-
- memset(&paramList->Parameters[oldNum], 0,
- sz4 * sizeof(struct gl_program_parameter));
-
- for (i = 0; i < sz4; i++) {
- struct gl_program_parameter *p = paramList->Parameters + oldNum + i;
- p->Name = name ? strdup(name) : NULL;
- p->Type = type;
- p->Size = size;
- p->DataType = datatype;
- if (values) {
- if (size >= 4) {
- COPY_4V(paramList->ParameterValues[oldNum + i], values);
+
+ GLuint i, j;
+
+ paramList->NumParameters = oldNum + sz4;
+
+ memset(&paramList->Parameters[oldNum], 0,
+ sz4 * sizeof(struct gl_program_parameter));
+
+ for (i = 0; i < sz4; i++) {
+ struct gl_program_parameter *p = paramList->Parameters + oldNum + i;
+ p->Name = name ? strdup(name) : NULL;
+ p->Type = type;
+ p->Size = size;
+ p->DataType = datatype;
+ if (values) {
+ if (size >= 4) {
+ COPY_4V(paramList->ParameterValues[oldNum + i], values);
+ } else {
+ /* copy 1, 2 or 3 values */
+ GLuint remaining = size % 4;
+ assert(remaining < 4);
+ for (j = 0; j < remaining; j++) {
+ paramList->ParameterValues[oldNum + i][j].f = values[j].f;
}
- else {
- /* copy 1, 2 or 3 values */
- GLuint remaining = size % 4;
- assert(remaining < 4);
- for (j = 0; j < remaining; j++) {
- paramList->ParameterValues[oldNum + i][j].f = values[j].f;
- }
- /* fill in remaining positions with zeros */
- for (; j < 4; j++) {
- paramList->ParameterValues[oldNum + i][j].f = 0.0f;
- }
+ /* fill in remaining positions with zeros */
+ for (; j < 4; j++) {
+ paramList->ParameterValues[oldNum + i][j].f = 0.0f;
}
- values += 4;
- p->Initialized = GL_TRUE;
}
- else {
- /* silence valgrind */
- for (j = 0; j < 4; j++)
- paramList->ParameterValues[oldNum + i][j].f = 0;
- }
- size -= 4;
- }
-
- if (state) {
- for (i = 0; i < STATE_LENGTH; i++)
- paramList->Parameters[oldNum].StateIndexes[i] = state[i];
+ values += 4;
+ p->Initialized = GL_TRUE;
+ } else {
+ /* silence valgrind */
+ for (j = 0; j < 4; j++)
+ paramList->ParameterValues[oldNum + i][j].f = 0;
}
+ size -= 4;
+ }
- return (GLint) oldNum;
+ if (state) {
+ for (i = 0; i < STATE_LENGTH; i++)
+ paramList->Parameters[oldNum].StateIndexes[i] = state[i];
}
+
+ return (GLint) oldNum;
}