summaryrefslogtreecommitdiff
path: root/hir_field_selection.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-24 15:27:04 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-24 15:27:04 -0700
commit9e97ffb7547f25cbec96f1fb2c60f3ab9b0f0488 (patch)
tree3d4ce6c5ad6018ee5cbb7b4b1af028a88143ded2 /hir_field_selection.cpp
parentafbe26fd61abb3c28c1b0165427b77fd2fed355d (diff)
Trivial cleanups in generate_swizzle
Add 'const' and 'static const' in a couple of places.
Diffstat (limited to 'hir_field_selection.cpp')
-rw-r--r--hir_field_selection.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/hir_field_selection.cpp b/hir_field_selection.cpp
index 554fdd30d53..9928b7b0bfa 100644
--- a/hir_field_selection.cpp
+++ b/hir_field_selection.cpp
@@ -42,7 +42,7 @@ generate_swizzle(const char *str, ir_dereference *deref,
* swizzle characters (e.g., 'k'), a special value is used that will allow
* detection of errors.
*/
- unsigned char base_idx[26] = {
+ static const unsigned char base_idx[26] = {
/* a b c d e f g h i j k l m */
R, R, I, I, I, I, R, I, I, I, I, I, I,
/* n o p q r s t u v w x y z */
@@ -66,7 +66,7 @@ generate_swizzle(const char *str, ir_dereference *deref,
* swizzle values are { 3, 2, 4, 5 }. Since 4 and 5 are outside the range
* [0,3], the error is detected.
*/
- unsigned char idx_map[26] = {
+ static const unsigned char idx_map[26] = {
/* a b c d e f g h i j k l m */
R+3, R+2, 0, 0, 0, 0, R+1, 0, 0, 0, 0, 0, 0,
/* n o p q r s t u v w x y z */
@@ -74,7 +74,6 @@ generate_swizzle(const char *str, ir_dereference *deref,
};
int swiz_idx[4] = { 0, 0, 0, 0 };
- unsigned base;
unsigned i;
@@ -84,7 +83,7 @@ generate_swizzle(const char *str, ir_dereference *deref,
if ((str[0] < 'a') || (str[0] > 'z'))
return false;
- base = base_idx[str[0] - 'a'];
+ const unsigned base = base_idx[str[0] - 'a'];
for (i = 0; (i < 4) && (str[i] != '\0'); i++) {