diff --git a/classes/array.pmc b/classes/array.pmc index 5403897ad1..ce8e9e4263 100644 --- a/classes/array.pmc +++ b/classes/array.pmc @@ -50,7 +50,7 @@ static PMC* retval(Interp *interp, void *ret) { 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 @@ Parrot_Array_set_pmc_ptr(Interp *interp, List *list, INTVAL key) 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 @@ Sets the PMC at element C to C<*src>. 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 @@ C. 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); } diff --git a/classes/complex.pmc b/classes/complex.pmc index dd22db9d0d..11162264af 100644 --- a/classes/complex.pmc +++ b/classes/complex.pmc @@ -114,7 +114,7 @@ complex_parse_string (Parrot_Interp interp, 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 @@ complex_parse_string (Parrot_Interp interp, 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 @@ complex_locate_keyed_num(Parrot_Interp interp, PMC* self, STRING *key) { 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; } diff --git a/classes/default.pmc b/classes/default.pmc index 00a68e3d9e..628585814e 100644 --- a/classes/default.pmc +++ b/classes/default.pmc @@ -55,7 +55,7 @@ static void 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)); } diff --git a/classes/delegate.pmc b/classes/delegate.pmc index d0c96aa9af..15e5ee5f41 100644 --- a/classes/delegate.pmc +++ b/classes/delegate.pmc @@ -87,7 +87,7 @@ find_or_die(Parrot_Interp interpreter, PMC *pmc, STRING *meth) { 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 @@ find_or_die(Parrot_Interp interpreter, PMC *pmc, STRING *meth) { ); } 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) ); } diff --git a/classes/fixedbooleanarray.pmc b/classes/fixedbooleanarray.pmc index cd8b951b2d..fc3bf5b490 100644 --- a/classes/fixedbooleanarray.pmc +++ b/classes/fixedbooleanarray.pmc @@ -157,7 +157,7 @@ Returns the integer value of the element at index C. 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 @@ Resizes the array to C elements. 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 @@ Sets the integer value of the element at index C to C. 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); diff --git a/classes/fixedfloatarray.pmc b/classes/fixedfloatarray.pmc index 577b8b5d86..ccf42f7182 100644 --- a/classes/fixedfloatarray.pmc +++ b/classes/fixedfloatarray.pmc @@ -188,7 +188,7 @@ Returns the floating-point value of the element at index C. 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 @@ Resizes the array to C elements. 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 @@ C. 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; diff --git a/classes/fixedintegerarray.pmc b/classes/fixedintegerarray.pmc index cb2c8e6eb5..1587e7e78d 100644 --- a/classes/fixedintegerarray.pmc +++ b/classes/fixedintegerarray.pmc @@ -157,7 +157,7 @@ Returns the integer value of the element at index C. 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 @@ Resizes the array to C elements. 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 @@ Sets the integer value of the element at index C to C. 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; diff --git a/classes/fixedpmcarray.pmc b/classes/fixedpmcarray.pmc index 8626bbadbb..703c9da514 100644 --- a/classes/fixedpmcarray.pmc +++ b/classes/fixedpmcarray.pmc @@ -422,7 +422,7 @@ Returns the PMC value of the element at index C. 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 @@ Resizes the array to C elements. 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 @@ Sets the PMC value of the element at index C to C<*src>. 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); diff --git a/classes/fixedstringarray.pmc b/classes/fixedstringarray.pmc index 1cc2fea031..48e3346be9 100644 --- a/classes/fixedstringarray.pmc +++ b/classes/fixedstringarray.pmc @@ -243,7 +243,7 @@ Returns the Parrot string value of the element at index C. 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 @@ Resizes the array to C elements. 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 @@ Sets the Parrot string value of the element at index C to C. 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; diff --git a/classes/integer.pmc b/classes/integer.pmc index c15385279f..f341fb07dd 100644 --- a/classes/integer.pmc +++ b/classes/integer.pmc @@ -598,7 +598,7 @@ Divides the integer by C<*value> and returns the result in C<*dest>. */ 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); @@ -609,7 +609,7 @@ MMD_DEFAULT: { 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; @@ -623,7 +623,7 @@ MMD_DEFAULT: { 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); diff --git a/classes/intlist.pmc b/classes/intlist.pmc index c764ffbf7b..8507d234a1 100644 --- a/classes/intlist.pmc +++ b/classes/intlist.pmc @@ -20,7 +20,7 @@ C provides an integer-only array. #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 @@ Removes and returns the first element in the list. 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); } diff --git a/classes/iterator.pmc b/classes/iterator.pmc index a7a166196b..ca10887f96 100644 --- a/classes/iterator.pmc +++ b/classes/iterator.pmc @@ -40,7 +40,7 @@ Raises an exception. Use C. */ void init () { - internal_exception(1, "Iterator init without aggregate\n"); + internal_exception(1, "Iterator init without aggregate"); } /* @@ -283,7 +283,7 @@ Reset the Iterator. C must be one of 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) { diff --git a/classes/null.pl b/classes/null.pl index fbfb226495..9ac46f7d71 100644 --- a/classes/null.pl +++ b/classes/null.pl @@ -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"; } diff --git a/classes/parrotobject.pmc b/classes/parrotobject.pmc index 6a8423f96f..4659d13fa0 100644 --- a/classes/parrotobject.pmc +++ b/classes/parrotobject.pmc @@ -62,7 +62,7 @@ C. */ void init() { - internal_exception(1, "Can't create new ParrotObjects\n", + internal_exception(1, "Can't create new ParrotObjects", "use the registered class instead"); } diff --git a/classes/perlhash.pmc b/classes/perlhash.pmc index f965a46161..c06b8a61fb 100644 --- a/classes/perlhash.pmc +++ b/classes/perlhash.pmc @@ -142,7 +142,7 @@ static STRING* make_hash_key(Interp* interpreter, PMC * key) { 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); diff --git a/classes/perlstring.pmc b/classes/perlstring.pmc index 336ab86aea..82eaad575c 100644 --- a/classes/perlstring.pmc +++ b/classes/perlstring.pmc @@ -268,7 +268,7 @@ When Python mode is enabled does sprintf :( } else { internal_exception(INVALID_OPERATION, - "modulus() not implemented for PerlString\n"); + "modulus() not implemented for PerlString"); } } diff --git a/classes/perlundef.pmc b/classes/perlundef.pmc index 4f12ebebcd..5822c793eb 100644 --- a/classes/perlundef.pmc +++ b/classes/perlundef.pmc @@ -306,15 +306,15 @@ Morphs to a C with the value of C<*value>. 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 @@ Morphs to a C with the value of C<*value>. 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 @@ Morphs to a C with the value of C<*value>. 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 @@ Morphs to a C with the value of C<*value>. 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 @@ Morphs to a C with the value of C<*value>. 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 @@ Morphs to a C with the value of C<*value>. 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); } diff --git a/classes/resizablebooleanarray.pmc b/classes/resizablebooleanarray.pmc index ae19ab5e94..8d8828c981 100644 --- a/classes/resizablebooleanarray.pmc +++ b/classes/resizablebooleanarray.pmc @@ -43,7 +43,7 @@ Returns the integer value of the element at index C. 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 @@ Sets the integer value of the element at index C to C. 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 @@ Resizes the array to C elements. 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; diff --git a/classes/resizablefloatarray.pmc b/classes/resizablefloatarray.pmc index 51c181b0b0..7241ea494f 100644 --- a/classes/resizablefloatarray.pmc +++ b/classes/resizablefloatarray.pmc @@ -45,7 +45,7 @@ Returns the floating-point value of the element at index C. 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 @@ C. 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 @@ shrink to one and half times the new size (three thirds of the old size). 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 @@ Removes and returns the last element in the array. 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]; diff --git a/classes/resizableintegerarray.pmc b/classes/resizableintegerarray.pmc index 43f64061b4..88f9169efb 100644 --- a/classes/resizableintegerarray.pmc +++ b/classes/resizableintegerarray.pmc @@ -43,7 +43,7 @@ Returns the integer value of the element at index C. 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 @@ Sets the integer value of the element at index C to C. 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 @@ Resizes the array to C elements. 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; diff --git a/classes/resizablepmcarray.pmc b/classes/resizablepmcarray.pmc index 50a9df0f76..36f1bce563 100644 --- a/classes/resizablepmcarray.pmc +++ b/classes/resizablepmcarray.pmc @@ -66,7 +66,7 @@ Resizes the array to C elements. 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 @@ Returns the PMC value of the element at index C. 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 @@ If key is a slice, do a splice as set that item. 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 @@ If key is a slice, do a splice as set that item. Parrot_py_set_slice(INTERP, SELF, key, NULL); else internal_exception(OUT_OF_BOUNDS, - "ResizablePMCArray: unimplemented delete!\n"); + "ResizablePMCArray: unimplemented delete!"); } /* diff --git a/classes/resizablestringarray.pmc b/classes/resizablestringarray.pmc index 3ce9d04a64..47a908506a 100644 --- a/classes/resizablestringarray.pmc +++ b/classes/resizablestringarray.pmc @@ -43,7 +43,7 @@ Returns the Parrot string value of the element at index C. 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 @@ Sets the Parrot string value of the element at index C to C. 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 @@ Resizes the array to C elements. 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; diff --git a/classes/sarray.pmc b/classes/sarray.pmc index 85efc30231..0d59827b05 100644 --- a/classes/sarray.pmc +++ b/classes/sarray.pmc @@ -68,7 +68,7 @@ ret_int(Parrot_Interp interpreter, HashEntry *e) 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 @@ ret_num(Parrot_Interp interpreter, HashEntry *e) 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 @@ ret_string(Parrot_Interp interpreter, HashEntry *e) 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 @@ ret_pmc(Parrot_Interp interpreter, HashEntry *e) 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 @@ shift_entry(PMC *self) 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 @@ get_entry(PMC *self, INTVAL key) } 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 @@ Resizes the array to C elements. 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 @@ Sets the integer value of the element at index C to C. 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 @@ Adds an element with integer value C to the end of the array. 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 @@ C. 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 @@ Adds an element with floating-point value C to the end of the array. 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 @@ Sets the Parrot string value of the element at index C to C. 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 @@ array. 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 @@ Sets the PMC value of the element at index C to C<*src>. 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 @@ Adds an element with PMC value C<*value> to the end of the array. 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); diff --git a/classes/unmanagedstruct.pmc b/classes/unmanagedstruct.pmc index 0fef99663d..2f18d2f5de 100644 --- a/classes/unmanagedstruct.pmc +++ b/classes/unmanagedstruct.pmc @@ -362,7 +362,7 @@ ret_pmc(Parrot_Interp interpreter, PMC* pmc, char *p, int type, INTVAL idx) else { internal_exception(1, - "no initializer available for nested struct\n"); + "no initializer available for nested struct"); } /* assign the pointer */ diff --git a/dynclasses/match.pmc b/dynclasses/match.pmc index b47ce4eaa9..55d4d8decc 100644 --- a/dynclasses/match.pmc +++ b/dynclasses/match.pmc @@ -33,7 +33,7 @@ static STRING* make_hash_key(Interp* interpreter, PMC * key) { 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); diff --git a/dynclasses/matchrange.pmc b/dynclasses/matchrange.pmc index b558fdd06b..0547dc3f1b 100644 --- a/dynclasses/matchrange.pmc +++ b/dynclasses/matchrange.pmc @@ -63,7 +63,7 @@ matchrange_locate_keyed_int(Parrot_Interp interp, PMC* self, STRING *key) 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; } diff --git a/dynclasses/pylist.pmc b/dynclasses/pylist.pmc index d5be0adc25..42abbe96d4 100644 --- a/dynclasses/pylist.pmc +++ b/dynclasses/pylist.pmc @@ -115,7 +115,7 @@ Delete a (range of) elements from the list } else internal_exception(OUT_OF_BOUNDS, - "PyList: unimplemented delete!\n"); + "PyList: unimplemented delete!"); } /* diff --git a/dynclasses/pyobject.pmc b/dynclasses/pyobject.pmc index a5947a04ef..6f3843b2d1 100644 --- a/dynclasses/pyobject.pmc +++ b/dynclasses/pyobject.pmc @@ -755,7 +755,7 @@ according to the type of C<*value>. } 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))); } diff --git a/dynclasses/pytuple.pmc b/dynclasses/pytuple.pmc index 6fc53b3d29..2cdc059c20 100644 --- a/dynclasses/pytuple.pmc +++ b/dynclasses/pytuple.pmc @@ -172,7 +172,7 @@ Returns the PMC value of the element at index C. 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]; @@ -242,7 +242,7 @@ Resizes the array to C elements. 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; @@ -283,7 +283,7 @@ Sets the PMC value of the element at index C to C<*src>. 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); diff --git a/dynclasses/tclarray.pmc b/dynclasses/tclarray.pmc index ade2a4e9c1..a550a1f2c8 100644 --- a/dynclasses/tclarray.pmc +++ b/dynclasses/tclarray.pmc @@ -38,7 +38,7 @@ static STRING* make_hash_key(Interp* interpreter, PMC * key) { 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 @@ Returns the next key relative to the location specified in C. /* 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; diff --git a/dynclasses/tclfloat.pmc b/dynclasses/tclfloat.pmc index 5d9e79236f..3788fdd4b9 100644 --- a/dynclasses/tclfloat.pmc +++ b/dynclasses/tclfloat.pmc @@ -246,12 +246,12 @@ pmclass TclFloat extends TclObject dynpmc group tcl_group { /* 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 () { diff --git a/dynclasses/tclint.pmc b/dynclasses/tclint.pmc index c42d5af0f4..f229914cc5 100644 --- a/dynclasses/tclint.pmc +++ b/dynclasses/tclint.pmc @@ -203,7 +203,7 @@ pmclass TclInt extends TclObject dynpmc group tcl_group { 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 @@ pmclass TclInt extends TclObject dynpmc group tcl_group { /* 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'"); } diff --git a/ops/core.ops b/ops/core.ops index f5b2eca4f5..123aa16dc6 100644 --- a/ops/core.ops +++ b/ops/core.ops @@ -185,7 +185,7 @@ inline op branch_cs (in STR) :base_loop,check_event { struct PackFile_FixupEntry *fe = PackFile_find_fixup_entry(interpreter, enum_fixup_label, label); if (!fe) - internal_exception(1, "branch_cs: fixup for '%s' not found\n", label); + internal_exception(1, "branch_cs: fixup for '%s' not found", label); else { interpreter->resume_offset = fe->offset; Parrot_switch_to_cs(interpreter, fe->seg, 1); @@ -530,7 +530,7 @@ a return continuation in P1 of class $2 and return address $4. inline op newsub(out PMC, in INT, labelconst INT) { if ($2 <= 0 || $2 >= enum_class_max) { - internal_exception(1, "Illegal PMC enum (%d) in newsub\n", (int)$2); + internal_exception(1, "Illegal PMC enum (%d) in newsub", (int)$2); abort(); /* Deserve to lose */ } $1 = pmc_new_noinit(interpreter, $2); @@ -541,11 +541,11 @@ inline op newsub(out PMC, in INT, labelconst INT) { inline op newsub(in INT, in INT, labelconst INT, labelconst INT) { if ($1 <= 0 || $1 >= enum_class_max) { - internal_exception(1, "Illegal PMC enum (%d) in newsub\n", (int)$1); + internal_exception(1, "Illegal PMC enum (%d) in newsub", (int)$1); abort(); /* Deserve to lose */ } if ($2 <= 0 || $2 >= enum_class_max) { - internal_exception(1, "Illegal PMC enum (%d) in newsub\n", (int)$2); + internal_exception(1, "Illegal PMC enum (%d) in newsub", (int)$2); abort(); /* Deserve to lose */ } REG_PMC(0) = pmc_new_noinit(interpreter, $1); diff --git a/ops/dotgnu.ops b/ops/dotgnu.ops index c207219d4d..0138ce2600 100644 --- a/ops/dotgnu.ops +++ b/ops/dotgnu.ops @@ -27,7 +27,7 @@ inline op conv_i1_ovf(inout INT) :dotgnu_core { $1 = (INTVAL)((signed char)($1)); } else { - internal_exception(1, "Overflow exception for conv_i1_ovf\n"); + internal_exception(1, "Overflow exception for conv_i1_ovf"); } goto NEXT(); } @@ -42,7 +42,7 @@ inline op conv_u1_ovf(inout INT) :dotgnu_core { $1 = (INTVAL)((unsigned char)($1)); } else { - internal_exception(1, "Overflow exception for conv_u1_ovf\n"); + internal_exception(1, "Overflow exception for conv_u1_ovf"); } goto NEXT(); } @@ -58,7 +58,7 @@ inline op conv_i2_ovf(inout INT) :dotgnu_core { } else { - internal_exception(1, "Overflow exception for conv_i2_ovf\n"); + internal_exception(1, "Overflow exception for conv_i2_ovf"); } goto NEXT(); } @@ -74,7 +74,7 @@ inline op conv_u2_ovf(inout INT) :dotgnu_core { } else { - internal_exception(1, "Overflow exception for conv_u2_ovf\n"); + internal_exception(1, "Overflow exception for conv_u2_ovf"); } goto NEXT(); } diff --git a/ops/experimental.ops b/ops/experimental.ops index 7f933143a7..c7c0fbe60a 100644 --- a/ops/experimental.ops +++ b/ops/experimental.ops @@ -164,7 +164,7 @@ op die(in INT) :base_debug { op new(out PMC, in INT, in KEY) { if ($2 <= 0 || $2 >= enum_class_max) { - internal_exception(1, "Illegal PMC enum (%d) in new\n", (int)$2); + internal_exception(1, "Illegal PMC enum (%d) in new", (int)$2); } $1 = pmc_new_init(interpreter, $2, $3); goto NEXT(); diff --git a/ops/object.ops b/ops/object.ops index 135da0f3bf..de4a60476d 100644 --- a/ops/object.ops +++ b/ops/object.ops @@ -240,7 +240,7 @@ inline op subclass(out PMC, in PMC) :object_classes { op subclass(out PMC, in STR, in STR) :object_classes { PMC *class = Parrot_class_lookup(interpreter, $2); if (PMC_IS_NULL(class)) { - internal_exception(NO_CLASS, "Class '%s' doesn't exist\n", + internal_exception(NO_CLASS, "Class '%s' doesn't exist", string_to_cstring( interpreter, $3 )); } $1 = VTABLE_subclass(interpreter, class, $3); @@ -250,7 +250,7 @@ op subclass(out PMC, in STR, in STR) :object_classes { op subclass(out PMC, in STR) :object_classes { PMC *class = Parrot_class_lookup(interpreter, $2); if (PMC_IS_NULL(class)) { - internal_exception(NO_CLASS, "Class '%s' doesn't exist\n", + internal_exception(NO_CLASS, "Class '%s' doesn't exist", string_to_cstring( interpreter, $2 )); } $1 = VTABLE_subclass(interpreter, class, NULL); @@ -282,7 +282,7 @@ character, so Perl's Foo::Bar would be Foo\0Bar. inline op getclass(out PMC, in STR) :object_classes { PMC *class = Parrot_class_lookup(interpreter, $2); if (PMC_IS_NULL(class)) { - internal_exception(NO_CLASS, "Class '%s' doesn't exist\n", + internal_exception(NO_CLASS, "Class '%s' doesn't exist", string_to_cstring( interpreter, $2 )); } else diff --git a/ops/pmc.ops b/ops/pmc.ops index 2fa34ec70a..deec472ea6 100644 --- a/ops/pmc.ops +++ b/ops/pmc.ops @@ -56,7 +56,7 @@ only referended. The initializer may be NULL. op new(out PMC, in INT) { if ($2 <= 0 || $2 >= enum_class_max) { - internal_exception(1, "Illegal PMC enum (%d) in new\n", (int)$2); + internal_exception(1, "Illegal PMC enum (%d) in new", (int)$2); abort(); /* Deserve to lose */ } @@ -70,7 +70,7 @@ op new(out PMC, in INT) { op new(out PMC, in INT, in PMC) { if ($2 <= 0 || $2 >= enum_class_max) { - internal_exception(1, "Illegal PMC enum (%d) in new\n", (int)$2); + internal_exception(1, "Illegal PMC enum (%d) in new", (int)$2); } $1 = pmc_new_init(interpreter, $2, $3); goto NEXT(); @@ -78,7 +78,7 @@ op new(out PMC, in INT, in PMC) { op new(out PMC, in INT, in PMC, in PMC) { if ($2 <= 0 || $2 >= enum_class_max) { - internal_exception(1, "Illegal PMC enum (%d) in new\n", (int)$2); + internal_exception(1, "Illegal PMC enum (%d) in new", (int)$2); } $1 = pmc_new_noinit(interpreter, $2); $1->vtable->init_pmc_props(interpreter, $1, $3, $4); diff --git a/ops/stack.ops b/ops/stack.ops index e268e6ca3a..f8a3bccf78 100644 --- a/ops/stack.ops +++ b/ops/stack.ops @@ -376,7 +376,7 @@ op entrytype(out INT, in INT) :base_core { entry = stack_entry(interpreter, interpreter->ctx.user_stack, $2); if (!entry) { - internal_exception(99, "Stack Depth wrong\n"); + internal_exception(99, "Stack Depth wrong"); } $1 = get_entry_type(interpreter, entry); goto NEXT(); @@ -416,9 +416,9 @@ op lookback(out INT, in INT) :base_core { Stack_Entry_t *entry = stack_entry(interpreter, interpreter->ctx.user_stack, $2); if (!entry) - internal_exception(99, "Stack depth wrong\n"); + internal_exception(99, "Stack depth wrong"); if (entry->entry_type != STACK_ENTRY_INT) { - internal_exception(ERROR_BAD_STACK_TYPE, "Wrong type on stack!\n"); + internal_exception(ERROR_BAD_STACK_TYPE, "Wrong type on stack!"); } $1 = UVal_int(entry->entry); @@ -429,9 +429,9 @@ op lookback(out STR, in INT) :base_core { Stack_Entry_t *entry = stack_entry(interpreter, interpreter->ctx.user_stack, $2); if (!entry) - internal_exception(99, "Stack depth wrong\n"); + internal_exception(99, "Stack depth wrong"); if (entry->entry_type != STACK_ENTRY_STRING) { - internal_exception(ERROR_BAD_STACK_TYPE, "Wrong type on stack!\n"); + internal_exception(ERROR_BAD_STACK_TYPE, "Wrong type on stack!"); } $1 = UVal_str(entry->entry); @@ -442,9 +442,9 @@ op lookback(out NUM, in INT) :base_core { Stack_Entry_t *entry = stack_entry(interpreter, interpreter->ctx.user_stack, $2); if (!entry) - internal_exception(99, "Stack depth wrong\n"); + internal_exception(99, "Stack depth wrong"); if (entry->entry_type != STACK_ENTRY_FLOAT) { - internal_exception(ERROR_BAD_STACK_TYPE, "Wrong type on stack!\n"); + internal_exception(ERROR_BAD_STACK_TYPE, "Wrong type on stack!"); } $1 = UVal_num(entry->entry); @@ -455,9 +455,9 @@ op lookback(out PMC, in INT) :base_core { Stack_Entry_t *entry = stack_entry(interpreter, interpreter->ctx.user_stack, $2); if (!entry) - internal_exception(99, "Stack depth wrong\n"); + internal_exception(99, "Stack depth wrong"); if (entry->entry_type != STACK_ENTRY_PMC) { - internal_exception(ERROR_BAD_STACK_TYPE, "Wrong type on stack!\n"); + internal_exception(ERROR_BAD_STACK_TYPE, "Wrong type on stack!"); } $1 = UVal_pmc(entry->entry); diff --git a/ops/string.ops b/ops/string.ops index fe2d5068ec..0d422f1cc4 100644 --- a/ops/string.ops +++ b/ops/string.ops @@ -133,7 +133,7 @@ Repeats string $2 $3 times and stores result in $1. inline op repeat(out STR, in STR, in INT) :base_mem { if ($3 < 0) { - internal_exception(NEG_REPEAT, "Cannot repeat with negative arg\n"); + internal_exception(NEG_REPEAT, "Cannot repeat with negative arg"); } $1 = string_repeat(interpreter, $2, (UINTVAL)$3, NULL); goto NEXT(); diff --git a/src/exceptions.c b/src/exceptions.c index 3debc4b313..75dd247305 100644 --- a/src/exceptions.c +++ b/src/exceptions.c @@ -52,6 +52,7 @@ internal_exception(int exitcode, const char *format, ...) va_list arglist; va_start(arglist, format); vfprintf(stderr, format, arglist); + fprintf(stderr, "\n"); va_end(arglist); Parrot_exit(exitcode); } diff --git a/src/rxstacks.c b/src/rxstacks.c index e923b195a5..3a34cb8f2d 100644 --- a/src/rxstacks.c +++ b/src/rxstacks.c @@ -141,7 +141,7 @@ intstack_pop(Interp *interpreter, IntStack stack) /* Quick sanity check */ if (chunk->used == 0) { - internal_exception(ERROR_STACK_EMPTY, "No entries on stack!\n"); + internal_exception(ERROR_STACK_EMPTY, "No entries on stack!"); } entry = &chunk->entry[chunk->used - 1]; diff --git a/src/stacks.c b/src/stacks.c index 592b391572..ab53db7e7f 100644 --- a/src/stacks.c +++ b/src/stacks.c @@ -201,7 +201,7 @@ rotate_entries(Interp *interpreter, Stack_Chunk_t **stack_p, Intval num_entries) depth = num_entries - 1; if (stack_height(interpreter, stack) < (size_t)num_entries) { - internal_exception(ERROR_STACK_SHALLOW, "Stack too shallow!\n"); + internal_exception(ERROR_STACK_SHALLOW, "Stack too shallow!"); } temp = *stack_entry(interpreter, stack, depth); @@ -215,7 +215,7 @@ rotate_entries(Interp *interpreter, Stack_Chunk_t **stack_p, Intval num_entries) else { if (stack_height(interpreter, stack) < (size_t)num_entries) { - internal_exception(ERROR_STACK_SHALLOW, "Stack too shallow!\n"); + internal_exception(ERROR_STACK_SHALLOW, "Stack too shallow!"); } temp = *stack_entry(interpreter, stack, 0); for (i = 0; i < depth; i++) { @@ -278,7 +278,7 @@ stack_push(Interp *interpreter, Stack_Chunk_t **stack_p, break; default: internal_exception(ERROR_BAD_STACK_TYPE, - "Invalid Stack_Entry_type!\n"); + "Invalid Stack_Entry_type!"); break; } } diff --git a/t/op/conv.t b/t/op/conv.t index 75a190483b..1249c3e518 100644 --- a/t/op/conv.t +++ b/t/op/conv.t @@ -148,7 +148,6 @@ output_is(<<'CODE', <strlen"); @@ -372,7 +376,7 @@ xyz OUTPUT -output_is( <<'CODE', 'Can only replace inside string or index after end of string', "5 arg substr, offset past end of string" ); +output_is( <<'CODE', <<'OUTPUT', "5 arg substr, offset past end of string" ); set S0, "abcdefghijk" set S1, "xyz" substr S2, S0, 12, 3, S1 @@ -384,6 +388,8 @@ output_is( <<'CODE', 'Can only replace inside string or index after end of strin print "\n" end CODE +Can only replace inside string or index after end of string +OUTPUT output_is( <<'CODE', <<'OUTPUT', "5 arg substr, -ve offset, repl=length" ); set S0, "abcdefghijk" @@ -436,7 +442,7 @@ xyz fghi OUTPUT -output_is( <<'CODE', 'Can only replace inside string or index after end of string', "5 arg substr, -ve offset out of string" ); +output_is( <<'CODE', <<'OUTPUT', "5 arg substr, -ve offset out of string" ); set S0, "abcdefghijk" set S1, "xyz" substr S2, S0, -12, 4, S1 @@ -448,6 +454,8 @@ output_is( <<'CODE', 'Can only replace inside string or index after end of strin print "\n" end CODE +Can only replace inside string or index after end of string +OUTPUT output_is( <<'CODE', <<'OUTPUT', "5 arg substr, length > strlen " ); set S0, "abcdefghijk" @@ -891,29 +899,37 @@ CODE foo OUTPUT -output_is(<<'CODE','Cannot get character of empty string','2-param ord, empty string'); +output_is(<<'CODE', <<'OUTPUT','2-param ord, empty string'); ord I0,"" print I0 end CODE +Cannot get character of empty string +OUTPUT -output_is(<<'CODE','Cannot get character of empty string','2-param ord, empty string register'); +output_is(<<'CODE', <<'OUTPUT','2-param ord, empty string register'); ord I0,S0 print I0 end CODE +Cannot get character of empty string +OUTPUT -output_is(<<'CODE','Cannot get character of empty string','3-param ord, empty string'); +output_is(<<'CODE', <<'OUTPUT','3-param ord, empty string'); ord I0,"",0 print I0 end CODE +Cannot get character of empty string +OUTPUT -output_is(<<'CODE','Cannot get character of empty string','3-param ord, empty string register'); +output_is(<<'CODE', <<'OUTPUT','3-param ord, empty string register'); ord I0,S0,0 print I0 end CODE +Cannot get character of empty string +OUTPUT output_is(<<'CODE',ord('a'),'2-param ord, one-character string'); ord I0,"a" @@ -960,18 +976,22 @@ output_is(<<'CODE',ord('b'),'3-param ord, multi-character string register'); end CODE -output_is(<<'CODE', 'Cannot get character past end of string','3-param ord, multi-character string'); +output_is(<<'CODE', <<'OUTPUT','3-param ord, multi-character string'); ord I0,"ab",2 print I0 end CODE +Cannot get character past end of string +OUTPUT -output_is(<<'CODE', 'Cannot get character past end of string','3-param ord, multi-character string'); +output_is(<<'CODE', <<'OUTPUT','3-param ord, multi-character string'); set S0,"ab" ord I0,S0,2 print I0 end CODE +Cannot get character past end of string +OUTPUT output_is(<<'CODE',ord('a'),'3-param ord, one-character string, from end'); ord I0,"a",-1 @@ -999,12 +1019,14 @@ output_is(<<'CODE',ord('b'),'3-param ord, multi-character string register, from end CODE -output_is(<<'CODE','Cannot get character before beginning of string','3-param ord, multi-character string register, from end, OOB'); +output_is(<<'CODE',<<'OUTPUT','3-param ord, multi-character string register, from end, OOB'); set S0,"ab" ord I0,S0,-3 print I0 end CODE +Cannot get character before beginning of string +OUTPUT output_is(<<'CODE',chr(32),'chr of 32 is space in ASCII'); chr S0, 32 diff --git a/t/src/basic.t b/t/src/basic.t index 46a93029e5..d0f0c362f8 100644 --- a/t/src/basic.t +++ b/t/src/basic.t @@ -34,7 +34,7 @@ c_output_is(<<'CODE', <<'OUTPUT', "direct internal_exception call"); #include int main(int argc, char* argv[]) { - internal_exception(0, "Blow'd Up(tm)\n"); /* ' */ + internal_exception(0, "Blow'd Up(tm)"); /* ' */ } CODE Blow'd Up(tm)