Author: particle
Date: Thu Mar 29 10:11:25 2007
New Revision: 17837
Modified:
trunk/src/inter_call.c
trunk/src/inter_misc.c
trunk/src/objects.c
trunk/src/packdump.c
trunk/src/pmc/class.pmc
trunk/src/pmc/pccmethod_test.pmc
trunk/src/pmc/role.pmc
trunk/src/pmc/smop_class.pmc
Log:
[src]: fix line length coding standard exceptions
Modified: trunk/src/inter_call.c
==============================================================================
--- trunk/src/inter_call.c (original)
+++ trunk/src/inter_call.c Thu Mar 29 10:11:25 2007
@@ -854,7 +854,8 @@
*/
if (!(state & CALL_STATE_NAMED_x)) {
if (!(state & CALL_STATE_SLURP) &&
- (st->dest.sig & (PARROT_ARG_SLURPY_ARRAY|PARROT_ARG_NAME))
== PARROT_ARG_SLURPY_ARRAY) {
+ (st->dest.sig & (PARROT_ARG_SLURPY_ARRAY|PARROT_ARG_NAME))
+ == PARROT_ARG_SLURPY_ARRAY) {
/* create dest slurp array */
idx = st->dest.u.op.pc[st->dest.i];
assert(idx >= 0);
@@ -1117,7 +1118,8 @@
}
int
-set_retval_util(Parrot_Interp interp, const char *sig, parrot_context_t *ctx,
struct call_state *st)
+set_retval_util(Parrot_Interp interp, const char *sig, parrot_context_t *ctx,
+ struct call_state *st)
{
opcode_t *src_pc = interp->current_returns;
int todo = Parrot_init_arg_op(interp, ctx, src_pc, &st->src);
@@ -1226,8 +1228,8 @@
}
/*
- * commit_last_arg is called by Parrot_PCCINVOKE when it reaches the end of
each arg in the arg
- * signature. see Parrot_PCCINVOKE for signature syntax.
+ * commit_last_arg is called by Parrot_PCCINVOKE when it reaches the end of
each arg
+ * in the arg signature. see Parrot_PCCINVOKE for signature syntax.
*/
static void
commit_last_arg(Interp *interp, int index, int cur, opcode_t *n_regs_used, int
seen_arrow,
@@ -1241,10 +1243,14 @@
/* calculate arg's register offset */
switch (cur & PARROT_ARG_TYPE_MASK) { /* calc reg offset */
- case PARROT_ARG_INTVAL: reg_offset = n_regs_used[seen_arrow * 4 +
REGNO_INT]++; break;
- case PARROT_ARG_FLOATVAL: reg_offset = n_regs_used[seen_arrow * 4 +
REGNO_NUM]++; break;
- case PARROT_ARG_STRING: reg_offset = n_regs_used[seen_arrow * 4 +
REGNO_STR]++; break;
- case PARROT_ARG_PMC : reg_offset = n_regs_used[seen_arrow * 4 +
REGNO_PMC]++; break;
+ case PARROT_ARG_INTVAL:
+ reg_offset = n_regs_used[seen_arrow * 4 + REGNO_INT]++; break;
+ case PARROT_ARG_FLOATVAL:
+ reg_offset = n_regs_used[seen_arrow * 4 + REGNO_NUM]++; break;
+ case PARROT_ARG_STRING:
+ reg_offset = n_regs_used[seen_arrow * 4 + REGNO_STR]++; break;
+ case PARROT_ARG_PMC :
+ reg_offset = n_regs_used[seen_arrow * 4 + REGNO_PMC]++; break;
default:
real_exception(interp, NULL, E_IndexError,
"Parrot_PCCINVOKE: invalid reg type");
@@ -1258,10 +1264,14 @@
/* perform the arg accessor function, assigning the arg to its
corresponding register */
if (!seen_arrow) {
switch (cur & PARROT_ARG_TYPE_MASK) {
- case PARROT_ARG_INTVAL: CTX_REG_INT(ctx, reg_offset) =
va_arg(*list, INTVAL); break;
- case PARROT_ARG_FLOATVAL: CTX_REG_NUM(ctx, reg_offset) =
va_arg(*list, FLOATVAL); break;
- case PARROT_ARG_STRING: CTX_REG_STR(ctx, reg_offset) =
va_arg(*list, STRING*); break;
- case PARROT_ARG_PMC : CTX_REG_PMC(ctx, reg_offset) =
va_arg(*list, PMC*); break;
+ case PARROT_ARG_INTVAL:
+ CTX_REG_INT(ctx, reg_offset) = va_arg(*list, INTVAL); break;
+ case PARROT_ARG_FLOATVAL:
+ CTX_REG_NUM(ctx, reg_offset) = va_arg(*list, FLOATVAL); break;
+ case PARROT_ARG_STRING:
+ CTX_REG_STR(ctx, reg_offset) = va_arg(*list, STRING*); break;
+ case PARROT_ARG_PMC:
+ CTX_REG_PMC(ctx, reg_offset) = va_arg(*list, PMC*); break;
default:
real_exception(interp, NULL, E_IndexError,
"Parrot_PCCINVOKE: invalid reg type");
Modified: trunk/src/inter_misc.c
==============================================================================
--- trunk/src/inter_misc.c (original)
+++ trunk/src/inter_misc.c Thu Mar 29 10:11:25 2007
@@ -38,28 +38,33 @@
void Parrot_NCI_make_raw_nci(Interp *interp, PMC *method, void *func);
void
-enter_nci_method(Parrot_Interp interp, const int type, void *func, const char
*name, const char *proto)
+enter_nci_method(Parrot_Interp interp, const int type, void *func,
+ const char *name, const char *proto)
{
PMC * const method = pmc_new(interp, enum_class_NCI);
/* create call func */
VTABLE_set_pointer_keyed_str(interp, method,
- string_make(interp, proto, strlen(proto), NULL,
PObj_constant_FLAG|PObj_external_FLAG),
+ string_make(interp, proto, strlen(proto), NULL,
+ PObj_constant_FLAG|PObj_external_FLAG),
func);
/* insert it into namespace */
VTABLE_set_pmc_keyed_str(interp, interp->vtables[type]->_namespace,
- string_make(interp, name, strlen(name), NULL,
PObj_constant_FLAG|PObj_external_FLAG),
+ string_make(interp, name, strlen(name), NULL,
+ PObj_constant_FLAG|PObj_external_FLAG),
method);
}
void
-register_raw_nci_method_in_ns(Parrot_Interp interp, const int type, void
*func, const char *name)
+register_raw_nci_method_in_ns(Parrot_Interp interp, const int type, void *func,
+ const char *name)
{
PMC * const method = pmc_new(interp, enum_class_NCI);
/* setup call func */
Parrot_NCI_make_raw_nci(interp, method, func);
/* insert it into namespace */
VTABLE_set_pmc_keyed_str(interp, interp->vtables[type]->_namespace,
- string_make(interp, name, strlen(name), NULL,
PObj_constant_FLAG|PObj_external_FLAG),
+ string_make(interp, name, strlen(name), NULL,
+ PObj_constant_FLAG|PObj_external_FLAG),
method);
}
Modified: trunk/src/objects.c
==============================================================================
--- trunk/src/objects.c (original)
+++ trunk/src/objects.c Thu Mar 29 10:11:25 2007
@@ -1935,7 +1935,8 @@
method_name);
else
real_exception(interp, NULL,
ROLE_COMPOSITOIN_METH_CONFLICT,
- "A conflict occurred during role composition due to
the aliasing of '%S' to '%S'.",
+ "A conflict occurred during role composition"
+ " due to the aliasing of '%S' to '%S'.",
method_name, check_name);
return;
}
@@ -1946,11 +1947,13 @@
* very weird is going on. */
if (check_name != method_name)
real_exception(interp, NULL,
ROLE_COMPOSITOIN_METH_CONFLICT,
- "A conflict occurred during role composition; '%S' was
aliased to '%S', but the role already has a '%S'.",
+ "A conflict occurred during role composition;"
+ " '%S' was aliased to '%S', but the role already has a
'%S'.",
method_name, check_name, check_name);
else
real_exception(interp, NULL,
ROLE_COMPOSITOIN_METH_CONFLICT,
- "A conflict occurred during role composition; the
method '%S' from the role managed to conflict with itself somehow.",
+ "A conflict occurred during role composition;"
+ " the method '%S' from the role managed to conflict
with itself somehow.",
method_name);
return;
}
Modified: trunk/src/packdump.c
==============================================================================
--- trunk/src/packdump.c (original)
+++ trunk/src/packdump.c Thu Mar 29 10:11:25 2007
@@ -221,11 +221,16 @@
switch (sub->namespace_name->vtable->base_type) {
case enum_class_String:
namespace_description =
string_from_cstring(interp, "'", 1);
- namespace_description = string_append(interp,
namespace_description, PMC_str_val(sub->namespace_name));
- namespace_description = string_append(interp,
namespace_description, string_from_cstring(interp, "'", 1));
+ namespace_description = string_append(interp,
+ namespace_description,
+ PMC_str_val(sub->namespace_name));
+ namespace_description = string_append(interp,
+ namespace_description,
+ string_from_cstring(interp, "'", 1));
break;
case enum_class_Key:
- namespace_description =
key_set_to_string(interp, sub->namespace_name);
+ namespace_description =
+ key_set_to_string(interp,
sub->namespace_name);
break;
default:
namespace_description =
sub->namespace_name->vtable->whoami;
@@ -258,7 +263,8 @@
);
break;
default:
- PIO_printf(interp, "\tno dump info for PMC %ld %Ss\n",
pmc->vtable->base_type, pmc->vtable->whoami);
+ PIO_printf(interp, "\tno dump info for PMC %ld %Ss\n",
+ pmc->vtable->base_type, pmc->vtable->whoami);
PIO_printf(interp, "\tclass => %Ss,\n",
pmc->vtable->whoami);
}
}
Modified: trunk/src/pmc/class.pmc
==============================================================================
--- trunk/src/pmc/class.pmc (original)
+++ trunk/src/pmc/class.pmc Thu Mar 29 10:11:25 2007
@@ -241,7 +241,8 @@
=cut
*/
- PCCMETHOD void add_attribute(STRING *attribute_name, STRING*
attribute_type :optional, int got_type :opt_flag) {
+ PCCMETHOD void add_attribute(STRING *attribute_name,
+ STRING* attribute_type :optional, int got_type :opt_flag) {
Parrot_Class *class = PARROT_CLASS(SELF);
PMC *new_attribute = pmc_new(interp, enum_class_Hash);
@@ -460,14 +461,17 @@
/*
-=item C<void add_role(PMC* role, PMC* without :optional :named["without"],
PMC* alias :optional :named["alias"])>
+=item C<void add_role(PMC* role, PMC* without :optional :named["without"],
+PMC* alias :optional :named["alias"])>
Compose a role into a class with the given exclusions and aliases.
=cut
*/
- PCCMETHOD void add_role(PMC* role, PMC* without :optional
:named["without"], int got_without :opt_flag, PMC* alias :optional
:named["alias"], int got_alias :opt_flag) {
+ PCCMETHOD void add_role(PMC* role,
+ PMC* without :optional :named["without"], int got_without
:opt_flag,
+ PMC* alias :optional :named["alias"], int got_alias :opt_flag)
{
Parrot_Class *class = PARROT_CLASS(SELF);
Parrot_ComposeRole(interp, role, without, got_without, alias,
got_alias,
class->methods, class->roles);
Modified: trunk/src/pmc/pccmethod_test.pmc
==============================================================================
--- trunk/src/pmc/pccmethod_test.pmc (original)
+++ trunk/src/pmc/pccmethod_test.pmc Thu Mar 29 10:11:25 2007
@@ -64,7 +64,8 @@
{
STRING* kevin = string_from_cstring(interp, "KEVIN", 0);
PIO_printf(interp, "test_method2\n");
- PIO_printf(interp, "%d, %d, %Ss %Ss\n", a1, a1o, VTABLE_name(interp,
slurpy_pos), VTABLE_get_repr(interp,slurpy_pos));
+ PIO_printf(interp, "%d, %d, %Ss %Ss\n", a1, a1o, VTABLE_name(interp,
slurpy_pos),
+ VTABLE_get_repr(interp,slurpy_pos));
PCCRETURN(int 1000, STRING* kevin);
}
@@ -73,7 +74,8 @@
PIO_printf(interp, "test_method3\n");
PIO_printf(interp, "%Ps, %Ps\n", a1, a2);
}
- PCCMETHOD void test_method4( int george :optional, int g_f :opt_flag, PMC
*slurpy_pos :slurpy, PMC *slurpy_named :slurpy :named )
+ PCCMETHOD void test_method4( int george :optional, int g_f :opt_flag, PMC
*slurpy_pos :slurpy,
+ PMC *slurpy_named :slurpy :named )
{
PIO_printf(interp, "test_method4\n");
}
Modified: trunk/src/pmc/role.pmc
==============================================================================
--- trunk/src/pmc/role.pmc (original)
+++ trunk/src/pmc/role.pmc Thu Mar 29 10:11:25 2007
@@ -142,7 +142,8 @@
=cut
*/
- PCCMETHOD void add_attribute(STRING *attribute_name, STRING*
attribute_type :optional, int got_type :opt_flag) {
+ PCCMETHOD void add_attribute(STRING *attribute_name,
+ STRING* attribute_type :optional, int got_type :opt_flag) {
Parrot_Role *role = PARROT_ROLE(SELF);
PMC *new_attribute = pmc_new(interp, enum_class_Hash);
@@ -279,14 +280,17 @@
/*
-=item C<void add_role(PMC* role, PMC* without :optional :named["without"],
PMC* alias :optional :named["alias"])>
+=item C<void add_role(PMC* role, PMC* without :optional :named["without"],
+PMC* alias :optional :named["alias"])>
Compose the given role into this one, using the given exclusions and aliases.
=cut
*/
- PCCMETHOD void add_role(PMC* role, PMC* without :optional
:named["without"], int got_without :opt_flag, PMC* alias :optional
:named["alias"], int got_alias :opt_flag) {
+ PCCMETHOD void add_role(PMC* role,
+ PMC* without :optional :named["without"], int got_without
:opt_flag,
+ PMC* alias :optional :named["alias"], int got_alias :opt_flag) {
Parrot_Role *role_info = PARROT_ROLE(SELF);
Parrot_ComposeRole(interp, role, without, got_without, alias,
got_alias,
role_info->methods, role_info->roles);
Modified: trunk/src/pmc/smop_class.pmc
==============================================================================
--- trunk/src/pmc/smop_class.pmc (original)
+++ trunk/src/pmc/smop_class.pmc Thu Mar 29 10:11:25 2007
@@ -64,7 +64,8 @@
PMC* class_meta;
PMC* class_string;
PMC* attributes = pmc_new(interp, enum_class_ResizablePMCArray);
- const char *attribute_names[] = { "name", "namespace",
"_parrotclass", "attributes", "methods", "superclasses" };
+ const char *attribute_names[] = { "name", "namespace",
"_parrotclass",
+ "attributes", "methods", "superclasses" };
for (i=0; i<6; i++) {
PMC* attribute = pmc_new(interp, enum_class_SMOP_Attribute);
@@ -78,12 +79,17 @@
(PMC* class_meta) = PCCINVOKE(interp, class, "new");
class_string = pmc_new(interp, enum_class_String);
- VTABLE_set_string_native(interp, class_string,
string_from_const_cstring(interp, "Class", 0));
- VTABLE_set_attr_str(interp, class_meta,
string_from_const_cstring(interp, attribute_names[0], 0), class_string);
- VTABLE_set_attr_str(interp, class_meta,
string_from_const_cstring(interp, attribute_names[2], 0), class);
+ VTABLE_set_string_native(interp, class_string,
+ string_from_const_cstring(interp, "Class", 0));
+ VTABLE_set_attr_str(interp, class_meta,
+ string_from_const_cstring(interp, attribute_names[0], 0),
class_string);
+ VTABLE_set_attr_str(interp, class_meta,
+ string_from_const_cstring(interp, attribute_names[2], 0),
class);
VTABLE_init(interp,class_meta);
- VTABLE_set_attr_str(interp, class_meta,
string_from_const_cstring(interp, attribute_names[3], 0), attributes);
- Parrot_store_global_n(interp, interp->root_namespace,
string_from_const_cstring(interp, "class_object", 0), class_meta);
+ VTABLE_set_attr_str(interp, class_meta,
+ string_from_const_cstring(interp, attribute_names[3], 0),
attributes);
+ Parrot_store_global_n(interp, interp->root_namespace,
+ string_from_const_cstring(interp, "class_object", 0),
class_meta);
}
@@ -132,8 +138,10 @@
PCCMETHOD void name(PMC *name :optional, int got_name :opt_flag) {
if (got_name) {
- Parrot_store_global_n(interp, interp->root_namespace,
string_from_const_cstring(interp, "class_object", 0), name);
- VTABLE_set_attr_str(interp, SELF,
string_from_const_cstring(interp, "namespace",0),
CONTEXT(interp->ctx)->current_namespace);
+ Parrot_store_global_n(interp, interp->root_namespace,
+ string_from_const_cstring(interp, "class_object", 0),
name);
+ VTABLE_set_attr_str(interp, SELF,
string_from_const_cstring(interp, "namespace",0),
+ CONTEXT(interp->ctx)->current_namespace);
}
}
@@ -166,9 +174,11 @@
PCCRETURN(PMC *rv)
}
- PCCMETHOD void add_attribute(STRING *attribute_name, STRING*
attribute_type :optional, int got_type :opt_flag) {
+ PCCMETHOD void add_attribute(STRING *attribute_name,
+ STRING* attribute_type :optional, int got_type :opt_flag) {
PMC *attributes;
- PMC *new_attribute = pmc_new(interp, pmc_type(interp,
string_from_const_cstring(interp, "SMOP_Attribute", 0)));
+ PMC *new_attribute = pmc_new(interp, pmc_type(interp,
+ string_from_const_cstring(interp, "SMOP_Attribute", 0)));
PCCINVOKE(interp, pmc, "name", STRING* attribute_name);
PCCINVOKE(interp, SELF, "class", PMC* SELF);