[svn:parrot] r43123 - branches/pmc_freeze_cleanup/src

plobsing at svn.parrot.org plobsing at svn.parrot.org
Thu Dec 17 06:02:48 UTC 2009


Author: plobsing
Date: Thu Dec 17 06:02:48 2009
New Revision: 43123
URL: https://trac.parrot.org/parrot/changeset/43123

Log:
eliminate logical || with non-zero constant warning

Modified:
   branches/pmc_freeze_cleanup/src/pmc_freeze.c

Modified: branches/pmc_freeze_cleanup/src/pmc_freeze.c
==============================================================================
--- branches/pmc_freeze_cleanup/src/pmc_freeze.c	Thu Dec 17 05:37:56 2009	(r43122)
+++ branches/pmc_freeze_cleanup/src/pmc_freeze.c	Thu Dec 17 06:02:48 2009	(r43123)
@@ -1095,9 +1095,9 @@
 
     if (!PMC_IS_NULL(pmc)
     && (VTABLE_does(interp, pmc, array) || VTABLE_does(interp, pmc, hash))) {
-        const INTVAL items = VTABLE_elements(interp, pmc) || 1;
+        const INTVAL items = VTABLE_elements(interp, pmc);
         /* TODO check e.g. first item of aggregate and estimate size */
-        len = items * FREEZE_BYTES_PER_ITEM;
+        len = (items ? items : 1) * FREEZE_BYTES_PER_ITEM;
     }
     else
         len = FREEZE_BYTES_PER_ITEM;


More information about the parrot-commits mailing list