summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm/lp_bld_type.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-02-26 17:44:10 -0700
committerBrian Paul <brianp@vmware.com>2010-03-04 10:53:26 -0700
commit38110fd1c3a6c57d1ff089d546a3456ca1a78da8 (patch)
treefca4f935395a2bce7785cc7029b21895197f09f9 /src/gallium/auxiliary/gallivm/lp_bld_type.c
parent8e7a8d65931a650534e0f5c4e0d8118cd6f7636e (diff)
gallivm: clarify unsigned vs. signed integer type construction
The lp_int_type() function was creating an unsigned type. So rename that function to lp_uint_type() and create new lp_int_type() that creates a signed type.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_type.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_type.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_type.c b/src/gallium/auxiliary/gallivm/lp_bld_type.c
index 8270cd057f..c327ba045a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_type.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_type.c
@@ -178,6 +178,25 @@ lp_build_int32_vec4_type(void)
}
+/**
+ * Create unsigned integer type variation of given type.
+ */
+struct lp_type
+lp_uint_type(struct lp_type type)
+{
+ struct lp_type res_type;
+
+ memset(&res_type, 0, sizeof res_type);
+ res_type.width = type.width;
+ res_type.length = type.length;
+
+ return res_type;
+}
+
+
+/**
+ * Create signed integer type variation of given type.
+ */
struct lp_type
lp_int_type(struct lp_type type)
{
@@ -186,6 +205,7 @@ lp_int_type(struct lp_type type)
memset(&res_type, 0, sizeof res_type);
res_type.width = type.width;
res_type.length = type.length;
+ res_type.sign = 1;
return res_type;
}