Browse files

[PDD07]: ws cleanup in src/, src/dynpmc/, and src/pmc/

git-svn-id: https://svn.parrot.org/parrot/trunk@15022 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent f0e1044 commit bf41b66b28784f106f819b24560d4d826471f8c0 @particle particle committed Oct 25, 2006
Showing with 1,096 additions and 1,096 deletions.
  1. +52 −52 src/bignum.c
  2. +7 −7 src/builtin.c
  3. +1 −1 src/byteorder.c
  4. +9 −9 src/debug.c
  5. +1 −1 src/dynpmc/gdbmhash.pmc
  6. +1 −1 src/dynpmc/perlenv.pmc
  7. +2 −2 src/dynpmc/perlhash.pmc
  8. +3 −3 src/dynpmc/perlint.pmc
  9. +3 −3 src/dynpmc/perlnum.pmc
  10. +1 −1 src/dynpmc/perlscalar.pmc
  11. +5 −5 src/dynpmc/perlstring.pmc
  12. +6 −6 src/dynpmc/perlundef.pmc
  13. +4 −4 src/dynpmc/quantumreg.pmc
  14. +3 −3 src/embed.c
  15. +1 −1 src/encoding.c
  16. +11 −11 src/events.c
  17. +1 −1 src/exceptions.c
  18. +5 −5 src/exec.c
  19. +6 −6 src/exec_save.c
  20. +1 −1 src/exec_start.c
  21. +1 −1 src/exit.c
  22. +13 −13 src/extend.c
  23. +4 −4 src/gc_gms.c
  24. +18 −18 src/global.c
  25. +4 −4 src/global_setup.c
  26. +1 −1 src/hash.c
  27. +7 −7 src/headers.c
  28. +10 −10 src/hll.c
  29. +54 −54 src/inter_call.c
  30. +11 −11 src/inter_cb.c
  31. +3 −3 src/inter_create.c
  32. +12 −12 src/inter_misc.c
  33. +4 −4 src/interpreter.c
  34. +23 −23 src/jit.c
  35. +13 −13 src/library.c
  36. +3 −3 src/list.c
  37. +7 −7 src/longopt.c
  38. +2 −2 src/malloc-trace.c
  39. +351 −351 src/malloc.c
  40. +4 −4 src/memory.c
  41. +18 −18 src/mmd.c
  42. +1 −1 src/nci_test.c
  43. +33 −33 src/objects.c
  44. +35 −35 src/packfile.c
  45. +3 −3 src/packout.c
  46. +2 −2 src/parrot.c
  47. +2 −2 src/pbc_merge.c
  48. +3 −3 src/pdb.c
  49. +13 −13 src/pic.c
  50. +14 −14 src/pic_jit.c
  51. +4 −4 src/pmc.c
  52. +1 −1 src/pmc/array.pmc
  53. +19 −19 src/pmc/bigint.pmc
  54. +4 −4 src/pmc/closure.pmc
  55. +2 −2 src/pmc/complex.pmc
  56. +3 −3 src/pmc/coroutine.pmc
  57. +8 −8 src/pmc/default.pmc
  58. +3 −3 src/pmc/env.pmc
  59. +1 −1 src/pmc/exception.pmc
  60. +1 −1 src/pmc/file.pmc
  61. +4 −4 src/pmc/fixedbooleanarray.pmc
  62. +2 −2 src/pmc/fixedintegerarray.pmc
  63. +8 −8 src/pmc/fixedpmcarray.pmc
  64. +1 −1 src/pmc/float.pmc
  65. +10 −10 src/pmc/hash.pmc
  66. +1 −1 src/pmc/integer.pmc
  67. +1 −1 src/pmc/intlist.pmc
  68. +11 −11 src/pmc/namespace.pmc
  69. +1 −1 src/pmc/nci.pmc
  70. +3 −3 src/pmc/orderedhash.pmc
  71. +2 −2 src/pmc/os.pmc
  72. +1 −1 src/pmc/parrotclass.pmc
  73. +4 −4 src/pmc/parrotinterpreter.pmc
  74. +7 −7 src/pmc/parrotio.pmc
  75. +4 −4 src/pmc/parrotobject.pmc
  76. +2 −2 src/pmc/parrotrunningthread.pmc
  77. +4 −4 src/pmc/parrotthread.pmc
  78. +6 −6 src/pmc/resizablebooleanarray.pmc
  79. +3 −3 src/pmc/resizablefloatarray.pmc
  80. +1 −1 src/pmc/resizablepmcarray.pmc
  81. +3 −3 src/pmc/resizablestringarray.pmc
  82. +1 −1 src/pmc/sarray.pmc
  83. +1 −1 src/pmc/scalar.pmc
  84. +1 −1 src/pmc/slice.pmc
  85. +2 −2 src/pmc/stmref.pmc
  86. +2 −2 src/pmc/stmvar.pmc
  87. +6 −6 src/pmc/string.pmc
  88. +7 −7 src/pmc/sub.pmc
  89. +1 −1 src/pmc/undef.pmc
  90. +1 −1 src/pmc/unmanagedstruct.pmc
  91. +1 −1 src/pmc_freeze.c
  92. +3 −3 src/register.c
  93. +1 −1 src/res_lea.c
  94. +24 −24 src/resources.c
  95. +2 −2 src/runops_cores.c
  96. +5 −5 src/smallobject.c
  97. +9 −9 src/spf_render.c
  98. +3 −3 src/stack_common.c
  99. +2 −2 src/stacks.c
  100. +5 −5 src/string.c
  101. +14 −14 src/string_primitives.c
  102. +5 −5 src/sub.c
  103. +39 −39 src/thread.c
  104. +7 −7 src/trace.c
  105. +2 −2 src/tsq.c
  106. +31 −31 src/utils.c
  107. +3 −3 src/vtables.c
  108. +1 −1 src/warnings.c
