shader-effect: Zero out ShaderUniform
authorEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 29 Nov 2010 08:55:13 +0000 (08:55 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 29 Nov 2010 08:58:08 +0000 (08:58 +0000)
Do not use the compiler to zero the first field of the GValue member,
since it's apparently non-portable. As we're allocating memory anyway we
can let the slice allocator do the zero-ing for us.

Mentioned in: http://bugzilla.clutter-project.org/show_bug.cgi?id=2455

clutter/clutter-shader-effect.c

index 53e82f7..7274310 100644 (file)
@@ -530,11 +530,10 @@ shader_uniform_new (const gchar  *name,
 {
   ShaderUniform *retval;
 
-  retval = g_slice_new (ShaderUniform);
+  retval = g_slice_new0 (ShaderUniform);
   retval->name = g_strdup (name);
   retval->type = G_VALUE_TYPE (value);
   retval->location = -1;
-  retval->value = (GValue){0};
 
   g_value_init (&retval->value, retval->type);
   g_value_copy (value, &retval->value);