Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:parrot/parrot
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeenan committed Oct 23, 2011
2 parents be8655d + 7a6d1d9 commit 0da8859
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 19 deletions.
2 changes: 2 additions & 0 deletions src/dynpmc/dynlexpad.pmc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pmclass DynLexPad dynpmc provides lexpad auto_attrs {
ATTR PMC *init; /* the PMC used to initialize this DynLexPad */

VTABLE void init() {
UNUSED(SELF);
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"don't create me like this");
}
Expand Down Expand Up @@ -82,6 +83,7 @@ Return the raw Hash pointer, for use in iterators
*/

VTABLE void *get_pointer() {
UNUSED(INTERP);
return PARROT_DYNLEXPAD(SELF)->hash;
}

Expand Down
39 changes: 32 additions & 7 deletions src/pmc/default.pmc
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ PARROT_WARN_UNUSED_RESULT
static INTVAL check_set_std_props(PARROT_INTERP,
ARGMOD(PMC *pmc),
ARGIN(const STRING *key),
ARGIN(PMC *value))
ARGMOD(PMC *value))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3)
__attribute__nonnull__(4)
FUNC_MODIFIES(*pmc);
FUNC_MODIFIES(*pmc)
FUNC_MODIFIES(*value);

PARROT_WARN_UNUSED_RESULT
static INTVAL has_pending_std_props(ARGIN(const PMC *self))
Expand Down Expand Up @@ -192,7 +193,7 @@ in a future call to C<propagate_std_props()>

PARROT_WARN_UNUSED_RESULT
static INTVAL
check_set_std_props(PARROT_INTERP, ARGMOD(PMC *pmc), ARGIN(const STRING *key), ARGIN(PMC *value))
check_set_std_props(PARROT_INTERP, ARGMOD(PMC *pmc), ARGIN(const STRING *key), ARGMOD(PMC *value))
{
ASSERT_ARGS(check_set_std_props)

Expand Down Expand Up @@ -342,6 +343,8 @@ Does nothing.
*/

VTABLE void init() {
UNUSED(INTERP);
UNUSED(SELF);
}

/*
Expand Down Expand Up @@ -391,6 +394,8 @@ Does nothing.
*/

VTABLE void destroy() {
UNUSED(INTERP);
UNUSED(SELF);
}

/*
Expand Down Expand Up @@ -430,6 +435,7 @@ Panics with a "no custom mark routine defined" error message.
*/

VTABLE void mark() {
UNUSED(SELF);
PANIC(INTERP, "custom_mark flag set but no custom mark routine defined");
}

Expand Down Expand Up @@ -518,6 +524,7 @@ Returns the PMC's type.
*/

VTABLE INTVAL type() {
UNUSED(INTERP);
return SELF->vtable->base_type;
}

Expand All @@ -532,6 +539,7 @@ Returns the name of the PMC.
*/

VTABLE STRING *name() {
UNUSED(INTERP);
return SELF->vtable->whoami;
}

Expand All @@ -548,6 +556,9 @@ Role-y.
*/

VTABLE void add_attribute(STRING *name, PMC *type) {
UNUSED(SELF);
UNUSED(name);
UNUSED(type);
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Cannot add attribute to non-class");
}
Expand Down Expand Up @@ -670,6 +681,7 @@ same pointer).
*/

VTABLE INTVAL is_same(PMC *value) {
UNUSED(INTERP);
return SELF == value;
}

Expand Down Expand Up @@ -872,6 +884,8 @@ Returns true.
*/

VTABLE INTVAL defined() {
UNUSED(INTERP);
UNUSED(SELF);
return 1;
}

Expand Down Expand Up @@ -949,7 +963,9 @@ Reports whether the PMC "does" the C<role>.
*/

VTABLE INTVAL does_pmc(PMC *role) {
UNUSED(role)
UNUSED(INTERP);
UNUSED(SELF);
UNUSED(role);
/* No C-level roles yet. */
return 0;
}
Expand Down Expand Up @@ -1105,7 +1121,7 @@ Add class C<parent> to the list of our parents.
*/