View
104 src/bignum.c
@@ -69,7 +69,7 @@ Get value of digit at C<pos>.
#define BN_setd(x, y, z) \
( x->buffer[(y) / BN_D_PER_NIB] = \
((z) << ( (y) % BN_D_PER_NIB)*4) | \
- (x->buffer[(y) / BN_D_PER_NIB] & ~(15<< ( (y) % BN_D_PER_NIB)*4)))
+ (x->buffer[(y) / BN_D_PER_NIB] & ~(15<< ( (y) % BN_D_PER_NIB)*4)))
#define BN_getd(x,y) \
( (x->buffer[(y) / BN_D_PER_NIB] >> \
( (y) % BN_D_PER_NIB)*4) & 15 )
@@ -86,7 +86,7 @@ decided by C<elimit>), returns true.
*/
#define CHECK_OVERFLOW(bn, incr, context) \
- ( (context)->elimit - ((bn)->expn + (bn)->digits -1 ) < (incr) ? 1 : 0)
+ ( (context)->elimit - ((bn)->expn + (bn)->digits -1 ) < (incr) ? 1 : 0)
/*
@@ -189,20 +189,20 @@ int BN_strip_tail_zeros(PINTD_ BIGNUM* victim, BN_CONTEXT*);
int BN_round_up(PINTD_ BIGNUM *victim, BN_CONTEXT* context);
int BN_round_down(PINTD_ BIGNUM *victim, BN_CONTEXT* context);
int BN_make_integer(PINTD_ BIGNUM* bn, BN_CONTEXT* context);
-int BN_arith_setup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
+int BN_arith_setup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_CONTEXT *context, BN_SAVE_PREC* restore);
-int BN_arith_cleanup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
+int BN_arith_cleanup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_CONTEXT *context, BN_SAVE_PREC* restore);
-int BN_iadd(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
+int BN_iadd(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_CONTEXT *context);
-int BN_isubtract(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
+int BN_isubtract(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_CONTEXT *context);
int BN_align(PINTD_ BIGNUM* one, BIGNUM* two);
-INTVAL BN_nonfatal(PINTD_ BN_CONTEXT *context, BN_EXCEPTIONS except,
+INTVAL BN_nonfatal(PINTD_ BN_CONTEXT *context, BN_EXCEPTIONS except,
char *msg);
int BN_set_verybig(PINTD_ BIGNUM* bn, BN_CONTEXT *context);
-/*
+/*
=back
@@ -612,7 +612,7 @@ BN_nonfatal(PINTD_ BN_CONTEXT *context, BN_EXCEPTIONS except, char *msg) {
if (context->traps & (BN_F_DIVISION_BY_ZERO) ) {
BN_EXCEPT(PINT_ except, msg);
}
- break;
+ break;
case BN_DIVISION_IMPOSSIBLE:
/* integer result of div-int or rem > precision */
context->flags |= BN_F_INVALID_OPERATION;
@@ -687,7 +687,7 @@ BN_nonfatal(PINTD_ BN_CONTEXT *context, BN_EXCEPTIONS except, char *msg) {
default:
BN_EXCEPT(PINT_ BN_INVALID_OPERATION, "An unknown error occurred");
}
-
+
}
/*
@@ -808,14 +808,14 @@ BN_to_scieng_string(PINTD_ BIGNUM* bn, char **dest, int eng) {
}
else { /* Use exponential notation, different for sci and eng */
if (bn->sign) *cur++ = '-'; /* We don't prefix '+' */
-
+
if (eng) {
int deficit;
if (adj_exp < 0) {
deficit = (-adj_exp) % 3;
if (deficit == 1) {
deficit = 2;
- adj_exp -= 2;
+ adj_exp -= 2;
}
else if (deficit == 2) {
deficit = 1;
@@ -839,7 +839,7 @@ BN_to_scieng_string(PINTD_ BIGNUM* bn, char **dest, int eng) {
else if (bn->digits == 2) {
*cur++ = '0' + BN_getd(bn,bn->digits-2);
if (deficit == 1) *cur++ = '.';
- *cur++ = '0';
+ *cur++ = '0';
}
else {
*cur++ = '0' + BN_getd(bn,bn->digits-2);
@@ -868,7 +868,7 @@ BN_to_scieng_string(PINTD_ BIGNUM* bn, char **dest, int eng) {
}
}
*cur++ = 'E'; /* Eza Good, Eza Good */
- sprintf(cur, "%+i", adj_exp);
+ sprintf(cur, "%+i", adj_exp);
}
}
@@ -878,7 +878,7 @@ BN_to_scieng_string(PINTD_ BIGNUM* bn, char **dest, int eng) {
/*
=item C<BIGNUM*
-BN_from_string(PINTD_ char* s2, BN_CONTEXT *context)>
+BN_from_string(PINTD_ char* s2, BN_CONTEXT *context)>
Convert a scientific string to a BIGNUM. This function deals entirely
with common-or-garden C byte strings, so the library can work
@@ -910,15 +910,15 @@ BN_from_string(PINTD_ char* s2, BN_CONTEXT *context) {
int in_number = 0; /* are we reading coeff digits */
INTVAL exponent = 0; /* the exponent */
INTVAL fake_exponent = 0; /* adjustment for digits after a '.' */
- INTVAL i = 0;
+ INTVAL i = 0;
int non_zero_digits = 0; /* have we seen *any* digits */
int seen_plus = 0; /* was number prefixed with '+' */
int infinity =0;
int qNAN = 0;
int sNAN = 0;
temp = BN_new(PINT_ 1); /* We store coeff reversed in temp */
-
+
while (*s2) { /* charge through the string */
if (isdigit(*s2) && !in_exp) {
/* We're somewhere in the main string of numbers */
@@ -1000,7 +1000,7 @@ BN_from_string(PINTD_ char* s2, BN_CONTEXT *context) {
else {
qNAN = 1;
break;
- }
+ }
}
qNAN = 1;
break;
@@ -1048,13 +1048,13 @@ BN_from_string(PINTD_ char* s2, BN_CONTEXT *context) {
}
s2++; /* rinse, lather... */
}
-
+
if (!(qNAN || sNAN || infinity)) {
if (in_number && !pos) { /* Only got zeros */
pos = 1;
BN_setd(temp, 0, 0);
}
-
+
if (pos==0) { /* This includes ".e+20" */
if (!context->extended) {
BN_EXCEPT(PINT_ BN_CONVERSION_SYNTAX, "no digits in string");
@@ -1070,11 +1070,11 @@ BN_from_string(PINTD_ char* s2, BN_CONTEXT *context) {
/* copy reversed string of digits backwards into result */
if (!(qNAN || sNAN || infinity)) { /* Normal */
temp->digits = pos;
-
+
for (i=0; i< temp->digits; i++) {
BN_setd(result, i, BN_getd(temp, temp->digits-i-1));
}
-
+
result->sign = negative;
result->digits = pos;
if (exp_sign == -1) {
@@ -1118,7 +1118,7 @@ Removes any zeros before the msd and after the lsd.
int
BN_strip_lead_zeros(PINTD_ BIGNUM* bn, BN_CONTEXT *context) {
INTVAL msd, i;
-
+
if (bn->digits == 0) return 0; /* Cannot "fail" with special nums */
msd = bn->digits-1;
@@ -1152,15 +1152,15 @@ BN_strip_tail_zeros(PINTD_ BIGNUM *bn, BN_CONTEXT *context) {
lsd++;
}
if (bn->expn >= 0) {
- lsd = 0; /* units column */
+ lsd = 0; /* units column */
}
else if (bn->expn + lsd > 0) {
lsd = -bn->expn;
}
for (i=0; i< bn->digits -lsd; i++) {
BN_setd(bn, i, BN_getd(bn, i+lsd));
}
-
+
if (CHECK_OVERFLOW( bn, lsd, context)) {
BN_EXCEPT(PINT_ BN_OVERFLOW, "overflow when striping zeros");
}
@@ -1219,7 +1219,7 @@ BN_really_zero(PINTD_ BIGNUM* bn, int allow_neg_zero) {
if (bn->digits == 0) return;
for (i=0; i< bn->digits; i++)
if (BN_getd(bn, i) != 0) return;
-
+
bn->digits = 1;
bn->expn = 0;
if (!allow_neg_zero) bn->sign = 0;
@@ -1516,7 +1516,7 @@ BN_round_as_integer(PINTD_ BIGNUM *bn, BN_CONTEXT *context) {
=back
-=head2 Arithmetic operations
+=head2 Arithmetic operations
Operations are performed like this:
@@ -1647,7 +1647,7 @@ BN_arith_cleanup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
/*
=item C<int
-BN_align(PINTD_ BIGNUM* one, BIGNUM* two)>
+BN_align(PINTD_ BIGNUM* one, BIGNUM* two)>
Adds zero digits so that decimal points of each number are at the same
place.
@@ -1662,7 +1662,7 @@ BN_align(PINTD_ BIGNUM* one, BIGNUM* two) {
INTVAL diff;
diff = one->expn - two->expn;
-
+
if (diff == 0) {
/* The numbers have the same exponent, we merely need to extend
the one with a shorter coeff length with zeros */
@@ -1705,7 +1705,7 @@ BN_align(PINTD_ BIGNUM* one, BIGNUM* two) {
/* Add zeros to start of two */
for (i=two->digits; i<final; i++)
BN_setd(two, i, 0);
-
+
/* Add zeros to start of one */
for (i=one->digits + diff; i< final; i++)
BN_setd(one, i, 0);
@@ -1717,7 +1717,7 @@ BN_align(PINTD_ BIGNUM* one, BIGNUM* two) {
/* Set end of one to zeros */
for (i=0; i< diff; i++)
BN_setd(one, i, 0);
-
+
one->digits = two->digits = final;
one->expn = two->expn;
}
@@ -2131,7 +2131,7 @@ BN_isubtract (PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
/*
=item C<void
-BN_plus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context)>
+BN_plus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context)>
Perform unary C<+> on C<*one>. Does all the rounding and what have you.
@@ -2165,7 +2165,7 @@ BN_plus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context) {
/*
=item C<void
-BN_minus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context)>
+BN_minus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context)>
Perform unary C<-> (minus) on C<*one>. Does all the rounding and what
have you.
@@ -2247,11 +2247,11 @@ BN_compare (PINT_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
}
else {
BN_arith_setup(PINT_ result, one, two, context, NULL);
- cmp = BN_comp(PINT_ one, two, context);
+ cmp = BN_comp(PINT_ one, two, context);
}
result->digits = 1;
result->expn = 0;
-
+
if (cmp == 0) {
BN_setd(result, 0, 0);
result->sign = 0;
@@ -2269,17 +2269,17 @@ BN_compare (PINT_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
/*
-=item C<void
+=item C<void
BN_multiply (PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
- BN_CONTEXT *context)>
+ BN_CONTEXT *context)>
Multiplies C<*one> and C<*two>, storing the result in C<*result>.
=cut
*/
-void
+void
BN_multiply (PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_CONTEXT *context)
{
@@ -2371,7 +2371,7 @@ BN_imultiply (PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
else {
result->digits = one->digits + two->digits - 1;
}
-
+
i = one->expn + two->expn;
/*XXX: use unsigned here to be sure? */
if ( i > context->elimit) {
@@ -2381,7 +2381,7 @@ BN_imultiply (PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_EXCEPT(PINT_ BN_UNDERFLOW, "underflow in multiplication");
}
result->expn = i;
-
+
result->sign = 1 & (one->sign ^ two->sign);
return;
}
@@ -2527,7 +2527,7 @@ BN_divide(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_nonfatal(PINT_ context, BN_ROUNDED,
"Rounded in divide");
BN_really_zero(PINT_ rem, context->extended);
-
+
if (result->sign) {
if (BN_getd(result, 0) != 0 ||
!BN_is_zero(PINT_ result, context)) {
@@ -2556,7 +2556,7 @@ BN_divide(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_nonfatal(PINT_ context, BN_ROUNDED,
"Rounded in divide");
BN_really_zero(PINT_ rem, context->extended);
-
+
if (!result->sign) {
if (BN_getd(result, 0) != 0 ||
!BN_is_zero(PINT_ result, context)) {
@@ -2596,7 +2596,7 @@ BN_divide(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_nonfatal(PINT_ context, BN_INEXACT,
"Loss of precision in divide");
}
-
+
context->traps = save_lost;
context->flags = (context->flags & ~(unsigned char)BN_F_LOST_DIGITS)
| (flags_save & BN_F_LOST_DIGITS);
@@ -2624,7 +2624,7 @@ BN_divide(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
}
result->expn += i;
}
-
+
BN_destroy(PINT_ rem);
}
@@ -2700,11 +2700,11 @@ BN_divide_integer (PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
result->sign = 1 & (one->sign ^ two->sign);
return;
}
-
+
rem = BN_new(PINT_ 1);
BN_arith_setup(PINT_ result, one, two, context, NULL);
BN_idivide(PINT_ result, one, two, context, BN_DIV_DIVINT, rem);
-
+
BN_really_zero(PINT_ rem, context->extended);
if (result->expn >0 && context->precision > 0 &&
result->expn + result->digits > context->precision &&
@@ -2819,7 +2819,7 @@ BN_remainder (PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_arith_cleanup(PINT_ result, one, two, context, NULL);
}
-/*
+/*
=item C<BN_idivide(PINT_ BIGNUM *result, BIGNUM *one, BIGNUM *two,
BN_CONTEXT *context, BN_DIV_ENUM operation, BIGNUM *rem)>
@@ -2860,7 +2860,7 @@ BN_idivide (PINT_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
BN_EXCEPT(PINT_ BN_UNDERFLOW, "underflow in divide (1)");
}
t1->expn = newexpn;
-
+
value = 0;
for (;;) {
if (!(t2->digits % 10)) BN_grow(PINT_ t2, t2->digits+11);
@@ -2945,7 +2945,7 @@ BN_idivide (PINT_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
return; /* phew! */
}
-/*
+/*
=item C<INTVAL
BN_comp (PINTD_ BIGNUM *one, BIGNUM *two, BN_CONTEXT* context)>
@@ -3025,7 +3025,7 @@ BN_power(PINTD_ BIGNUM* result, BIGNUM* bignum,
=item C<void
BN_rescale(PINTD_ BIGNUM* result, BIGNUM* one, BIGNUM* two,
BN_CONTEXT* context)>
-
+
Rescales C<*one> to have an exponent of C<*two>.
=cut
@@ -3096,13 +3096,13 @@ BN_to_int(PINT_ BIGNUM* bn, BN_CONTEXT* context) {
result = result * 10 + BN_getd(bn, i);
}
for (i=0; i<bn->expn; i++) result = result * 10;
- }
+ }
else {
for (i=bn->digits-1; i>-1-bn->expn; i--) {
result = result * 10 + BN_getd(bn, i);
}
}
-
+
return bn->sign ? -result : result;
}
View
14 src/builtin.c
@@ -125,7 +125,7 @@ static int find_builtin(Interp *interpreter, const char *func)
__attribute__nonnull__(2);
static int find_builtin_s(Interp *interpreter, STRING *func)
__attribute__nonnull__(2);
-static int check_builtin_sig(Interp *interpreter, size_t i,
+static int check_builtin_sig(Interp *interpreter, size_t i,
const char *sig, int pass)
__attribute__nonnull__(3);
@@ -134,13 +134,13 @@ find_builtin(Interp *interpreter, const char *func /*NN*/)
{
int low = 0;
int high = N_BUILTINS - 1;
-
+
/* binary search */
while (low <= high)
{
int i = (low + high) / 2;
int cmp = strcmp(func, builtins[i].c_name);
-
+
if (!cmp)
{
/* we have to loop here because there is currently more than one
@@ -163,13 +163,13 @@ find_builtin_s(Interp *interpreter, STRING *func /*NN*/)
{
int low = 0;
int high = N_BUILTINS - 1;
-
+
/* binary search */
while (low <= high)
{
int i = (low + high) / 2;
int cmp = string_compare(interpreter, func, builtins[i].meth_name);
-
+
if (!cmp)
return i;
else if (cmp > 0)
@@ -181,7 +181,7 @@ find_builtin_s(Interp *interpreter, STRING *func /*NN*/)
}
static int
-check_builtin_sig(Interp *interpreter, size_t i,
+check_builtin_sig(Interp *interpreter, size_t i,
const char *sig /*NN*/, int pass)
{
const Builtins * const b = builtins + i;
@@ -227,7 +227,7 @@ Parrot_is_builtin(Interp *interpreter, const char *func, const char *sig)
for (pass = 0; pass <= 1; ++pass) {
i = bi;
again:
- if (check_builtin_sig(interpreter, i, sig, pass))
+ if (check_builtin_sig(interpreter, i, sig, pass))
return i;
if (i < N_BUILTINS - 1) {
/* try next with same name */
View
2 src/byteorder.c
@@ -8,7 +8,7 @@ src/byteorder.c - Byteordering functions
=head1 DESCRIPTION
-These are assigned to a vtable when the PBC file is loaded.
+These are assigned to a vtable when the PBC file is loaded.
If the vtable method for conversion from the native byteorder is called,
it is a I<no op> and will work, but the caller should know if the
View
18 src/debug.c
@@ -381,7 +381,7 @@ PDB_run_command(Interp *interpreter, const char *command)
break;
case c_p:
case c_print:
- PDB_print(interpreter, command);
+ PDB_print(interpreter, command);
break;
case c_n:
case c_next:
@@ -2043,7 +2043,7 @@ PDB_extend_const_table(Interp *interpreter)
interpreter->code->const_table->constants =
mem_sys_realloc(interpreter->code->const_table->constants,
k * sizeof(struct PackFile_Constant *));
- }
+ }
else {
interpreter->code->const_table->constants =
mem_sys_allocate(k * sizeof(struct PackFile_Constant *));
@@ -2144,7 +2144,7 @@ PDB_print_user_stack(Interp *interpreter, const char *command)
=item C<void
PDB_print(Interp *interpreter, const char *command)>
-Print interpreter registers.
+Print interpreter registers.
=cut
@@ -2154,7 +2154,7 @@ void
PDB_print(Interp *interpreter, const char *command)
{
const char *s;
-
+
s = GDB_P(interpreter->pdb->debugee, command);
PIO_eprintf(interpreter, "%s\n", s);
}
@@ -2384,7 +2384,7 @@ PDB_backtrace(Interp *interpreter)
str = Parrot_Context_infostr(interpreter, sub_cont->to_ctx);
if (!str)
break;
-
+
/* recursion detection */
if (!PMC_IS_NULL(old) && PMC_cont(old) &&
PMC_cont(old)->to_ctx->current_pc ==
@@ -2417,7 +2417,7 @@ PDB_backtrace(Interp *interpreter)
*
* GDB_P gdb> pp $I0 print register I0 value
*
- * TODO more, more
+ * TODO more, more
*/
static const char*
@@ -2458,7 +2458,7 @@ static PDB_breakpoint_t *gdb_bps;
/*
* GDB_pb gdb> pb 244 # set breakpoint at opcode 244
- *
+ *
* XXX We can't remove the breakpoint yet, executing the next ins
* most likely fails, as the length of the debug-brk stmt doesn't
* match the old opcode
@@ -2476,7 +2476,7 @@ GDB_B(Interp *interpreter, char *s) {
unsigned long offs = (unsigned long)s;
/* TODO check if in bounds */
pc = interpreter->code->base.data + offs;
-
+
if (!gdb_bps) {
nr = 0;
newbreak = mem_sys_allocate(sizeof(PDB_breakpoint_t));
@@ -2535,7 +2535,7 @@ Debug commands are mostly run inside the C<debugger>. User code
runs of course in the C<debugee>.
=back
-
+
=cut
*/
View
2 src/dynpmc/gdbmhash.pmc
@@ -79,7 +79,7 @@ loadable module is created. On Unix-like systems this is a shared library.
When it is available, the shared library has linked in the library 'gdbm'.
On WIN32 the relevant library seems to be called 'gdbm3'.
-So we do a bit of cheating here, and load it during class initialization.
+So we do a bit of cheating here, and load it during class initialization.
=cut
View
2 src/dynpmc/perlenv.pmc
@@ -69,7 +69,7 @@ Returns the result of C<get_string_keyed(key)> as a C<PerlString>.
INTVAL dynpmc_PerlString;
PMC *ret;
STRING *string;
-
+
dynpmc_PerlString = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlString", 0));
ret = pmc_new(INTERP, dynpmc_PerlString);
View
4 src/dynpmc/perlhash.pmc
@@ -36,7 +36,7 @@ pmclass PerlHash
maps Hash {
void class_init() {
- _PerlUndef = pmc_type(INTERP,
+ _PerlUndef = pmc_type(INTERP,
string_from_const_cstring(INTERP, "PerlUndef", 0));
}
@@ -46,7 +46,7 @@ pmclass PerlHash
return pmc_new(INTERP, _PerlUndef);
return result;
}
-
+
}
/*
View
6 src/dynpmc/perlint.pmc
@@ -26,7 +26,7 @@ void Parrot_perlscalar_morph(Interp* , PMC* pmc, INTVAL type);
pmclass PerlInt
extends Integer
does integer
- does scalar
+ does scalar
dynpmc
group perl_group
hll Perl
@@ -44,7 +44,7 @@ Morphs the integer to a C<PerlNum> and sets the value from C<value>.
*/
void set_number_native (FLOATVAL value) {
INTVAL dynpmc_PerlNum;
-
+
dynpmc_PerlNum = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlNum", 0));
DYNSELF.morph(dynpmc_PerlNum);
@@ -63,7 +63,7 @@ Sets the value of the integer to C<*value>.
*/
void set_string_native (STRING* value) {
INTVAL dynpmc_PerlString;
-
+
dynpmc_PerlString = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlString", 0));
DYNSELF.morph(dynpmc_PerlString);
View
6 src/dynpmc/perlnum.pmc
@@ -25,7 +25,7 @@ void Parrot_perlscalar_morph(Interp* , PMC* pmc, INTVAL type);
pmclass PerlNum
extends Float
does float
- does scalar
+ does scalar
dynpmc
group perl_group
hll Perl
@@ -69,7 +69,7 @@ Returns the number as a Parrot string.
void set_integer_native (INTVAL value) {
INTVAL dynpmc_PerlInt;
-
+
dynpmc_PerlInt = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlInt", 0));
DYNSELF.morph(dynpmc_PerlInt);
@@ -111,7 +111,7 @@ Note that this method morphs the number into a C<PerlString>.
void set_string_native (STRING * value) {
INTVAL dynpmc_PerlString;
-
+
dynpmc_PerlString = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlString", 0));
DYNSELF.morph(dynpmc_PerlString);
View
2 src/dynpmc/perlscalar.pmc
@@ -46,7 +46,7 @@ Morphs the scalar to the specified type.
return;
switch (type) {
- case enum_class_Integer:
+ case enum_class_Integer:
type = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlInt", 0));
break;
View
10 src/dynpmc/perlstring.pmc
@@ -27,7 +27,7 @@ void Parrot_perlscalar_morph(Interp* , PMC* pmc, INTVAL type);
pmclass PerlString
extends String
does string
- does scalar
+ does scalar
dynpmc
group perl_group
hll Perl
@@ -38,7 +38,7 @@ pmclass PerlString
=item C<INTVAL get_integer()>
Returns the integer representation of the string by converting to float first.
-See t/pmc/perlstring_13 set P0, "1.23e2" ; set I0, P0
+See t/pmc/perlstring_13 set P0, "1.23e2" ; set I0, P0
=cut
@@ -84,7 +84,7 @@ Morphs the string to a C<PerlInt> and sets its value to C<value>.
void set_integer_native (INTVAL value) {
INTVAL dynpmc_PerlInt;
-
+
dynpmc_PerlInt = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlInt", 0));
DYNSELF.morph(dynpmc_PerlInt);
@@ -103,7 +103,7 @@ Morphs the string to a C<PerlNum> and sets its value to C<value>.
void set_number_native (FLOATVAL value) {
INTVAL dynpmc_PerlNum;
-
+
dynpmc_PerlNum = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlNum", 0));
DYNSELF.morph(dynpmc_PerlNum);
@@ -162,7 +162,7 @@ Returns the string value for C<SELF[key]>.
STRING *s;
PMC *ret;
INTVAL dynpmc_PerlString;
-
+
s = PMC_str_val(SELF);
dynpmc_PerlString = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlString", 0));
View
12 src/dynpmc/perlundef.pmc
@@ -22,7 +22,7 @@ the Perl C<undef> value.
#include "parrot/parrot.h"
pmclass PerlUndef
- extends PerlInt
+ extends PerlInt
dynpmc
group perl_group
hll Perl
@@ -137,7 +137,7 @@ Morphs to a C<PerlInt> with value C<value>.
void set_integer_native (INTVAL value) {
INTVAL dynpmc_PerlInt;
-
+
dynpmc_PerlInt = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlInt", 0));
DYNSELF.morph(dynpmc_PerlInt);
@@ -170,7 +170,7 @@ Morphs to a C<PerlString> with the value of C<*value>.
void set_string_native (STRING* value) {
INTVAL dynpmc_PerlString;
-
+
dynpmc_PerlString = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlString", 0));
DYNSELF.morph(dynpmc_PerlString);
@@ -488,7 +488,7 @@ All these methods simply return undef itself.
PMC* logical_not (PMC* dest) {
if (!dest) {
INTVAL dynpmc_PerlInt;
-
+
dynpmc_PerlInt = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlInt", 0));
dest = pmc_new(INTERP, dynpmc_PerlInt);
@@ -526,7 +526,7 @@ Morphs to a C<PerlInt> with value C<1>.
void increment () {
INTVAL dynpmc_PerlInt;
-
+
dynpmc_PerlInt = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlInt", 0));
DYNSELF.morph(dynpmc_PerlInt);
@@ -545,7 +545,7 @@ Morphs to a C<PerlInt> with value C<-1>.
void decrement () {
INTVAL dynpmc_PerlInt;
-
+
dynpmc_PerlInt = pmc_type(interpreter,
string_from_const_cstring(interpreter, "PerlInt", 0));
DYNSELF.morph(dynpmc_PerlInt);
View
8 src/dynpmc/quantumreg.pmc
@@ -5,8 +5,8 @@
* These are the vtable functions for the QuantumReg PMC
* Data Structure and Algorithms:
* History:
- * 2005-11-13: Get started, start with example in
- * http://www.enyo.de/libquantum/api/node12.html
+ * 2005-11-13: Get started, start with example in
+ * http://www.enyo.de/libquantum/api/node12.html
* Notes:
* Please remove unneeded entries.
* References:
@@ -77,7 +77,7 @@ Create a new QuantumReg with specified number of registers.
/* change 1|0> to 0.5*sqrt(2)*|0> + 0.5*sqrt(2)*|1> for first qubit */
/* Measuring |0> will give a random value */
/* TODO: op or method for hadamard */
- quantum_hadamard(0, reg_p);
+ quantum_hadamard(0, reg_p);
return;
}
@@ -95,7 +95,7 @@ Makes a measurement on |0> of the qubit at position key.
INTVAL get_integer_keyed_int (INTVAL key) {
quantum_reg * reg_p = (quantum_reg *) PMC_struct_val(SELF);
-
+
return quantum_bmeasure(key, reg_p);
}
View
6 src/embed.c
@@ -55,7 +55,7 @@ extern void Parrot_initialize_core_pmcs(Interp *interp);
=item C<void Parrot_init(Interp *interpreter)>
Initializes the new interpreter. This function only has effect the first
-time it is called. Therefore Parrot_init() doesn't have to be called
+time it is called. Therefore Parrot_init() doesn't have to be called
on an interpreter returned from Parrot_new().
Use this function when you intend to enter the run loop,
@@ -594,7 +594,7 @@ print_profile(Interp *interpreter, int status, void *p)
RunProfile *profile = interpreter->profile;
FLOATVAL empty = calibrate(interpreter);
- PIO_printf(interpreter,
+ PIO_printf(interpreter,
" Code J Name "
"Calls Total/s Avg/ms\n");
for (j = 0; j < interpreter->op_count + PARROT_PROF_EXTRA; j++) {
@@ -834,7 +834,7 @@ Parrot_debug(Interp *debugger, opcode_t * pc)
interpreter = pdb->debugee;
interpreter->pdb = pdb;
debugger->lo_var_ptr = interpreter->lo_var_ptr;
-
+
PDB_disassemble(interpreter, NULL);
while (!(pdb->state & PDB_EXIT)) {
View
2 src/encoding.c
@@ -114,7 +114,7 @@ Parrot_encoding_number(Interp *interpreter, STRING *encodingname)
n = all_encodings->n_encodings;
for (i = 0; i < n; ++i) {
- if (!string_equal(interpreter, all_encodings->enc[i].name,
+ if (!string_equal(interpreter, all_encodings->enc[i].name,
encodingname))
return i;
}
View
22 src/events.c
@@ -103,7 +103,7 @@ static int pipe_fds[2];
#define PIPE_READ_FD pipe_fds[0]
#define PIPE_WRITE_FD pipe_fds[1]
-/*
+/*
* a structure to communicate with the io_thread
*/
typedef struct {
@@ -455,7 +455,7 @@ Parrot_del_timer_event(Parrot_Interp interpreter, PMC* timer)
for (entry = event_queue->head; entry; entry = entry->next) {
if (entry->type == QUEUE_ENTRY_TYPE_TIMED_EVENT) {
event = entry->data;
- if (event->interp == interpreter
+ if (event->interp == interpreter
&& event->u.timer_event.timer == timer) {
event->u.timer_event.interval = 0.0;
event->type = EVENT_TYPE_NONE;
@@ -505,8 +505,8 @@ Parrot_new_suspend_for_gc_event(Parrot_Interp interpreter) {
qe->next = NULL;
qe->data = ev;
qe->type = QUEUE_ENTRY_TYPE_EVENT;
- /* we don't use schedule_event because we must modify its
- * task queue immediately
+ /* we don't use schedule_event because we must modify its
+ * task queue immediately
*/
Parrot_schedule_interp_qentry(interpreter, qe);
}
@@ -770,7 +770,7 @@ io_thread(void *data)
case IO_THR_MSG_TERMINATE:
running = 0;
break;
- case IO_THR_MSG_ADD_SELECT_RD:
+ case IO_THR_MSG_ADD_SELECT_RD:
{
PMC *pio = buf.ev->u.io_event.pio;
int fd = PIO_getfd(NULL, pio);
@@ -793,8 +793,8 @@ io_thread(void *data)
}
else {
- /*
- * one of the io_event fds is ready
+ /*
+ * one of the io_event fds is ready
* remove from active set, as we don't
* want to fire again during io_handler
* invocation
@@ -841,7 +841,7 @@ stop_io_thread(void)
}
void
-Parrot_event_add_io_event(Interp* interpreter,
+Parrot_event_add_io_event(Interp* interpreter,
PMC* pio, PMC* sub, PMC* data, INTVAL which)
{
parrot_event *event;
@@ -850,7 +850,7 @@ Parrot_event_add_io_event(Interp* interpreter,
event = mem_sys_allocate(sizeof(parrot_event));
event->type = EVENT_TYPE_IO;
event->interp = interpreter;
- /*
+ /*
* TODO dod_register these PMCs as long as the event system
* owns these 3
* unregister, when event is passed to interp again
@@ -1233,7 +1233,7 @@ do_event(Parrot_Interp interpreter, parrot_event* event, void *next)
break;
case EVENT_TYPE_TIMER:
/* run ops, save registers */
- Parrot_runops_fromc_args_event(interpreter,
+ Parrot_runops_fromc_args_event(interpreter,
event->u.timer_event.sub, "v");
break;
case EVENT_TYPE_CALL_BACK:
@@ -1243,7 +1243,7 @@ do_event(Parrot_Interp interpreter, parrot_event* event, void *next)
break;
case EVENT_TYPE_IO:
edebug((stderr, "starting io handler\n"));
- Parrot_runops_fromc_args_event(interpreter,
+ Parrot_runops_fromc_args_event(interpreter,
event->u.io_event.handler,
"vPP",
event->u.io_event.pio,
View
2 src/exceptions.c
@@ -63,7 +63,7 @@ internal_exception(int exitcode, const char *format, ...)
va_end(arglist);
/*
* XXX TODO get rid of all the internal_exceptions or call them
- * with an interpreter arg
+ * with an interpreter arg
Parrot_exit(interpreter, exitcode);
*/
exit(exitcode);
View
10 src/exec.c
@@ -74,7 +74,7 @@ Parrot_exec(Interp *interpreter, opcode_t *pc,
Parrot_exec_rel_addr = (char **)mem_sys_allocate_zeroed(4 * sizeof(char *));
obj->bytecode_header_size =
(interpreter->code->base.file_offset + 4) * sizeof(opcode_t);
- jit_info = parrot_build_asm(interpreter, code_start, code_end,
+ jit_info = parrot_build_asm(interpreter, code_start, code_end,
obj, JIT_CODE_FILE);
/* TODO Go zero the calls to jited opcodes. */
@@ -197,7 +197,7 @@ Adds a symbol to the object file.
*/
int
-Parrot_exec_add_symbol(Parrot_exec_objfile_t *obj /*NN*/,
+Parrot_exec_add_symbol(Parrot_exec_objfile_t *obj /*NN*/,
const char *symbol /*NN*/, int stype)
{
@@ -233,16 +233,16 @@ Parrot_exec_add_symbol(Parrot_exec_objfile_t *obj /*NN*/,
}
int *
-Parrot_exec_add_text_rellocation_reg(Parrot_exec_objfile_t *obj /*NN*/,
- char *nptr, const char *var, int offset,
+Parrot_exec_add_text_rellocation_reg(Parrot_exec_objfile_t *obj /*NN*/,
+ char *nptr, const char *var, int offset,
int disp)
{
Parrot_exec_add_text_rellocation(obj, nptr, RTYPE_COM, var, disp);
return (int *)offset;
}
void
-Parrot_exec_add_text_rellocation_func(Parrot_exec_objfile_t *obj /*NN*/,
+Parrot_exec_add_text_rellocation_func(Parrot_exec_objfile_t *obj /*NN*/,
char *nptr, const char *func_name)
{
Parrot_exec_add_text_rellocation(obj, nptr, RTYPE_FUNC, func_name, 1);
View
12 src/exec_save.c
@@ -53,7 +53,7 @@ Parrot_exec_save(Parrot_exec_objfile_t *obj, const char *file)
struct nlist symlst;
fp = fopen(file, "w");
-
+
header.a_midmag = 0x07018600;
header.a_text = obj->text.size;
header.a_data = obj->data.size;
@@ -148,7 +148,7 @@ Parrot_exec_save(Parrot_exec_objfile_t *obj, const char *file)
# include <elf.h>
# endif
-/* Add a section to the file
+/* Add a section to the file
*
* n = Name
* t = Type
@@ -200,7 +200,7 @@ Parrot_exec_save(Parrot_exec_objfile_t *obj, const char *file)
char shst[SHSTRTABSIZE], *shste;
fp = fopen(file, "w");
-
+
bzero(&header, sizeof(Elf32_Ehdr));
header.e_ident[0] = ELFMAG0;
header.e_ident[1] = ELFMAG1;
@@ -268,7 +268,7 @@ Parrot_exec_save(Parrot_exec_objfile_t *obj, const char *file)
/* Bss */
sh_add(".bss", SHT_NOBITS, SHF_WRITE | SHF_ALLOC, obj->bss.size,
0, 0, 4, 0);
- /*
+ /*
* Text rellocation records.
* Link must be the symtab section header index.
* Info is the text section header index.
@@ -284,7 +284,7 @@ Parrot_exec_save(Parrot_exec_objfile_t *obj, const char *file)
sh_add(".rela.text", SHT_RELA, 0, obj->text_rellocation_count *
sizeof(Elf32_Rela), 6, 2, 4, sizeof(Elf32_Rela));
# endif
- /*
+ /*
* Symbol table.
* Link is the strtab section header index.
* Info is the index of the first symbol in the symbol table.
@@ -467,7 +467,7 @@ Parrot_exec_save(Parrot_exec_objfile_t *obj, const char *file)
int i;
fp = fopen(file, "w");
-
+
fprintf(fp, "\xFE\xED\xFA\xCE"); /* Header for Darwin */
save_int(fp, 0x12);
save_int(fp, 0);
View
2 src/exec_start.c
@@ -97,7 +97,7 @@ main(int argc, char * argv[])
#if defined(JIT_CGP)
exec_init_prederef(interpreter, &exec_prederef_code);
#endif
- /* Parrot_set_run_core(interpreter, PARROT_EXEC_CORE);
+ /* Parrot_set_run_core(interpreter, PARROT_EXEC_CORE);
interpreter->code->base.data =
(opcode_t *)&((&program_code)[bytecode_offset]);
Parrot_exec_run = 0; */
View
2 src/exit.c
@@ -74,7 +74,7 @@ Parrot_exit(Interp *interp, int status) {
* we don't allow new exit_handlers being installed inside exit handlers
* - do we?
* and: interp->exit_handler_list is gone, after the last exit handler
- * (Parrot_really_destroy) has run
+ * (Parrot_really_destroy) has run
*/
while (node) {
next = node->next;
View
26 src/extend.c
@@ -64,7 +64,7 @@ can.
/*
=item C<Parrot_STRING
-Parrot_PMC_get_string_intkey(Parrot_INTERP interp, Parrot_PMC pmc,
+Parrot_PMC_get_string_intkey(Parrot_INTERP interp, Parrot_PMC pmc,
Parrot_Int key)>
Return the integer keyed string value of the passed-in PMC
@@ -73,7 +73,7 @@ Return the integer keyed string value of the passed-in PMC
*/
-Parrot_STRING Parrot_PMC_get_string_intkey(Parrot_INTERP interp,
+Parrot_STRING Parrot_PMC_get_string_intkey(Parrot_INTERP interp,
Parrot_PMC pmc, Parrot_Int key) {
Parrot_STRING retval;
PARROT_CALLIN_START(interp);
@@ -95,7 +95,7 @@ Return the keyed, signed integer value of the value in the PMC.
*/
-void *Parrot_PMC_get_pointer_intkey(Parrot_INTERP interp, Parrot_PMC pmc,
+void *Parrot_PMC_get_pointer_intkey(Parrot_INTERP interp, Parrot_PMC pmc,
Parrot_Int key) {
void *retval;
PARROT_CALLIN_START(interp);
@@ -115,7 +115,7 @@ Return the integer keyed PMC value of the passed-in PMC
*/
-Parrot_PMC Parrot_PMC_get_pmc_intkey(Parrot_INTERP interp, Parrot_PMC pmc,
+Parrot_PMC Parrot_PMC_get_pmc_intkey(Parrot_INTERP interp, Parrot_PMC pmc,
Parrot_Int key) {
Parrot_PMC retval;
PARROT_CALLIN_START(interp);
@@ -155,7 +155,7 @@ Return the keyed, signed integer value of the value in the PMC.
*/
-Parrot_Int Parrot_PMC_get_intval_intkey(Parrot_INTERP interp, Parrot_PMC pmc,
+Parrot_Int Parrot_PMC_get_intval_intkey(Parrot_INTERP interp, Parrot_PMC pmc,
Parrot_Int key) {
Parrot_Int retval;
PARROT_CALLIN_START(interp);
@@ -312,7 +312,7 @@ char *Parrot_PMC_get_cstringn_intkey(Parrot_INTERP interp, Parrot_PMC pmc,
Parrot_Int *length, Parrot_Int key) {
char *retval;
PARROT_CALLIN_START(interp);
- retval = string_to_cstring(interp,
+ retval = string_to_cstring(interp,
VTABLE_get_string_keyed_int(interp, pmc, key));
*length = strlen(retval);
PARROT_CALLIN_END(interp);
@@ -332,7 +332,7 @@ Assign the passed-in Parrot string to the passed-in PMC.
*/
void
-Parrot_PMC_set_string(Parrot_INTERP interp, Parrot_PMC pmc,
+Parrot_PMC_set_string(Parrot_INTERP interp, Parrot_PMC pmc,
Parrot_STRING value) {
PARROT_CALLIN_START(interp);
VTABLE_set_string_native(interp, pmc, value);
@@ -510,7 +510,7 @@ Assign the passed-in null-terminated C string to the passed-in PMC.
void
Parrot_PMC_set_cstring(Parrot_INTERP interp, Parrot_PMC pmc, const char *value){
PARROT_CALLIN_START(interp);
- VTABLE_set_string_native(interp, pmc,
+ VTABLE_set_string_native(interp, pmc,
string_from_cstring(interp, value, 0));
PARROT_CALLIN_END(interp);
}
@@ -531,7 +531,7 @@ void
Parrot_PMC_set_cstring_intkey(Parrot_INTERP interp, Parrot_PMC pmc,
Parrot_Int key, const char *value) {
PARROT_CALLIN_START(interp);
- VTABLE_set_string_keyed_int(interp, pmc, key,
+ VTABLE_set_string_keyed_int(interp, pmc, key,
string_from_cstring(interp, value, 0));
PARROT_CALLIN_END(interp);
}
@@ -549,10 +549,10 @@ Assign the passed-in length-noted string to the passed-in PMC.
*/
void
-Parrot_PMC_set_cstringn(Parrot_INTERP interp, Parrot_PMC pmc,
+Parrot_PMC_set_cstringn(Parrot_INTERP interp, Parrot_PMC pmc,
const char *value, Parrot_Int length) {
PARROT_CALLIN_START(interp);
- VTABLE_set_string_native(interp, pmc,
+ VTABLE_set_string_native(interp, pmc,
string_from_cstring(interp, value, length));
PARROT_CALLIN_END(interp);
}
@@ -960,7 +960,7 @@ Set the value of an N register.
*/
void
-Parrot_set_numreg(Parrot_INTERP interpreter, Parrot_Int regnum,
+Parrot_set_numreg(Parrot_INTERP interpreter, Parrot_Int regnum,
Parrot_Float value)
{
REG_NUM(regnum) = value;
@@ -1047,7 +1047,7 @@ Find the magic token for an encoding, by name.
*/
/*
-Parrot_Const_Encoding Parrot_find_encoding(Parrot_INTERP interpreter,
+Parrot_Const_Encoding Parrot_find_encoding(Parrot_INTERP interpreter,
char *encoding_name) {
return Parrot_encoding_lookup(encoding_name);
}
View
8 src/gc_gms.c
@@ -267,23 +267,23 @@ Parrot_gc_gms_init(Interp* interpreter)
=over 4
-=item C<static void gc_gms_add_free_object(Interp *,
+=item C<static void gc_gms_add_free_object(Interp *,
struct Small_Object_Pool *pool,
void *to_add)>
Unused. White (dead) objects are added in a bunch to the free_list.
-=item C<static void * gc_gms_get_free_object(Interp *,
+=item C<static void * gc_gms_get_free_object(Interp *,
struct Small_Object_Pool *pool)>
Get a new object off the free_list in the given pool.
-=item C<static void gc_gms_alloc_objects(Interp *,
+=item C<static void gc_gms_alloc_objects(Interp *,
struct Small_Object_Pool *pool)>
Allocate new objects for the given pool.
-=item C<static void gc_gms_more_objects(Interp *,
+=item C<static void gc_gms_more_objects(Interp *,
struct Small_Object_Pool *pool)>
Run a GC cycle or allocate new objects for the given pool.
View
36 src/global.c
@@ -34,7 +34,7 @@ tdb
/* flags for internal_ns_keyed */
#define INTERN_NS_CREAT 1 /* I'm a fan of the classics */
-static PMC * internal_ns_keyed(Interp *interp, PMC *base_ns, PMC *pmc_key,
+static PMC * internal_ns_keyed(Interp *interp, PMC *base_ns, PMC *pmc_key,
STRING *str_key, int flags)
{
PMC *ns, *sub_ns;
@@ -79,7 +79,7 @@ static PMC * internal_ns_keyed(Interp *interp, PMC *base_ns, PMC *pmc_key,
/* TODO - match HLL of enclosing namespace? */
sub_ns = pmc_new(interp,
- Parrot_get_ctx_HLL_type(interp,
+ Parrot_get_ctx_HLL_type(interp,
enum_class_NameSpace));
if (PMC_IS_NULL(sub_ns))
return PMCNULL;
@@ -271,7 +271,7 @@ Parrot_find_global_k(Interp *interpreter, PMC *pmc_key, STRING *globalname)
PMC *
Parrot_find_global_s(Interp *inter, STRING *str_key, STRING *globalname)
{
- PMC *const ns =
+ PMC *const ns =
Parrot_get_namespace_keyed_str(inter,
Parrot_get_ctx_HLL_namespace(inter),
str_key);
@@ -306,7 +306,7 @@ the HLL root if C<str_key> is NULL, with the name C<globalname>.
*/
void
-Parrot_store_global_n(Interp *interpreter, PMC *ns,
+Parrot_store_global_n(Interp *interpreter, PMC *ns,
STRING *globalname, PMC *val)
{
#if DEBUG_GLOBAL
@@ -342,7 +342,7 @@ Parrot_store_global_k(Interp *interpreter, PMC *pmc_key,
* not good enough but it avoids regressesions for now
*/
if (pmc_key->vtable->base_type == enum_class_String) {
- Parrot_store_global_s(interpreter, PMC_str_val(pmc_key),
+ Parrot_store_global_s(interpreter, PMC_str_val(pmc_key),
globalname, val);
return;
}
@@ -357,7 +357,7 @@ Parrot_store_global_k(Interp *interpreter, PMC *pmc_key,
}
void
-Parrot_store_global_s(Interp *inter, STRING *str_key,
+Parrot_store_global_s(Interp *inter, STRING *str_key,
STRING *globalname, PMC *val)
{
PMC *ns;
@@ -495,19 +495,19 @@ store_sub(Interp *interpreter, PMC *pmc_key, STRING *str_key,
ns = Parrot_make_namespace_keyed(interpreter, ns, pmc_key);
else if (str_key)
ns = Parrot_make_namespace_keyed_str(interpreter, ns, str_key);
-
+
Parrot_store_global_n(interpreter, ns, sub_name, sub_pmc);
/* TEMPORARY HACK - cache invalidation should be a namespace function */
if (! PMC_IS_NULL(pmc_key)) {
if (pmc_key->vtable->base_type == enum_class_String)
- Parrot_invalidate_method_cache(interpreter,
+ Parrot_invalidate_method_cache(interpreter,
PMC_str_val(pmc_key), sub_name);
}
else if (str_key)
Parrot_invalidate_method_cache(interpreter, str_key, sub_name);
- /* MultiSub isa R*PMCArray and doesn't have a PMC_sub structure
+ /* MultiSub isa R*PMCArray and doesn't have a PMC_sub structure
* MultiSub could also contain subs from various namespaces,
* so it doesn't make much sense to associate a namespace
* with a multi.
@@ -517,7 +517,7 @@ store_sub(Interp *interpreter, PMC *pmc_key, STRING *str_key,
}
static void
-store_sub_in_namespace(Parrot_Interp interpreter, PMC* sub_pmc,
+store_sub_in_namespace(Parrot_Interp interpreter, PMC* sub_pmc,
PMC *pmc_key, STRING *sub_name)
{
/*
@@ -536,7 +536,7 @@ store_sub_in_namespace(Parrot_Interp interpreter, PMC* sub_pmc,
store_sub(interpreter, pmc_key, NULL, sub_name, sub_pmc);
break;
default:
- internal_exception(1,
+ internal_exception(1,
"Namespace constant is neither "
"String nor Key");
}
@@ -582,15 +582,15 @@ store_named_in_namespace(Parrot_Interp interpreter, PMC* sub_pmc)
sub_name = PMC_sub(sub_pmc)->name;
namespace = PMC_sub(sub_pmc)->namespace;
multi_sig = PMC_sub(sub_pmc)->multi_signature;
-
+
if (PMC_IS_NULL(multi_sig)) {
store_sub_in_namespace(interpreter, sub_pmc, namespace, sub_name);
}
else {
STRING *long_name;
PMC *multi_sub;
PMC *stash;
-
+
/* If namespace is NULL, we need to look in the root HLL namespace. But
since we haven't actually run code yet, the context hasn't been set
to include the HLL, so we have to do the work ourselves. */
@@ -600,7 +600,7 @@ store_named_in_namespace(Parrot_Interp interpreter, PMC* sub_pmc)
multi_sub = PMC_IS_NULL(stash)
? PMCNULL
: VTABLE_get_pmc_keyed_str(interpreter, stash, sub_name);
-
+
/* is there an existing MultiSub PMC? or do we need to create one? */
if (PMC_IS_NULL(multi_sub)) {
multi_sub = pmc_new(interpreter, enum_class_MultiSub);
@@ -612,7 +612,7 @@ store_named_in_namespace(Parrot_Interp interpreter, PMC* sub_pmc)
}
else
VTABLE_push_pmc(interpreter, multi_sub, sub_pmc);
-
+
long_name = Parrot_multi_long_name(interpreter, sub_pmc);
store_sub_in_namespace(interpreter, sub_pmc, namespace, long_name);
@@ -635,15 +635,15 @@ Parrot_store_sub_in_namespace(Parrot_Interp interpreter, PMC *sub)
Parrot_block_DOD(interpreter);
/* store relative to HLL namespace */
CONTEXT(interpreter->ctx)->current_HLL = PMC_sub(sub)->HLL_id;
-
+
store_named_in_namespace(interpreter, sub);
-
+
/* restore HLL_id */
CONTEXT(interpreter->ctx)->current_HLL = cur_id;
Parrot_unblock_DOD(interpreter);
}
else {
- PMC *stash =
+ PMC *stash =
Parrot_get_HLL_namespace(interpreter, PMC_sub(sub)->HLL_id);
PMC_sub(sub)->namespace_stash = stash;
}
View
8 src/global_setup.c
@@ -166,16 +166,16 @@ parrot_global_setup_2(Interp *interpreter)
/* create the namespace root stash */
interpreter->root_namespace = pmc_new(interpreter, enum_class_NameSpace);
- interpreter->HLL_info = constant_pmc_new(interpreter,
+ interpreter->HLL_info = constant_pmc_new(interpreter,
enum_class_ResizablePMCArray);
- interpreter->HLL_namespace = constant_pmc_new(interpreter,
+ interpreter->HLL_namespace = constant_pmc_new(interpreter,
enum_class_ResizablePMCArray);
Parrot_register_HLL(interpreter, const_string(interpreter, "parrot"), NULL);
- parrot_ns = VTABLE_get_pmc_keyed_int(interpreter,
+ parrot_ns = VTABLE_get_pmc_keyed_int(interpreter,
interpreter->HLL_namespace, 0);
- CONTEXT(interpreter->ctx)->current_namespace = parrot_ns;
+ CONTEXT(interpreter->ctx)->current_namespace = parrot_ns;
/* We need a class hash */
interpreter->class_hash = classname_hash =
View
2 src/hash.c
@@ -14,7 +14,7 @@ creation the types of key and value as well as appropriate compare and
hashing functions can be set.
This hash implementation uses just one piece of malloced memory. The
-C<< hash->bs >> bucket store points this regions.
+C<< hash->bs >> bucket store points this regions.
This hash doesn't move during GC, therefore a lot of the old caveats
don't apply.
View
14 src/headers.c
@@ -185,7 +185,7 @@ make_bufferlike_pool(Interp *interpreter, size_t buffer_size)
/* Expand the array of sized resource pools, if necessary */
if (num_old <= idx) {
UINTVAL num_new = idx + 1;
- sized_pools = mem_internal_realloc(sized_pools,
+ sized_pools = mem_internal_realloc(sized_pools,
num_new * sizeof(void *));
memset(sized_pools + num_old, 0, sizeof(void *) * (num_new - num_old));
@@ -597,7 +597,7 @@ Parrot_initialize_header_pools(Interp *interpreter)
/*
-=item C<int Parrot_forall_header_pools(Interp *, int flag,
+=item C<int Parrot_forall_header_pools(Interp *, int flag,
void *arg, pool_iter_fn)>
Iterate through all header pools by calling the passed function. Returns
@@ -761,7 +761,7 @@ Merge the header pools of C<source_interp> into those of C<dest_interp>.
=cut
*/
-static void fix_pmc_syncs(Interp *dest_interp,
+static void fix_pmc_syncs(Interp *dest_interp,
struct Small_Object_Pool *pool) {
/* XXX largely copied from dod_sweep */
struct Small_Object_Arena *cur_arena;
@@ -780,9 +780,9 @@ static void fix_pmc_syncs(Interp *dest_interp,
PMC *p = (PMC *)b;
if (PObj_is_PMC_shared_TEST(p)) {
PMC_sync(p)->owner = dest_interp;
- }
+ }
else {
- /* fprintf(stderr, "BAD PMC: address=%p,
+ /* fprintf(stderr, "BAD PMC: address=%p,
base_type=%d\n",
p, p->vtable->base_type); */
assert(0);
@@ -812,7 +812,7 @@ Parrot_merge_header_pools(Interp *dest_interp, Interp *source_interp) {
fix_pmc_syncs(dest_interp, source_arena->pmc_pool);
Parrot_small_object_pool_merge(dest_interp, dest_arena->pmc_pool,
source_arena->pmc_pool);
- Parrot_small_object_pool_merge(dest_interp,
+ Parrot_small_object_pool_merge(dest_interp,
dest_arena->constant_string_header_pool,
source_arena->constant_string_header_pool);
Parrot_small_object_pool_merge(dest_interp,
@@ -826,7 +826,7 @@ Parrot_merge_header_pools(Interp *dest_interp, Interp *source_interp) {
if (i >= dest_arena->num_sized ||
!dest_arena->sized_header_pools[i]) {
- make_bufferlike_pool(dest_interp, i * sizeof(void *)
+ make_bufferlike_pool(dest_interp, i * sizeof(void *)
+ sizeof(Buffer));
assert(dest_arena->sized_header_pools[i]);
}
View
20 src/hll.c
@@ -103,7 +103,7 @@ new_hll_entry(Interp *interpreter)
* ATT: all items that are owned by the HLL_info structure
* have to be created as constant objects, because
* this structure isn't marked by DOD/GC
- */
+ */
entry = constant_pmc_new(interpreter, enum_class_FixedPMCArray);
VTABLE_push_pmc(interpreter, hll_info, entry);
@@ -156,12 +156,12 @@ Parrot_register_HLL(Interp *interpreter,
* ns_hash to another type, if mappings provide one
* XXX - FIXME
*/
- ns_hash = Parrot_make_namespace_keyed_str(interpreter,
- interpreter->root_namespace,
+ ns_hash = Parrot_make_namespace_keyed_str(interpreter,
+ interpreter->root_namespace,
hll_name);
/* cache HLLs toplevel namespace */
- VTABLE_set_pmc_keyed_int(interpreter, interpreter->HLL_namespace,
+ VTABLE_set_pmc_keyed_int(interpreter, interpreter->HLL_namespace,
idx, ns_hash);
/* register HLL lib */
@@ -200,12 +200,12 @@ Parrot_get_HLL_id(Interp* interpreter, STRING *hll_name)
for (i = 0; i < nelements; ++i) {
PMC * const entry = VTABLE_get_pmc_keyed_int(interpreter, hll_info, i);
- PMC * const name_pmc = VTABLE_get_pmc_keyed_int(interpreter, entry,
+ PMC * const name_pmc = VTABLE_get_pmc_keyed_int(interpreter, entry,
e_HLL_name);
STRING * name;
if (PMC_IS_NULL(name_pmc))
- continue;
+ continue;
name = VTABLE_get_string(interpreter, name_pmc);
if (!string_equal(interpreter, name, hll_name))
break;
@@ -225,7 +225,7 @@ Parrot_get_HLL_name(Interp *interpreter, INTVAL id)
nelements = VTABLE_elements(interpreter, hll_info);
if (id < 0 || id >= nelements) {
ret = NULL;
- }
+ }
else {
PMC *entry;
PMC *name_pmc;
@@ -384,7 +384,7 @@ Parrot_regenerate_HLL_namespaces(Interp *interpreter)
interpreter->HLL_namespace,
hll_id);
if (PMC_IS_NULL(ns_hash) ||
- ns_hash->vtable->base_type == enum_class_Undef)
+ ns_hash->vtable->base_type == enum_class_Undef)
{
STRING *hll_name;
hll_name = Parrot_get_HLL_name(interpreter, hll_id);
@@ -396,9 +396,9 @@ Parrot_regenerate_HLL_namespaces(Interp *interpreter)
* easy to do that here since the typemap already exists,
* but it is not currently done for consistency.
*/
- ns_hash = Parrot_make_namespace_keyed_str(interpreter,
+ ns_hash = Parrot_make_namespace_keyed_str(interpreter,
interpreter->root_namespace, hll_name);
- VTABLE_set_pmc_keyed_int(interpreter, interpreter->HLL_namespace,
+ VTABLE_set_pmc_keyed_int(interpreter, interpreter->HLL_namespace,
hll_id, ns_hash);
}
}
View
108 src/inter_call.c
@@ -31,12 +31,12 @@ static int next_arg(Interp *, struct call_state_item *st);
/*
-=item C<int Parrot_init_arg_nci(Interp *,
+=item C<int Parrot_init_arg_nci(Interp *,
struct call_state *st, const char *sig)>
Initialize the argument passing state C<call_state> for the given NCI signature.
-=item C<int Parrot_init_ret_nci(Interp *,
+=item C<int Parrot_init_ret_nci(Interp *,
struct call_state *st, const char *sig)>
Initialize the return value passing state C<call_state> for the given
@@ -316,7 +316,7 @@ fetch_arg_pmc_sig(Interp *interpreter, struct call_state *st)
}
if (st->src.sig & PARROT_ARG_FLATTEN) {
make_flattened(interpreter, st, UVal_pmc(st->val));
- }
+ }
else {
st->src.mode |= CALL_STATE_NEXT_ARG;
}
@@ -441,7 +441,7 @@ Parrot_fetch_arg(Interp *interpreter, struct call_state *st)
PMC *elem;
if (st->key) {
st->src.slurp_i++;
- st->name = parrot_hash_get_idx(interpreter,
+ st->name = parrot_hash_get_idx(interpreter,
PMC_struct_val(st->src.slurp), st->key);
assert(st->name);
elem = VTABLE_get_pmc_keyed_str(interpreter, st->src.slurp,
@@ -462,7 +462,7 @@ Parrot_fetch_arg(Interp *interpreter, struct call_state *st)
/* advance src - get next arg */
return Parrot_fetch_arg(interpreter, st);
}
- if ((st->src.sig & PARROT_ARG_NAME) &&
+ if ((st->src.sig & PARROT_ARG_NAME) &&
!(st->src.sig & PARROT_ARG_FLATTEN)) {
fetch_arg_op(interpreter, st);
st->name = UVal_str(st->val);
@@ -495,7 +495,7 @@ Parrot_fetch_arg_nci(Interp *interpreter, struct call_state *st)
Parrot_fetch_arg(interpreter, st);
}
UVal_pmc(st->val) = slurped;
- }
+ }
else {
Parrot_convert_arg(interpreter, st);
st->dest.mode |= CALL_STATE_NEXT_ARG;
@@ -639,7 +639,7 @@ init_named(Interp *interpreter, struct call_state *st)
{
int i, n_named, idx;
INTVAL sig;
-
+
if (st->dest.mode & CALL_STATE_SIG)
real_exception(interpreter, NULL, E_ValueError,
"Can't call C function with named arguments");
@@ -745,8 +745,8 @@ locate_named_named(Interp *interpreter, struct call_state *st)
return 0;
}
-static void
-store_arg(struct call_state *st, INTVAL idx)
+static void
+store_arg(struct call_state *st, INTVAL idx)
{
switch (st->dest.sig & PARROT_ARG_TYPE_MASK) {
@@ -776,8 +776,8 @@ create_slurpy_ar(Interp *interpreter, struct call_state *st, INTVAL idx)
st->dest.mode &= ~CALL_STATE_OPT;
}
-static void
-too_few(Interp *interpreter, struct call_state *st, const char *action)
+static void
+too_few(Interp *interpreter, struct call_state *st, const char *action)
{
int max_expected_args = st->params;
int min_expected_args = max_expected_args - st->optionals;
@@ -793,8 +793,8 @@ too_few(Interp *interpreter, struct call_state *st, const char *action)
}
-static void
-too_many(Interp *interpreter, struct call_state *st, const char *action)
+static void
+too_many(Interp *interpreter, struct call_state *st, const char *action)
{
int max_expected_args = st->params;
int min_expected_args = max_expected_args - st->optionals;
@@ -807,8 +807,8 @@ too_many(Interp *interpreter, struct call_state *st, const char *action)
}
}
-static void
-null_val(int sig, struct call_state *st)
+static void
+null_val(int sig, struct call_state *st)
{
switch (sig & PARROT_ARG_TYPE_MASK) {
case PARROT_ARG_INTVAL:
@@ -822,8 +822,8 @@ null_val(int sig, struct call_state *st)
}
}
-static void
-check_named(Interp *interpreter, struct call_state *st, const char *action)
+static void
+check_named(Interp *interpreter, struct call_state *st, const char *action)
{
int i, n_named, idx, was_set, n_i;
INTVAL sig;
@@ -866,7 +866,7 @@ check_named(Interp *interpreter, struct call_state *st, const char *action)
}
static void
-process_args(Interp *interpreter, struct call_state *st,
+process_args(Interp *interpreter, struct call_state *st,
const char *action, int err_check)
{
int state, opt_flag;
@@ -883,7 +883,7 @@ process_args(Interp *interpreter, struct call_state *st,
* finished if both are at end or src at end
* and we are slurpying
*/
- if ((state & CALL_STATE_END_x) &&
+ if ((state & CALL_STATE_END_x) &&
((state & CALL_STATE_x_END) ||
(state & CALL_STATE_SLURP)))
return;
@@ -892,8 +892,8 @@ process_args(Interp *interpreter, struct call_state *st,
*/
if (!(state & CALL_STATE_NAMED_x)) {
if (!(state & CALL_STATE_SLURP) &&
- (st->dest.sig &
- (PARROT_ARG_SLURPY_ARRAY|PARROT_ARG_NAME)) ==
+ (st->dest.sig &
+ (PARROT_ARG_SLURPY_ARRAY|PARROT_ARG_NAME)) ==
PARROT_ARG_SLURPY_ARRAY) {
/* create array */
idx = st->dest.u.op.pc[st->dest.i];
@@ -936,16 +936,16 @@ process_args(Interp *interpreter, struct call_state *st,
state = st->dest.mode & CALL_STATE_MASK;
switch(state) {
- case CALL_STATE_NAMED_NAMED:
- case CALL_STATE_NAMED_NAMED_OPT:
+ case CALL_STATE_NAMED_NAMED:
+ case CALL_STATE_NAMED_NAMED_OPT:
if (!locate_named_named(interpreter, st))
real_exception(interpreter, NULL, E_ValueError,
"too many named arguments - '%Ss' not expected",
st->name);
if (st->dest.mode & CALL_STATE_SLURP)
<