Use statically typed ir_constant constructors wherever possible
diff --git a/ast_function.cpp b/ast_function.cpp
index d89266b..279c45e 100644
--- a/ast_function.cpp
+++ b/ast_function.cpp
@@ -170,8 +170,13 @@
       }
       break;
    case GLSL_TYPE_BOOL: {
-      int z = 0;
-      ir_constant *const zero = new ir_constant(src->type, &z);
+      ir_constant *zero = NULL;
+
+      switch (b) {
+      case GLSL_TYPE_UINT:  zero = new ir_constant(unsigned(0)); break;
+      case GLSL_TYPE_INT:   zero = new ir_constant(int(0));      break;
+      case GLSL_TYPE_FLOAT: zero = new ir_constant(0.0f);        break;
+      }
 
       result = new ir_expression(ir_binop_nequal, desired_type, src, zero);
    }
@@ -211,7 +216,7 @@
        */
       const int c = component / src->type->column_type()->vector_elements;
       const int r = component % src->type->column_type()->vector_elements;
-      ir_constant *const col_index = new ir_constant(glsl_type::int_type, &c);
+      ir_constant *const col_index = new ir_constant(c);
       ir_dereference *const col = new ir_dereference_array(src, col_index);
 
       col->type = src->type->column_type();