VTABLE void add_parent(PMC *parent) {
UNUSED(parent)
UNUSED(parent);
if (!PObj_is_class_TEST(SELF))
Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
"Only classes can be subclassed");
Expand All @@ -1125,6 +1141,9 @@ Used by GC to mark the PMC.
*/

VTABLE void visit(PMC *info) {
UNUSED(INTERP);
UNUSED(SELF);
UNUSED(info);
}

/*
Expand Down Expand Up @@ -1152,7 +1171,9 @@ Does nothing.
*/

VTABLE void freeze(PMC *info) {
UNUSED(info)
UNUSED(INTERP);
UNUSED(SELF);
UNUSED(info);
/* default - no action */
}

Expand All @@ -1167,6 +1188,8 @@ Initializes the PMC during unarchiving.
*/

VTABLE void thaw(PMC *info) {
UNUSED(INTERP);
UNUSED(info);
/* default - initialize the PMC */
SELF.init();
}
Expand All @@ -1182,7 +1205,9 @@ Does nothing.
*/

VTABLE void thawfinish(PMC *info) {
UNUSED(info)
UNUSED(INTERP);
UNUSED(SELF);
UNUSED(info);
/* default - no action */
}

Expand Down
18 changes: 10 additions & 8 deletions src/pmc/imageiosize.pmc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ Gets the size of an ImageIO image without the allocation costs.
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

PARROT_INLINE
static int check_seen(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *v))
static int check_seen(PARROT_INTERP,
ARGIN(const PMC *self),
ARGIN(const PMC *v))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3);
Expand All @@ -38,7 +40,7 @@ static int check_seen(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *v))

/*

=item C<static int check_seen(PARROT_INTERP, PMC *self, PMC *v)>
=item C<static int check_seen(PARROT_INTERP, const PMC *self, const PMC *v)>

Check the seen hash to prevent duplicate serialization.

Expand All @@ -49,11 +51,11 @@ Check the seen hash to prevent duplicate serialization.

PARROT_INLINE
static int
check_seen(PARROT_INTERP, ARGIN(PMC *self), ARGIN(PMC *v))
check_seen(PARROT_INTERP, ARGIN(const PMC *self), ARGIN(const PMC *v))
{
ASSERT_ARGS(check_seen)
Hash *seen = (Hash *)VTABLE_get_pointer(interp, PARROT_IMAGEIOSIZE(self)->seen);
HashBucket *b = Parrot_hash_get_bucket(interp, seen, v);
const Hash * const seen = (Hash *)VTABLE_get_pointer(interp, PARROT_IMAGEIOSIZE(self)->seen);
const HashBucket * const b = Parrot_hash_get_bucket(interp, seen, v);
if (b)
return 1;
else
Expand Down Expand Up @@ -258,8 +260,8 @@ hasn't been seen yet, it is also pushed onto the todo list.
SELF.push_integer(0);
else {
INTVAL cno, idx;
PackFile_ConstTable *ct = PARROT_IMAGEIOSIZE(SELF)->pf_ct;
Hash *seen = (Hash *)VTABLE_get_pointer(INTERP,
PackFile_ConstTable * const ct = PARROT_IMAGEIOSIZE(SELF)->pf_ct;
Hash * const seen = (Hash *)VTABLE_get_pointer(INTERP,
PARROT_IMAGEIOSIZE(SELF)->seen);

if (PObj_flag_TEST(private1, SELF)
Expand All @@ -285,7 +287,7 @@ hasn't been seen yet, it is also pushed onto the todo list.
VTABLE void set_pmc(PMC *p)
{
if (!PObj_flag_TEST(private1, SELF)) {
UINTVAL header_length = GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
const UINTVAL header_length = GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
PARROT_IMAGEIOSIZE(SELF)->size += header_length;
}

Expand Down
12 changes: 10 additions & 2 deletions src/pmc/pointer.pmc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2001-2007, Parrot Foundation.
Copyright (C) 2001-2011, Parrot Foundation.

=head1 NAME

Expand Down Expand Up @@ -38,6 +38,7 @@ Initializes the pointer.
*/

VTABLE void init() {
UNUSED(interp);
PObj_custom_mark_SET(SELF);
}

