Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiteknight committed Apr 23, 2011
2 parents 7ae065a + 68ee5a9 commit 6eb1def
Show file tree
Hide file tree
Showing 19 changed files with 66 additions and 73 deletions.
12 changes: 0 additions & 12 deletions compilers/pct/src/PAST/Compiler.pir
Expand Up @@ -854,23 +854,11 @@ Return the POST representation of a C<PAST::Block>.
## pir-encode name and namespace
.local string blockreg, blockref
blockreg = self.'uniquereg'('P')
if ns goto block_ns
blockref = concat ".const 'Sub' ", blockreg
blockref = concat blockref, ' = '
$P0 = bpost.'subid'()
$S0 = self.'escape'($P0)
blockref = concat blockref, $S0
goto have_blockref
block_ns:
$P0 = get_hll_global ['POST'], 'Compiler'
blockref = concat 'get_hll_global ', blockreg
$S0 = $P0.'key_pir'(ns)
blockref = concat blockref, ', '
blockref = concat blockref, $S0
$S0 = self.'escape'(name)
blockref = concat blockref, ', '
blockref = concat blockref, $S0
have_blockref:
## determine the outer POST::Sub for the new one
.local pmc outerpost
Expand Down
4 changes: 2 additions & 2 deletions runtime/parrot/library/Archive/Tar.pir
@@ -1,4 +1,4 @@
# Copyright (C) 2010, Parrot Foundation.
# Copyright (C) 2010-2011, Parrot Foundation.

=head1 NAME

Expand All @@ -8,7 +8,7 @@ Archive/Tar

Partial port of Archive::Tar (version 1.60)

See L<http://search.cpan.org/~bingos/Archive-Tar/>
See L<http://search.cpan.org/dist/Archive-Tar/>

=cut

Expand Down
4 changes: 2 additions & 2 deletions runtime/parrot/library/Archive/Zip.pir
@@ -1,4 +1,4 @@
# Copyright (C) 2010, Parrot Foundation.
# Copyright (C) 2010-2011, Parrot Foundation.

=head1 NAME

Expand All @@ -8,7 +8,7 @@ Archive/Zip

Partial port of Archive::Zip (version 1.30)

See L<http://search.cpan.org/~adamk/Archive-Zip/>
See L<http://search.cpan.org/dist/Archive-Zip/>

=cut

Expand Down
4 changes: 2 additions & 2 deletions runtime/parrot/library/HTTP/Message.pir
@@ -1,4 +1,4 @@
# Copyright (C) 2010, Parrot Foundation.
# Copyright (C) 2010-2011, Parrot Foundation.

=head1 NAME

Expand All @@ -7,7 +7,7 @@ LWP - The World-Wide Web library for Parrot
=head2 DESCRIPTION

Simplified port of LWP (version 5.834)
see http://search.cpan.org/~gaas/libwww-perl/
see http://search.cpan.org/dist/libwww-perl/

=head3 HTTP;Date

Expand Down
4 changes: 2 additions & 2 deletions runtime/parrot/library/LWP/Protocol.pir
@@ -1,4 +1,4 @@
# Copyright (C) 2010, Parrot Foundation.
# Copyright (C) 2010-2011, Parrot Foundation.

=head1 NAME

Expand All @@ -7,7 +7,7 @@ LWP - The World-Wide Web library for Parrot
=head2 DESCRIPTION

Simplified port of LWP (version 5.834)
see http://search.cpan.org/~gaas/libwww-perl/
see http://search.cpan.org/dist/libwww-perl/

=head3 Class LWP;Protocol

Expand Down
6 changes: 3 additions & 3 deletions runtime/parrot/library/LWP/UserAgent.pir
@@ -1,13 +1,13 @@
# Copyright (C) 2010, Parrot Foundation.
# Copyright (C) 2010-2011, Parrot Foundation.

=head1 NAME

LWP - The World-Wide Web library for Parrot

=head2 DESCRIPTION

Simplified port of LWP (version 5.834)
see http://search.cpan.org/~gaas/libwww-perl/
Simplified port of LWP::UserAgent (version 5.834)
see http://search.cpan.org/dist/libwww-perl/

=head3 Class LWP;UserAgent

Expand Down
26 changes: 13 additions & 13 deletions runtime/parrot/library/NCI/Utils.pir
Expand Up @@ -12,11 +12,11 @@ NCI/Utils.pir - Utility functions to make Parrot NCI work easier
use FooTK:from<parrot>;

