[svn:parrot] r45199 - trunk/src/pmc
petdance at svn.parrot.org
petdance at svn.parrot.org
Sat Mar 27 04:28:27 UTC 2010
Author: petdance
Date: Sat Mar 27 04:28:27 2010
New Revision: 45199
URL: https://trac.parrot.org/parrot/changeset/45199
Log:
Don't spell NULL as '0' when returning pointers. More consting, too.
Modified:
trunk/src/pmc/default.pmc
Modified: trunk/src/pmc/default.pmc
==============================================================================
--- trunk/src/pmc/default.pmc Sat Mar 27 04:05:33 2010 (r45198)
+++ trunk/src/pmc/default.pmc Sat Mar 27 04:28:27 2010 (r45199)
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
$Id$
=head1 NAME
@@ -960,7 +960,7 @@
*/
VTABLE PMC *inspect() {
- PMC *metadata = Parrot_pmc_new(interp, enum_class_Hash);
+ PMC * const metadata = Parrot_pmc_new(interp, enum_class_Hash);
STRING * const flags_str = CONST_STRING(interp, "flags");
VTABLE_set_pmc_keyed_str(interp, metadata, flags_str,
@@ -979,15 +979,16 @@
*/
VTABLE PMC *get_class() {
- PMC *ns = VTABLE_get_namespace(interp, SELF);
+ PMC * const ns = VTABLE_get_namespace(interp, SELF);
PMC *_class = PMCNULL;
if (!PMC_IS_NULL(ns))
_class = VTABLE_get_class(interp, ns);
if (PMC_IS_NULL(_class)) {
- INTVAL type = VTABLE_type(interp, SELF);
- PMC *type_num = Parrot_pmc_new(interp, enum_class_Integer);
+ const INTVAL type = VTABLE_type(interp, SELF);
+ PMC * const type_num = Parrot_pmc_new(interp, enum_class_Integer);
+
VTABLE_set_integer_native(interp, type_num, type);
return Parrot_pmc_new_init(interp, enum_class_PMCProxy, type_num);
}
@@ -1766,7 +1767,7 @@
/* Don't multidispatch if you've got two pointers to the same PMC. They
* are equal. */
if (SELF == value)
- return 0;
+ return NULL;
Parrot_mmd_multi_dispatch_from_c_args(interp,
"cmp_pmc", "PP->P", SELF, value, &retval);
More information about the parrot-commits
mailing list