Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some enhancements on linelength.t

Some column 80 cuts.


git-svn-id: https://svn.parrot.org/parrot/trunk@14265 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit fe05e8a2dfb11ada81b0b171463e881725ea9234 1 parent 7c56f83
Alberto Simões ambs authored
5 Configure.pl
View
@@ -72,8 +72,9 @@ =head2 Command-line Options
=item C<--m=32>
-Create a 32-bit executable on 64-architectures like x86_64. This option
-appends -m32 to compiler and linker programs and does s/lib64/lib/g on link flags.
+Create a 32-bit executable on 64-architectures like x86_64. This
+option appends -m32 to compiler and linker programs and does
+s/lib64/lib/g on link flags.
This option is experimental. See F<config/init/defaults.pm> for more.
28 compilers/imcc/cfg.c
View
@@ -259,8 +259,9 @@ build_cfg(Parrot_Interp interpreter, IMC_Unit * unit)
if (!saves)
bb_add_edge(unit, bb,
unit->bb_list[j+1]);
- IMCC_debug(interpreter, DEBUG_CFG, "\tand does saveall %s\n",
- saves ? "yes" : "no");
+ IMCC_debug(interpreter, DEBUG_CFG,
+ "\tand does saveall %s\n",
+ saves ? "yes" : "no");
}
}
else if (!strcmp(pred->from->end->op, "invoke")) {
@@ -269,15 +270,16 @@ build_cfg(Parrot_Interp interpreter, IMC_Unit * unit)
goto invok;
}
if (!found)
- IMCC_debug(interpreter, DEBUG_CFG, "\tcalled from unknown!\n");
+ IMCC_debug(interpreter, DEBUG_CFG,
+ "\tcalled from unknown!\n");
}
}
last = bb;
}
- /* Decouple unreachable blocks (not the first block, with no predecessors)
- * from the CFG
+ /* Decouple unreachable blocks (not the first block, with no
+ * predecessors) from the CFG
*/
do {
changes = 0;
@@ -303,7 +305,8 @@ build_cfg(Parrot_Interp interpreter, IMC_Unit * unit)
/* find the placement of the label, and link the two nodes */
static void
-bb_findadd_edge(Parrot_Interp interpreter, IMC_Unit * unit, Basic_block *from, SymReg *label)
+bb_findadd_edge(Parrot_Interp interpreter, IMC_Unit * unit,
+ Basic_block *from, SymReg *label)
{
Instruction *ins;
SymReg *r = find_sym(interpreter, label->name);
@@ -758,7 +761,9 @@ compute_dominators (Parrot_Interp interpreter, IMC_Unit * unit)
if (i != b && set_contains(dominators[b], i)) {
wrong = 0;
for (runner = 0; runner < n; runner++) {
- if (runner != b && runner != i && set_contains(dominators[b], runner)) {
+ if (runner != b && runner != i &&
+ set_contains(dominators[b], runner))
+ {
if (set_contains(dominators[runner], i)) {
wrong = 1;
break;
@@ -960,10 +965,13 @@ natural_preheader (IMC_Unit * unit, Loop_info* loop_info)
int preheader = -1;
Edge* edge;
- for (edge = unit->bb_list[loop_info->header]->pred_list; edge; edge = edge->pred_next) {
+ for (edge = unit->bb_list[loop_info->header]->pred_list;
+ edge; edge = edge->pred_next) {
if (!set_contains(loop_info->loop, edge->from->index)) {
- if (preheader == -1 && unit->bb_list[edge->from->index]->succ_list->to->index == loop_info->header &&
- !unit->bb_list[edge->from->index]->succ_list->succ_next) {
+ if (preheader == -1 &&
+ unit->bb_list[edge->from->index]->succ_list->to->index == loop_info->header &&
+ !unit->bb_list[edge->from->index]->succ_list->succ_next)
+ {
preheader = unit->bb_list[edge->from->index]->index;
continue;
} else {
7 compilers/imcc/debug.c
View
@@ -104,7 +104,9 @@ dump_instructions(Interp *interpreter, IMC_Unit * unit)
Basic_block *bb;
int pc;
- fprintf(stderr, "\nDumping the instructions status:\n-------------------------------\n");
+ fprintf(stderr,
+ "\nDumping the instructions status:"
+ "\n-------------------------------\n");
fprintf(stderr,
"nins line blck deep flags\t type opnr size pc X ins\n");
for (pc = 0, ins = unit->instructions; ins; ins = ins->next) {
@@ -166,7 +168,8 @@ dump_loops(IMC_Unit * unit)
fprintf(stderr,
"Loop %d, depth %d, size %d, header %d, preheader %d\n",
i, loop_info[i]->depth,
- loop_info[i]->size, loop_info[i]->header, loop_info[i]->preheader);
+ loop_info[i]->size, loop_info[i]->header,
+ loop_info[i]->preheader);
fprintf(stderr, " Contains blocks: ");
for (j = 0; j < unit->n_basic_blocks; j++)
if (set_contains(loop, j))
3  compilers/imcc/main.c
View
@@ -29,7 +29,8 @@ static void
usage(FILE* fp)
{
fprintf(fp,
- "parrot -[abcCEfgGhjprStvVwy.] [-d [FLAGS]] [-O [level]] [-o FILE] <file>\n");
+ "parrot -[abcCEfgGhjprStvVwy.] [-d [FLAGS]] "
+ "[-O [level]] [-o FILE] <file>\n");
}
static void
43 compilers/imcc/optimizer.c
View
@@ -211,7 +211,8 @@ if_branch(Interp *interpreter, IMC_Unit * unit)
if ((neg_op = get_neg_op(last->op, &args)) != 0) {
Instruction * tmp;
last->r[reg] = go;
- tmp = INS(interpreter, unit, (char*)neg_op, "", last->r, args, 0, 0);
+ tmp = INS(interpreter, unit, (char*)neg_op, "",
+ last->r, args, 0, 0);
last->opnum = tmp->opnum;
last->opsize = tmp->opsize;
free(last->op);
@@ -865,7 +866,8 @@ branch_branch(Interp *interpreter, IMC_Unit * unit)
if (r && (r->type & VTADDRESS) && r->first_ins) {
next = r->first_ins->next;
-/* if (!next || !strcmp(next->r[0]->name, get_branch_reg(ins)->name))
+/* if (!next ||
+ !strcmp(next->r[0]->name, get_branch_reg(ins)->name))
break;*/
if (next &&
(next->type & IF_goto) &&
@@ -914,19 +916,23 @@ branch_reorg(Interp *interpreter, IMC_Unit * unit)
if (r && (r->type & VTADDRESS) && r->first_ins) {
start = r->first_ins;
found = 0;
- for (edge = unit->bb_list[start->bbindex]->pred_list; edge; edge = edge->pred_next) {
+ for (edge = unit->bb_list[start->bbindex]->pred_list;
+ edge; edge = edge->pred_next)
+ {
if (edge->from->index == start->bbindex - 1) {
found = 1;
break;
}
}
- /* if target block is not reached by falling into it from another block */
+ /* if target block is not reached by falling into it
+ * from another block */
if (!found) {
/* move target block and its positional successors
* to follow block with unconditional jump
* (this could actually be in another block) */
for (end = start; end->next; end = end->next) {
- if ((end->type & IF_goto) && !strcmp(end->op, "branch")) {
+ if ((end->type & IF_goto) &&
+ !strcmp(end->op, "branch")) {
break;
}
}
@@ -1067,7 +1073,8 @@ branch_cond_loop(Interp *interpreter, IMC_Unit * unit)
|| cond->type & ITCALL) {
break;
/* just until we can copy set_args et al */
- } else if (cond->type & ITBRANCH && get_branch_regno(cond) >= 0) {
+ } else if (cond->type & ITBRANCH &&
+ get_branch_regno(cond) >= 0) {
found = 1;
break;
}
@@ -1152,7 +1159,8 @@ unused_label(Interp *interpreter, IMC_Unit * unit)
#endif
if (!used) {
ostat.deleted_labels++;
- IMCC_debug(interpreter, DEBUG_OPT1, "block %d label %s deleted\n", i, lab->name);
+ IMCC_debug(interpreter, DEBUG_OPT1,
+ "block %d label %s deleted\n", i, lab->name);
ostat.deleted_ins++;
ins = delete_ins(unit, ins, 1);
changed = 1;
@@ -1185,7 +1193,8 @@ dead_code_remove(Interp *interpreter, IMC_Unit * unit)
/* this block isn't entered from anywhere */
if (!bb->pred_list) {
int bbi = bb->index;
- IMCC_debug(interpreter, DEBUG_OPT1, "found dead block %d\n", bb->index);
+ IMCC_debug(interpreter, DEBUG_OPT1,
+ "found dead block %d\n", bb->index);
for (ins = bb->start; ins && ins->bbindex == bbi; ) {
IMCC_debug(interpreter, DEBUG_OPT1,
"\tins deleted (dead block) %I\n", ins);
@@ -1198,9 +1207,11 @@ dead_code_remove(Interp *interpreter, IMC_Unit * unit)
/* Unreachable instructions */
- for (last = unit->instructions, ins=last->next; last && ins; ins = ins->next) {
+ for (last = unit->instructions, ins=last->next;
+ last && ins;
+ ins = ins->next) {
if ((last->type & IF_goto) && !(ins->type & ITLABEL) &&
- !strcmp(last->op, "branch")) {
+ !strcmp(last->op, "branch")) {
IMCC_debug(interpreter, DEBUG_OPT1,
"unreachable ins deleted (after branch) %I\n", ins);
ins = delete_ins(unit, ins, 1);
@@ -1214,7 +1225,8 @@ dead_code_remove(Interp *interpreter, IMC_Unit * unit)
if (ins && last && (last->type & IF_goto) && (ins->type & ITLABEL) &&
!strcmp(last->op, "branch") &&
!strcmp(last->r[0]->name, ins->r[0]->name)) {
- IMCC_debug(interpreter, DEBUG_OPT1, "dead branch deleted %I\n", ins);
+ IMCC_debug(interpreter, DEBUG_OPT1,
+ "dead branch deleted %I\n", ins);
ins = delete_ins(unit, last, 1);
ostat.deleted_ins++;
changed++;
@@ -1241,7 +1253,8 @@ used_once(Parrot_Interp interpreter, IMC_Unit * unit)
if (!r)
continue;
if (r->use_count == 1 && r->lhs_use_count == 1) {
- IMCC_debug(interpreter, DEBUG_OPT2, "used once '%I' deleted\n", ins);
+ IMCC_debug(interpreter, DEBUG_OPT2,
+ "used once '%I' deleted\n", ins);
ins = delete_ins(unit, ins, 1);
ins = ins->prev ? ins->prev : unit->instructions;
ostat.deleted_ins++;
@@ -1346,14 +1359,16 @@ _is_ins_save(IMC_Unit * unit, Instruction *check_ins,
}
static int
-is_ins_save(Parrot_Interp interpreter, IMC_Unit * unit, Instruction *ins, SymReg *r, int what)
+is_ins_save(Parrot_Interp interpreter, IMC_Unit * unit,
+ Instruction *ins, SymReg *r, int what)
{
int save;
reason = 0;
save = _is_ins_save(unit, ins, r, what);
if (!save && reason)
- IMCC_debug(interpreter, DEBUG_OPT2, "ins not save var %s reason %d %I\n",
+ IMCC_debug(interpreter, DEBUG_OPT2,
+ "ins not save var %s reason %d %I\n",
r->name, reason, ins);
return save;
}
8 compilers/imcc/pbc.c
View
@@ -766,9 +766,10 @@ add_const_key(Interp *interpreter, opcode_t key[],
interpreter->code->const_table->constants[k]->type = PFC_KEY;
interpreter->code->const_table->constants[k]->u.key = pfc->u.key;
store_key_const(s_key, k);
- IMCC_debug(interpreter, DEBUG_PBC_CONST, "\t=> %s #%d size %d\n", s_key, k, size);
+ IMCC_debug(interpreter, DEBUG_PBC_CONST, "\t=> %s #%d size %d\n",
+ s_key, k, size);
IMCC_debug(interpreter, DEBUG_PBC_CONST, "\t %x /%x %x/ /%x %x/\n",
- key[0],key[1],key[2],key[3],key[4]);
+ key[0],key[1],key[2],key[3],key[4]);
return k;
}
@@ -1194,7 +1195,8 @@ e_pbc_emit(Interp *interpreter, void *param, IMC_Unit * unit, Instruction * ins)
/* if item is a PCC_SUB entry then store it constants */
if (ins->r[0] && ins->r[0]->pcc_sub) {
#if IMC_TRACE
- PIO_eprintf(NULL, "pbc.c: e_pbc_emit (pcc_sub=%s)\n", ins->r[0]->name);
+ PIO_eprintf(NULL, "pbc.c: e_pbc_emit (pcc_sub=%s)\n",
+ ins->r[0]->name);
#endif
add_const_pmc_sub(interpreter, ins->r[0], oldsize,
oldsize+code_size);
5 compilers/imcc/pcc.c
View
@@ -176,7 +176,7 @@ expand_pcc_sub(Parrot_Interp interp, IMC_Unit * unit, Instruction *ins)
unit->last_ins->n_r == 1 &&
( sub = unit->last_ins->r[0] ) &&
sub->pcc_sub &&
- !sub->pcc_sub->object && /* s. src/inter_call.c:119 */
+ !sub->pcc_sub->object && /* s. src/inter_call.c:119 */
(sub->pcc_sub->flags & isTAIL_CALL))
return;
if (unit->last_ins->type != (ITPCCSUB|ITLABEL) &&
@@ -184,7 +184,8 @@ expand_pcc_sub(Parrot_Interp interp, IMC_Unit * unit, Instruction *ins)
strcmp(unit->last_ins->op, "exit") &&
strcmp(unit->last_ins->op, "end") &&
strcmp(unit->last_ins->op, "branch") &&
- strcmp(unit->last_ins->op, "returncc") /* was adding rets multiple times... */
+ /* was adding rets multiple times... */
+ strcmp(unit->last_ins->op, "returncc")
) {
if (sub->pcc_sub->pragma & P_MAIN) {
tmp = INS(interp, unit, "end", NULL, regs, 0, 0, 0);
7 src/stacks.c
View
@@ -147,7 +147,8 @@ stack_entry(Interp *interpreter, Stack_Chunk_t *stack /*NN*/, INTVAL depth)
/* For negative depths, look from the bottom of the stack up. */
if (depth < 0) {
- depth = stack_height(interpreter, CONTEXT(interpreter->ctx)->user_stack) + depth;
+ depth = stack_height(interpreter,
+ CONTEXT(interpreter->ctx)->user_stack) + depth;
if (depth < 0)
return NULL;
offset = (size_t)depth;
@@ -181,7 +182,9 @@ element.
*/
void
-rotate_entries(Interp *interpreter, Stack_Chunk_t **stack_p /*NN*/, INTVAL num_entries)
+rotate_entries(Interp *interpreter,
+ Stack_Chunk_t **stack_p /*NN*/,
+ INTVAL num_entries)
{
Stack_Chunk_t *stack = *stack_p;
Stack_Entry_t temp;
20 src/string.c
View
@@ -146,8 +146,9 @@ Parrot_make_COW_reference(Interp *interpreter, STRING *s)
!Parrot_in_memory_pool(interpreter, PObj_bufstart(s))) {
Parrot_unmake_COW(interpreter, d);
PIO_eprintf(interpreter, "cross-interpreter copy of "
- "relocatable string '%Ss' into tid %d\n", d,
- interpreter->thread_data->tid);
+ "relocatable string '%Ss' into tid %d\n",
+ d,
+ interpreter->thread_data->tid);
}
#endif
}
@@ -337,8 +338,10 @@ Returs NULL, if no compatible string representation can be found.
*/
CHARSET *
-string_rep_compatible (Interp *interpreter, STRING *a /*NN*/, const STRING *b /*NN*/,
- ENCODING **e /*NN*/)
+string_rep_compatible (Interp *interpreter,
+ STRING *a /*NN*/,
+ const STRING *b /*NN*/,
+ ENCODING **e /*NN*/)
{
if (a->encoding == b->encoding && a->charset == b->charset) {
*e = a->encoding;
@@ -2470,7 +2473,8 @@ character classes. Returns 0 otherwise, or if the string is empty or NULL.
*/
INTVAL
-Parrot_string_is_cclass(Interp *interpreter, PARROT_CCLASS_FLAGS flags, STRING *s, UINTVAL offset)
+Parrot_string_is_cclass(Interp *interpreter, PARROT_CCLASS_FLAGS flags,
+ STRING *s, UINTVAL offset)
{
if (!string_length(interpreter, s))
return 0;
@@ -2478,7 +2482,8 @@ Parrot_string_is_cclass(Interp *interpreter, PARROT_CCLASS_FLAGS flags, STRING *
}
INTVAL
-Parrot_string_find_cclass(Interp *interpreter, PARROT_CCLASS_FLAGS flags, STRING *s, UINTVAL offset, UINTVAL count)
+Parrot_string_find_cclass(Interp *interpreter, PARROT_CCLASS_FLAGS flags,
+ STRING *s, UINTVAL offset, UINTVAL count)
{
if (!s)
return -1;
@@ -2486,7 +2491,8 @@ Parrot_string_find_cclass(Interp *interpreter, PARROT_CCLASS_FLAGS flags, STRING
}
INTVAL
-Parrot_string_find_not_cclass(Interp *interpreter, PARROT_CCLASS_FLAGS flags, STRING *s, UINTVAL offset, UINTVAL count)
+Parrot_string_find_not_cclass(Interp *interpreter, PARROT_CCLASS_FLAGS flags,
+ STRING *s, UINTVAL offset, UINTVAL count)
{
if (!s)
return -1;
9 src/sub.c
View
@@ -136,8 +136,10 @@ to the current context.
struct Parrot_cont *
new_continuation(Interp *interp, struct Parrot_cont *to)
{
- struct Parrot_cont * const cc = mem_sys_allocate(sizeof(struct Parrot_cont));
- struct Parrot_Context * const to_ctx = to ? to->to_ctx : CONTEXT(interp->ctx);
+ struct Parrot_cont * const cc =
+ mem_sys_allocate(sizeof(struct Parrot_cont));
+ struct Parrot_Context * const to_ctx =
+ to ? to->to_ctx : CONTEXT(interp->ctx);
cc->to_ctx = to_ctx;
cc->from_ctx = CONTEXT(interp->ctx);
@@ -169,7 +171,8 @@ Returns a new C<Parrot_cont> pointing to the current context.
struct Parrot_cont *
new_ret_continuation(Interp *interp)
{
- struct Parrot_cont * const cc = mem_sys_allocate(sizeof(struct Parrot_cont));
+ struct Parrot_cont * const cc =
+ mem_sys_allocate(sizeof(struct Parrot_cont));
cc->to_ctx = CONTEXT(interp->ctx);
cc->from_ctx = NULL; /* filled in during a call */
cc->runloop_id = 0;
45 src/thread.c
View
@@ -66,7 +66,8 @@ make_local_copy(Parrot_Interp interpreter, Parrot_Interp from, PMC *arg)
{
PMC *ret_val;
STRING *const _sub = interpreter->vtables[enum_class_Sub]->whoami;
- STRING *const _multi_sub = interpreter->vtables[enum_class_MultiSub]->whoami;
+ STRING *const _multi_sub =
+ interpreter->vtables[enum_class_MultiSub]->whoami;
if (PMC_IS_NULL(arg)) {
ret_val = PMCNULL;
} else if (PObj_is_PMC_shared_TEST(arg)) {
@@ -110,7 +111,9 @@ Make a local copy of the corresponding array of arguments.
*/
static PMC *
-make_local_args_copy(Parrot_Interp interpreter, Parrot_Interp old_interp, PMC *args)
+make_local_args_copy(Parrot_Interp interpreter,
+ Parrot_Interp old_interp,
+ PMC *args)
{
PMC *ret_val;
INTVAL old_size;
@@ -163,7 +166,7 @@ PMC *pt_shared_fixup(Parrot_Interp interpreter, PMC *pmc) {
PMC *vtable_cache;
/* keep the original vtable from going away... */
- vtable_cache = ((PMC**) PMC_data(pmc->vtable->class))[PCD_OBJECT_VTABLE];
+ vtable_cache = ((PMC**)PMC_data(pmc->vtable->class))[PCD_OBJECT_VTABLE];
assert(vtable_cache->vtable->base_type == enum_class_VtableCache);
add_pmc_sync(interpreter, vtable_cache);
PObj_is_PMC_shared_SET(vtable_cache);
@@ -171,7 +174,8 @@ PMC *pt_shared_fixup(Parrot_Interp interpreter, PMC *pmc) {
/* don't want the referenced class disappearing on us */
LOCK_INTERPRETER(master);
type_num = pmc->vtable->base_type;
- SET_CLASS((SLOTTYPE*) PMC_data(pmc), pmc, master->vtables[type_num]->class);
+ SET_CLASS((SLOTTYPE*) PMC_data(pmc), pmc,
+ master->vtables[type_num]->class);
UNLOCK_INTERPRETER(master);
} else {
/* TODO this will need to change for thread pools
@@ -301,7 +305,8 @@ pt_thread_wait(Parrot_Interp interp) {
UNLOCK(interpreter_array_mutex);
pt_suspend_self_for_gc(interp);
LOCK(interpreter_array_mutex);
- /* while we were GCing, whatever we were waiting on might have changed */
+ /* while we were GCing, whatever we were waiting on might have
+ * changed */
return;
}
interp->thread_data->state |= THREAD_STATE_GC_WAKEUP;
@@ -355,10 +360,11 @@ thread_func(void *arg)
except = interpreter->exceptions;
/* XXX what should we really do here */
PIO_eprintf(interpreter,
- "Unhandled exception in thread with tid %d (message=%Ss, number=%d)\n",
- interpreter->thread_data->tid,
- except->msg,
- except->error);
+ "Unhandled exception in thread with tid %d "
+ "(message=%Ss, number=%d)\n",
+ interpreter->thread_data->tid,
+ except->msg,
+ except->error);
} else {
/* run normally */
push_new_c_exception_handler(interpreter, &exp);
@@ -916,14 +922,16 @@ pt_suspend_all_for_gc(Parrot_Interp interp)
continue;
}
if (is_suspended_for_gc(other_interp) &&
- other_interp != interp &&
- (other_interp->thread_data->state & THREAD_STATE_SUSPENDED_GC)) {
+ other_interp != interp &&
+ (other_interp->thread_data->state & THREAD_STATE_SUSPENDED_GC))
+ {
int successp;
/* this means that someone else already got this far,
* so we have a suspend event in our queue to ignore
*/
/* XXX still reachable? */
- TRACE_THREAD("apparently someone else is doing it [%p]", other_interp);
+ TRACE_THREAD("apparently someone else is doing it [%p]",
+ other_interp);
fprintf(stderr, "??? found later (%p)\n", other_interp);
successp = remove_queued_suspend_gc(interp);
assert(successp);
@@ -1351,14 +1359,16 @@ pt_DOD_start_mark(Parrot_Interp interpreter)
*/
LOCK(interpreter_array_mutex);
if (interpreter->thread_data->state & THREAD_STATE_SUSPENDED_GC) {
- assert(!(interpreter->thread_data->state & THREAD_STATE_SUSPEND_GC_REQUESTED));
+ assert(!(interpreter->thread_data->state &
+ THREAD_STATE_SUSPEND_GC_REQUESTED));
TRACE_THREAD("already suspended...");
UNLOCK(interpreter_array_mutex);
} else if (block_level) {
/* unthreaded collection */
TRACE_THREAD("... but blocked");
return; /* holding the lock */
- } else if (interpreter->thread_data->state & THREAD_STATE_SUSPEND_GC_REQUESTED) {
+ } else if (interpreter->thread_data->state &
+ THREAD_STATE_SUSPEND_GC_REQUESTED) {
while (remove_queued_suspend_gc(interpreter));
interpreter->thread_data->state &= ~THREAD_STATE_SUSPEND_GC_REQUESTED;
interpreter->thread_data->state |= THREAD_STATE_SUSPENDED_GC;
@@ -1434,7 +1444,8 @@ pt_DOD_stop_mark(Parrot_Interp interpreter)
UNLOCK(interpreter_array_mutex);
return;
}
- assert(!(interpreter->thread_data->state & THREAD_STATE_SUSPEND_GC_REQUESTED));
+ assert(!(interpreter->thread_data->state &
+ THREAD_STATE_SUSPEND_GC_REQUESTED));
interpreter->thread_data->state &= ~THREAD_STATE_SUSPENDED_GC;
while (remove_queued_suspend_gc(interpreter)) {
/* XXX FIXME make this message never trigger */
@@ -1443,7 +1454,9 @@ pt_DOD_stop_mark(Parrot_Interp interpreter)
TRACE_THREAD("%p: unlock", interpreter);
UNLOCK(interpreter_array_mutex);
TRACE_THREAD("wait to sweep");
- pt_gc_wait_for_stage(interpreter, THREAD_GC_STAGE_MARK, THREAD_GC_STAGE_SWEEP);
+ pt_gc_wait_for_stage(interpreter,
+ THREAD_GC_STAGE_MARK,
+ THREAD_GC_STAGE_SWEEP);
}
3  src/trace.c
View
@@ -43,7 +43,8 @@ trace_class_name(Interp *interpreter, PMC* pmc)
STRING *class_name;
if (PObj_is_class_TEST(pmc)) {
SLOTTYPE * const class_array = PMC_data(pmc);
- PMC * const class_name_pmc = get_attrib_num(class_array, PCD_CLASS_NAME);
+ PMC * const class_name_pmc = get_attrib_num(class_array,
+ PCD_CLASS_NAME);
class_name = PMC_str_val(class_name_pmc);
}
else
11 src/utils.c
View
@@ -410,7 +410,8 @@ C<how_random> is ignored.
INTVAL
Parrot_range_rand(INTVAL from, INTVAL to, INTVAL how_random)
{
- return (INTVAL)( from + ((double)(to - from)) * Parrot_float_rand(how_random) );
+ return (INTVAL)( from + ((double)(to - from))
+ * Parrot_float_rand(how_random) );
}
/*
@@ -512,12 +513,16 @@ Parrot_make_cpa(Interp *interpreter, PMC *array) {
to actually have an array, even if the inbound array is
completely empty
*/
- char ** const out_array = mem_sys_allocate((sizeof(char *)) * (arraylen + 1));
+ char ** const out_array = mem_sys_allocate((sizeof(char *))
+ * (arraylen + 1));
out_array[arraylen] = 0;
/* printf("String array has %i elements\n", arraylen);*/
for (cur = 0; cur < arraylen; cur++) {
- out_array[cur] = string_to_cstring(interpreter, VTABLE_get_string_keyed_int(interpreter, array, cur));
+ out_array[cur] =
+ string_to_cstring(interpreter,
+ VTABLE_get_string_keyed_int(interpreter,
+ array, cur));
/* printf("Offset %i is %s\n", cur, out_array[cur]);*/
}
40 t/distro/linelength.t
View
@@ -40,22 +40,23 @@ my $manifest = maniread("$build_dir/MANIFEST");
my $manifest_gen = maniread("$build_dir/MANIFEST.generated");
foreach my $file (sort keys(%$manifest)) {
- $file = "$build_dir/$file";
- # skip binary files (including .pbc files)
- next if -B $file;
- # skip missing MANIFEST.generated files
- next unless -e $file;
- next if exists($manifest_gen->{$file});
+ my $ffile = "$build_dir/$file";
- # I could make this other way, but this way is more flexible
- next if ($file =~ m!^$build_dir/languages/([^/]+)/! &&
- ! $check_language{$1});
+ # skip binary files (including .pbc files)
+ next if -B $ffile;
+ # skip missing MANIFEST.generated files
+ next unless -e $ffile;
+ next if exists($manifest_gen->{$file});
+ # I could make this other way, but this way is more flexible
+ next if ($ffile =~ m!^$build_dir/languages/([^/]+)/!
+ &&
+ ! $check_language{$1});
- push @files, $file if $file =~ m!\.c$!;
- push @files, $file if $file =~ m!\.pmc$!;
- push @files, $file if $file =~ m!\.pl$!;
+ push @files, $ffile if $file =~ m!\.c$!;
+ push @files, $ffile if $file =~ m!\.pmc$!;
+ push @files, $ffile if $file =~ m!\.pl$!;
}
plan tests => scalar @files;
@@ -63,15 +64,26 @@ check($_) for (@files);
sub check {
my $f = shift;
- my $g = $f;
+ my $l; # will hold the first line to be corrected
+
+ my $g = $f; # will hold the file to be corrected with relative path;
$g =~ s!^$build_dir/!!;
+
my $ok = 1;
+
open F, $f or die "Can't open file '$f'";
while ($ok && ($_ = <F>)) {
chomp;
$ok = 0 if length > $columns;
}
+ $l = $.; # save the line number for future reference
close F;
- ok($ok, $g);
+ # if not ok, print the line where the bug was first found, for
+ # easier correction;
+ if ($ok) {
+ ok($ok, $g)
+ } else {
+ ok($ok, "$g (line $l)")
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.