sub MAIN(*@ARGS is rw) {
# Call toolkit's init function, overwriting @ARGS with mangled copy
# Call toolkit's init function, overwriting @ARGS with mangled copy
@ARGS = call_toolkit_init(&fooInit, @ARGS, $*PROGRAM_NAME);

# Alternately, you can save both the original @ARGS and mangled copy
my @mangled_args = call_toolkit_init(&fooInit, @ARGS);
# Alternately, you can save both the original @ARGS and mangled copy
my @mangled_args = call_toolkit_init(&fooInit, @ARGS);

# ...
}
Expand All @@ -26,20 +26,20 @@ NCI/Utils.pir - Utility functions to make Parrot NCI work easier
.param pmc argv

# Load this library and the NCI wrapper for a framework/toolkit
load_bytecode 'NCI/Utils.pbc'
load_bytecode 'FooTK.pbc'
load_bytecode 'NCI/Utils.pbc'
load_bytecode 'FooTK.pbc'

# Find Subs for call_toolkit_init() and the toolkit's init function
# Find Subs for call_toolkit_init() and the toolkit's init function
.local pmc call_toolkit_init, fooInit
call_toolkit_init = get_global ['NCI';'Utils'], 'call_toolkit_init'
fooInit = get_global ['FooTK'], 'fooInit'
call_toolkit_init = get_global ['NCI';'Utils'], 'call_toolkit_init'
fooInit = get_global ['FooTK'], 'fooInit'

# Call toolkit's init function, overwriting argv with mangled copy
argv = call_toolkit_init(fooInit, argv)
# Call toolkit's init function, overwriting argv with mangled copy
argv = call_toolkit_init(fooInit, argv)

# Alternately, you can save both the original argv and mangled copy
.local pmc mangled_argv
mangled_argv = call_toolkit_init(fooInit, argv)
# Alternately, you can save both the original argv and mangled copy
.local pmc mangled_argv
mangled_argv = call_toolkit_init(fooInit, argv)

# ...
.end
Expand Down
2 changes: 1 addition & 1 deletion runtime/parrot/library/Stream/Sub.pir
Expand Up @@ -19,7 +19,7 @@ version 0.1
...
.sub _test :method
self."write"( "hello, world" )
self."write"( "hello, world" )
.end
=head1 DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions runtime/parrot/library/Stream/Writer.pir
Expand Up @@ -21,8 +21,8 @@ version 0.1
...

.sub _reader :method
.local string str
str = self."read"()
.local string str
str = self."read"()
.end

=head1 DESCRIPTION
Expand Down
6 changes: 3 additions & 3 deletions runtime/parrot/library/TAP/Harness.pir
@@ -1,4 +1,4 @@
# Copyright (C) 2010, Parrot Foundation.
# Copyright (C) 2010-2011, Parrot Foundation.

=head1 NAME

Expand All @@ -9,8 +9,8 @@ TAP/Harness
Simplified port of TAP::Harness (version 3.21)
and TAP::Harness::Archive (version 0.14)

See L<http://search.cpan.org/~andya/Test-Harness/>
end L<http://search.cpan.org/~wonko/TAP-Harness-Archive/>.
See L<http://search.cpan.org/dist/Test-Harness/>
end L<http://search.cpan.org/dist/TAP-Harness-Archive/>.

=head3 Class TAP;Harness

Expand Down
4 changes: 2 additions & 2 deletions runtime/parrot/library/TAP/Parser.pir
@@ -1,4 +1,4 @@
# Copyright (C) 2010, Parrot Foundation.
# Copyright (C) 2010-2011, Parrot Foundation.

=head1 NAME

Expand All @@ -8,7 +8,7 @@ TAP/Parser

Simplified port of TAP::Parser (version 3.21)

See L<http://search.cpan.org/~andya/Test-Harness/>
See L<http://search.cpan.org/dist/Test-Harness/>

=head3 Class TAP;Parser;Result

Expand Down
5 changes: 2 additions & 3 deletions src/dynoplibs/io.ops
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010, Parrot Foundation.
* Copyright (C) 2010-2011, Parrot Foundation.
** io.ops
*/

