FYI- I just re-indented a bunch of code, using the tools/dev/run_indent.pl
script.
--Josh
------- Forwarded Message
Date: 02 Nov 2002 14:57:48 +0000
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: cvs commit: parrot chartype.c datatypes.c disassemble.c dod.c encoding
.c global_setup.c hash.c jit.c key.c method_util.c misc.c packdump.c
packout.c pdb.c pdump.c pmc.c pxs.c register.c res_lea.c resources.c
runops_cores.c rx.c rxstacks.c spf_render.c spf_vtable.c stacks.c str
ing.c sub.c warnings.c
cvsuser 02/11/02 06:57:48
Modified: . chartype.c datatypes.c disassemble.c dod.c
encoding.c global_setup.c hash.c jit.c key.c
method_util.c misc.c packdump.c packout.c pdb.c
pdump.c pmc.c pxs.c register.c res_lea.c
resources.c runops_cores.c rx.c rxstacks.c
spf_render.c spf_vtable.c stacks.c string.c sub.c
warnings.c
Log:
large-scale reindenting (run_indent.pl)
Revision Changes Path
1.8 +2 -2 parrot/chartype.c
Index: chartype.c
===================================================================
RCS file: /cvs/public/parrot/chartype.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -r1.7 -r1.8
--- chartype.c 18 Jul 2002 04:29:39 -0000 1.7
+++ chartype.c 2 Nov 2002 14:57:47 -0000 1.8
@@ -1,7 +1,7 @@
/* chartype.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: chartype.c,v 1.7 2002/07/18 04:29:39 mongo Exp $
+ * $Id: chartype.c,v 1.8 2002/11/02 14:57:47 josh Exp $
* Overview:
* This defines the string character type subsystem
* Data Structure and Algorithms:
1.3 +7 -7 parrot/datatypes.c
Index: datatypes.c
===================================================================
RCS file: /cvs/public/parrot/datatypes.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- datatypes.c 28 Oct 2002 13:58:36 -0000 1.2
+++ datatypes.c 2 Nov 2002 14:57:47 -0000 1.3
@@ -3,7 +3,7 @@
* Copyright: (c) 2002 Leopold Toetsch <[EMAIL PROTECTED]>
* License: Artistic/GPL, see README and LICENSES for details
* CVS Info
- * $Id: datatypes.c,v 1.2 2002/10/28 13:58:36 leo Exp $
+ * $Id: datatypes.c,v 1.3 2002/11/02 14:57:47 josh Exp $
* Overview:
* Parrot and native data types functions.
*/
1.4 +2 -2 parrot/disassemble.c
Index: disassemble.c
===================================================================
RCS file: /cvs/public/parrot/disassemble.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- disassemble.c 17 Aug 2002 01:11:08 -0000 1.3
+++ disassemble.c 2 Nov 2002 14:57:47 -0000 1.4
@@ -2,7 +2,7 @@
* disassemble.c
*
* CVS Info
- * $Id: disassemble.c,v 1.3 2002/08/17 01:11:08 sfink Exp $
+ * $Id: disassemble.c,v 1.4 2002/11/02 14:57:47 josh Exp $
* Overview:
* Parrot disassembler
* History:
1.26 +69 -72 parrot/dod.c
Index: dod.c
===================================================================
RCS file: /cvs/public/parrot/dod.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -w -r1.25 -r1.26
--- dod.c 28 Oct 2002 13:58:04 -0000 1.25
+++ dod.c 2 Nov 2002 14:57:47 -0000 1.26
@@ -1,7 +1,7 @@
/* dod.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: dod.c,v 1.25 2002/10/28 13:58:04 leo Exp $
+ * $Id: dod.c,v 1.26 2002/11/02 14:57:47 josh Exp $
* Overview:
* Handles dead object destruction of the various headers
* Data Structure and Algorithms:
@@ -224,7 +224,8 @@
* assumption, but it'll do for now */
for (i = 0; i < NUM_REGISTERS; i++) {
Buffer* reg = (Buffer *) interpreter->ctx.string_reg.registers[i];
- if (reg) buffer_lives(interpreter, reg);
+ if (reg)
+ buffer_lives(interpreter, reg);
}
/* The interpreter has a few strings of its own */
@@ -243,7 +244,8 @@
for (j = 0; j < cur_chunk->used; j++) {
for (i = 0; i < NUM_REGISTERS; i++) {
Buffer* reg = (Buffer *) cur_chunk->SReg[j].registers[i];
- if (reg) buffer_lives(interpreter, reg);
+ if (reg)
+ buffer_lives(interpreter, reg);
}
}
}
@@ -287,8 +289,7 @@
/* Run through all the buffer header pools and mark */
for (cur_arena = interpreter->arena_base->pmc_pool->last_Arena;
- NULL != cur_arena;
- cur_arena = cur_arena->prev) {
+ NULL != cur_arena; cur_arena = cur_arena->prev) {
PMC *pmc_array = cur_arena->start_objects;
for (i = 0; i < cur_arena->used; i++) {
/* If it's not live or on the free list, put it on the free list
.
@@ -298,9 +299,9 @@
if (!(pmc_array[i].flags & (PMC_live_FLAG | PMC_on_free_list_FLA
G |
PMC_constant_FLAG))) {
add_free_pmc(interpreter,
- interpreter->arena_base->pmc_pool,
- &pmc_array[i]);
- } else if(!(pmc_array[i].flags & PMC_on_free_list_FLAG)) {
+ interpreter->arena_base->pmc_pool, &pmc_array[i
]);
+ }
+ else if (!(pmc_array[i].flags & PMC_on_free_list_FLAG)) {
total_used++;
pmc_array[i].flags &= ~PMC_live_FLAG;
pmc_array[i].next_for_GC = NULL;
@@ -327,8 +328,7 @@
#ifdef LEA_DEBUG
/* check/clear tail, e.g. on changes in string.c or res.c */
for (cur_arena = pool->last_Arena;
- NULL != cur_arena;
- cur_arena = cur_arena->prev) {
+ NULL != cur_arena; cur_arena = cur_arena->prev) {
b = cur_arena->start_objects;
for (i = 0; i < cur_arena->used; i++) {
if ((b->flags & BUFFER_COW_FLAG) && b->bufstart &&
@@ -343,8 +343,7 @@
#endif
for (cur_arena = pool->last_Arena;
- NULL != cur_arena;
- cur_arena = cur_arena->prev) {
+ NULL != cur_arena; cur_arena = cur_arena->prev) {
b = cur_arena->start_objects;
for (i = 0; i < cur_arena->used; i++) {
if ((b->flags & BUFFER_COW_FLAG) &&
@@ -381,8 +380,7 @@
#endif /* GC_IS_MALLOC */
/* Run through all the buffer header pools and mark */
for (cur_arena = pool->last_Arena;
- NULL != cur_arena;
- cur_arena = cur_arena->prev) {
+ NULL != cur_arena; cur_arena = cur_arena->prev) {
Buffer *b = cur_arena->start_objects;
for (i = 0; i < cur_arena->used; i++) {
#ifdef GC_IS_MALLOC
@@ -397,15 +395,12 @@
* on_free_list and live, because of our conservative stack-walk
* collection. We must be wary of this case. */
if (!(b->flags & ( BUFFER_on_free_list_FLAG
- | BUFFER_constant_FLAG
- | BUFFER_live_FLAG )))
- {
+ | BUFFER_constant_FLAG | BUFFER_live_FLAG))) {
#ifndef GC_IS_MALLOC
if (pool->mem_pool) {
if (!(b->flags & BUFFER_COW_FLAG)) {
((struct Memory_Pool *)
- pool->mem_pool)->guaranteed_reclaimable +=
- b->buflen;
+ pool->mem_pool)->guaranteed_reclaimable += b->bufle
n;
}
((struct Memory_Pool *)
pool->mem_pool)->possibly_reclaimable += b->buflen;
@@ -422,7 +417,8 @@
else
#endif /* GC_IS_MALLOC */
add_free_buffer(interpreter, pool, b);
- } else if (!(b->flags & BUFFER_on_free_list_FLAG)) {
+ }
+ else if (!(b->flags & BUFFER_on_free_list_FLAG)) {
total_used++;
}
#ifdef GC_IS_MALLOC
@@ -443,7 +439,8 @@
/* Find a mask covering the longest common bit-prefix of val1 and val2 */
static size_t
-find_common_mask(size_t val1, size_t val2){
+find_common_mask(size_t val1, size_t val2)
+{
int i;
int bound = sizeof(size_t) * 8;
@@ -474,7 +471,8 @@
size_t pmc_max = get_max_pmc_address(interpreter);
size_t mask = find_common_mask(buffer_min < pmc_min ? buffer_min: pmc_mi
n,
- buffer_max > pmc_max ? buffer_max : pmc_max);
+ buffer_max >
+ pmc_max ? buffer_max : pmc_max);
/* Get the expected prefix */
prefix = mask & buffer_min;
@@ -496,15 +494,14 @@
* a live pmc/buffer, and could very well have its bufstart/vtab
le
* destroyed due to the linked list of free headers... */
if (pmc_min <= ptr && ptr < pmc_max &&
- is_pmc_ptr(interpreter,(void *)ptr))
- {
+ is_pmc_ptr(interpreter, (void *)ptr)) {
/* ...so ensure that mark_used checks PMC_on_free_list_FLAG
* before adding it to the next_for_GC list, to have
* vtable->mark() called. */
last = mark_used((PMC *)ptr, last);
- } else if (buffer_min <= ptr && ptr < buffer_max &&
- is_buffer_ptr(interpreter,(void *)ptr))
- {
+ }
+ else if (buffer_min <= ptr && ptr < buffer_max &&
+ is_buffer_ptr(interpreter, (void *)ptr)) {
/* ...and since buffer_lives doesn't care about bufstart,
* it doesn't really matter if it sets a flag */
buffer_lives(interpreter, (Buffer *)ptr);
1.7 +4 -4 parrot/encoding.c
Index: encoding.c
===================================================================
RCS file: /cvs/public/parrot/encoding.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- encoding.c 3 Apr 2002 14:49:05 -0000 1.6
+++ encoding.c 2 Nov 2002 14:57:47 -0000 1.7
@@ -1,7 +1,7 @@
/* encoding.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: encoding.c,v 1.6 2002/04/03 14:49:05 josh Exp $
+ * $Id: encoding.c,v 1.7 2002/11/02 14:57:47 josh Exp $
* Overview:
* This defines the string encoding subsystem
* Data Structure and Algorithms:
1.39 +2 -2 parrot/global_setup.c
Index: global_setup.c
===================================================================
RCS file: /cvs/public/parrot/global_setup.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -w -r1.38 -r1.39
--- global_setup.c 2 Nov 2002 02:06:16 -0000 1.38
+++ global_setup.c 2 Nov 2002 14:57:47 -0000 1.39
@@ -1,7 +1,7 @@
/* global_setup.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: global_setup.c,v 1.38 2002/11/02 02:06:16 josh Exp $
+ * $Id: global_setup.c,v 1.39 2002/11/02 14:57:47 josh Exp $
* Overview:
* Performs all the global setting up of things. This includes the
* (very few) global variables that Parrot totes around
1.30 +57 -51 parrot/hash.c
Index: hash.c
===================================================================
RCS file: /cvs/public/parrot/hash.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -w -r1.29 -r1.30
--- hash.c 2 Nov 2002 06:03:17 -0000 1.29
+++ hash.c 2 Nov 2002 14:57:47 -0000 1.30
@@ -1,7 +1,7 @@
/* hash.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: hash.c,v 1.29 2002/11/02 06:03:17 josh Exp $
+ * $Id: hash.c,v 1.30 2002/11/02 14:57:47 josh Exp $
* Overview:
* Data Structure and Algorithms:
* A hashtable contains an array of bucket indexes. Buckets
@@ -61,18 +61,22 @@
/* Is there a way to portably add inlining hints anymore? */
#define FIXME_INLINE
-static FIXME_INLINE HASHBUCKET* getBucket(HASH* hash, BucketIndex idx)
+static FIXME_INLINE HASHBUCKET *
+getBucket(HASH *hash, BucketIndex idx)
{
- if (idx == NULLBucketIndex) return NULL;
+ if (idx == NULLBucketIndex)
+ return NULL;
return &((HASHBUCKET*) hash->bucket_pool->bufstart)[idx];
}
-static FIXME_INLINE BucketIndex lookupBucketIndex(HASH* hash, HashIndex slot
)
+static FIXME_INLINE BucketIndex
+lookupBucketIndex(HASH *hash, HashIndex slot)
{
return ((BucketIndex*) hash->buffer.bufstart)[slot];
}
-static FIXME_INLINE HASHBUCKET* lookupBucket(HASH* hash, HashIndex slot)
+static FIXME_INLINE HASHBUCKET *
+lookupBucket(HASH *hash, HashIndex slot)
{
return getBucket(hash, lookupBucketIndex(hash, slot));
}
@@ -105,22 +109,25 @@
{
HashIndex i;
PIO_fprintf(interpreter, PIO_STDERR(interpreter),
- "Hashtable[%vd/%vd]\n",
- hash->entries, hash->max_chain + 1);
+ "Hashtable[%vd/%vd]\n", hash->entries, hash->max_chain + 1);
/* Iterate one past the end of the hashtable, so we can use the
* last value as a special case for dumping out the free bucket
* list. */
for (i = 0; i <= hash->max_chain + 1; i++) {
HASHBUCKET* bucket;
- if (i > hash->max_chain) bucket = getBucket(hash, hash->free_list);
- else bucket = lookupBucket(hash, i);
- if (bucket == NULL) continue;
+ if (i > hash->max_chain)
+ bucket = getBucket(hash, hash->free_list);
+ else
+ bucket = lookupBucket(hash, i);
+ if (bucket == NULL)
+ continue;
PIO_eprintf(interpreter, " Bucket %vd: ", i);
while (bucket) {
PIO_eprintf(interpreter, "type(%d)", bucket->value.type);
bucket = getBucket(hash, bucket->next);
- if (bucket) PIO_eprintf(interpreter, " -> ");
+ if (bucket)
+ PIO_eprintf(interpreter, " -> ");
}
PIO_eprintf(interpreter, "\n");
}
@@ -206,8 +213,7 @@
/* NULL out new space in table */
memset((HashIndex *) hash->buffer.bufstart + old_size,
- NULLBucketIndex,
- (new_size - old_size) * sizeof(BucketIndex));
+ NULLBucketIndex, (new_size - old_size) * sizeof(BucketIndex));
/* Warning: for efficiency, we cache the table in a local
* variable. If any possibly gc-triggering code is added to the
@@ -355,7 +361,8 @@
hash_get(Interp *interpreter, HASH *hash, STRING *key)
{
HASHBUCKET* bucket = hash_lookup(interpreter, hash, key);
- if (bucket == NULL) return NULL; /* Not found */
+ if (bucket == NULL)
+ return NULL; /* Not found */
return &bucket->value;
}
@@ -407,9 +414,7 @@
slot = hashval & hash->max_chain;
for (bucket = lookupBucket(hash, slot);
- bucket != NULL;
- bucket = getBucket(hash, bucket->next))
- {
+ bucket != NULL; bucket = getBucket(hash, bucket->next)) {
if (string_compare(interpreter, key, bucket->key) == 0) {
/* FIXME: If string_compare triggers a collection, both
* bucket and prev will end up pointing to junk memory.
@@ -456,8 +461,9 @@
case enum_hash_pmc:
valtmp.type = enum_hash_pmc;
- valtmp.val.pmc_val = b->value.val.pmc_val->vtable->clone(
- interp, b->value.val.pmc_val);
+ valtmp.val.pmc_val =
+ b->value.val.pmc_val->vtable->clone(interp,
+ b->value.val.pmc_val
);
/* b is no longer valid (due to GC) */
b = getBucket(hash, bi);
break;
1.35 +123 -126 parrot/jit.c
Index: jit.c
===================================================================
RCS file: /cvs/public/parrot/jit.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -w -r1.34 -r1.35
--- jit.c 2 Nov 2002 06:03:17 -0000 1.34
+++ jit.c 2 Nov 2002 14:57:47 -0000 1.35
@@ -1,7 +1,7 @@
/*
* jit.c
*
- * $Id: jit.c,v 1.34 2002/11/02 06:03:17 josh Exp $
+ * $Id: jit.c,v 1.35 2002/11/02 14:57:47 josh Exp $
*/
#include <parrot/parrot.h>
@@ -76,11 +76,11 @@
*/
/* Predereference the opcode information table for this opcode
- early since it's going to be used many times */
+ * early since it's going to be used many times */
op_info = &interpreter->op_info_table[*cur_op];
/* if op_info->jump is not 0 this opcode may jump,
- so mark this opcode as a branch source */
+ * so mark this opcode as a branch source */
if (op_info->jump)
branch[cur_op - code_start] = JIT_BRANCH_SOURCE;
/* If it's not a constant, no joy*/
@@ -133,7 +133,7 @@
cur_op = code_start;
while (cur_section) {
/* Predereference the opcode information for this opcode
- early since it's going to be used many times */
+ * early since it's going to be used many times */
op_info = &interpreter->op_info_table[*cur_op];
/* Calculate the next pc */
@@ -143,13 +143,13 @@
cur_section->op_count++;
/* If the opcode is jitted and calls a C function or it's not jitted
- at all, we will not count it. */
+ * at all, we will not count it. */
if (!op_jit[*cur_op].extcall) {
cur_section->jit_op_count++;
/* For each argument that has the opcode increment the usage cou
nt,
- right now, we are only ckecking integer registers.
- We move from the end since we need to check if the first opco
de
- using the register will read or write it. */
+ * right now, we are only ckecking integer registers.
+ * We move from the end since we need to check if the first opco
de
+ * using the register will read or write it. */
for (argn = op_info->arg_count - 1; argn > 0; argn--) {
if (op_info->types[argn] == PARROT_ARG_I) {
if ((!cur_section->int_reg_count[*(cur_op + argn)]++) &&
@@ -173,25 +173,24 @@
#endif
}
/* If we are here means the current section is jitted, so if the
- next opcode is not end the section. */
+ * next opcode is not end the section. */
if (next_op < code_end && op_jit[*next_op].extcall)
goto END_SECTION;
}
else
/* The current section is not jitted, end it if the next opcode
- is. */
+ * is. */
if (next_op < code_end && !op_jit[*next_op].extcall)
goto END_SECTION;
/* The section ends when the current opcode is a branch source,
- in other words if the opcode jumps, or if the next opcode is
- a branch target, allocate a new section only if it's not the
- last opcode */
+ * in other words if the opcode jumps, or if the next opcode is
+ * a branch target, allocate a new section only if it's not the
+ * last opcode */
if ((branch[cur_op - code_start] == JIT_BRANCH_SOURCE)
|| (next_op < code_end &&
(branch[next_op - code_start] == JIT_BRANCH_TARGET))
- || (next_op >= code_end))
- {
+ || (next_op >= code_end)) {
END_SECTION:
/* Set the type, depending on whether the current
* instruction is external or jitted. */
@@ -240,7 +239,7 @@
}
/* This is where we start deciding which Parrot registers get
- mapped to a hardware one in each different section. */
+ * mapped to a hardware one in each different section. */
/* Start from the first section */
cur_section = optimizer->sections;
@@ -255,15 +254,15 @@
cur_section->float_registers_used = 1;
#endif
/* Sort the registers by the usage,
- Start from the register number 1 since we compare it with the
- previous one */
+ * Start from the register number 1 since we compare it with the
+ * previous one */
for (i = 1; i < NUM_REGISTERS; i++) {
/* If the register is not used continue to the next one */
if (!cur_section->int_reg_count[i] &&
!cur_section->float_reg_count[i])
continue;
/* Count the number of hardware registers that is going to be
- used in this section */
+ * used in this section */
if (cur_section->int_registers_used < INT_REGISTERS_TO_MAP)
cur_section->int_registers_used++;
#if FLOAT_REGISTERS_TO_MAP
@@ -274,12 +273,12 @@
/* Any register before this one */
for (j = 0; j < i; j++) {
/* If the usage of this register is greater than the usage
- of the register in the j'th position of the list */
+ * of the register in the j'th position of the list */
if (cur_section->int_reg_count[i] >
cur_section->int_reg_count[cur_section->int_reg_usage[j]
])
{
/* Move all the registers from the j'th position to
- the next one */
+ * the next one */
for (k = i; k > j; k--)
cur_section->int_reg_usage[k] =
cur_section->int_reg_usage[k - 1];
@@ -291,10 +290,10 @@
}
#if FLOAT_REGISTERS_TO_MAP
if (cur_section->float_reg_count[i] >
- cur_section->float_reg_count[cur_section->float_reg_usage[j
]])
- {
+ cur_section->float_reg_count[cur_section->
+ float_reg_usage[j]]) {
/* Move all the registers from the j'th position to
- the next one */
+ * the next one */
for (k = i; k > j; k--)
cur_section->float_reg_usage[k] =
cur_section->float_reg_usage[k - 1];
@@ -308,11 +307,11 @@
}
}
/* Set the branch target of this section, that is the section where
- the program execution continues, if it ends in a branch source we
- use the branch target and not the next section. */
+ * the program execution continues, if it ends in a branch source we
+ * use the branch target and not the next section. */
if (optimizer->branch_list[cur_section->end - code_start]) {
/* If the branch target is to a section before the current one
- move from the start, otherwise from the current section */
+ * move from the start, otherwise from the current section */
if (optimizer->branch_list[cur_section->end - code_start] <
cur_section->begin)
t_section = optimizer->sections;
@@ -322,8 +321,7 @@
while (t_section) {
/* If we find the section attach it to the current one. */
if (t_section->begin ==
- optimizer->branch_list[cur_section->end - code_start])
- {
+ optimizer->branch_list[cur_section->end - code_start]) {
cur_section->branch_target = t_section;
break;
}
@@ -345,10 +343,8 @@
/* If the argument is in most used list */
for (i = 0; i < INT_REGISTERS_TO_MAP; i++)
if (cur_op[op_arg] ==
- (opcode_t)cur_section->int_reg_usage[i])
- {
- map[cur_op + op_arg - code_start] =
- intval_map[i];
+ (opcode_t)cur_section->int_reg_usage[i]) {
+ map[cur_op + op_arg - code_start] = intval_map[i
];
cur_section->maps++;
break;
}
@@ -359,8 +355,7 @@
/* If the argument is in most used list */
for (i = 0; i < FLOAT_REGISTERS_TO_MAP; i++)
if (cur_op[op_arg] ==
- (opcode_t)cur_section->float_reg_usage[i])
- {
+ (opcode_t)cur_section->float_reg_usage[i]) {
map[cur_op + op_arg - code_start] =
floatval_map[i];
cur_section->maps++;
@@ -456,8 +451,11 @@
/* Byte code size in opcode_t's */
jit_info.arena.map_size = (code_end - code_start) + 1;
- jit_info.arena.op_map = (Parrot_jit_opmap_t *)mem_sys_allocate(
- jit_info.arena.map_size * sizeof(*(jit_info.arena.op_map)) );
+ jit_info.arena.op_map =
+ (Parrot_jit_opmap_t *)mem_sys_allocate(jit_info.arena.map_size *
+ sizeof(*
+ (jit_info.arena.
+ op_map)));
/* This memory MUST be zeroed for conversion of offsets to pointers to
* work later
@@ -502,14 +500,13 @@
jit_info.cur_op = jit_info.optimizer->cur_section->begin;
/* The first opcode of each section doesn't have a previous one sinc
e
- it's imposible to be sure which was it */
+ * it's imposible to be sure which was it */
jit_info.prev_op = NULL;
while (jit_info.cur_op <= jit_info.optimizer->cur_section->end) {
/* Grow the arena early */
if (jit_info.arena.size <
- (jit_info.arena.op_map[jit_info.op_i].offset + 100))
- {
+ (jit_info.arena.op_map[jit_info.op_i].offset + 100)) {
#if REQUIRES_CONSTANT_POOL
Parrot_jit_extend_arena(&jit_info);
#else
@@ -525,9 +522,9 @@
cur_opcode_byte = *jit_info.cur_op;
/* Need to save the registers if there is a branch and is not to
- the same section, I admit I don't like this, and it should be
- really checking if the target section has the same registers
- mapped too. */
+ * the same section, I admit I don't like this, and it should be
+ * really checking if the target section has the same registers
+ * mapped too. */
if ((jit_info.optimizer->map_branch[jit_info.cur_op - code_start
]
== JIT_BRANCH_SOURCE) &&
(jit_info.optimizer->cur_section->branch_target !=
1.33 +12 -12 parrot/key.c
Index: key.c
===================================================================
RCS file: /cvs/public/parrot/key.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -w -r1.32 -r1.33
--- key.c 21 Oct 2002 08:46:59 -0000 1.32
+++ key.c 2 Nov 2002 14:57:47 -0000 1.33
@@ -1,7 +1,7 @@
/* key.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: key.c,v 1.32 2002/10/21 08:46:59 sfink Exp $
+ * $Id: key.c,v 1.33 2002/11/02 14:57:47 josh Exp $
* Overview:
* The base vtable calling functions.
* Data Structure and Algorithms:
1.7 +31 -30 parrot/method_util.c
Index: method_util.c
===================================================================
RCS file: /cvs/public/parrot/method_util.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- method_util.c 21 Oct 2002 08:46:59 -0000 1.6
+++ method_util.c 2 Nov 2002 14:57:47 -0000 1.7
@@ -1,7 +1,7 @@
/* method_util.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: method_util.c,v 1.6 2002/10/21 08:46:59 sfink Exp $
+ * $Id: method_util.c,v 1.7 2002/11/02 14:57:47 josh Exp $
* Overview:
* Utility functions to handle Parrot calling conventions, lookup
* methods, etc.
@@ -79,8 +79,7 @@
Parrot_push_proto(struct Parrot_Interp * interp,
INTVAL intc, INTVAL * intv,
INTVAL numc, FLOATVAL * numv,
- INTVAL strc, STRING ** strv,
- INTVAL pmcc, PMC ** pmcv)
+ INTVAL strc, STRING **strv, INTVAL pmcc, PMC **pmcv)
{
int npush; /* overflow params */
interp->ctx.int_reg.registers[0] = 1; /* with proto */
@@ -126,12 +125,12 @@
* Lookup a method in a method stash.
*/
PMC *
-Parrot_find_method(struct Parrot_Interp * interp, struct Stash * stash,
- PMC * key)
+Parrot_find_method(struct Parrot_Interp *interp, struct Stash *stash, PMC *k
ey)
{
while (stash) {
- PMC * meth = stash->stash_hash->vtable
- ->get_pmc_keyed(interp, stash->stash_hash, key);
+ PMC *meth =
+ stash->stash_hash->vtable->get_pmc_keyed(interp, stash->stash_ha
sh,
+ key);
if (meth)
return meth;
stash = stash->parent_stash;
@@ -150,7 +149,8 @@
size_t i;
for ( ; cur_stack; cur_stack = cur_stack->prev) {
- if (cur_stack->buffer == NULL) continue;
+ if (cur_stack->buffer == NULL)
+ continue;
buffer_lives(interpreter, cur_stack->buffer);
entry = (Stack_Entry_t *)(cur_stack->buffer->bufstart);
@@ -159,7 +159,8 @@
entry[i].entry.pmc_val) {
end_of_used_list = mark_used(entry[i].entry.pmc_val,
end_of_used_list);
- } else if (STACK_ENTRY_STRING == entry[i].entry_type &&
+ }
+ else if (STACK_ENTRY_STRING == entry[i].entry_type &&
entry[i].entry.string_val) {
buffer_lives(interpreter, (Buffer *)entry[i].entry.string_va
l);
}
1.28 +2 -2 parrot/misc.c
Index: misc.c
===================================================================
RCS file: /cvs/public/parrot/misc.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -w -r1.27 -r1.28
--- misc.c 15 Oct 2002 18:39:19 -0000 1.27
+++ misc.c 2 Nov 2002 14:57:47 -0000 1.28
@@ -1,7 +1,7 @@
/* misc.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: misc.c,v 1.27 2002/10/15 18:39:19 leo Exp $
+ * $Id: misc.c,v 1.28 2002/11/02 14:57:47 josh Exp $
* Overview:
* Miscellaneous functions, mainly the Parrot_sprintf family
* Data Structure and Algorithms:
1.6 +9 -9 parrot/packdump.c
Index: packdump.c
===================================================================
RCS file: /cvs/public/parrot/packdump.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- packdump.c 29 Oct 2002 13:43:03 -0000 1.5
+++ packdump.c 2 Nov 2002 14:57:47 -0000 1.6
@@ -7,7 +7,7 @@
** This program is free software. It is subject to the same
** license as Parrot itself.
**
-** $Id: packdump.c,v 1.5 2002/10/29 13:43:03 leo Exp $
+** $Id: packdump.c,v 1.6 2002/11/02 14:57:47 josh Exp $
*/
#include "parrot/parrot.h"
1.15 +58 -57 parrot/packout.c
Index: packout.c
===================================================================
RCS file: /cvs/public/parrot/packout.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -r1.14 -r1.15
--- packout.c 2 Nov 2002 02:27:28 -0000 1.14
+++ packout.c 2 Nov 2002 14:57:47 -0000 1.15
@@ -7,7 +7,7 @@
** This program is free software. It is subject to the same
** license as Parrot itself.
**
-** $Id: packout.c,v 1.14 2002/11/02 02:27:28 josh Exp $
+** $Id: packout.c,v 1.15 2002/11/02 14:57:47 josh Exp $
** History:
** Rework by Melvin; new bytecode format, make bytecode portable.
** (Do endian conversion and wordsize transforms on the fly.)
@@ -216,7 +216,8 @@
* key constant is in constant table,
* so we search for it @�$&
*/
-static int find_in_const(PMC *key, int type)
+static int
+find_in_const(PMC *key, int type)
{
int i;
for (i = 0 ; i < ct->const_count; i++)
@@ -230,6 +231,7 @@
exit(1);
return 0;
}
+
/***************************************
Pack a PackFile Constant into a contiguous region of memory. NOTE: The memor
y
block had better have at least the amount of memory indicated by
@@ -285,8 +287,7 @@
padded_size = self->string->bufused;
if (padded_size % sizeof(opcode_t)) {
- padded_size += sizeof(opcode_t) -
- (padded_size % sizeof(opcode_t));
+ padded_size += sizeof(opcode_t) - (padded_size % sizeof(opcode_t
));
}
/* Include space for flags, encoding, type, and size fields. */
1.6 +3 -3 parrot/pdb.c
Index: pdb.c
===================================================================
RCS file: /cvs/public/parrot/pdb.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- pdb.c 26 Aug 2002 14:15:45 -0000 1.5
+++ pdb.c 2 Nov 2002 14:57:47 -0000 1.6
@@ -2,7 +2,7 @@
* pdb.c
*
* CVS Info
- * $Id: pdb.c,v 1.5 2002/08/26 14:15:45 grunblatt Exp $
+ * $Id: pdb.c,v 1.6 2002/11/02 14:57:47 josh Exp $
* Overview:
* The Parrot debugger
* History:
1.16 +3 -4 parrot/pdump.c
Index: pdump.c
===================================================================
RCS file: /cvs/public/parrot/pdump.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -r1.15 -r1.16
--- pdump.c 2 Nov 2002 03:36:13 -0000 1.15
+++ pdump.c 2 Nov 2002 14:57:47 -0000 1.16
@@ -1,7 +1,7 @@
/* pdump.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: pdump.c,v 1.15 2002/11/02 03:36:13 josh Exp $
+ * $Id: pdump.c,v 1.16 2002/11/02 14:57:47 josh Exp $
* Overview:
* A program to dump pack files to human readable form.
* Data Structure and Algorithms:
@@ -13,8 +13,7 @@
#include "parrot/packfile.h"
#include "parrot/interpreter.h"
-void PackFile_dump (struct Parrot_Interp *interpreter,
- struct PackFile *pf);
+void PackFile_dump(struct Parrot_Interp *interpreter, struct PackFile *pf);
int
main(int argc, char **argv)
1.20 +2 -2 parrot/pmc.c
Index: pmc.c
===================================================================
RCS file: /cvs/public/parrot/pmc.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -r1.19 -r1.20
--- pmc.c 19 Oct 2002 16:05:36 -0000 1.19
+++ pmc.c 2 Nov 2002 14:57:47 -0000 1.20
@@ -1,7 +1,7 @@
/* pmc.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: pmc.c,v 1.19 2002/10/19 16:05:36 leo Exp $
+ * $Id: pmc.c,v 1.20 2002/11/02 14:57:47 josh Exp $
* Overview:
* The base vtable calling functions.
* Data Structure and Algorithms:
1.6 +40 -25 parrot/pxs.c
Index: pxs.c
===================================================================
RCS file: /cvs/public/parrot/pxs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- pxs.c 14 Sep 2002 13:51:34 -0000 1.5
+++ pxs.c 2 Nov 2002 14:57:47 -0000 1.6
@@ -7,76 +7,91 @@
#include "parrot/pxs.h"
int
-PXS_initargs(Parrot_Interp_t interp) {
+PXS_initargs(Parrot_Interp_t interp)
+{
INTVAL numargs;
stack_pop(interp, &interp->user_stack, &numargs, STACK_ENTRY_INT);
return numargs;
}
void
-PXS_reti(Parrot_Interp_t interp, INTVAL i) {
+PXS_reti(Parrot_Interp_t interp, INTVAL i)
+{
stack_push(interp, &interp->user_stack, &i, STACK_ENTRY_INT,
STACK_CLEANUP_NULL);
}
void
-PXS_retn(Parrot_Interp_t interp, FLOATVAL f) {
+PXS_retn(Parrot_Interp_t interp, FLOATVAL f)
+{
stack_push(interp, &interp->user_stack, &f, STACK_ENTRY_FLOAT,
STACK_CLEANUP_NULL);
}
void
-PXS_rets(Parrot_Interp_t interp, STRING * s) {
+PXS_rets(Parrot_Interp_t interp, STRING *s)
+{
stack_push(interp, &interp->user_stack, s, STACK_ENTRY_STRING,
STACK_CLEANUP_NULL);
}
void
-PXS_retp(Parrot_Interp_t interp, PMC * p) {
+PXS_retp(Parrot_Interp_t interp, PMC *p)
+{
stack_push(interp, &interp->user_stack, p, STACK_ENTRY_PMC,
STACK_CLEANUP_NULL);
}
INTVAL
-PXS_shifti(Parrot_Interp_t interp) {
+PXS_shifti(Parrot_Interp_t interp)
+{
INTVAL i;
stack_pop(interp, &interp->user_stack, &i, STACK_ENTRY_INT);
return i;
}
FLOATVAL
-PXS_shiftn(Parrot_Interp_t interp) {
+PXS_shiftn(Parrot_Interp_t interp)
+{
FLOATVAL f;
stack_pop(interp, &interp->user_stack, &f, STACK_ENTRY_FLOAT);
return f;
}
STRING *
-PXS_shifts(Parrot_Interp_t interp) {
+PXS_shifts(Parrot_Interp_t interp)
+{
STRING * s;
stack_pop(interp, &interp->user_stack, &s, STACK_ENTRY_STRING);
return s;
}
-char * PXS_shiftcs(Parrot_Interp_t interp) {
+char *
+PXS_shiftcs(Parrot_Interp_t interp)
+{
STRING * s;
stack_pop(interp, &interp->user_stack, &s, STACK_ENTRY_STRING);
return string_to_cstring(interp, s);
}
PMC *
-PXS_shiftp(Parrot_Interp_t interp) {
+PXS_shiftp(Parrot_Interp_t interp)
+{
PMC * p;
stack_pop(interp, &interp->user_stack, &p, STACK_ENTRY_PMC);
return p;
}
-INTVAL PXS_findop(Parrot_Interp_t interp, const char * opname) {
+INTVAL
+PXS_findop(Parrot_Interp_t interp, const char *opname)
+{
int op = interp->op_lib->op_code(opname, 1);
return op;
}
-PMC * PXS_pointer(Parrot_Interp_t interp, void * object) {
+PMC *
+PXS_pointer(Parrot_Interp_t interp, void *object)
+{
PMC * p = new_pmc_header(interp);
p->data = object;
p->vtable = YOU_LOSE_VTABLE;
1.24 +11 -8 parrot/register.c
Index: register.c
===================================================================
RCS file: /cvs/public/parrot/register.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -w -r1.23 -r1.24
--- register.c 4 Jul 2002 20:39:44 -0000 1.23
+++ register.c 2 Nov 2002 14:57:47 -0000 1.24
@@ -1,7 +1,7 @@
/* register.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: register.c,v 1.23 2002/07/04 20:39:44 mrjoltcola Exp $
+ * $Id: register.c,v 1.24 2002/11/02 14:57:47 josh Exp $
* Overview:
* Register handling routines
* Data Structure and Algorithms:
@@ -21,7 +21,8 @@
/* Do we have any space in the current savestack? If so, memcpy
* down */
if (interpreter->ctx.int_reg_top->free) {
- memcpy(&interpreter->ctx.int_reg_top->IReg[interpreter->ctx.int_reg_
top->used],
+ memcpy(&interpreter->ctx.int_reg_top->
+ IReg[interpreter->ctx.int_reg_top->used],
&interpreter->ctx.int_reg, sizeof(struct IReg));
interpreter->ctx.int_reg_top->free--;
interpreter->ctx.int_reg_top->used++;
@@ -176,7 +177,8 @@
/* Do we have any space in the current savestack? If so, memcpy
* down */
if (interpreter->ctx.num_reg_top->free) {
- memcpy(&interpreter->ctx.num_reg_top->NReg[interpreter->ctx.num_reg_
top->used],
+ memcpy(&interpreter->ctx.num_reg_top->
+ NReg[interpreter->ctx.num_reg_top->used],
&interpreter->ctx.num_reg, sizeof(struct NReg));
interpreter->ctx.num_reg_top->free--;
interpreter->ctx.num_reg_top->used++;
@@ -253,7 +255,8 @@
/* Do we have any space in the current savestack? If so, memcpy
* down */
if (interpreter->ctx.pmc_reg_top->free) {
- memcpy(&interpreter->ctx.pmc_reg_top->PReg[interpreter->ctx.pmc_reg_
top->used],
+ memcpy(&interpreter->ctx.pmc_reg_top->
+ PReg[interpreter->ctx.pmc_reg_top->used],
&interpreter->ctx.pmc_reg, sizeof(struct PReg));
interpreter->ctx.pmc_reg_top->free--;
interpreter->ctx.pmc_reg_top->used++;
1.3 +5 -5 parrot/res_lea.c
Index: res_lea.c
===================================================================
RCS file: /cvs/public/parrot/res_lea.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
1.96 +69 -72 parrot/resources.c
Index: resources.c
===================================================================
RCS file: /cvs/public/parrot/resources.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -w -r1.95 -r1.96
--- resources.c 2 Nov 2002 03:03:15 -0000 1.95
+++ resources.c 2 Nov 2002 14:57:47 -0000 1.96
@@ -1,7 +1,7 @@
/* resources.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: resources.c,v 1.95 2002/11/02 03:03:15 josh Exp $
+ * $Id: resources.c,v 1.96 2002/11/02 14:57:47 josh Exp $
* Overview:
* Allocate and deallocate tracked resources
* Data Structure and Algorithms:
@@ -118,8 +118,7 @@
> (size_t)(pool->total_allocated * pool->reclaim_factor)
/* don't bother reclaiming if it won't even be enough */
&& (pool->guaranteed_reclaimable > size)
- )
- {
+ ) {
(*pool->compact)(interpreter, pool);
}
else {
@@ -152,15 +151,13 @@
buffer_movable(UINTVAL flags)
{
UINTVAL mask = BUFFER_on_free_list_FLAG
- | BUFFER_constant_FLAG
- | BUFFER_immobile_FLAG
- | BUFFER_external_FLAG;
+ | BUFFER_constant_FLAG | BUFFER_immobile_FLAG | BUFFER_external_FLAG
;
return !(flags & mask);
}
/* Compact the buffer pool */
-static void compact_pool(struct Parrot_Interp *interpreter,
- struct Memory_Pool *pool)
+static void
+compact_pool(struct Parrot_Interp *interpreter, struct Memory_Pool *pool)
{
UINTVAL total_size;
struct Memory_Block *new_block; /* A pointer to our working block
*/
@@ -207,24 +204,27 @@
/* Run through all the Buffer header pools and copy */
for (j = -2; j < (INTVAL) interpreter->arena_base->num_sized; j++) {
- if (j == -2) header_pool = interpreter->arena_base->buffer_header_po
ol;
- else if (j == -1) header_pool =
- interpreter->arena_base->string_header_pool;
- else header_pool = interpreter->arena_base->sized_header_pools[j];
- if (header_pool == NULL) continue;
+ if (j == -2)
+ header_pool = interpreter->arena_base->buffer_header_pool;
+ else if (j == -1)
+ header_pool = interpreter->arena_base->string_header_pool;
+ else
+ header_pool = interpreter->arena_base->sized_header_pools[j];
+ if (header_pool == NULL)
+ continue;
object_size = header_pool->object_size;
for (cur_buffer_arena = header_pool->last_Arena;
NULL != cur_buffer_arena;
- cur_buffer_arena = cur_buffer_arena->prev)
- {
+ cur_buffer_arena = cur_buffer_arena->prev) {
Buffer *b = cur_buffer_arena->start_objects;
UINTVAL i;
for (i = 0; i < cur_buffer_arena->used; i++) {
if (b->bufstart && buffer_movable(b->flags)) {
struct Buffer_Tail *tail =
- (struct Buffer_Tail *)((char *)b->bufstart +b->bufle
n);
+ (struct Buffer_Tail *)((char *)b->bufstart +
+ b->buflen);
ptrdiff_t offset = 0;
/* we can't perform the math all the time,
* because strstart might be in unallocated memory */
@@ -234,8 +234,7 @@
}
/* buffer has already been moved; just change the header
*/
if (b->flags & BUFFER_COW_FLAG
- && tail->flags & TAIL_moved_FLAG)
- {
+ && tail->flags & TAIL_moved_FLAG) {
/* Find out who else references our data */
Buffer* hdr = *(Buffer**)(b->bufstart);
/* Make sure they know that we own it too */
@@ -250,8 +249,7 @@
offset;
}
}
- else if (!(b->flags & BUFFER_external_FLAG))
- {
+ else if (!(b->flags & BUFFER_external_FLAG)) {
struct Buffer_Tail *new_tail =
(struct Buffer_Tail *)((char *)cur_spot +
b->buflen);
@@ -292,9 +290,7 @@
* that data will get duplicated during this collection run. */
for (j = 0;
j < (INTVAL)( interpreter->arena_base->extra_buffer_headers.buflen
/
- sizeof(Buffer*) );
- j++
- ) {
+ sizeof(Buffer *)); j++) {
Buffer** buffers =
interpreter->arena_base->extra_buffer_headers.bufstart;
Buffer* b = buffers[j];
@@ -345,7 +341,7 @@
/* Note that we don't have it any more */
interpreter->memory_allocated -= cur_block->size;
/* We know the pool body and pool header are a single chunk, so
- this is enough to get rid of 'em both */
+ * this is enough to get rid of 'em both */
mem_sys_free(cur_block);
cur_block = next_block;
}
@@ -394,7 +390,8 @@
interpreter->arena_base->memory_pool->possibly_reclaimable +=
buffer->buflen;
mem = mem_allocate(interpreter, &alloc_size,
- interpreter->arena_base->memory_pool, BUFFER_ALIGNMENT-1);
+ interpreter->arena_base->memory_pool,
+ BUFFER_ALIGNMENT - 1);
if (!mem) {
return NULL;
@@ -456,7 +453,9 @@
((Buffer *)buffer)->buflen = 0;
((Buffer *)buffer)->bufstart = NULL;
((Buffer *)buffer)->bufstart = mem_allocate(interpreter, &req_size,
- interpreter->arena_base->memory_pool, BUFFER_ALIGNMENT-1);
+ interpreter->arena_base->
+ memory_pool,
+ BUFFER_ALIGNMENT - 1);
((Buffer *)buffer)->buflen = size;
return buffer;
}
@@ -520,10 +519,8 @@
*/
interpreter->arena_base->memory_pool =
- new_memory_pool(32768,
- &compact_pool);
- alloc_new_block(interpreter, 32768,
- interpreter->arena_base->memory_pool);
+ new_memory_pool(32768, &compact_pool);
+ alloc_new_block(interpreter, 32768, interpreter->arena_base->memory_pool
);
/* Constant strings - not compacted */
interpreter->arena_base->constant_string_pool =
1.25 +7 -6 parrot/runops_cores.c
Index: runops_cores.c
===================================================================
RCS file: /cvs/public/parrot/runops_cores.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -w -r1.24 -r1.25
--- runops_cores.c 2 Nov 2002 02:27:28 -0000 1.24
+++ runops_cores.c 2 Nov 2002 14:57:47 -0000 1.25
@@ -1,7 +1,7 @@
/* runops_cores.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: runops_cores.c,v 1.24 2002/11/02 02:27:28 josh Exp $
+ * $Id: runops_cores.c,v 1.25 2002/11/02 14:57:47 josh Exp $
* Overview:
* The switchable runops cores.
* Data Structure and Algorithms:
@@ -52,7 +52,8 @@
pc = cg_core(pc, interpreter);
return pc;
#else
- PIO_eprintf(interpreter, "Computed goto unavailable in this configuratio
n.\n");
+ PIO_eprintf(interpreter,
+ "Computed goto unavailable in this configuration.\n");
exit(1);
return NULL;
#endif
1.20 +2 -2 parrot/rx.c
Index: rx.c
===================================================================
RCS file: /cvs/public/parrot/rx.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -r1.19 -r1.20
--- rx.c 9 Oct 2002 04:26:49 -0000 1.19
+++ rx.c 2 Nov 2002 14:57:47 -0000 1.20
@@ -1,7 +1,7 @@
/* rx.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: rx.c,v 1.19 2002/10/09 04:26:49 sfink Exp $
+ * $Id: rx.c,v 1.20 2002/11/02 14:57:47 josh Exp $
* Overview:
* Supporting file for the regular expression engine
* Data Structure and Algorithms:
1.9 +6 -4 parrot/rxstacks.c
Index: rxstacks.c
===================================================================
RCS file: /cvs/public/parrot/rxstacks.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -r1.8 -r1.9
--- rxstacks.c 22 Aug 2002 20:08:24 -0000 1.8
+++ rxstacks.c 2 Nov 2002 14:57:47 -0000 1.9
@@ -1,7 +1,7 @@
/* rxstacks.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: rxstacks.c,v 1.8 2002/08/22 20:08:24 dan Exp $
+ * $Id: rxstacks.c,v 1.9 2002/11/02 14:57:47 josh Exp $
* Overview:
* Regex stack handling routines for Parrot
* Data Structure and Algorithms:
@@ -102,7 +102,8 @@
}
-void intstack_free (struct Parrot_Interp *interpreter, IntStack stack)
+void
+intstack_free(struct Parrot_Interp *interpreter, IntStack stack)
{
IntStack chunk, temp;
@@ -113,6 +114,7 @@
mem_sys_free(stack);
}
+
/*
* Local variables:
* c-indentation-style: bsd
1.8 +18 -16 parrot/spf_render.c
Index: spf_render.c
===================================================================
RCS file: /cvs/public/parrot/spf_render.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -r1.7 -r1.8
--- spf_render.c 2 Nov 2002 02:06:16 -0000 1.7
+++ spf_render.c 2 Nov 2002 14:57:47 -0000 1.8
@@ -1,7 +1,7 @@
/* spf_render.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: spf_render.c,v 1.7 2002/11/02 02:06:16 josh Exp $
+ * $Id: spf_render.c,v 1.8 2002/11/02 14:57:47 josh Exp $
* Overview:
* Implements the main function that drives the Parrot_sprintf
* family and its utility functions.
@@ -507,7 +507,8 @@
break;
case 'x':
- theuint = obj->getuint(interpreter, info.type, o
bj);
+ theuint =
+ obj->getuint(interpreter, info.type, obj);
uint_to_str(interpreter, ts, tc, theuint, 16);
handle_flags(interpreter, &info, ts, 1, "0x");
@@ -591,7 +592,8 @@
UINTVAL i;
for(i=0; i < strlen(tc); i++) {
if(tolower(tc[i]) == 'e' &&
- (tc[i+1] == '+' || tc[i+1] == '-'))
{
+ (tc[i + 1] == '+'
+ || tc[i + 1] == '-')) {
tc[i+2]='\0';
strcat(tc, &(tc[i+3]));
}
1.6 +107 -101 parrot/spf_vtable.c
Index: spf_vtable.c
===================================================================
RCS file: /cvs/public/parrot/spf_vtable.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- spf_vtable.c 25 Oct 2002 15:09:51 -0000 1.5
+++ spf_vtable.c 2 Nov 2002 14:57:47 -0000 1.6
@@ -1,7 +1,7 @@
/* spf_vtable.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: spf_vtable.c,v 1.5 2002/10/25 15:09:51 leo Exp $
+ * $Id: spf_vtable.c,v 1.6 2002/11/02 14:57:47 josh Exp $
* Overview:
* Implements the two families of functions Parrot_sprintf
* may use to retrieve arguments.
@@ -195,12 +195,14 @@
{
STRING *s;
PMC *tmp = ((PMC *) obj->data)->vtable->get_pmc_keyed_int(interpreter,
- ((PMC *) obj->data),
+ ((PMC *)obj->
+ data),
&(obj->index));
obj->index++;
s = tmp->vtable->get_string(interpreter, tmp);
/* XXX string_copy like below? + adjusting bufused */
- return string_make(interpreter, s->strstart, 1, 0, BUFFER_external_FLAG,
0);
+ return string_make(interpreter, s->strstart, 1, 0, BUFFER_external_FLAG,
+ 0);
}
static HUGEINTVAL
@@ -208,7 +210,8 @@
{
HUGEINTVAL ret;
PMC *tmp = ((PMC *) obj->data)->vtable->get_pmc_keyed_int(interpreter,
- ((PMC *) obj->
data),
+ ((PMC *)obj->
+ data),
&(obj->index))
;
obj->index++;
ret = (HUGEINTVAL) (tmp->vtable->get_integer(interpreter, tmp));
@@ -234,7 +237,8 @@
{
UHUGEINTVAL ret;
PMC *tmp = ((PMC *) obj->data)->vtable->get_pmc_keyed_int(interpreter,
- ((PMC *) obj->
data),
+ ((PMC *)obj->
+ data),
&(obj->index))
;
obj->index++;
ret = (UHUGEINTVAL) (tmp->vtable->get_integer(interpreter, tmp));
@@ -260,7 +264,8 @@
{
HUGEFLOATVAL ret;
PMC *tmp = ((PMC *) obj->data)->vtable->get_pmc_keyed_int(interpreter,
- ((PMC *) obj->
data),
+ ((PMC *)obj->
+ data),
&(obj->index))
;
obj->index++;
ret = (HUGEFLOATVAL) (tmp->vtable->get_number(interpreter, tmp));
@@ -280,12 +285,12 @@
}
static STRING *
-getstring_pmc(struct Parrot_Interp *interpreter,
- INTVAL size, SPRINTF_OBJ * obj)
+getstring_pmc(struct Parrot_Interp *interpreter, INTVAL size, SPRINTF_OBJ *o
bj)
{
STRING *s;
PMC *tmp = ((PMC *) obj->data)->vtable->get_pmc_keyed_int(interpreter,
- ((PMC *) obj->data),
+ ((PMC *)obj->
+ data),
&(obj->index));
obj->index++;
s = (STRING *)(tmp->vtable->get_string(interpreter, tmp));
@@ -296,7 +301,8 @@
getptr_pmc(struct Parrot_Interp *interpreter, INTVAL size, SPRINTF_OBJ * obj
)
{
PMC *tmp = ((PMC *) obj->data)->vtable->get_pmc_keyed_int(interpreter,
- ((PMC *) obj->
data),
+ ((PMC *)obj->
+ data),
&(obj->index))
;
obj->index++;
/* XXX correct? */
1.46 +77 -78 parrot/stacks.c
Index: stacks.c
===================================================================
RCS file: /cvs/public/parrot/stacks.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -w -r1.45 -r1.46
--- stacks.c 17 Aug 2002 01:11:08 -0000 1.45
+++ stacks.c 2 Nov 2002 14:57:47 -0000 1.46
@@ -1,7 +1,7 @@
/* stacks.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: stacks.c,v 1.45 2002/08/17 01:11:08 sfink Exp $
+ * $Id: stacks.c,v 1.46 2002/11/02 14:57:47 josh Exp $
* Overview:
* Stack handling routines for Parrot
* Data Structure and Algorithms:
@@ -49,7 +49,8 @@
}
void
-stack_mark_cow(Stack_Chunk_t *stack) {
+stack_mark_cow(Stack_Chunk_t *stack)
+{
Stack_Chunk_t * chunk = stack;
chunk->flags |= STACK_CHUNK_COW_FLAG;
for (chunk = chunk->prev; chunk; chunk = chunk->prev)
@@ -74,7 +75,8 @@
* references, fix this to do COW by chunk.
*/
Stack_Chunk_t *
-stack_copy(struct Parrot_Interp * interp, Stack_Chunk_t *old_top) {
+stack_copy(struct Parrot_Interp *interp, Stack_Chunk_t *old_top)
+{
Stack_Chunk_t *old_chunk = old_top;
Stack_Chunk_t *new_chunk;
Stack_Chunk_t *new_top = NULL;
@@ -126,8 +128,7 @@
/* For negative depths, look from the bottom of the stack up. */
if (depth < 0) {
/* FIXME: Non-circular stack makes this rare case slow */
- for(chunk = stack; chunk->prev; chunk = chunk->prev)
- ;
+ for (chunk = stack; chunk->prev; chunk = chunk->prev);
offset = (size_t)-depth;
while (chunk != NULL && offset >= chunk->used) {
offset -= chunk->used;
@@ -160,8 +161,7 @@
is bubble down, so that the Nth element becomes the top most element.
*/
void
-rotate_entries(Interp *interpreter, Stack_Chunk_t *stack,
- Intval num_entries)
+rotate_entries(Interp *interpreter, Stack_Chunk_t *stack, Intval num_entries
)
{
Stack_Entry_t temp;
Intval i;
@@ -258,8 +258,7 @@
entry->entry_type = type;
/* If we were passed a cleanup function, mark the flag entry
* for this as needing cleanup */
- entry->flags = (cleanup ? STACK_ENTRY_CLEANUP_FLAG
- : NO_STACK_ENTRY_FLAGS);
+ entry->flags = (cleanup ? STACK_ENTRY_CLEANUP_FLAG : NO_STACK_ENTRY_FLAG
S);
/* Remember the cleanup function */
entry->cleanup = cleanup;
/* Store our thing */
1.104 +79 -75 parrot/string.c
Index: string.c
===================================================================
RCS file: /cvs/public/parrot/string.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -w -r1.103 -r1.104
--- string.c 2 Nov 2002 06:03:17 -0000 1.103
+++ string.c 2 Nov 2002 14:57:47 -0000 1.104
@@ -1,7 +1,7 @@
/* string.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: string.c,v 1.103 2002/11/02 06:03:17 josh Exp $
+ * $Id: string.c,v 1.104 2002/11/02 14:57:47 josh Exp $
* Overview:
* This is the api definitions for the string subsystem
* Data Structure and Algorithms:
@@ -52,7 +52,8 @@
}
}
-static void copy_string_header(struct Parrot_Interp *interpreter,
+static void
+copy_string_header(struct Parrot_Interp *interpreter,
String *dest, String *src)
{
UINTVAL version;
@@ -88,7 +89,9 @@
}
static void
-make_COW_reference_from_header(struct Parrot_Interp *interpreter, STRING *s,
STRING *d) {
+make_COW_reference_from_header(struct Parrot_Interp *interpreter, STRING *s,
+ STRING *d)
+{
if (s->flags & BUFFER_constant_FLAG) {
s->flags |= BUFFER_COW_FLAG|BUFFER_external_FLAG;
copy_string_header(interpreter, d, s);
@@ -131,15 +134,14 @@
/* Is A real? */
if (a != NULL && a->strlen != 0) {
/* If the destination's constant, then just fall back to
- string_concat */
+ * string_concat */
if (a->flags & BUFFER_constant_FLAG) {
return string_concat(interpreter, a, b, Uflags);
}
/* First, make sure B is the same type as A, transcoding
- if we need to */
+ * if we need to */
if (a->type != b->type || a->encoding != b->encoding) {
- b = string_transcode(interpreter, b, a->encoding, a->type,
- NULL);
+ b = string_transcode(interpreter, b, a->encoding, a->type, NULL)
;
}
unmake_COW(interpreter, a);
/* make sure A's big enough for both */
@@ -162,14 +164,13 @@
return string_concat(interpreter, a, b, Uflags);
}
/* There's at least a string header for A. Make it a copy
- of B */
+ * of B */
if (a->buflen < b->bufused) {
a = string_grow(interpreter, a, b->bufused + EXTRA_SIZE);
}
a->flags = b->flags;
a->flags &= ~(UINTVAL)(BUFFER_constant_FLAG
- |BUFFER_COW_FLAG
- |BUFFER_external_FLAG);
+ | BUFFER_COW_FLAG | BUFFER_external_FLAG)
;
a->bufused = b->bufused;
a->strlen = b->strlen;
a->encoding = b->encoding;
@@ -206,9 +207,9 @@
s = new_string_header(interpreter, flags);
if (flags & BUFFER_external_FLAG) {
/* The following cast discards the 'const'. That raises
- a warning with gcc, but is ok since the caller indicated
- it was safe by setting BUFFER_external_FLAG.
- (The cast is necessary to pacify TenDRA's tcc.)
+ * a warning with gcc, but is ok since the caller indicated
+ * it was safe by setting BUFFER_external_FLAG.
+ * (The cast is necessary to pacify TenDRA's tcc.)
*/
s->bufstart = (void *) buffer;
s->buflen = buflen;
@@ -241,7 +242,8 @@
* grow the string buffer by addlen bytes
*/
STRING *
-string_grow(struct Parrot_Interp * interpreter, STRING * s, INTVAL addlen) {
+string_grow(struct Parrot_Interp *interpreter, STRING *s, INTVAL addlen)
+{
unmake_COW(interpreter,s);
/* Don't check buflen, if we are here, we already checked. */
@@ -281,12 +283,14 @@
if (s->encoding->index == enum_encoding_singlebyte) {
/* This inlines the computations used for the case that the strings
is
* in a singlebyte encoding.
- * This assumes that any singlebyte encoding uses is us-ascii, which
is wrong,
- * but consistent withthe result of calling s->encoding->decode */
+ * This assumes that any singlebyte encoding uses is us-ascii, which
+ * is wrong, but consistent with the result of calling
+ * s->encoding->decode */
return *((unsigned char*) s->strstart + idx);
}
else {
- return s->encoding->decode(s->encoding->skip_forward(s->strstart, id
x));
+ return s->encoding->decode(s->encoding->
+ skip_forward(s->strstart, idx));
}
}
@@ -688,14 +692,13 @@
*/
diff = (subend_off - substart_off) - rep->bufused;
- if(diff >= 0
- || ((INTVAL)src->bufused - (INTVAL)src->buflen) <= diff) {
+ if (diff >= 0 || ((INTVAL)src->bufused - (INTVAL)src->buflen) <= diff) {
unmake_COW(interpreter, src);
if(diff != 0) {
- mem_sys_memmove((char*)src->strstart + substart_off + rep->bufus
ed,
- (char*)src->strstart + subend_off,
+ mem_sys_memmove((char *)src->strstart + substart_off +
+ rep->bufused, (char *)src->strstart + subend_off
,
src->buflen - (subend_off - diff));
src->bufused -= diff;
}
@@ -768,8 +771,7 @@
* necessary
*/
INTVAL
-string_compare(struct Parrot_Interp *interpreter, STRING *s1,
- STRING *s2)
+string_compare(struct Parrot_Interp *interpreter, STRING *s1, STRING *s2)
{
const char *s1start;
const char *s1end;
@@ -852,7 +854,8 @@
* Set the contents of one string to the contents of another.
*/
STRING *
-string_set(struct Parrot_Interp *interpreter, STRING *dest, STRING *src) {
+string_set(struct Parrot_Interp *interpreter, STRING *dest, STRING *src)
+{
if(dest) {
make_COW_reference_from_header(interpreter, src, dest);
}
@@ -1002,7 +1005,8 @@
}
STRING *
-string_from_int(struct Parrot_Interp * interpreter, INTVAL i) {
+string_from_int(struct Parrot_Interp *interpreter, INTVAL i)
+{
char buf[128];
char *ptr = &buf[127];
int neg = 0;
@@ -1032,8 +1036,8 @@
string_from_num(struct Parrot_Interp * interpreter, FLOATVAL f)
{
/* Too damn hard--hand it off to Parrot_sprintf, which'll probably
- use the system sprintf anyway, but has gigantic buffers that are
- awfully hard to overflow. */
+ * use the system sprintf anyway, but has gigantic buffers that are
+ * awfully hard to overflow. */
return Parrot_sprintf_c(interpreter, "%vg", f);
}
1.8 +11 -12 parrot/sub.c
Index: sub.c
===================================================================
RCS file: /cvs/public/parrot/sub.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -r1.7 -r1.8
--- sub.c 22 Aug 2002 14:24:05 -0000 1.7
+++ sub.c 2 Nov 2002 14:57:47 -0000 1.8
@@ -1,7 +1,7 @@
/* sub.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: sub.c,v 1.7 2002/08/22 14:24:05 mrjoltcola Exp $
+ * $Id: sub.c,v 1.8 2002/11/02 14:57:47 josh Exp $
* Overview:
* Sub-routines, co-routines and other fun stuff...
* Data Structure and Algorithms:
@@ -72,4 +72,3 @@
*
* vim: expandtab shiftwidth=4:
*/
-
1.14 +14 -18 parrot/warnings.c
Index: warnings.c
===================================================================
RCS file: /cvs/public/parrot/warnings.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -r1.13 -r1.14
--- warnings.c 2 Nov 2002 06:03:17 -0000 1.13
+++ warnings.c 2 Nov 2002 14:57:47 -0000 1.14
@@ -13,8 +13,7 @@
va_list args;
va_start(args, message);
- if (!(interpreter == NULL ||
- PARROT_WARNINGS_test(interpreter, warnclass))) {
+ if (!(interpreter == NULL || PARROT_WARNINGS_test(interpreter, warnclass
))) {
return 2;
}
@@ -28,12 +27,11 @@
if (PIO_eprintf(interpreter, "%S%S.\n",
targ,
- interpreter ? Parrot_sprintf_c(
- interpreter, " at %S line %d", interpreter->current_file,
- interpreter->current_line
- ) : NULL
- ) < 0)
- {
+ interpreter ? Parrot_sprintf_c(interpreter,
+ " at %S line %d",
+ interpreter->current_file
,
+ interpreter->
+ current_line) : NULL) < 0
) {
return -2;
}
else {
@@ -50,8 +48,7 @@
va_list args;
va_start(args, message);
- if (!(interpreter == NULL ||
- PARROT_WARNINGS_test(interpreter, warnclass))) {
+ if (!(interpreter == NULL || PARROT_WARNINGS_test(interpreter, warnclass
))) {
return 2;
}
@@ -64,12 +61,11 @@
if (PIO_eprintf(interpreter, "%S%S.\n",
targ,
- interpreter ? Parrot_sprintf_c(
- interpreter, " at %S line %d", interpreter->current_file,
- interpreter->current_line
- ) : NULL
- ) < 0)
- {
+ interpreter ? Parrot_sprintf_c(interpreter,
+ " at %S line %d",
+ interpreter->current_file
,
+ interpreter->
+ current_line) : NULL) < 0
) {
return -2;
}
else {
------- End of Forwarded Message