Expand All @@ -54,7 +55,7 @@ Marks the pointer as live.
VTABLE void mark() {
void (*mark_function)(Interp *, void *) =
(void (*)(Interp *, void *))D2FPTR(PARROT_POINTER(SELF)->mark_function);
void * data = PARROT_POINTER(SELF)->pointer;
void * const data = PARROT_POINTER(SELF)->pointer;
if (data && mark_function)
(*mark_function)(INTERP, data);
}
Expand Down Expand Up @@ -87,6 +88,7 @@ Sets the pointer value.
*/

VTABLE void set_pointer(void *ptr) {
UNUSED(interp);
PARROT_POINTER(SELF)->pointer = ptr;
}

Expand All @@ -101,6 +103,7 @@ Returns the pointer value.
*/

VTABLE void *get_pointer() {
UNUSED(interp);
return PARROT_POINTER(SELF)->pointer;
}

Expand All @@ -115,6 +118,7 @@ Returns the pointer value as an integer.
*/

VTABLE INTVAL get_integer() {
UNUSED(interp);
return (INTVAL)(PARROT_POINTER(SELF)->pointer);
}

Expand All @@ -129,6 +133,7 @@ Returns the pointer value as a floating-point number.
*/

VTABLE FLOATVAL get_number() {
UNUSED(interp);
return (FLOATVAL)(INTVAL)(PARROT_POINTER(SELF)->pointer);
}

Expand All @@ -143,6 +148,7 @@ Returns the pointer value as a Parrot string.
*/

VTABLE STRING *get_repr() {
UNUSED(interp);
return Parrot_sprintf_c(INTERP, "Pointer = 0x%p", PARROT_POINTER(SELF)->pointer);
}

Expand Down Expand Up @@ -172,6 +178,7 @@ Returns whether the pointer is not C<NULL>.
*/

VTABLE INTVAL get_bool() {
UNUSED(interp);
return (INTVAL)(PMC_data(SELF) != NULL);
}

Expand All @@ -186,6 +193,7 @@ Returns whether the pointer has the same value as C<*pmc2>.
*/

VTABLE INTVAL is_same(PMC *pmc2) {
UNUSED(interp);
return (INTVAL)(SELF->vtable == pmc2->vtable &&
PARROT_POINTER(SELF)->pointer == PARROT_POINTER(pmc2)->pointer);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pmc/undef.pmc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ appropriate type.
}
else {
PMC * const clone = VTABLE_clone(INTERP, other);
void *attrs = PMC_data(clone);
void * const attrs = PMC_data(clone);
PMC * const meta = PMC_metadata(clone);

/* now swap memory without leaking it */
Expand Down
7 changes: 6 additions & 1 deletion tools/dev/mk_inno_language.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ =head1 DESCRIPTION
? qq{Source: ".\\parrot-*.exe"; DestDir: "{app}\\bin"; Flags:}
: '; no .exe'
);
my $pbc = <*.pbc> && ! -d $lang
my $pbc = <*.pbc> && ! -d $lang && $lang ne 'rakudo'
? qq{Source: ".\\*.pbc"; DestDir: "{app}\\lib\\parrot\\languages\\$lang"; Flags:}
: '; no .pbc';
my $lng = -d $lang
Expand Down Expand Up @@ -98,7 +98,12 @@ =head1 DESCRIPTION
Source: ".\nqp\nqpmo.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags:
Source: ".\nqp\nqp.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags:
Source: ".\nqp\QRegex.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib"; Flags:
Source: ".\blib\Perl6\*.pbc"; DestDir: "{app}\lib\parrot\languages\nqp\lib\Perl6"; Flags:
Source: ".\perl6.pbc"; DestDir: "{app}\lib\parrot\languages\perl6"; Flags:
Source: ".\*.setting.pbc"; DestDir: "{app}\lib\parrot\languages\perl6\lib"; Flags:
Source: ".\lib\Test.pm"; DestDir: "{app}\lib\parrot\languages\perl6\lib"; Flags:
Source: ".\lib\Pod\To\Text.pm"; DestDir: "{app}\lib\parrot\languages\perl6\lib\Pod\To"; Flags:
RAKUDO

my $filename = 'parrot-' . $lclang . '.iss';
Expand Down

0 comments on commit 0da8859

Please sign in to comment.