st/mesa: s/CALLOC/calloc/ to fix allocation bug
authorBrian Paul <brianp@vmware.com>
Thu, 30 Aug 2012 22:12:53 +0000 (16:12 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 31 Aug 2012 14:05:38 +0000 (08:05 -0600)
The CALLOC() macro only takes one argument so this was being treated
as a comma expression.  Simply use calloc() instead.

A follow-on patch will replace all CALLOC() calls with calloc().

NOTE: This is a candidate for the 8.0 and 9.0 branches.

src/mesa/state_tracker/st_mesa_to_tgsi.c

index 4d99b17ddfad08073b512192133accf6d0fe03a9..56047141415cf9aebb1d32dca15597a51e8bda59 100644 (file)
@@ -1198,7 +1198,7 @@ st_translate_mesa_program(
     * for these, so we put all the translated regs in t->constants.
     */
    if (program->Parameters) {
-      t->constants = CALLOC( program->Parameters->NumParameters,
+      t->constants = calloc( program->Parameters->NumParameters,
                              sizeof t->constants[0] );
       if (t->constants == NULL) {
          ret = PIPE_ERROR_OUT_OF_MEMORY;