# New Ticket Created by James deBoer
# Please include the string: [perl #32769]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=32769 >
Some calls to internal_exception will include a newline, others will
not. The effect of this is that
when some exceptions occur, parrot will exit without printing a newline,
which is ugly.
The fix I've attached is two-fold. First, it removes any newline passed
to internal_exception. (This was a search and replace, I may have missed
a few). Second, it modifies the the internal_exception function to print
a newline after printing the error.
- James
Index: classes/array.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/array.pmc,v
retrieving revision 1.90
diff -u -r1.90 array.pmc
--- classes/array.pmc 19 Aug 2004 13:46:12 -0000 1.90
+++ classes/array.pmc 2 Dec 2004 16:22:25 -0000
@@ -50,7 +50,7 @@
{
PMC *value;
if (ret == 0)
- internal_exception(OUT_OF_BOUNDS, "Array index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "Array index out of bounds!");
/* XXX getting non existent value, exception or undef?
* current is for perlarray */
if (ret == (void*) -1)
@@ -135,7 +135,7 @@
PMC *value;
if (ret == 0)
- internal_exception(OUT_OF_BOUNDS, "Array index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "Array index out of bounds!");
/* assign into a sparse or not yet set value */
if (ret == (void*) -1 || *(PMC**)ret == 0) {
value = undef(interp);
@@ -675,7 +675,7 @@
INTVAL length;
length = ((List *) PMC_data(SELF))->length;
if (idx >= length || -idx > length) {
- internal_exception(OUT_OF_BOUNDS, "Array index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "Array index out of bounds!");
}
list_assign(INTERP, (List *) PMC_data(SELF), idx,
@@ -974,7 +974,7 @@
void splice(PMC* value, INTVAL offset, INTVAL count) {
if (SELF->vtable->base_type != value->vtable->base_type)
- internal_exception(1, "Type mismatch in splice\n");
+ internal_exception(1, "Type mismatch in splice");
list_splice(INTERP, (List*) PMC_data(SELF), value, offset, count);
}
Index: classes/complex.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/complex.pmc,v
retrieving revision 1.13
diff -u -r1.13 complex.pmc
--- classes/complex.pmc 29 Nov 2004 18:07:28 -0000 1.13
+++ classes/complex.pmc 2 Dec 2004 16:22:26 -0000
@@ -114,7 +114,7 @@
if( (*t != 'i' && *t != 'j') || (*(t+1) != 0) ) {
/* imaginary part does not end in 'i' or 'j' */
internal_exception(INVALID_STRING_REPRESENTATION,
- "Complex: malformed string\n");
+ "Complex: malformed string");
first_num_length = second_num_length = 0;
}
/* this is useful if there is no number for the
@@ -126,7 +126,7 @@
else {
/* "+" or "-" not found: error */
internal_exception(INVALID_STRING_REPRESENTATION,
- "Complex: malformed string\n");
+ "Complex: malformed string");
first_num_length = second_num_length = 0;
}
}
@@ -188,7 +188,7 @@
if(0 == string_equal(interp, key, real))
return &RE(self);
internal_exception(KEY_NOT_FOUND,
- "Complex: key is neither 'real' or 'imag'\n");
+ "Complex: key is neither 'real' or 'imag'");
return NULL;
}
Index: classes/default.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/default.pmc,v
retrieving revision 1.103
diff -u -r1.103 default.pmc
--- classes/default.pmc 20 Nov 2004 16:57:24 -0000 1.103
+++ classes/default.pmc 2 Dec 2004 16:22:26 -0000
@@ -55,7 +55,7 @@
cant_do_method(Parrot_Interp interpreter, PMC * pmc, const char *methname)
{
internal_exception(ILL_INHERIT,
- "%s() not implemented in class '%s'\n", methname,
+ "%s() not implemented in class '%s'", methname,
caller(interpreter, pmc));
}
Index: classes/delegate.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/delegate.pmc,v
retrieving revision 1.33
diff -u -r1.33 delegate.pmc
--- classes/delegate.pmc 28 Oct 2004 11:24:32 -0000 1.33
+++ classes/delegate.pmc 2 Dec 2004 16:22:27 -0000
@@ -87,7 +87,7 @@
if (PObj_is_object_TEST(pmc)) {
class = GET_CLASS((Buffer *)PMC_data(pmc), pmc);
internal_exception(METH_NOT_FOUND,
- "Can't find method '%s' for object '%s'\n",
+ "Can't find method '%s' for object '%s'",
string_to_cstring(interpreter, meth),
string_to_cstring(interpreter, PMC_str_val(
get_attrib_num((SLOTTYPE *)PMC_data(class),
@@ -95,7 +95,7 @@
);
} else {
internal_exception(METH_NOT_FOUND,
- "Can't find method '%s' - erroneous PMC\n",
+ "Can't find method '%s' - erroneous PMC",
string_to_cstring(interpreter, meth)
);
}
Index: classes/fixedbooleanarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/fixedbooleanarray.pmc,v
retrieving revision 1.3
diff -u -r1.3 fixedbooleanarray.pmc
--- classes/fixedbooleanarray.pmc 19 Oct 2004 01:14:34 -0000 1.3
+++ classes/fixedbooleanarray.pmc 2 Dec 2004 16:22:27 -0000
@@ -157,7 +157,7 @@
INTVAL *data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "FixedBooleanArray: index out of bounds!\n");
+ "FixedBooleanArray: index out of bounds!");
data = (INTVAL *)PMC_data(SELF);
return data[key];
@@ -288,7 +288,7 @@
void set_integer_native (INTVAL size) {
if (PMC_int_val(SELF) || size < 1)
- internal_exception(OUT_OF_BOUNDS, "FixedBooleanArray: Can't resize!\n");
+ internal_exception(OUT_OF_BOUNDS, "FixedBooleanArray: Can't resize!");
PMC_int_val(SELF) = size;
PMC_data(SELF) = mem_sys_allocate(size * sizeof(INTVAL));
PObj_active_destroy_SET(SELF);
@@ -308,7 +308,7 @@
INTVAL *data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "FixedBooleanArray: index out of bounds!\n");
+ "FixedBooleanArray: index out of bounds!");
data = (INTVAL*)PMC_data(SELF);
data[key] = (value != 0);
Index: classes/fixedfloatarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/fixedfloatarray.pmc,v
retrieving revision 1.4
diff -u -r1.4 fixedfloatarray.pmc
--- classes/fixedfloatarray.pmc 19 Oct 2004 01:14:34 -0000 1.4
+++ classes/fixedfloatarray.pmc 2 Dec 2004 16:22:27 -0000
@@ -188,7 +188,7 @@
FLOATVAL *data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "FixedFloatArray: index out of bounds!\n");
+ "FixedFloatArray: index out of bounds!");
data = (FLOATVAL *)PMC_data(SELF);
return data[key];
@@ -288,7 +288,7 @@
void set_integer_native (INTVAL size) {
if (PMC_int_val(SELF) || size < 1)
- internal_exception(OUT_OF_BOUNDS, "FixedFloatArray: Can't resize!\n");
+ internal_exception(OUT_OF_BOUNDS, "FixedFloatArray: Can't resize!");
PMC_int_val(SELF) = size;
PMC_data(SELF) = mem_sys_allocate(size * sizeof(FLOATVAL));
PObj_active_destroy_SET(SELF);
@@ -339,7 +339,7 @@
FLOATVAL *data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "FixedFloatArray: index out of bounds!\n");
+ "FixedFloatArray: index out of bounds!");
data = (FLOATVAL*)PMC_data(SELF);
data[key] = value;
Index: classes/fixedintegerarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/fixedintegerarray.pmc,v
retrieving revision 1.3
diff -u -r1.3 fixedintegerarray.pmc
--- classes/fixedintegerarray.pmc 19 Oct 2004 01:14:34 -0000 1.3
+++ classes/fixedintegerarray.pmc 2 Dec 2004 16:22:28 -0000
@@ -157,7 +157,7 @@
INTVAL *data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "FixedIntegerArray: index out of bounds!\n");
+ "FixedIntegerArray: index out of bounds!");
data = (INTVAL *)PMC_data(SELF);
return data[key];
@@ -288,7 +288,7 @@
void set_integer_native (INTVAL size) {
if (PMC_int_val(SELF) || size < 1)
- internal_exception(OUT_OF_BOUNDS, "FixedIntegerArray: Can't resize!\n");
+ internal_exception(OUT_OF_BOUNDS, "FixedIntegerArray: Can't resize!");
PMC_int_val(SELF) = size;
PMC_data(SELF) = mem_sys_allocate(size * sizeof(INTVAL));
PObj_active_destroy_SET(SELF);
@@ -308,7 +308,7 @@
INTVAL *data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "FixedIntegerArray: index out of bounds!\n");
+ "FixedIntegerArray: index out of bounds!");
data = (INTVAL*)PMC_data(SELF);
data[key] = value;
Index: classes/fixedpmcarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/fixedpmcarray.pmc,v
retrieving revision 1.25
diff -u -r1.25 fixedpmcarray.pmc
--- classes/fixedpmcarray.pmc 8 Nov 2004 10:37:49 -0000 1.25
+++ classes/fixedpmcarray.pmc 2 Dec 2004 16:22:29 -0000
@@ -422,7 +422,7 @@
PMC **data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "FixedPMCArray: index out of bounds!\n");
+ "FixedPMCArray: index out of bounds!");
data = (PMC **)PMC_data(SELF);
return data[key];
@@ -458,7 +458,7 @@
PMC **data;
if (PMC_int_val(SELF) && size)
- internal_exception(OUT_OF_BOUNDS, "FixedPMCArray: Can't resize!\n");
+ internal_exception(OUT_OF_BOUNDS, "FixedPMCArray: Can't resize!");
if (!size)
return;
PMC_int_val(SELF) = size;
@@ -604,7 +604,7 @@
PMC **data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "FixedPMCArray: index out of bounds!\n");
+ "FixedPMCArray: index out of bounds!");
data = (PMC**)PMC_data(SELF);
DOD_WRITE_BARRIER(INTERP, SELF, data[key], src);
Index: classes/fixedstringarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/fixedstringarray.pmc,v
retrieving revision 1.3
diff -u -r1.3 fixedstringarray.pmc
--- classes/fixedstringarray.pmc 19 Oct 2004 01:14:35 -0000 1.3
+++ classes/fixedstringarray.pmc 2 Dec 2004 16:22:29 -0000
@@ -243,7 +243,7 @@
STRING **data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "FixedStringArray: index out of bounds!\n");
+ "FixedStringArray: index out of bounds!");
data = (STRING **)PMC_data(SELF);
return data[key];
@@ -312,7 +312,7 @@
void set_integer_native (INTVAL size) {
if (PMC_int_val(SELF) || size < 1)
- internal_exception(OUT_OF_BOUNDS, "FixedStringArray: Can't resize!\n");
+ internal_exception(OUT_OF_BOUNDS, "FixedStringArray: Can't resize!");
PMC_int_val(SELF) = size;
PMC_data(SELF) = mem_sys_allocate_zeroed(size * sizeof(STRING*));
PObj_custom_mark_destroy_SETALL(SELF);
@@ -406,7 +406,7 @@
STRING **data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "FixedStringArray: index out of bounds!\n");
+ "FixedStringArray: index out of bounds!");
data = (STRING**)PMC_data(SELF);
data[key] = value;
Index: classes/intlist.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/intlist.pmc,v
retrieving revision 1.30
diff -u -r1.30 intlist.pmc
--- classes/intlist.pmc 22 Aug 2004 09:15:51 -0000 1.30
+++ classes/intlist.pmc 2 Dec 2004 16:22:29 -0000
@@ -20,7 +20,7 @@
#include "parrot/parrot.h"
-#define THROW_UNSUPPORTED internal_exception(INTERP_ERROR, "Operation not supported\n")
+#define THROW_UNSUPPORTED internal_exception(INTERP_ERROR, "Operation not supported")
pmclass IntList does array {
@@ -212,7 +212,7 @@
void splice(PMC* value, INTVAL offset, INTVAL count) {
if (SELF->vtable->base_type != value->vtable->base_type)
- internal_exception(1, "Type mismatch in splice\n");
+ internal_exception(1, "Type mismatch in splice");
list_splice(INTERP, (List*) PMC_struct_val(SELF), value,
offset, count);
}
Index: classes/iterator.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/iterator.pmc,v
retrieving revision 1.31
diff -u -r1.31 iterator.pmc
--- classes/iterator.pmc 30 Aug 2004 13:55:27 -0000 1.31
+++ classes/iterator.pmc 2 Dec 2004 16:22:30 -0000
@@ -40,7 +40,7 @@
*/
void init () {
- internal_exception(1, "Iterator init without aggregate\n");
+ internal_exception(1, "Iterator init without aggregate");
}
/*
@@ -283,7 +283,7 @@
void set_integer_native (INTVAL value) {
PMC *key, *agg;
if (value < ITERATE_FROM_START || value > ITERATE_FROM_END)
- internal_exception(1, "Illegal set_integer on iterator\n");
+ internal_exception(1, "Illegal set_integer on iterator");
/* reset iterator on aggregate */
agg = (PMC*) PMC_pmc_val(SELF);
if (agg->vtable->base_type == enum_class_Slice) {
Index: classes/null.pl
===================================================================
RCS file: /cvs/public/parrot/classes/null.pl,v
retrieving revision 1.2
diff -u -r1.2 null.pl
--- classes/null.pl 29 Oct 2003 04:15:34 -0000 1.2
+++ classes/null.pl 2 Dec 2004 16:22:30 -0000
@@ -49,7 +49,7 @@
}
print " $retval $methname ($args) {\n";
- print " internal_exception(NULL_REG_ACCESS, \"Fatal exception: Null PMC access (PMC::$methname)!\\n\");\n";
+ print " internal_exception(NULL_REG_ACCESS, \"Fatal exception: Null PMC access (PMC::$methname)!\");\n";
if($retval ne 'void') {
print " return ($retval)0;\n";
}
Index: classes/parrotobject.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/parrotobject.pmc,v
retrieving revision 1.35
diff -u -r1.35 parrotobject.pmc
--- classes/parrotobject.pmc 20 Nov 2004 16:57:24 -0000 1.35
+++ classes/parrotobject.pmc 2 Dec 2004 16:22:30 -0000
@@ -62,7 +62,7 @@
*/
void init() {
- internal_exception(1, "Can't create new ParrotObjects\n",
+ internal_exception(1, "Can't create new ParrotObjects",
"use the registered class instead");
}
Index: classes/perlhash.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlhash.pmc,v
retrieving revision 1.92
diff -u -r1.92 perlhash.pmc
--- classes/perlhash.pmc 9 Sep 2004 10:47:46 -0000 1.92
+++ classes/perlhash.pmc 2 Dec 2004 16:22:31 -0000
@@ -142,7 +142,7 @@
{
if (key == NULL) {
internal_exception(OUT_OF_BOUNDS,
- "Cannot use NULL key for PerlHash!\n");
+ "Cannot use NULL key for PerlHash!");
return NULL;
}
return key_string(interpreter, key);
Index: classes/perlint.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlint.pmc,v
retrieving revision 1.83
diff -u -r1.83 perlint.pmc
--- classes/perlint.pmc 22 Nov 2004 10:53:42 -0000 1.83
+++ classes/perlint.pmc 2 Dec 2004 16:22:32 -0000
@@ -525,7 +525,7 @@
*/
void divide (PMC* value, PMC* dest) {
MMD_PerlUndef: {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
MMD_BigInt: {
overflow_p(INTERP, SELF, value, dest, MMD_DIVIDE);
@@ -536,7 +536,7 @@
FLOATVAL d;
INTVAL i;
if (valf == 0.0) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
return;
}
d = PMC_int_val(SELF)/valf;
@@ -549,7 +549,7 @@
}
void floor_divide (PMC* value, PMC* dest) {
MMD_PerlUndef: {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
MMD_BigInt: {
overflow_p(INTERP, SELF, value, dest, MMD_DIVIDE);
@@ -977,7 +977,7 @@
*/
void repeat (PMC* value, PMC* dest) {
internal_exception(INVALID_OPERATION,
- "repeat() not implemented in class 'PerlInt'\n");
+ "repeat() not implemented in class 'PerlInt'");
}
/*
@@ -991,7 +991,7 @@
*/
void repeat_int (INTVAL value, PMC* dest) {
internal_exception(INVALID_OPERATION,
- "repeat() not implemented in class 'PerlInt'\n");
+ "repeat() not implemented in class 'PerlInt'");
}
/*
Index: classes/perlnum.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlnum.pmc,v
retrieving revision 1.65
diff -u -r1.65 perlnum.pmc
--- classes/perlnum.pmc 28 Sep 2004 11:23:10 -0000 1.65
+++ classes/perlnum.pmc 2 Dec 2004 16:22:33 -0000
@@ -591,7 +591,7 @@
void repeat (PMC* value, PMC* dest) {
internal_exception(INVALID_OPERATION,
- "repeat() not implemented in class 'PerlNum'\n");
+ "repeat() not implemented in class 'PerlNum'");
}
/*
@@ -606,7 +606,7 @@
void repeat_int (INTVAL value, PMC* dest) {
internal_exception(INVALID_OPERATION,
- "repeat() not implemented in class 'PerlNum'\n");
+ "repeat() not implemented in class 'PerlNum'");
}
/*
Index: classes/perlstring.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlstring.pmc,v
retrieving revision 1.89
diff -u -r1.89 perlstring.pmc
--- classes/perlstring.pmc 14 Oct 2004 09:07:07 -0000 1.89
+++ classes/perlstring.pmc 2 Dec 2004 16:22:33 -0000
@@ -440,7 +440,7 @@
}
else {
internal_exception(INVALID_OPERATION,
- "modulus() not implemented for PerlString\n");
+ "modulus() not implemented for PerlString");
}
}
Index: classes/perlundef.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/perlundef.pmc,v
retrieving revision 1.42
diff -u -r1.42 perlundef.pmc
--- classes/perlundef.pmc 17 Jul 2004 16:01:05 -0000 1.42
+++ classes/perlundef.pmc 2 Dec 2004 16:22:34 -0000
@@ -306,15 +306,15 @@
Parrot_warn(INTERP, PARROT_WARNINGS_UNDEF_FLAG,
"Use of uninitialized value in division");
if(value->vtable == Parrot_base_vtables[enum_class_PerlUndef]) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
else if(value->vtable == Parrot_base_vtables[enum_class_PerlInt]) {
if(VTABLE_get_integer(INTERP, value) == 0) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
}
else if(VTABLE_get_number(INTERP, value) == 0) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
VTABLE_set_integer_native(INTERP, dest, 0);
@@ -332,7 +332,7 @@
Parrot_warn(INTERP, PARROT_WARNINGS_UNDEF_FLAG,
"Use of uninitialized value in integer division");
if(value == 0) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
VTABLE_set_integer_native(INTERP, dest, 0);
}
@@ -350,7 +350,7 @@
Parrot_warn(INTERP, PARROT_WARNINGS_UNDEF_FLAG,
"Use of uninitialized value in numeric division");
if(value == 0) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
VTABLE_set_integer_native(INTERP, dest, 0);
}
@@ -367,15 +367,15 @@
Parrot_warn(INTERP, PARROT_WARNINGS_UNDEF_FLAG,
"Use of uninitialized value in modulus");
if(value->vtable == Parrot_base_vtables[enum_class_PerlUndef]) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
else if(value->vtable == Parrot_base_vtables[enum_class_PerlInt]) {
if(VTABLE_get_integer(INTERP, value) == 0) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
}
else if(VTABLE_get_number(INTERP, value) == 0) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
VTABLE_set_integer_native(INTERP, dest, 0);
@@ -393,7 +393,7 @@
Parrot_warn(INTERP, PARROT_WARNINGS_UNDEF_FLAG,
"Use of uninitialized value in integer modulus");
if(value == 0) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
VTABLE_set_integer_native(INTERP, dest, 0);
}
@@ -411,7 +411,7 @@
Parrot_warn(INTERP, PARROT_WARNINGS_UNDEF_FLAG,
"Use of uninitialized value in numeric modulus");
if(value == 0) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
}
VTABLE_set_integer_native(INTERP, dest, 0);
}
Index: classes/resizablebooleanarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/resizablebooleanarray.pmc,v
retrieving revision 1.3
diff -u -r1.3 resizablebooleanarray.pmc
--- classes/resizablebooleanarray.pmc 19 Oct 2004 01:14:35 -0000 1.3
+++ classes/resizablebooleanarray.pmc 2 Dec 2004 16:22:34 -0000
@@ -43,7 +43,7 @@
SizeBooleanData *sd;
if (key < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableBooleanArray: index out of bounds!\n");
+ "ResizableBooleanArray: index out of bounds!");
if(key >= PMC_int_val(SELF))
DYNSELF.set_integer_native(key+1);
@@ -65,7 +65,7 @@
SizeBooleanData *sd;
if (key < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableBooleanArray: index out of bounds!\n");
+ "ResizableBooleanArray: index out of bounds!");
if(key >= PMC_int_val(SELF))
DYNSELF.set_integer_native(key+1);
@@ -103,7 +103,7 @@
SizeBooleanData *sd;
if (size < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableBooleanArray: Can't resize!\n");
+ "ResizableBooleanArray: Can't resize!");
sd = PMC_data(SELF);
PMC_int_val(SELF) = size;
Index: classes/resizablefloatarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/resizablefloatarray.pmc,v
retrieving revision 1.5
diff -u -r1.5 resizablefloatarray.pmc
--- classes/resizablefloatarray.pmc 19 Oct 2004 01:14:35 -0000 1.5
+++ classes/resizablefloatarray.pmc 2 Dec 2004 16:22:34 -0000
@@ -45,7 +45,7 @@
SizeFloatData *sd;
if (key < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableFloatArray: index out of bounds!\n");
+ "ResizableFloatArray: index out of bounds!");
if (key >= PMC_int_val(SELF))
DYNSELF.set_integer_native(key+1);
@@ -68,7 +68,7 @@
SizeFloatData *sd;
if (key < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableFloatArray: index out of bounds!\n");
+ "ResizableFloatArray: index out of bounds!");
if(key >= PMC_int_val(SELF))
DYNSELF.set_integer_native(key+1);
@@ -96,7 +96,7 @@
SizeFloatData *sd;
if (size < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableFloatArray: Can't resize to negative value!\n");
+ "ResizableFloatArray: Can't resize to negative value!");
sd = PMC_data(SELF);
PMC_int_val(SELF) = size;
@@ -182,7 +182,7 @@
if (sd == NULL || size == 0) {
internal_exception(OUT_OF_BOUNDS,
- "ResizableFloatArray: Can't pop from an empty array!\n");
+ "ResizableFloatArray: Can't pop from an empty array!");
}
value = sd->data[size - 1];
Index: classes/resizableintegerarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/resizableintegerarray.pmc,v
retrieving revision 1.3
diff -u -r1.3 resizableintegerarray.pmc
--- classes/resizableintegerarray.pmc 19 Oct 2004 01:14:35 -0000 1.3
+++ classes/resizableintegerarray.pmc 2 Dec 2004 16:22:35 -0000
@@ -43,7 +43,7 @@
SizeIntData *sd;
if (key < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableIntegerArray: index out of bounds!\n");
+ "ResizableIntegerArray: index out of bounds!");
if(key >= PMC_int_val(SELF))
DYNSELF.set_integer_native(key+1);
@@ -65,7 +65,7 @@
SizeIntData *sd;
if (key < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableIntegerArray: index out of bounds!\n");
+ "ResizableIntegerArray: index out of bounds!");
if(key >= PMC_int_val(SELF))
DYNSELF.set_integer_native(key+1);
@@ -87,7 +87,7 @@
SizeIntData *sd;
if (size < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableIntegerArray: Can't resize!\n");
+ "ResizableIntegerArray: Can't resize!");
sd = PMC_data(SELF);
PMC_int_val(SELF) = size;
Index: classes/resizablepmcarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/resizablepmcarray.pmc,v
retrieving revision 1.15
diff -u -r1.15 resizablepmcarray.pmc
--- classes/resizablepmcarray.pmc 19 Oct 2004 01:14:35 -0000 1.15
+++ classes/resizablepmcarray.pmc 2 Dec 2004 16:22:35 -0000
@@ -66,7 +66,7 @@
if (size < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizablePMCArray: Can't resize!\n");
+ "ResizablePMCArray: Can't resize!");
if (!PMC_data(SELF)) {
/* empty - used fixed routine */
@@ -119,7 +119,7 @@
key += PMC_int_val(SELF);
if (key < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizablePMCArray: index out of bounds!\n");
+ "ResizablePMCArray: index out of bounds!");
if (key >= PMC_int_val(SELF))
DYNSELF.set_integer_native(key+1);
data = PMC_data(SELF);
@@ -151,7 +151,7 @@
key += PMC_int_val(SELF);
if (key < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizablePMCArray: index out of bounds!\n");
+ "ResizablePMCArray: index out of bounds!");
if (key >= PMC_int_val(SELF))
DYNSELF.set_integer_native(key+1);
data = (PMC**)PMC_data(SELF);
@@ -171,7 +171,7 @@
Parrot_py_set_slice(INTERP, SELF, key, NULL);
else
internal_exception(OUT_OF_BOUNDS,
- "ResizablePMCArray: unimplemented delete!\n");
+ "ResizablePMCArray: unimplemented delete!");
}
/*
Index: classes/resizablestringarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/resizablestringarray.pmc,v
retrieving revision 1.5
diff -u -r1.5 resizablestringarray.pmc
--- classes/resizablestringarray.pmc 19 Oct 2004 01:14:35 -0000 1.5
+++ classes/resizablestringarray.pmc 2 Dec 2004 16:22:35 -0000
@@ -43,7 +43,7 @@
SizeStringData *sd;
if (key < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableStringArray: index out of bounds!\n");
+ "ResizableStringArray: index out of bounds!");
if(key >= PMC_int_val(SELF))
DYNSELF.set_integer_native(key+1);
@@ -65,7 +65,7 @@
SizeStringData *sd;
if (key < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableStringArray: index out of bounds!\n");
+ "ResizableStringArray: index out of bounds!");
if(key >= PMC_int_val(SELF))
DYNSELF.set_integer_native(key+1);
@@ -104,7 +104,7 @@
if (size < 0)
internal_exception(OUT_OF_BOUNDS,
- "ResizableStringArray: Can't resize!\n");
+ "ResizableStringArray: Can't resize!");
sd = (SizeStringData *)PMC_data(SELF);
PMC_int_val(SELF) = size;
Index: classes/sarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/sarray.pmc,v
retrieving revision 1.30
diff -u -r1.30 sarray.pmc
--- classes/sarray.pmc 8 Sep 2004 00:33:51 -0000 1.30
+++ classes/sarray.pmc 2 Dec 2004 16:22:36 -0000
@@ -68,7 +68,7 @@
default:
break;
}
- internal_exception(OUT_OF_BOUNDS, "SArray: Entry not an integer!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray: Entry not an integer!");
return 0;
}
@@ -95,7 +95,7 @@
default:
break;
}
- internal_exception(OUT_OF_BOUNDS, "SArray: Entry not a number!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray: Entry not a number!");
return 0;
}
@@ -122,7 +122,7 @@
default:
break;
}
- internal_exception(OUT_OF_BOUNDS, "SArray: Entry not a string!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray: Entry not a string!");
return 0;
}
@@ -158,7 +158,7 @@
case enum_hash_pmc:
return UVal_pmc(e->val);
default:
- internal_exception(OUT_OF_BOUNDS, "SArray: Unknown entry!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray: Unknown entry!");
}
return NULL;
}
@@ -183,7 +183,7 @@
INTVAL end_index = UVal_int(e[1].val);
if (start_index >= end_index)
- internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
ret = (HashEntry *) PMC_data(self) + (2 + start_index++);
@@ -215,7 +215,7 @@
}
key += start_index; /* lower bound if already shifted */
if (key < start_index || key >= end_index)
- internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
e = (HashEntry *) PMC_data(self) + (2 + key);
return e;
}
@@ -616,7 +616,7 @@
void set_integer_native (INTVAL size) {
if (PMC_int_val(SELF))
- internal_exception(OUT_OF_BOUNDS, "SArray: Can't resize!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray: Can't resize!");
PMC_int_val(SELF) = size;
/* Probably ought to actually copy this... */
if (PMC_data(SELF)) {
@@ -640,7 +640,7 @@
void set_integer_keyed_int (INTVAL key, INTVAL value) {
HashEntry *e;
if (key < 0 || key >= PMC_int_val(SELF))
- internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
e = (HashEntry *) PMC_data(SELF) + (2 + key);
e->type = enum_hash_int;
UVal_int(e->val) = value;
@@ -663,7 +663,7 @@
HashEntry *e;
INTVAL nextix;
if (!PMC_data(SELF))
- internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
e = (HashEntry *) PMC_data(SELF) + 1;
nextix = UVal_int(e->val);
DYNSELF.set_integer_keyed_int(nextix, value);
@@ -683,7 +683,7 @@
void set_number_keyed_int (INTVAL key, FLOATVAL value) {
HashEntry *e;
if (key < 0 || key >= PMC_int_val(SELF))
- internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
e = (HashEntry *) PMC_data(SELF) + (2 + key);
e->type = enum_hash_num;
UVal_num(e->val) = value;
@@ -706,7 +706,7 @@
HashEntry *e;
INTVAL nextix;
if (!PMC_data(SELF))
- internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
e = (HashEntry *) PMC_data(SELF) + 1;
nextix = UVal_int(e->val);
DYNSELF.set_number_keyed_int(nextix, value);
@@ -725,7 +725,7 @@
void set_string_keyed_int (INTVAL key, STRING* value) {
HashEntry *e;
if (key < 0 || key >= PMC_int_val(SELF))
- internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
e = (HashEntry *) PMC_data(SELF) + (2 + key);
e->type = enum_hash_string;
UVal_str(e->val) = value;
@@ -749,7 +749,7 @@
HashEntry *e;
INTVAL nextix;
if (!PMC_data(SELF))
- internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
e = (HashEntry *) PMC_data(SELF) + 1;
nextix = UVal_int(e->val);
DYNSELF.set_string_keyed_int(nextix, value);
@@ -768,7 +768,7 @@
void set_pmc_keyed_int (INTVAL key, PMC* src) {
HashEntry *e;
if (key < 0 || key >= PMC_int_val(SELF))
- internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
e = (HashEntry *) PMC_data(SELF) + (2 + key);
e->type = enum_hash_pmc;
DOD_WRITE_BARRIER(INTERP, SELF, UVal_pmc(e->val), src);
@@ -792,7 +792,7 @@
HashEntry *e;
INTVAL nextix;
if (!PMC_data(SELF))
- internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!\n");
+ internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
e = (HashEntry *) PMC_data(SELF) + 1;
nextix = UVal_int(e->val);
DYNSELF.set_pmc_keyed_int(nextix, value);
Index: classes/unmanagedstruct.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/unmanagedstruct.pmc,v
retrieving revision 1.47
diff -u -r1.47 unmanagedstruct.pmc
--- classes/unmanagedstruct.pmc 13 Sep 2004 09:17:33 -0000 1.47
+++ classes/unmanagedstruct.pmc 2 Dec 2004 16:22:38 -0000
@@ -362,7 +362,7 @@
else
{
internal_exception(1,
- "no initializer available for nested struct\n");
+ "no initializer available for nested struct");
}
/* assign the pointer */
Index: dynclasses/match.pmc
===================================================================
RCS file: /cvs/public/parrot/dynclasses/match.pmc,v
retrieving revision 1.1
diff -u -r1.1 match.pmc
--- dynclasses/match.pmc 17 Sep 2004 04:55:02 -0000 1.1
+++ dynclasses/match.pmc 2 Dec 2004 16:22:39 -0000
@@ -33,7 +33,7 @@
{
if (key == NULL) {
internal_exception(OUT_OF_BOUNDS,
- "Cannot use NULL key for Match!\n");
+ "Cannot use NULL key for Match!");
return NULL;
}
return key_string(interpreter, key);
Index: dynclasses/matchrange.pmc
===================================================================
RCS file: /cvs/public/parrot/dynclasses/matchrange.pmc,v
retrieving revision 1.2
diff -u -r1.2 matchrange.pmc
--- dynclasses/matchrange.pmc 19 Nov 2004 06:41:29 -0000 1.2
+++ dynclasses/matchrange.pmc 2 Dec 2004 16:22:40 -0000
@@ -63,7 +63,7 @@
if(0 == string_equal(interp, key, end))
return &RANGE_END(self);
internal_exception(KEY_NOT_FOUND,
- "MatchRange: key is neither 'start' nor 'end'\n");
+ "MatchRange: key is neither 'start' nor 'end'");
return NULL;
}
Index: dynclasses/pycomplex.pmc
===================================================================
RCS file: /cvs/public/parrot/dynclasses/pycomplex.pmc,v
retrieving revision 1.1
diff -u -r1.1 pycomplex.pmc
--- dynclasses/pycomplex.pmc 30 Nov 2004 21:49:20 -0000 1.1
+++ dynclasses/pycomplex.pmc 2 Dec 2004 16:22:41 -0000
@@ -116,7 +116,7 @@
if( (*t != 'i' && *t != 'j') || (*(t+1) != 0) ) {
/* imaginary part does not end in 'i' or 'j' */
internal_exception(INVALID_STRING_REPRESENTATION,
- "Complex: malformed string\n");
+ "Complex: malformed string");
first_num_length = second_num_length = 0;
}
/* this is useful if there is no number for the
@@ -128,7 +128,7 @@
else {
/* "+" or "-" not found: error */
internal_exception(INVALID_STRING_REPRESENTATION,
- "Complex: malformed string\n");
+ "Complex: malformed string");
first_num_length = second_num_length = 0;
}
}
@@ -190,7 +190,7 @@
if(0 == string_equal(interp, key, real))
return &RE(self);
internal_exception(KEY_NOT_FOUND,
- "Complex: key is neither 'real' or 'imag'\n");
+ "Complex: key is neither 'real' or 'imag'");
return NULL;
}
Index: dynclasses/pylist.pmc
===================================================================
RCS file: /cvs/public/parrot/dynclasses/pylist.pmc,v
retrieving revision 1.3
diff -u -r1.3 pylist.pmc
--- dynclasses/pylist.pmc 2 Dec 2004 14:56:43 -0000 1.3
+++ dynclasses/pylist.pmc 2 Dec 2004 16:22:42 -0000
@@ -102,7 +102,7 @@
}
else
internal_exception(OUT_OF_BOUNDS,
- "PyList: unimplemented delete!\n");
+ "PyList: unimplemented delete!");
}
/*
Index: dynclasses/pyobject.pmc
===================================================================
RCS file: /cvs/public/parrot/dynclasses/pyobject.pmc,v
retrieving revision 1.1
diff -u -r1.1 pyobject.pmc
--- dynclasses/pyobject.pmc 10 Nov 2004 01:23:21 -0000 1.1
+++ dynclasses/pyobject.pmc 2 Dec 2004 16:22:43 -0000
@@ -692,7 +692,7 @@
}
else {
internal_exception(ILL_INHERIT,
- "set_pmc not implemented in class '%s'\n",
+ "set_pmc not implemented in class '%s'",
string_to_cstring(INTERP, VTABLE_name(INTERP, pmc)));
}
Index: dynclasses/pytuple.pmc
===================================================================
RCS file: /cvs/public/parrot/dynclasses/pytuple.pmc,v
retrieving revision 1.2
diff -u -r1.2 pytuple.pmc
--- dynclasses/pytuple.pmc 30 Nov 2004 21:49:20 -0000 1.2
+++ dynclasses/pytuple.pmc 2 Dec 2004 16:22:43 -0000
@@ -154,7 +154,7 @@
PMC **data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "PyTuple: index out of bounds!\n");
+ "PyTuple: index out of bounds!");
data = (PMC **)PMC_data(SELF);
return data[key];
@@ -224,7 +224,7 @@
PMC **data;
if (PMC_int_val(SELF) && size)
- internal_exception(OUT_OF_BOUNDS, "PyTuple: Can't resize!\n");
+ internal_exception(OUT_OF_BOUNDS, "PyTuple: Can't resize!");
if (!size)
return;
PMC_int_val(SELF) = size;
@@ -249,7 +249,7 @@
PMC **data;
if (key < 0 || key >= PMC_int_val(SELF))
internal_exception(OUT_OF_BOUNDS,
- "PyTuple: index out of bounds!\n");
+ "PyTuple: index out of bounds!");
data = (PMC**)PMC_data(SELF);
DOD_WRITE_BARRIER(INTERP, SELF, data[key], src);
Index: dynclasses/tclarray.pmc
===================================================================
RCS file: /cvs/public/parrot/dynclasses/tclarray.pmc,v
retrieving revision 1.3
diff -u -r1.3 tclarray.pmc
--- dynclasses/tclarray.pmc 21 Nov 2004 20:50:13 -0000 1.3
+++ dynclasses/tclarray.pmc 2 Dec 2004 16:22:44 -0000
@@ -38,7 +38,7 @@
{
if (key == NULL) {
internal_exception(OUT_OF_BOUNDS,
- "Cannot use NULL key for TclArray!\n");
+ "Cannot use NULL key for TclArray!");
return NULL;
}
return key_string(interpreter, key);
@@ -818,7 +818,7 @@
/* do nothing: hash_get_idx does increment the idx */
break;
default:
- internal_exception(1, "Can't iterate from end\n");
+ internal_exception(1, "Can't iterate from end");
break;
}
return ret;
Index: dynclasses/tclfloat.pmc
===================================================================
RCS file: /cvs/public/parrot/dynclasses/tclfloat.pmc,v
retrieving revision 1.4
diff -u -r1.4 tclfloat.pmc
--- dynclasses/tclfloat.pmc 21 Nov 2004 20:50:13 -0000 1.4
+++ dynclasses/tclfloat.pmc 2 Dec 2004 16:22:44 -0000
@@ -246,12 +246,12 @@
/* XXX why except? */
void repeat (PMC* value, PMC* dest) {
internal_exception(INVALID_OPERATION,
- "repeat() not implemented in class 'TclFloat'\n");
+ "repeat() not implemented in class 'TclFloat'");
}
void repeat_int (INTVAL value, PMC* dest) {
internal_exception(INVALID_OPERATION,
- "repeat() not implemented in class 'TclFloat'\n");
+ "repeat() not implemented in class 'TclFloat'");
}
void increment () {
Index: dynclasses/tclint.pmc
===================================================================
RCS file: /cvs/public/parrot/dynclasses/tclint.pmc,v
retrieving revision 1.4
diff -u -r1.4 tclint.pmc
--- dynclasses/tclint.pmc 28 Nov 2004 01:03:24 -0000 1.4
+++ dynclasses/tclint.pmc 2 Dec 2004 16:22:45 -0000
@@ -203,7 +203,7 @@
pmci = PMC_int_val(SELF);
valf = VTABLE_get_number(INTERP, value);
if (valf == 0.0) {
- internal_exception(DIV_BY_ZERO, "division by zero!\n");
+ internal_exception(DIV_BY_ZERO, "division by zero!");
return;
}
@@ -406,12 +406,12 @@
/* XXX we want exceptions here? */
void repeat (PMC* value, PMC* dest) {
internal_exception(INVALID_OPERATION,
- "repeat() not implemented in class 'TclInt'\n");
+ "repeat() not implemented in class 'TclInt'");
}
void repeat_int (INTVAL value, PMC* dest) {
internal_exception(INVALID_OPERATION,
- "repeat() not implemented in class 'TclInt'\n");
+ "repeat() not implemented in class 'TclInt'");
}
Index: src/exceptions.c
===================================================================
RCS file: /cvs/public/parrot/src/exceptions.c,v
retrieving revision 1.65
diff -u -r1.65 exceptions.c
--- src/exceptions.c 25 Nov 2004 09:28:05 -0000 1.65
+++ src/exceptions.c 2 Dec 2004 16:22:54 -0000
@@ -52,6 +52,7 @@
va_list arglist;
va_start(arglist, format);
vfprintf(stderr, format, arglist);
+ fprintf(stderr, "\n");
va_end(arglist);
Parrot_exit(exitcode);
}