Expand Down Expand Up @@ -182,8 +182,7 @@ op tell(out INT, invar PMC) :base_io {

op tell(out INT, out INT, invar PMC) :base_io {
if ($3) {
PIOOFF_T pos;
pos = Parrot_io_tell_handle(interp, $3);
const PIOOFF_T pos = Parrot_io_tell_handle(interp, $3);
$1 = (INTVAL)(pos >> 31);
$2 = (INTVAL)(pos & 0xffffffff);
}
Expand Down
4 changes: 2 additions & 2 deletions src/dynoplibs/trans.ops
Expand Up @@ -172,7 +172,7 @@ Set $1 to the base 2 logarithm of $2.
=cut

op log2(out NUM, in NUM) :base_math {
FLOATVAL temp = log((FLOATVAL)2.0);
const FLOATVAL temp = log((FLOATVAL)2.0);
$1 = log((FLOATVAL)$2) / temp;
}

Expand Down Expand Up @@ -326,7 +326,7 @@ inline op pow(out NUM, in NUM, in INT) :base_core {

=head1 COPYRIGHT

Copyright (C) 2010-2010, Parrot Foundation.
Copyright (C) 2010-2011, Parrot Foundation.

=head1 LICENSE

Expand Down
20 changes: 13 additions & 7 deletions src/embed.c
Expand Up @@ -454,6 +454,9 @@ Parrot_load_bytecode_file(PARROT_INTERP, ARGIN(const char *filename))
return 0;
Parrot_pf_set_current_packfile(interp, pf);
return 1;
#else
UNUSED(interp);
UNUSED(filename);
#endif
return 0;
}
Expand Down Expand Up @@ -576,7 +579,7 @@ set_current_sub(PARROT_INTERP)
*/

for (i = 0; i < ct->pmc.const_count; i++) {
PMC *sub_pmc = ct->pmc.constants[i];
PMC * const sub_pmc = ct->pmc.constants[i];
if (VTABLE_isa(interp, sub_pmc, SUB)) {
Parrot_Sub_attributes *sub;

Expand Down Expand Up @@ -730,7 +733,7 @@ print_constant_table(PARROT_INTERP, ARGIN(PMC *output))
Parrot_io_fprintf(interp, output, "STR_CONST(%d): %S\n", i, ct->str.constants[i]);

for (i = 0; i < ct->pmc.const_count; i++) {
PMC *c = ct->pmc.constants[i];
PMC * const c = ct->pmc.constants[i];
Parrot_io_fprintf(interp, output, "PMC_CONST(%d): ", i);

switch (c->vtable->base_type) {
Expand Down Expand Up @@ -906,22 +909,25 @@ Parrot_compile_string(PARROT_INTERP, Parrot_String type, ARGIN(const char *code)
ARGOUT(Parrot_String *error))
{
ASSERT_ARGS(Parrot_compile_string)
PMC * compiler = Parrot_get_compiler(interp, type);
PMC * const compiler = Parrot_get_compiler(interp, type);

/* XXX error is not being set */
if (PMC_IS_NULL(compiler)) {
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
"Could not find compiler %Ss", type);
}
else {
PMC *result;
STRING * const code_s = Parrot_str_new(interp, code, 0);
PMC * result = PMCNULL;
imc_info_t * imcc = (imc_info_t*) VTABLE_get_pointer(interp, compiler);
INTVAL is_pasm = VTABLE_get_integer(interp, compiler);
imc_info_t * imcc = (imc_info_t*) VTABLE_get_pointer(interp, compiler);
const INTVAL is_pasm = VTABLE_get_integer(interp, compiler);

Parrot_block_GC_mark(interp);
result = imcc_compile_string(imcc, code_s, is_pasm);
if (PMC_IS_NULL(result)) {
STRING * const msg = imcc_last_error_message(imcc);
INTVAL code = imcc_last_error_code(imcc);
const INTVAL code = imcc_last_error_code(imcc);

Parrot_unblock_GC_mark(interp);
Parrot_ex_throw_from_c_args(interp, NULL, code, "%Ss", msg);
}
Expand Down
14 changes: 7 additions & 7 deletions src/ops/core.ops
Expand Up @@ -504,8 +504,8 @@ op set_returns(inconst PMC) :flow {
op get_results(inconst PMC) :flow {
opcode_t * const raw_params = CUR_OPCODE;
PMC * const signature = $1;
PMC *ctx = CURRENT_CONTEXT(interp);
PMC *call_object = Parrot_pcc_get_signature(interp, ctx);
PMC * const ctx = CURRENT_CONTEXT(interp);
PMC * const call_object = Parrot_pcc_get_signature(interp, ctx);

INTVAL argc;

Expand Down Expand Up @@ -1275,7 +1275,7 @@ inline op loadlib(out PMC, in STR, in PMC) {

op dlfunc(out PMC, invar PMC, in STR, in STR) {
void *dl_handle = NULL;
void *ptr = NULL;
void *ptr;
funcptr_t p;

if (!PMC_IS_NULL($2)
Expand All @@ -1288,7 +1288,7 @@ op dlfunc(out PMC, invar PMC, in STR, in STR) {
p = D2FPTR(ptr);

if (p == NULLfunc) {
const char * err = Parrot_dlerror();
const char * const err = Parrot_dlerror();
Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
"Symbol '%Ss' not found: %s\n", $3, err ? err : "unknown reason");
$1 = Parrot_pmc_new(interp, enum_class_Undef);
Expand All @@ -1301,7 +1301,7 @@ op dlfunc(out PMC, invar PMC, in STR, in STR) {

op dlfunc(out PMC, invar PMC, in STR, invar PMC) {
void *dl_handle = NULL;
void *ptr = NULL;
void *ptr;
funcptr_t p;

if (!PMC_IS_NULL($2)
Expand All @@ -1314,7 +1314,7 @@ op dlfunc(out PMC, invar PMC, in STR, invar PMC) {
p = D2FPTR(ptr);

if (p == NULLfunc) {
const char * err = Parrot_dlerror();
const char * const err = Parrot_dlerror();
Parrot_warn(interp, PARROT_WARNINGS_UNDEF_FLAG,
"Symbol '%Ss' not found: %s\n", $3, err ? err : "unknown reason");
$1 = Parrot_pmc_new(interp, enum_class_Undef);
Expand All @@ -1327,7 +1327,7 @@ op dlfunc(out PMC, invar PMC, in STR, invar PMC) {

op dlvar(out PMC, invar PMC, in STR) {
void * dl_handle = NULL;
void * p = NULL;
void * p;

if (!PMC_IS_NULL($2)
&& $2->vtable->base_type == enum_class_ParrotLibrary
Expand Down
2 changes: 1 addition & 1 deletion src/ops/math.ops
Expand Up @@ -342,7 +342,7 @@ inline op fdiv(out INT, in INT, in INT) :base_core {
}

inline op fdiv(out NUM, in NUM, in NUM) :base_core {
FLOATVAL den = $3;
const FLOATVAL den = $3;
if (FLOAT_IS_ZERO(den)) {
opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, expr NEXT(),
EXCEPTION_DIV_BY_ZERO,
Expand Down
3 changes: 1 addition & 2 deletions src/ops/object.ops
@@ -1,6 +1,5 @@
/*


object.ops

*/
Expand Down Expand Up @@ -107,7 +106,7 @@ op callmethod(invar PMC, in STR, invar PMC) :object_base :flow {
opcode_t * const next = expr NEXT();

PMC * const method_pmc = VTABLE_find_method(interp, object, meth);
opcode_t *dest = NULL;
opcode_t *dest;
PMC * signature = Parrot_pcc_get_signature(interp,
CURRENT_CONTEXT(interp));

Expand Down
4 changes: 2 additions & 2 deletions src/ops/set.ops
Expand Up @@ -404,7 +404,7 @@ inline op copy(inout PMC, invar PMC) :base_mem {
/* Preserve the metadata on the destination. */
PMC * const meta = VTABLE_getprops(interp, $1);
/* We have to preserve GC flags of original PMC */
Parrot_UInt gc_flags = $1->flags & PObj_GC_all_FLAGS;
const Parrot_UInt gc_flags = $1->flags & PObj_GC_all_FLAGS;

/* avoid leaks and unreachable memory by destroying the destination PMC */
Parrot_pmc_destroy(interp, $1);
Expand Down Expand Up @@ -490,7 +490,7 @@ inline op null(out NUM) :base_core {

=head1 COPYRIGHT

Copyright (C) 2001-2010, Parrot Foundation.
Copyright (C) 2001-2011, Parrot Foundation.

=head1 LICENSE

Expand Down

0 comments on commit 6eb1def

Please sign in to comment.