Search
lxdream.org :: lxdream/src/tools/gendec.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/tools/gendec.c
changeset 969:3f178ca1398c
prev948:545c85cc56f1
next979:2cc7b486ea6c
author nkeynes
date Thu Jan 22 00:45:15 2009 +0000 (13 years ago)
permissions -rw-r--r--
last change Make local functions static (to shut up icc warnings, plus not being a bad idea in general)
file annotate diff log raw
1.1 --- a/src/tools/gendec.c Wed Jan 07 04:39:04 2009 +0000
1.2 +++ b/src/tools/gendec.c Thu Jan 22 00:45:15 2009 +0000
1.3 @@ -42,14 +42,14 @@
1.4 int gen_mode = GEN_SOURCE;
1.5 struct option longopts[1] = { { NULL, 0, 0, 0 } };
1.6
1.7 -void usage() {
1.8 +static void usage() {
1.9 printf( "gendec <instruction-file> <action-file> [ -o <output-file> ]\n" );
1.10 }
1.11
1.12 /**
1.13 * Find a mask that can be used to split up the given rules
1.14 */
1.15 -uint32_t find_mask( struct ruleset *rules, int ruleidx[], int rule_count,
1.16 +static uint32_t find_mask( struct ruleset *rules, int ruleidx[], int rule_count,
1.17 uint32_t input_mask )
1.18 {
1.19 int i;
1.20 @@ -64,7 +64,7 @@
1.21 return mask & (~input_mask); /* but we don't want to see the input mask again */
1.22 }
1.23
1.24 -int get_option_count_for_mask( uint32_t mask ) {
1.25 +static int get_option_count_for_mask( uint32_t mask ) {
1.26 int count = 0;
1.27
1.28 while( mask ) {
1.29 @@ -84,7 +84,7 @@
1.30 return shift;
1.31 }
1.32
1.33 -void get_option_values_for_mask( uint32_t *options,
1.34 +static void get_option_values_for_mask( uint32_t *options,
1.35 uint32_t mask )
1.36 {
1.37 /* This could be a lot smarter. But it's not */
1.38 @@ -98,7 +98,7 @@
1.39 }
1.40 }
1.41
1.42 -void fprint_indent( char *action, int depth, FILE *f )
1.43 +static void fprint_indent( char *action, int depth, FILE *f )
1.44 {
1.45 int spaces = 0, needed = depth*8, i;
1.46 char *text = action;
1.47 @@ -126,7 +126,7 @@
1.48 }
1.49 }
1.50
1.51 -void fprint_action( struct rule *rule, char *action, int depth, FILE *f )
1.52 +static void fprint_action( struct rule *rule, char *action, int depth, FILE *f )
1.53 {
1.54 int i;
1.55 if( action == NULL ) {
1.56 @@ -161,7 +161,7 @@
1.57 }
1.58 }
1.59
1.60 -void split_and_generate( struct ruleset *rules, char **actions,
1.61 +static void split_and_generate( struct ruleset *rules, char **actions,
1.62 int ruleidx[], int rule_count, int input_mask,
1.63 int depth, FILE *f ) {
1.64 uint32_t mask;
1.65 @@ -223,7 +223,7 @@
1.66 }
1.67 }
1.68
1.69 -int generate_decoder( struct ruleset *rules, actionfile_t af, FILE *out )
1.70 +static int generate_decoder( struct ruleset *rules, actionfile_t af, FILE *out )
1.71 {
1.72 int ruleidx[rules->rule_count];
1.73 int i;
1.74 @@ -247,7 +247,7 @@
1.75 return 0;
1.76 }
1.77
1.78 -int generate_template( struct ruleset *rules, actionfile_t af, FILE *out )
1.79 +static int generate_template( struct ruleset *rules, actionfile_t af, FILE *out )
1.80 {
1.81 int i;
1.82
.