summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxplat <xplat>2002-09-15 23:21:01 (GMT)
committerxplat <xplat>2002-09-15 23:21:01 (GMT)
commit45ec5a42953676a190b550a0de6aed62dc1d0b7e (patch)
treee09426b5708d9586511e4988991b4d762fda90ba
parent3d90f823b37e374e19de9b01db7ccfc2f5e5a822 (diff)
downloadmoo-cvs-45ec5a42953676a190b550a0de6aed62dc1d0b7e.zip
moo-cvs-45ec5a42953676a190b550a0de6aed62dc1d0b7e.tar.gz
moo-cvs-45ec5a42953676a190b550a0de6aed62dc1d0b7e.tar.bz2
moo-cvs-45ec5a42953676a190b550a0de6aed62dc1d0b7e.tar.xz
GNU indent normalization.INLINEPC.updater.1
-rw-r--r--code_gen.c65
-rw-r--r--decompile.c5
-rw-r--r--execute.c15
-rw-r--r--execute.h5
-rw-r--r--opcode.h7
-rw-r--r--tasks.c5
6 files changed, 60 insertions, 42 deletions
diff --git a/code_gen.c b/code_gen.c
index d13f109..8835aeb 100644
--- a/code_gen.c
+++ b/code_gen.c
@@ -78,7 +78,7 @@ struct state {
Byte *pushmap;
Byte *trymap;
unsigned try_depth;
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
unsigned cur_stack, max_stack;
unsigned saved_stack;
unsigned num_loops, max_loops;
@@ -97,10 +97,10 @@ typedef struct state State;
(1 << SLOT_IOBJ) | \
(1 << SLOT_IOBJSTR) | \
(1 << SLOT_PLAYER))
-#else /* no BYTECODE_REDUCE_REF */
+#else /* no BYTECODE_REDUCE_REF */
#define INCR_TRY_DEPTH(SSS)
#define DECR_TRY_DEPTH(SSS)
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
static void
init_gstate(GState * gstate)
@@ -140,7 +140,7 @@ init_state(State * state, GState * gstate)
state->pushmap = mymalloc(sizeof(Byte) * state->max_bytes, M_BYTECODES);
state->trymap = mymalloc(sizeof(Byte) * state->max_bytes, M_BYTECODES);
state->try_depth = 0;
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
state->cur_stack = state->max_stack = 0;
state->saved_stack = UINT_MAX;
@@ -160,7 +160,7 @@ free_state(State state)
#ifdef BYTECODE_REDUCE_REF
myfree(state.pushmap, M_BYTECODES);
myfree(state.trymap, M_BYTECODES);
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
myfree(state.loops, M_CODE_GEN);
}
@@ -170,19 +170,19 @@ emit_byte(Byte b, State * state)
if (state->num_bytes == state->max_bytes) {
unsigned new_max = 2 * state->max_bytes;
state->bytes = myrealloc(state->bytes, sizeof(Byte) * new_max,
- M_BYTECODES);
+ M_BYTECODES);
#ifdef BYTECODE_REDUCE_REF
state->pushmap = myrealloc(state->pushmap, sizeof(Byte) * new_max,
M_BYTECODES);
state->trymap = myrealloc(state->trymap, sizeof(Byte) * new_max,
- M_BYTECODES);
-#endif /* BYTECODE_REDUCE_REF */
+ M_BYTECODES);
+#endif /* BYTECODE_REDUCE_REF */
state->max_bytes = new_max;
}
#ifdef BYTECODE_REDUCE_REF
state->pushmap[state->num_bytes] = 0;
state->trymap[state->num_bytes] = state->try_depth;
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
state->bytes[state->num_bytes++] = b;
}
@@ -269,16 +269,16 @@ add_literal(Var v, State * state)
gstate->literals = new_literals;
gstate->max_literals = new_max;
}
- if (v.type == TYPE_STR) {
- /* intern string if we can */
- Var nv;
-
- nv.type = TYPE_STR;
- nv.v.str = str_intern(v.v.str);
- gstate->literals[i = gstate->num_literals++] = nv;
- } else {
- gstate->literals[i = gstate->num_literals++] = var_ref(v);
- }
+ if (v.type == TYPE_STR) {
+ /* intern string if we can */
+ Var nv;
+
+ nv.type = TYPE_STR;
+ nv.v.str = str_intern(v.v.str);
+ gstate->literals[i = gstate->num_literals++] = nv;
+ } else {
+ gstate->literals[i = gstate->num_literals++] = var_ref(v);
+ }
}
add_fixup(FIXUP_LITERAL, i, state);
state->num_literals++;
@@ -484,7 +484,7 @@ emit_call_verb_op(Opcode op, State * state)
emit_byte(op, state);
#ifdef BYTECODE_REDUCE_REF
state->pushmap[state->num_bytes - 1] = OP_CALL_VERB;
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
}
static void
@@ -493,7 +493,7 @@ emit_ending_op(Opcode op, State * state)
emit_byte(op, state);
#ifdef BYTECODE_REDUCE_REF
state->pushmap[state->num_bytes - 1] = OP_DONE;
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
}
static void
@@ -505,8 +505,8 @@ emit_var_op(Opcode op, unsigned slot, State * state)
} else {
emit_byte(op + slot, state);
#ifdef BYTECODE_REDUCE_REF
- state->pushmap[state->num_bytes - 1] = op;
-#endif /* BYTECODE_REDUCE_REF */
+ state->pushmap[state->num_bytes - 1] = op;
+#endif /* BYTECODE_REDUCE_REF */
}
}
@@ -1125,9 +1125,9 @@ ref_size(unsigned max)
static int
bbd_cmp(int *a, int *b)
{
- return *a - *b;
+ return *a - *b;
}
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
static Bytecodes
stmt_to_code(Stmt * stmt, GState * gstate)
@@ -1141,7 +1141,7 @@ stmt_to_code(Stmt * stmt, GState * gstate)
#if NUM_READY_VARS > 32
#error assumed NUM_READY_VARS was 32
#endif
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
Fixup *fixup;
init_state(&state, gstate);
@@ -1215,19 +1215,19 @@ stmt_to_code(Stmt * stmt, GState * gstate)
while (n_bbd-- > 1) {
varbits = 0;
- for (old_i = bbd[n_bbd] - 1; old_i >= bbd[n_bbd - 1]; --old_i) {
+ for (old_i = bbd[n_bbd] - 1; old_i >= bbd[n_bbd - 1]; --old_i) {
if (state.pushmap[old_i] == OP_PUSH) {
int id = PUSH_n_INDEX(state.bytes[old_i]);
if (varbits & (1 << id)) {
- varbits &= ~(1 << id);
- state.bytes[old_i] += OP_PUSH_CLEAR - OP_PUSH;
+ varbits &= ~(1 << id);
+ state.bytes[old_i] += OP_PUSH_CLEAR - OP_PUSH;
}
} else if (state.trymap[old_i] > 0) {
/*
* Operations inside of exception handling blocks might not
* execute, so they can't set any bits.
- */;
+ */ ;
} else if (state.pushmap[old_i] == OP_PUT) {
int id = PUT_n_INDEX(state.bytes[old_i]);
varbits |= 1 << id;
@@ -1249,7 +1249,7 @@ stmt_to_code(Stmt * stmt, GState * gstate)
}
}
myfree(bbd, M_CODE_GEN);
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
fixup = state.fixups;
fix_i = 0;
@@ -1354,6 +1354,9 @@ char rcsid_code_gen[] = "$Id$";
/*
* $Log$
+ * Revision 1.11 2002/09/15 23:21:01 xplat
+ * GNU indent normalization.
+ *
* Revision 1.10 2002/08/23 13:00:18 bjj
* Removed a spurious EXPR_INDEX case left over from before x[$]
*
diff --git a/decompile.c b/decompile.c
index c2eb90f..95a3352 100644
--- a/decompile.c
+++ b/decompile.c
@@ -161,7 +161,7 @@ decompile(Bytecodes bc, Byte * start, Byte * end, Stmt ** stmt_sink,
e->e.id = PUSH_CLEAR_n_INDEX(op);
push_expr(HOT_OP(e));
continue;
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
} else if (IS_PUT_n(op)) {
e = alloc_expr(EXPR_ID);
e->e.id = PUT_n_INDEX(op);
@@ -994,6 +994,9 @@ char rcsid_decompile[] = "$Id$";
/*
* $Log$
+ * Revision 1.6 2002/09/15 23:21:01 xplat
+ * GNU indent normalization.
+ *
* Revision 1.5 1999/08/11 08:23:40 bjj
* Lineno computation could be wrong for forked vectors.
*
diff --git a/execute.c b/execute.c
index b41541a..385d439 100644
--- a/execute.c
+++ b/execute.c
@@ -511,7 +511,7 @@ push_activation(void)
}
void
-free_activation(activation *ap, char data_too)
+free_activation(activation * ap, char data_too)
{
Var *i;
@@ -978,7 +978,7 @@ do { \
res = list;
else {
res = var_dup(list);
- free_var(list);
+ free_var(list);
}
PUSH(listset(res, value, index.v.num));
} else { /* TYPE_STR */
@@ -1533,7 +1533,7 @@ do { \
enum error e;
e = enqueue_forked_task2(RUN_ACTIV, f_index, time.v.num,
- op == OP_FORK_WITH_ID ? id : -1);
+ op == OP_FORK_WITH_ID ? id : -1);
if (e != E_NONE)
RAISE_ERROR(e);
}
@@ -1753,8 +1753,8 @@ do { \
free_var(POP()); /* replace list with error code */
PUSH_ERROR(e);
for (i = 1; i <= nargs; i++) {
- SKIP_BYTES(bv, bc.numbytes_var_name);
- SKIP_BYTES(bv, bc.numbytes_label);
+ SKIP_BYTES(bv, bc.numbytes_var_name);
+ SKIP_BYTES(bv, bc.numbytes_label);
}
} else {
nopt_avail = len - nreq;
@@ -2010,7 +2010,7 @@ do { \
}
}
break;
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
case OP_PUT:
case OP_PUT + 1:
@@ -2878,6 +2878,9 @@ char rcsid_execute[] = "$Id$";
/*
* $Log$
+ * Revision 1.14 2002/09/15 23:21:01 xplat
+ * GNU indent normalization.
+ *
* Revision 1.13 2002/08/18 09:47:26 bjj
* Finally made free_activation() take a pointer after noticing how !$%^&
* much time it was taking in a particular profiling run.
diff --git a/execute.h b/execute.h
index 2cd6fb7..ec6d594 100644
--- a/execute.h
+++ b/execute.h
@@ -84,7 +84,7 @@ extern enum error call_verb(Objid obj, const char *vname, Var args,
/* if your vname is already a moo str (via str_dup) then you can
use this interface instead */
extern enum error call_verb2(Objid obj, const char *vname, Var args,
- int do_pass);
+ int do_pass);
extern int setup_activ_for_eval(Program * prog);
@@ -135,6 +135,9 @@ extern int read_activ(activation * a, int which_vector);
/*
* $Log$
+ * Revision 1.7 2002/09/15 23:21:01 xplat
+ * GNU indent normalization.
+ *
* Revision 1.6 2002/08/18 09:47:26 bjj
* Finally made free_activation() take a pointer after noticing how !$%^&
* much time it was taking in a particular profiling run.
diff --git a/opcode.h b/opcode.h
index a884c93..8eb09f4 100644
--- a/opcode.h
+++ b/opcode.h
@@ -72,7 +72,7 @@ enum Opcode {
/* final variable references, no tick: */
OP_PUSH_CLEAR,
OP_G_PUSH_CLEAR = OP_PUSH_CLEAR + NUM_READY_VARS,
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
/* expr-related opcodes with no tick: */
OP_IMM, OP_MAKE_EMPTY_LIST, OP_LIST_ADD_TAIL, OP_LIST_APPEND,
@@ -97,7 +97,7 @@ enum Opcode {
#define IS_PUSH_CLEAR_n(o) ((o) >= (unsigned) OP_PUSH_CLEAR \
&& (o) < (unsigned) OP_G_PUSH_CLEAR)
#define PUSH_CLEAR_n_INDEX(o) ((o) - OP_PUSH_CLEAR)
-#endif /* BYTECODE_REDUCE_REF */
+#endif /* BYTECODE_REDUCE_REF */
#define IS_PUT_n(o) ((o) >= (unsigned) OP_PUT \
&& (o) < (unsigned) OP_G_PUT)
#define PUSH_n_INDEX(o) ((o) - OP_PUSH)
@@ -124,6 +124,9 @@ typedef enum Extended_Opcode Extended_Opcode;
/*
* $Log$
+ * Revision 1.4 2002/09/15 23:21:01 xplat
+ * GNU indent normalization.
+ *
* Revision 1.3 1998/12/14 13:18:40 nop
* Merge UNSAFE_OPTS (ref fixups); fix Log tag placement to fit CVS whims
*
diff --git a/tasks.c b/tasks.c
index 326aa1c..fdd73eb 100644
--- a/tasks.c
+++ b/tasks.c
@@ -1423,7 +1423,7 @@ bf_task_id(Var arglist, Byte next, void *vdata, Objid progr)
}
static int
-activation_bytes(activation *ap)
+activation_bytes(activation * ap)
{
int total = sizeof(activation);
Var *v;
@@ -2013,6 +2013,9 @@ char rcsid_tasks[] = "$Id$";
/*
* $Log$
+ * Revision 1.10 2002/09/15 23:21:01 xplat
+ * GNU indent normalization.
+ *
* Revision 1.9 2001/07/31 06:33:22 bjj
* Fixed some bugs in the reporting of forked task sizes.
*