summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2010-07-19 02:01:26 +0200
committerJohannes Weiner <hannes@cmpxchg.org>2010-07-19 02:01:26 +0200
commit3aae5d5624d6c9636a4121c25f258c5a55f00f4d (patch)
treea33cc91caabcbe6719824566e18edb142d84e976
parent170a09436416549f3c9050eae5f20f39c8df8a20 (diff)
clean up function argument alignment
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
-rw-r--r--include/sheep/code.h13
-rw-r--r--include/sheep/compile.h34
-rw-r--r--include/sheep/foreign.h6
-rw-r--r--include/sheep/module.h12
-rw-r--r--include/sheep/parse.h13
-rw-r--r--include/sheep/read.h3
-rw-r--r--include/sheep/type.h6
-rw-r--r--include/sheep/types.h14
-rw-r--r--include/sheep/util.h2
-rw-r--r--sheep/alien.c11
-rw-r--r--sheep/code.c6
-rw-r--r--sheep/compile.c35
-rw-r--r--sheep/core.c76
-rw-r--r--sheep/eval.c36
-rw-r--r--sheep/foreign.c7
-rw-r--r--sheep/function.c8
-rw-r--r--sheep/gc.c2
-rw-r--r--sheep/list.c11
-rw-r--r--sheep/map.c3
-rw-r--r--sheep/module.c27
-rw-r--r--sheep/number.c8
-rw-r--r--sheep/object.c5
-rw-r--r--sheep/parse.c32
-rw-r--r--sheep/read.c21
-rw-r--r--sheep/string.c11
-rw-r--r--sheep/type.c12
-rw-r--r--sheep/unpack.c18
-rw-r--r--sheep/vm.c3
28 files changed, 277 insertions, 158 deletions
diff --git a/include/sheep/code.h b/include/sheep/code.h
index 3bc4ac2..340a556 100644
--- a/include/sheep/code.h
+++ b/include/sheep/code.h
@@ -57,7 +57,8 @@ static inline unsigned long sheep_encode(enum sheep_opcode op, unsigned int arg)
return code;
}
-static inline void sheep_decode(unsigned long code, enum sheep_opcode *op,
+static inline void sheep_decode(unsigned long code,
+ enum sheep_opcode *op,
unsigned int *arg)
{
*op = code >> SHEEP_OPCODE_SHIFT;
@@ -65,7 +66,8 @@ static inline void sheep_decode(unsigned long code, enum sheep_opcode *op,
}
static inline unsigned long sheep_emit(struct sheep_code *code,
- enum sheep_opcode op, unsigned int arg)
+ enum sheep_opcode op,
+ unsigned int arg)
{
return sheep_vector_push(&code->code, (void *)sheep_encode(op, arg));
}
@@ -74,8 +76,11 @@ unsigned long sheep_code_jump(struct sheep_code *);
void sheep_code_label(struct sheep_code *, unsigned long);
void sheep_code_finalize(struct sheep_code *);
-void sheep_code_dump(struct sheep_vm *, struct sheep_function *,
- unsigned long, enum sheep_opcode, unsigned int);
+void sheep_code_dump(struct sheep_vm *,
+ struct sheep_function *,
+ unsigned long,
+ enum sheep_opcode,
+ unsigned int);
void sheep_code_disassemble(struct sheep_code *);
diff --git a/include/sheep/compile.h b/include/sheep/compile.h
index 86fe05e..e1d7442 100644
--- a/include/sheep/compile.h
+++ b/include/sheep/compile.h
@@ -13,11 +13,12 @@
#include <sheep/map.h>
#include <sheep/vm.h>
-sheep_t __sheep_compile(struct sheep_vm *, struct sheep_module *,
+sheep_t __sheep_compile(struct sheep_vm *,
+ struct sheep_module *,
struct sheep_expr *);
static inline sheep_t sheep_compile(struct sheep_vm *vm,
- struct sheep_expr *expr)
+ struct sheep_expr *expr)
{
return __sheep_compile(vm, &vm->main, expr);
}
@@ -46,20 +47,29 @@ struct sheep_context {
*/
static inline int sheep_compile_object(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, sheep_t sheep)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ sheep_t sheep)
{
return sheep_type(sheep)->compile(compile, function, context, sheep);
}
-int sheep_compile_constant(struct sheep_compile *, struct sheep_function *,
- struct sheep_context *, sheep_t);
-int sheep_compile_name(struct sheep_compile *, struct sheep_function *,
- struct sheep_context *, sheep_t);
-int sheep_compile_set(struct sheep_compile *, struct sheep_function *,
- struct sheep_context *, sheep_t);
-int sheep_compile_list(struct sheep_compile *, struct sheep_function *,
- struct sheep_context *, sheep_t);
+int sheep_compile_constant(struct sheep_compile *,
+ struct sheep_function *,
+ struct sheep_context *,
+ sheep_t);
+int sheep_compile_name(struct sheep_compile *,
+ struct sheep_function *,
+ struct sheep_context *,
+ sheep_t);
+int sheep_compile_set(struct sheep_compile *,
+ struct sheep_function *,
+ struct sheep_context *,
+ sheep_t);
+int sheep_compile_list(struct sheep_compile *,
+ struct sheep_function *,
+ struct sheep_context *,
+ sheep_t);
void sheep_propagate_foreigns(struct sheep_function *, struct sheep_function *);
diff --git a/include/sheep/foreign.h b/include/sheep/foreign.h
index 7c37d72..b840863 100644
--- a/include/sheep/foreign.h
+++ b/include/sheep/foreign.h
@@ -43,11 +43,13 @@ struct sheep_indirect {
/* compile-time */
unsigned int sheep_foreign_slot(struct sheep_function *,
- unsigned int, unsigned int);
+ unsigned int,
+ unsigned int);
void sheep_foreign_propagate(struct sheep_function *, struct sheep_function *);
/* eval-time */
-struct sheep_vector *sheep_foreign_open(struct sheep_vm *, unsigned long,
+struct sheep_vector *sheep_foreign_open(struct sheep_vm *,
+ unsigned long,
struct sheep_function *,
struct sheep_function *);
void sheep_foreign_save(struct sheep_vm *, unsigned long);
diff --git a/include/sheep/module.h b/include/sheep/module.h
index a3ea1a3..c750ec9 100644
--- a/include/sheep/module.h
+++ b/include/sheep/module.h
@@ -22,10 +22,14 @@ extern const struct sheep_type sheep_module_type;
sheep_t sheep_module_load(struct sheep_vm *, const char *);
-unsigned int sheep_module_variable(struct sheep_vm *, struct sheep_module *,
- const char *, sheep_t);
-void sheep_module_function(struct sheep_vm *, struct sheep_module *,
- const char *, sheep_alien_t);
+unsigned int sheep_module_variable(struct sheep_vm *,
+ struct sheep_module *,
+ const char *,
+ sheep_t);
+void sheep_module_function(struct sheep_vm *,
+ struct sheep_module *,
+ const char *,
+ sheep_alien_t);
void sheep_module_builtins(struct sheep_vm *);
diff --git a/include/sheep/parse.h b/include/sheep/parse.h
index 17fbf66..7c05c9b 100644
--- a/include/sheep/parse.h
+++ b/include/sheep/parse.h
@@ -13,9 +13,14 @@
void sheep_parser_error(struct sheep_compile *, sheep_t, const char *, ...);
-int __sheep_parse(struct sheep_compile *, struct sheep_list *,
- struct sheep_list *, const char *, ...);
-int sheep_parse(struct sheep_compile *, struct sheep_list *,
- const char *, ...);
+int __sheep_parse(struct sheep_compile *,
+ struct sheep_list *,
+ struct sheep_list *,
+ const char *,
+ ...);
+int sheep_parse(struct sheep_compile *,
+ struct sheep_list *,
+ const char *,
+ ...);
#endif /* _SHEEP_PARSE_H */
diff --git a/include/sheep/read.h b/include/sheep/read.h
index e3db092..dc62e91 100644
--- a/include/sheep/read.h
+++ b/include/sheep/read.h
@@ -18,7 +18,8 @@ struct sheep_reader {
};
static inline void sheep_reader_init(struct sheep_reader *reader,
- const char *filename, FILE *file)
+ const char *filename,
+ FILE *file)
{
reader->filename = filename;
reader->lineno = 1;
diff --git a/include/sheep/type.h b/include/sheep/type.h
index 5ec884c..a2473b6 100644
--- a/include/sheep/type.h
+++ b/include/sheep/type.h
@@ -27,7 +27,9 @@ struct sheep_typeclass {
extern const struct sheep_type sheep_typeclass_type;
-sheep_t sheep_make_typeclass(struct sheep_vm *, const char *,
- const char **, unsigned int);
+sheep_t sheep_make_typeclass(struct sheep_vm *,
+ const char *,
+ const char **,
+ unsigned int);
#endif /* _SHEEP_TYPE_H */
diff --git a/include/sheep/types.h b/include/sheep/types.h
index caa13cf..aaac2ec 100644
--- a/include/sheep/types.h
+++ b/include/sheep/types.h
@@ -37,11 +37,15 @@ struct sheep_type {
void (*mark)(sheep_t);
void (*free)(struct sheep_vm *, sheep_t);
- int (*compile)(struct sheep_compile *, struct sheep_function *,
- struct sheep_context *, sheep_t);
-
- enum sheep_call (*call)(struct sheep_vm *, sheep_t,
- unsigned int, sheep_t *);
+ int (*compile)(struct sheep_compile *,
+ struct sheep_function *,
+ struct sheep_context *,
+ sheep_t);
+
+ enum sheep_call (*call)(struct sheep_vm *,
+ sheep_t,
+ unsigned int,
+ sheep_t *);
int (*test)(sheep_t);
int (*equal)(sheep_t, sheep_t);
diff --git a/include/sheep/util.h b/include/sheep/util.h
index 564c5eb..16b63c7 100644
--- a/include/sheep/util.h
+++ b/include/sheep/util.h
@@ -34,7 +34,7 @@ void __noreturn sheep_bug(const char *, ...);
#define sheep_bug_on(cond) \
do if (cond) \
sheep_bug("Unexpected condition `%s' in %s:%d", \
- #cond, __FILE__, __LINE__); \
+ #cond, __FILE__, __LINE__); \
while (0)
#endif /* _SHEEP_UTIL_H */
diff --git a/sheep/alien.c b/sheep/alien.c
index 4b47a82..a9b7383 100644
--- a/sheep/alien.c
+++ b/sheep/alien.c
@@ -15,8 +15,10 @@ static void alien_free(struct sheep_vm *vm, sheep_t sheep)
sheep_free(sheep_data(sheep));
}
-static enum sheep_call alien_call(struct sheep_vm *vm, sheep_t callable,
- unsigned int nr_args, sheep_t *valuep)
+static enum sheep_call alien_call(struct sheep_vm *vm,
+ sheep_t callable,
+ unsigned int nr_args,
+ sheep_t *valuep)
{
struct sheep_alien *alien;
sheep_t value;
@@ -47,8 +49,9 @@ const struct sheep_type sheep_alien_type = {
.format = alien_format,
};
-sheep_t sheep_make_alien(struct sheep_vm *vm, sheep_alien_t function,
- const char *name)
+sheep_t sheep_make_alien(struct sheep_vm *vm,
+ sheep_alien_t function,
+ const char *name)
{
struct sheep_alien *alien;
diff --git a/sheep/code.c b/sheep/code.c
index 384fb02..051f3ae 100644
--- a/sheep/code.c
+++ b/sheep/code.c
@@ -55,8 +55,10 @@ static const char *opnames[] = {
"LOAD",
};
-void sheep_code_dump(struct sheep_vm *vm, struct sheep_function *function,
- unsigned long basep, enum sheep_opcode op, unsigned int arg)
+void sheep_code_dump(struct sheep_vm *vm,
+ struct sheep_function *function,
+ unsigned long basep,
+ enum sheep_opcode op, unsigned int arg)
{
struct sheep_indirect *indirect;
sheep_t sheep;
diff --git a/sheep/compile.c b/sheep/compile.c
index 61ca62a..e796f62 100644
--- a/sheep/compile.c
+++ b/sheep/compile.c
@@ -18,7 +18,8 @@
#include <sheep/compile.h>
-sheep_t __sheep_compile(struct sheep_vm *vm, struct sheep_module *module,
+sheep_t __sheep_compile(struct sheep_vm *vm,
+ struct sheep_module *module,
struct sheep_expr *expr)
{
struct sheep_function *function;
@@ -50,8 +51,9 @@ sheep_t __sheep_compile(struct sheep_vm *vm, struct sheep_module *module,
}
int sheep_compile_constant(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, sheep_t sheep)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ sheep_t sheep)
{
unsigned int slot;
@@ -68,8 +70,10 @@ enum env_level {
};
static enum env_level lookup_env(struct sheep_compile *compile,
- struct sheep_context *context, const char *name,
- unsigned int *dist, unsigned int *slot)
+ struct sheep_context *context,
+ const char *name,
+ unsigned int *dist,
+ unsigned int *slot)
{
struct sheep_context *current = context;
unsigned int distance = 0;
@@ -99,7 +103,8 @@ static enum env_level lookup_env(struct sheep_compile *compile,
static int compile_name(struct sheep_compile *compile,
struct sheep_function *function,
struct sheep_context *context,
- sheep_t sheep, int set)
+ sheep_t sheep,
+ int set)
{
unsigned int dist, slot, i = 0;
struct sheep_name *name;
@@ -153,22 +158,25 @@ static int compile_name(struct sheep_compile *compile,
}
int sheep_compile_name(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, sheep_t sheep)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ sheep_t sheep)
{
return compile_name(compile, function, context, sheep, 0);
}
int sheep_compile_set(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, sheep_t sheep)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ sheep_t sheep)
{
return compile_name(compile, function, context, sheep, 1);
}
static int compile_call(struct sheep_compile *compile,
struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *form)
+ struct sheep_context *context,
+ struct sheep_list *form)
{
SHEEP_DEFINE_MAP(env);
struct sheep_context block = {
@@ -202,8 +210,9 @@ out:
}
int sheep_compile_list(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, sheep_t sheep)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ sheep_t sheep)
{
struct sheep_list *list;
diff --git a/sheep/core.c b/sheep/core.c
index 0750b66..a9719a9 100644
--- a/sheep/core.c
+++ b/sheep/core.c
@@ -24,8 +24,9 @@
/* (quote expr) */
static int compile_quote(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ struct sheep_list *args)
{
unsigned int slot;
sheep_t expr;
@@ -59,8 +60,9 @@ static int tailposition(struct sheep_context *context, struct sheep_list *block)
}
static int do_compile_forms(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ struct sheep_list *args)
{
for (;;) {
sheep_t value = args->head;
@@ -85,9 +87,11 @@ static int do_compile_forms(struct sheep_compile *compile,
}
static int do_compile_block(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *parent, struct sheep_map *env,
- struct sheep_list *args, int function_body)
+ struct sheep_function *function,
+ struct sheep_context *parent,
+ struct sheep_map *env,
+ struct sheep_list *args,
+ int function_body)
{
struct sheep_context context = {
.env = env,
@@ -102,8 +106,9 @@ static int do_compile_block(struct sheep_compile *compile,
/* (block expr*) */
static int compile_block(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ struct sheep_list *args)
{
SHEEP_DEFINE_MAP(env);
int ret;
@@ -121,7 +126,8 @@ static int compile_block(struct sheep_compile *compile,
/* (with (name value) expr*) */
static int compile_with(struct sheep_compile *compile,
struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_context *context,
+ struct sheep_list *args)
{
struct sheep_list *binding, *body;
SHEEP_DEFINE_MAP(env);
@@ -154,9 +160,9 @@ static int compile_with(struct sheep_compile *compile,
}
static void compile_set_return(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context,
- const char *name)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ const char *name)
{
unsigned int slot;
@@ -173,8 +179,9 @@ static void compile_set_return(struct sheep_compile *compile,
/* (variable name expr) */
static int compile_variable(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ struct sheep_list *args)
{
SHEEP_DEFINE_MAP(env);
struct sheep_context block = {
@@ -199,8 +206,9 @@ out:
/* (function name? (arg*) expr*) */
static int compile_function(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ struct sheep_list *args)
{
struct sheep_list *parms, *body;
struct sheep_function *childfun;
@@ -268,7 +276,8 @@ out:
/* (type name slotnames*) */
static int compile_type(struct sheep_compile *compile,
struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_context *context,
+ struct sheep_list *args)
{
const char **slotnames = NULL;
unsigned int nr_slots = 0;
@@ -305,10 +314,10 @@ err:
}
static int do_compile_chain(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context,
- struct sheep_list *args,
- enum sheep_opcode endbranch)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ struct sheep_list *args,
+ enum sheep_opcode endbranch)
{
SHEEP_DEFINE_MAP(env);
struct sheep_context block = {
@@ -351,24 +360,27 @@ out:
/* (or one two three*?) */
static int compile_or(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ struct sheep_list *args)
{
return do_compile_chain(compile, function, context, args, SHEEP_BRT);
}
/* (and one two three*?) */
static int compile_and(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ struct sheep_list *args)
{
return do_compile_chain(compile, function, context, args, SHEEP_BRF);
}
/* (if cond then else*?) */
static int compile_if(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ struct sheep_list *args)
{
SHEEP_DEFINE_MAP(env);
struct sheep_context block = {
@@ -420,8 +432,9 @@ out:
/* (set name value) */
static int compile_set(struct sheep_compile *compile,
- struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_function *function,
+ struct sheep_context *context,
+ struct sheep_list *args)
{
struct sheep_name *name;
SHEEP_DEFINE_MAP(env);
@@ -448,7 +461,8 @@ out:
/* (load name) */
static int compile_load(struct sheep_compile *compile,
struct sheep_function *function,
- struct sheep_context *context, struct sheep_list *args)
+ struct sheep_context *context,
+ struct sheep_list *args)
{
unsigned int slot;
const char *name;
diff --git a/sheep/eval.c b/sheep/eval.c
index c6ddd1b..62cb0c1 100644
--- a/sheep/eval.c
+++ b/sheep/eval.c
@@ -22,8 +22,10 @@
#include <sheep/eval.h>
-static sheep_t hash(struct sheep_vm *vm, sheep_t container,
- unsigned int key_slot, sheep_t value)
+static sheep_t hash(struct sheep_vm *vm,
+ sheep_t container,
+ unsigned int key_slot,
+ sheep_t value)
{
const char *key, *obj;
struct sheep_map *map;
@@ -59,8 +61,10 @@ err:
return NULL;
}
-static sheep_t closure(struct sheep_vm *vm, unsigned long basep,
- struct sheep_function *parent, sheep_t sheep)
+static sheep_t closure(struct sheep_vm *vm,
+ unsigned long basep,
+ struct sheep_function *parent,
+ sheep_t sheep)
{
struct sheep_function *function = sheep_data(sheep);
@@ -75,8 +79,10 @@ static sheep_t closure(struct sheep_vm *vm, unsigned long basep,
return sheep;
}
-static enum sheep_call precall(struct sheep_vm *vm, sheep_t callable,
- unsigned int nr_args, sheep_t *valuep)
+static enum sheep_call precall(struct sheep_vm *vm,
+ sheep_t callable,
+ unsigned int nr_args,
+ sheep_t *valuep)
{
const struct sheep_type *type;
@@ -88,8 +94,9 @@ static enum sheep_call precall(struct sheep_vm *vm, sheep_t callable,
return type->call(vm, callable, nr_args, valuep);
}
-static void splice_arguments(struct sheep_vm *vm, unsigned long basep,
- unsigned int nr_args)
+static void splice_arguments(struct sheep_vm *vm,
+ unsigned long basep,
+ unsigned int nr_args)
{
unsigned int t;
@@ -100,7 +107,7 @@ static void splice_arguments(struct sheep_vm *vm, unsigned long basep,
}
static unsigned long finalize_frame(struct sheep_vm *vm,
- struct sheep_function *function)
+ struct sheep_function *function)
{
unsigned int nr;
@@ -331,8 +338,9 @@ static sheep_t call(struct sheep_vm *vm, sheep_t callable, unsigned int nr_args)
sheep_bug("precall returned bull");
}
-sheep_t sheep_apply(struct sheep_vm *vm, sheep_t callable,
- struct sheep_list *args)
+sheep_t sheep_apply(struct sheep_vm *vm,
+ sheep_t callable,
+ struct sheep_list *args)
{
unsigned int nr_args = 0;
@@ -344,8 +352,10 @@ sheep_t sheep_apply(struct sheep_vm *vm, sheep_t callable,
return call(vm, callable, nr_args);
}
-sheep_t sheep_call(struct sheep_vm *vm, sheep_t callable,
- unsigned int nr_args, ...)
+sheep_t sheep_call(struct sheep_vm *vm,
+ sheep_t callable,
+ unsigned int nr_args,
+ ...)
{
unsigned int nr = nr_args;
va_list ap;
diff --git a/sheep/foreign.c b/sheep/foreign.c
index bc328ee..2b53199 100644
--- a/sheep/foreign.c
+++ b/sheep/foreign.c
@@ -13,7 +13,8 @@
/* foreign slot allocation at compile time */
unsigned int sheep_foreign_slot(struct sheep_function *function,
- unsigned int dist, unsigned int slot)
+ unsigned int dist,
+ unsigned int slot)
{
struct sheep_freevar *freevar;
struct sheep_vector *foreign;
@@ -46,7 +47,7 @@ unsigned int sheep_foreign_slot(struct sheep_function *function,
/* foreign slot upward propagation at function finalization */
void sheep_foreign_propagate(struct sheep_function *parent,
- struct sheep_function *child)
+ struct sheep_function *child)
{
unsigned int i;
@@ -70,7 +71,7 @@ void sheep_foreign_propagate(struct sheep_function *parent,
}
static struct sheep_indirect *open_indirect(struct sheep_vm *vm,
- unsigned long index)
+ unsigned long index)
{
struct sheep_indirect *new, *prev = NULL, *next = vm->pending;
diff --git a/sheep/function.c b/sheep/function.c
index 1e97a47..78a4cd3 100644
--- a/sheep/function.c
+++ b/sheep/function.c
@@ -37,8 +37,10 @@ static void function_free(struct sheep_vm *vm, sheep_t sheep)
sheep_free(function);
}
-static enum sheep_call function_call(struct sheep_vm *vm, sheep_t callable,
- unsigned int nr_args, sheep_t *valuep)
+static enum sheep_call function_call(struct sheep_vm *vm,
+ sheep_t callable,
+ unsigned int nr_args,
+ sheep_t *valuep)
{
struct sheep_function *function;
@@ -113,7 +115,7 @@ sheep_t sheep_make_function(struct sheep_vm *vm, const char *name)
}
sheep_t sheep_closure_function(struct sheep_vm *vm,
- struct sheep_function *function)
+ struct sheep_function *function)
{
struct sheep_function *closure;
diff --git a/sheep/gc.c b/sheep/gc.c
index db5c57e..542780b 100644
--- a/sheep/gc.c
+++ b/sheep/gc.c
@@ -76,7 +76,7 @@ static void mark_protected(struct sheep_vector *protected)
}
static unsigned int collect_pool(struct sheep_vm *vm,
- struct sheep_objects *pool)
+ struct sheep_objects *pool)
{
unsigned int i, moved;
diff --git a/sheep/list.c b/sheep/list.c
index bc9dc94..bac45e4 100644
--- a/sheep/list.c
+++ b/sheep/list.c
@@ -102,8 +102,9 @@ static sheep_t do_list_concat(struct sheep_vm *vm, sheep_t base, sheep_t tail)
return base;
}
-static sheep_t list_concat(struct sheep_vm *vm, sheep_t sheep,
- unsigned int nr_args)
+static sheep_t list_concat(struct sheep_vm *vm,
+ sheep_t sheep,
+ unsigned int nr_args)
{
sheep_t start, pos, result = NULL;
unsigned int i;
@@ -173,8 +174,10 @@ static sheep_t list_nth(struct sheep_vm *vm, size_t n, sheep_t sheep)
return sheep;
}
-static sheep_t list_slice(struct sheep_vm *vm, sheep_t sheep,
- size_t from, size_t to)
+static sheep_t list_slice(struct sheep_vm *vm,
+ sheep_t sheep,
+ size_t from,
+ size_t to)
{
struct sheep_list *list, *pos;
sheep_t new, result = NULL;
diff --git a/sheep/map.c b/sheep/map.c
index a4fa4a8..b52f9b8 100644
--- a/sheep/map.c
+++ b/sheep/map.c
@@ -24,7 +24,8 @@ static int hash(const char *name)
}
static struct sheep_map_entry **find(struct sheep_map *map,
- const char *name, int *create)
+ const char *name,
+ int *create)
{
struct sheep_map_entry **pentry, *entry;
int index;
diff --git a/sheep/module.c b/sheep/module.c
index 8f7f8b1..5639ec0 100644
--- a/sheep/module.c
+++ b/sheep/module.c
@@ -57,8 +57,9 @@ enum {
LOAD_FAIL,
};
-static unsigned int load_so(struct sheep_vm *vm, const char *path,
- struct sheep_module *mod)
+static unsigned int load_so(struct sheep_vm *vm,
+ const char *path,
+ struct sheep_module *mod)
{
int (*init)(struct sheep_vm *, struct sheep_module *);
void *handle;
@@ -87,8 +88,9 @@ err:
return LOAD_FAIL;
}
-static unsigned int load_sheep(struct sheep_vm *vm, const char *path,
- struct sheep_module *mod)
+static unsigned int load_sheep(struct sheep_vm *vm,
+ const char *path,
+ struct sheep_module *mod)
{
struct sheep_reader reader;
int ret = LOAD_FAIL;
@@ -124,8 +126,10 @@ out:
return ret;
}
-static unsigned int module_load(struct sheep_vm *vm, const char *path,
- const char *name, struct sheep_module *mod)
+static unsigned int module_load(struct sheep_vm *vm,
+ const char *path,
+ const char *name,
+ struct sheep_module *mod)
{
char filename[1024];
@@ -188,8 +192,9 @@ found:
}
unsigned int sheep_module_variable(struct sheep_vm *vm,
- struct sheep_module *module,
- const char *name, sheep_t sheep)
+ struct sheep_module *module,
+ const char *name,
+ sheep_t sheep)
{
unsigned int slot;
@@ -198,8 +203,10 @@ unsigned int sheep_module_variable(struct sheep_vm *vm,
return slot;
}
-void sheep_module_function(struct sheep_vm *vm, struct sheep_module *module,
- const char *name, sheep_alien_t alien)
+void sheep_module_function(struct sheep_vm *vm,
+ struct sheep_module *module,
+ const char *name,
+ sheep_alien_t alien)
{
sheep_t sheep;
diff --git a/sheep/number.c b/sheep/number.c
index fa25a54..a2da1b2 100644
--- a/sheep/number.c
+++ b/sheep/number.c
@@ -93,8 +93,9 @@ enum relation {
MORE,
};
-static sheep_t do_cmp(struct sheep_vm *vm, unsigned int nr_args,
- enum relation relation)
+static sheep_t do_cmp(struct sheep_vm *vm,
+ unsigned int nr_args,
+ enum relation relation)
{
int result = result;
long a, b;
@@ -146,7 +147,8 @@ static sheep_t builtin_more(struct sheep_vm *vm, unsigned int nr_args)
return do_cmp(vm, nr_args, MORE);
}
-static sheep_t do_binop(struct sheep_vm *vm, unsigned int nr_args,
+static sheep_t do_binop(struct sheep_vm *vm,
+ unsigned int nr_args,
char operation)
{
long value, a, b;
diff --git a/sheep/object.c b/sheep/object.c
index 59cf8e6..6c25267 100644
--- a/sheep/object.c
+++ b/sheep/object.c
@@ -14,8 +14,9 @@
#include <sheep/object.h>
-sheep_t sheep_make_object(struct sheep_vm *vm, const struct sheep_type *type,
- void *data)
+sheep_t sheep_make_object(struct sheep_vm *vm,
+ const struct sheep_type *type,
+ void *data)
{
struct sheep_object *sheep;
diff --git a/sheep/parse.c b/sheep/parse.c
index 1080142..18ed2ff 100644
--- a/sheep/parse.c
+++ b/sheep/parse.c
@@ -15,8 +15,10 @@
#include <sheep/parse.h>
-void sheep_parser_error(struct sheep_compile *compile, sheep_t culprit,
- const char *fmt, ...)
+void sheep_parser_error(struct sheep_compile *compile,
+ sheep_t culprit,
+ const char *fmt,
+ ...)
{
struct sheep_expr *expr = compile->expr;
const char *repr;
@@ -51,8 +53,10 @@ enum {
PARSE_TOO_MANY
};
-static unsigned int __parse(struct sheep_list *form, const char *items,
- sheep_t *mismatchp, va_list ap)
+static unsigned int __parse(struct sheep_list *form,
+ const char *items,
+ sheep_t *mismatchp,
+ va_list ap)
{
while (*items) {
struct sheep_name *name;
@@ -111,8 +115,11 @@ static unsigned int __parse(struct sheep_list *form, const char *items,
return PARSE_OK;
}
-static int parse(struct sheep_compile *compile, struct sheep_list *form,
- struct sheep_list *subform, const char *items, va_list ap)
+static int parse(struct sheep_compile *compile,
+ struct sheep_list *form,
+ struct sheep_list *subform,
+ const char *items,
+ va_list ap)
{
unsigned int ret;
sheep_t mismatch;
@@ -130,8 +137,11 @@ static int parse(struct sheep_compile *compile, struct sheep_list *form,
return -1;
}
-int __sheep_parse(struct sheep_compile *compile, struct sheep_list *form,
- struct sheep_list *subform, const char *items, ...)
+int __sheep_parse(struct sheep_compile *compile,
+ struct sheep_list *form,
+ struct sheep_list *subform,
+ const char *items,
+ ...)
{
va_list ap;
int ret;
@@ -142,8 +152,10 @@ int __sheep_parse(struct sheep_compile *compile, struct sheep_list *form,
return ret;
}
-int sheep_parse(struct sheep_compile *compile, struct sheep_list *form,
- const char *items, ...)
+int sheep_parse(struct sheep_compile *compile,
+ struct sheep_list *form,
+ const char *items,
+ ...)
{
va_list ap;
int ret;
diff --git a/sheep/read.c b/sheep/read.c
index e72e9ba..ede1a5b 100644
--- a/sheep/read.c
+++ b/sheep/read.c
@@ -55,7 +55,9 @@ static int issep(int c, int string)
}
static int read_token(struct sheep_reader *reader,
- char *buf, int len, int string)
+ char *buf,
+ int len,
+ int string)
{
int i, c = c;
@@ -85,7 +87,8 @@ static sheep_t read_string(struct sheep_reader *reader, struct sheep_vm *vm)
}
static sheep_t read_atom(struct sheep_reader *reader,
- struct sheep_vm *vm, int c)
+ struct sheep_vm *vm,
+ int c)
{
sheep_t sheep;
char buf[512];
@@ -105,12 +108,13 @@ static sheep_t read_atom(struct sheep_reader *reader,
}
static sheep_t read_sexp(struct sheep_reader *reader,
- struct sheep_vector *lines,
- struct sheep_vm *vm, int c);
+ struct sheep_vector *lines,
+ struct sheep_vm *vm,
+ int c);
static sheep_t read_list(struct sheep_reader *reader,
- struct sheep_vector *lines,
- struct sheep_vm *vm)
+ struct sheep_vector *lines,
+ struct sheep_vm *vm)
{
sheep_t list, pos;
int c;
@@ -141,8 +145,9 @@ static sheep_t read_list(struct sheep_reader *reader,
}
static sheep_t read_sexp(struct sheep_reader *reader,
- struct sheep_vector *lines,
- struct sheep_vm *vm, int c)
+ struct sheep_vector *lines,
+ struct sheep_vm *vm,
+ int c)
{
if (c == EOF)
return &sheep_eof;
diff --git a/sheep/string.c b/sheep/string.c
index 9766042..49b7688 100644
--- a/sheep/string.c
+++ b/sheep/string.c
@@ -58,8 +58,9 @@ static size_t string_length(sheep_t sheep)
return string->nr_bytes;
}
-static sheep_t string_concat(struct sheep_vm *vm, sheep_t sheep,
- unsigned int nr_args)
+static sheep_t string_concat(struct sheep_vm *vm,
+ sheep_t sheep,
+ unsigned int nr_args)
{
struct sheep_string *string;
struct sheep_strbuf sb;
@@ -111,8 +112,10 @@ static sheep_t string_nth(struct sheep_vm *vm, size_t n, sheep_t sheep)
return __sheep_make_string(vm, new, 1);
}
-static sheep_t string_slice(struct sheep_vm *vm, sheep_t sheep,
- size_t from, size_t to)
+static sheep_t string_slice(struct sheep_vm *vm,
+ sheep_t sheep,
+ size_t from,
+ size_t to)
{
struct sheep_string *string;
size_t length = 0;
diff --git a/sheep/type.c b/sheep/type.c
index bbcda07..9b7b728 100644
--- a/sheep/type.c
+++ b/sheep/type.c
@@ -64,8 +64,10 @@ static void typeclass_free(struct sheep_vm *vm, sheep_t sheep)
sheep_free(class);
}
-static enum sheep_call typeclass_call(struct sheep_vm *vm, sheep_t callable,
- unsigned int nr_args, sheep_t *valuep)
+static enum sheep_call typeclass_call(struct sheep_vm *vm,
+ sheep_t callable,
+ unsigned int nr_args,
+ sheep_t *valuep)
{
struct sheep_typeobject *object;
struct sheep_typeclass *class;
@@ -107,8 +109,10 @@ const struct sheep_type sheep_typeclass_type = {
.format = typeclass_format,
};
-sheep_t sheep_make_typeclass(struct sheep_vm *vm, const char *name,
- const char **names, unsigned int nr_slots)
+sheep_t sheep_make_typeclass(struct sheep_vm *vm,
+ const char *name,
+ const char **names,
+ unsigned int nr_slots)
{
struct sheep_typeclass *class;
diff --git a/sheep/unpack.c b/sheep/unpack.c
index bd5f612..8876967 100644
--- a/sheep/unpack.c
+++ b/sheep/unpack.c
@@ -21,8 +21,10 @@
#include <sheep/unpack.h>
-static const char *unpack(int control, sheep_t object,
- void **itemp, void **nextp)
+static const char *unpack(int control,
+ sheep_t object,
+ void **itemp,
+ void **nextp)
{
const struct sheep_type *type = sheep_type(object);
int want;
@@ -118,8 +120,10 @@ int sheep_unpack(struct sheep_vm *vm, sheep_t object, const char item, ...)
return 0;
}
-int sheep_unpack_list(struct sheep_vm *vm, struct sheep_list *list,
- const char *items, ...)
+int sheep_unpack_list(struct sheep_vm *vm,
+ struct sheep_list *list,
+ const char *items,
+ ...)
{
va_list ap;
@@ -165,8 +169,10 @@ int sheep_unpack_list(struct sheep_vm *vm, struct sheep_list *list,
return -1;
}
-int sheep_unpack_stack(struct sheep_vm *vm, unsigned int nr_args,
- const char *items, ...)
+int sheep_unpack_stack(struct sheep_vm *vm,
+ unsigned int nr_args,
+ const char *items,
+ ...)
{
unsigned long base, index;
va_list ap;
diff --git a/sheep/vm.c b/sheep/vm.c
index 97e9d2b..dabe835 100644
--- a/sheep/vm.c
+++ b/sheep/vm.c
@@ -109,7 +109,8 @@ void sheep_vm_mark(struct sheep_vm *vm)
}
unsigned int sheep_vm_variable(struct sheep_vm *vm,
- const char *name, sheep_t value)
+ const char *name,
+ sheep_t value)
{
unsigned int slot;