From f4826cf9ab5ed251018691d36caed697f0786e76 Mon Sep 17 00:00:00 2001 From: Toon Knapen Date: Thu, 10 Jul 2003 12:09:28 +0000 Subject: [PATCH] port to sunpro [SVN r19022] --- historic/jam/src/builtins.c | 19 ++++++++++--------- historic/jam/src/compile.c | 9 +++++---- historic/jam/src/execunix.c | 1 - historic/jam/src/filesys.h | 4 ++++ historic/jam/src/fileunix.c | 4 ++++ historic/jam/src/frames.h | 2 +- historic/jam/src/jam.c | 1 + historic/jam/src/make1.c | 11 ++++++++--- historic/jam/src/modules.c | 20 ++++++++++---------- historic/jam/src/newstr.c | 2 +- historic/jam/src/pathunix.c | 1 + historic/jam/src/rules.c | 17 +++++++++-------- historic/jam/src/rules.h | 2 +- historic/jam/src/variable.c | 2 +- jam_src/builtins.c | 19 ++++++++++--------- jam_src/compile.c | 9 +++++---- jam_src/execunix.c | 1 - jam_src/filesys.h | 4 ++++ jam_src/fileunix.c | 4 ++++ jam_src/frames.h | 2 +- jam_src/jam.c | 1 + jam_src/make1.c | 11 ++++++++--- jam_src/modules.c | 20 ++++++++++---------- jam_src/newstr.c | 2 +- jam_src/pathunix.c | 1 + jam_src/rules.c | 17 +++++++++-------- jam_src/rules.h | 2 +- jam_src/variable.c | 2 +- 28 files changed, 112 insertions(+), 78 deletions(-) diff --git a/historic/jam/src/builtins.c b/historic/jam/src/builtins.c index dc2f3ccb0..6f3008b36 100644 --- a/historic/jam/src/builtins.c +++ b/historic/jam/src/builtins.c @@ -19,6 +19,7 @@ # include "pwd.h" # include "pathsys.h" # include "make.h" +# include "hdrmacro.h" # include /* @@ -503,8 +504,8 @@ builtin_hdrmacro( /* helper function for builtin_rulenames(), below */ static void add_rule_name( void* r_, void* result_ ) { - RULE* r = r_; - LIST** result = result_; + RULE* r = (RULE*)r_; + LIST** result = (LIST**)result_; if ( r->exported ) *result = list_new( *result, copystr( r->name ) ); @@ -517,7 +518,7 @@ builtin_rulenames( { LIST *arg0 = lol_get( frame->args, 0 ); LIST *result = L0; - module* source_module = bindmodule( arg0 ? arg0->string : 0 ); + module_t* source_module = bindmodule( arg0 ? arg0->string : 0 ); if ( source_module->rules ) hashenumerate( source_module->rules, add_rule_name, &result ); @@ -536,7 +537,7 @@ builtin_rulenames( */ static void add_hash_key( void* np, void* result_ ) { - LIST** result = result_; + LIST** result = (LIST**)result_; *result = list_new( *result, copystr( *(char**)np ) ); } @@ -548,7 +549,7 @@ builtin_varnames( { LIST *arg0 = lol_get( frame->args, 0 ); LIST *result = L0; - module* source_module = bindmodule( arg0 ? arg0->string : 0 ); + module_t* source_module = bindmodule( arg0 ? arg0->string : 0 ); if ( source_module->variables ) hashenumerate( source_module->variables, add_hash_key, &result ); @@ -567,7 +568,7 @@ builtin_delete_module( { LIST *arg0 = lol_get( frame->args, 0 ); LIST *result = L0; - module* source_module = bindmodule( arg0 ? arg0->string : 0 ); + module_t* source_module = bindmodule( arg0 ? arg0->string : 0 ); delete_module( source_module ); return result; @@ -608,8 +609,8 @@ builtin_import( LIST *target_rules = lol_get( frame->args, 3 ); LIST *localize = lol_get( frame->args, 4 ); - module* target_module = bindmodule( target_module_list ? target_module_list->string : 0 ); - module* source_module = bindmodule( source_module_list ? source_module_list->string : 0 ); + module_t* target_module = bindmodule( target_module_list ? target_module_list->string : 0 ); + module_t* source_module = bindmodule( source_module_list ? source_module_list->string : 0 ); LIST *source_name, *target_name; @@ -666,7 +667,7 @@ builtin_export( LIST *module_list = lol_get( frame->args, 0 ); LIST *rules = lol_get( frame->args, 1 ); - module* m = bindmodule( module_list ? module_list->string : 0 ); + module_t* m = bindmodule( module_list ? module_list->string : 0 ); for ( ; rules; rules = list_next( rules ) ) diff --git a/historic/jam/src/compile.c b/historic/jam/src/compile.c index 551a5817f..a3a54068a 100644 --- a/historic/jam/src/compile.c +++ b/historic/jam/src/compile.c @@ -27,6 +27,7 @@ # include "hash.h" # include "modules.h" # include "strings.h" +# include "builtins.h" # include # include @@ -390,7 +391,7 @@ compile_module( LIST* module_name = parse_evaluate( p->left, frame ); LIST* result; - module* outer_module = frame->module; + module_t* outer_module = frame->module; frame->module = module_name ? bindmodule( module_name->string ) : root_module(); if ( outer_module != frame->module ) @@ -631,7 +632,7 @@ arg_modifier( LIST* formal ) static void type_check( char* type_name, LIST *values, FRAME* caller, RULE* called, LIST* arg_name ) { - static module *typecheck = 0; + static module_t *typecheck = 0; /* if nothing to check, bail now */ if ( !values || !type_name ) @@ -841,7 +842,7 @@ static void profile_exit(profile_frame* frame) static void dump_profile_entry(void* p_, void* ignored) { - profile_info* p = p_; + profile_info* p = (profile_info*)p_; printf("%10d %10d %10d %s\n", p->cumulative, p->net, p->num_entries, p->name); } @@ -866,7 +867,7 @@ evaluate_rule( LIST *result = L0; RULE *rule; profile_frame prof[1]; - module *prev_module = frame->module; + module_t *prev_module = frame->module; LIST *l; { diff --git a/historic/jam/src/execunix.c b/historic/jam/src/execunix.c index 2b297a341..1861cd400 100644 --- a/historic/jam/src/execunix.c +++ b/historic/jam/src/execunix.c @@ -9,7 +9,6 @@ # include "execcmd.h" # include - #if defined(sun) || defined(__sun) #include // need to include unistd.h on sun for the vfork prototype #include diff --git a/historic/jam/src/filesys.h b/historic/jam/src/filesys.h index 5d4523363..44b4021dc 100644 --- a/historic/jam/src/filesys.h +++ b/historic/jam/src/filesys.h @@ -19,6 +19,8 @@ #ifndef FILESYS_DWA20011025_H # define FILESYS_DWA20011025_H +# include "pathsys.h" + typedef void (*scanback)( void *closure, char *file, int found, time_t t ); void file_dirscan( char *dir, scanback func, void *closure ); @@ -26,4 +28,6 @@ void file_archscan( char *arch, scanback func, void *closure ); int file_time( char *filename, time_t *time ); +void file_build1(PATHNAME *f, string* file) ; + #endif diff --git a/historic/jam/src/fileunix.c b/historic/jam/src/fileunix.c index 28b7f3bc1..896b4f8b3 100644 --- a/historic/jam/src/fileunix.c +++ b/historic/jam/src/fileunix.c @@ -24,6 +24,10 @@ # ifdef USE_FILEUNIX +#if defined(sun) || defined(__sun) +# include // needed for read and close prototype +#endif + # if defined( OS_SEQUENT ) || \ defined( OS_DGUX ) || \ defined( OS_SCO ) || \ diff --git a/historic/jam/src/frames.h b/historic/jam/src/frames.h index 41cb02bf9..8541af1c0 100644 --- a/historic/jam/src/frames.h +++ b/historic/jam/src/frames.h @@ -18,7 +18,7 @@ struct frame { FRAME* prev; LOL args[1]; - module* module; + module_t* module; PARSE* procedure; char* rulename; }; diff --git a/historic/jam/src/jam.c b/historic/jam/src/jam.c index 4d92d3e9e..695b7c351 100644 --- a/historic/jam/src/jam.c +++ b/historic/jam/src/jam.c @@ -122,6 +122,7 @@ # include "timestamp.h" # include "make.h" # include "strings.h" +# include "expand.h" /* Macintosh is "special" */ diff --git a/historic/jam/src/make1.c b/historic/jam/src/make1.c index 744906f88..4cc0737e5 100644 --- a/historic/jam/src/make1.c +++ b/historic/jam/src/make1.c @@ -55,6 +55,7 @@ # include "assert.h" # include "variable.h" # include "rules.h" +# include "headers.h" # include "search.h" # include "newstr.h" @@ -62,6 +63,10 @@ # include "command.h" # include "execcmd.h" +#if defined(sun) || defined(__sun) +#include /* for unlink */ +#endif + static CMD *make1cmds( TARGET *t ); static LIST *make1list( LIST *l, TARGETS *targets, int flags ); static SETTINGS *make1settings( LIST *vars ); @@ -733,9 +738,9 @@ make1d(state *pState) * target with those from the new module and target */ static void swap_settings( - module** current_module + module_t** current_module , TARGET** current_target - , module* new_module + , module_t* new_module , TARGET* new_target) { if (new_module == root_module()) @@ -779,7 +784,7 @@ make1cmds( TARGET *t ) CMD *cmds = 0; LIST *shell = 0; - module *settings_module = 0; + module_t *settings_module = 0; TARGET *settings_target = 0; /* Step through actions */ diff --git a/historic/jam/src/modules.c b/historic/jam/src/modules.c index f80ef405d..4d9985c1c 100644 --- a/historic/jam/src/modules.c +++ b/historic/jam/src/modules.c @@ -17,7 +17,7 @@ static struct hash* module_hash = 0; -static char* new_module_str( module* m, char* suffix ) +static char* new_module_str( module_t* m, char* suffix ) { char* result; string s; @@ -28,13 +28,13 @@ static char* new_module_str( module* m, char* suffix ) return result; } -module* bindmodule( char* name ) +module_t* bindmodule( char* name ) { string s; - module m_, *m = &m_; + module_t m_, *m = &m_; if( !module_hash ) - module_hash = hashinit( sizeof( module ), "modules" ); + module_hash = hashinit( sizeof( module_t ), "modules" ); string_new( &s ); if (name) @@ -58,7 +58,7 @@ module* bindmodule( char* name ) /* * demand_rules() - Get the module's "rules" hash on demand */ -struct hash* demand_rules( module* m ) +struct hash* demand_rules( module_t* m ) { if ( !m->rules ) m->rules = hashinit( sizeof( RULE ), new_module_str( m, "rules" ) ); @@ -73,7 +73,7 @@ static void delete_rule_( void* xrule, void* data ) rule_free( (RULE*)xrule ); } -void delete_module( module* m ) +void delete_module( module_t* m ) { /* clear out all the rules */ if ( m->rules ) @@ -92,20 +92,20 @@ void delete_module( module* m ) } } -module* root_module() +module_t* root_module() { - static module* root = 0; + static module_t* root = 0; if ( !root ) root = bindmodule(0); return root; } -void enter_module( module* m ) +void enter_module( module_t* m ) { var_hash_swap( &m->variables ); } -void exit_module( module* m ) +void exit_module( module_t* m ) { var_hash_swap( &m->variables ); } diff --git a/historic/jam/src/newstr.c b/historic/jam/src/newstr.c index 58668fcb6..117dfb9ab 100644 --- a/historic/jam/src/newstr.c +++ b/historic/jam/src/newstr.c @@ -74,7 +74,7 @@ static char* allocate(size_t n) nalloc = STRING_BLOCK; /* allocate a new block and link into the chain */ - new_block = malloc( offsetof( strblock, data[0] ) + nalloc * sizeof(new_block->data[0]) ); + new_block = (strblock*)malloc( offsetof( strblock, data[0] ) + nalloc * sizeof(new_block->data[0]) ); if ( new_block == 0 ) return 0; new_block->next = strblock_chain; diff --git a/historic/jam/src/pathunix.c b/historic/jam/src/pathunix.c index d2a4c42de..ad8fc9ec4 100644 --- a/historic/jam/src/pathunix.c +++ b/historic/jam/src/pathunix.c @@ -16,6 +16,7 @@ # include "pathsys.h" # include "strings.h" # include "newstr.h" +# include "filesys.h" # ifdef USE_PATHUNIX diff --git a/historic/jam/src/rules.c b/historic/jam/src/rules.c index 0d3a748a8..fac0894e8 100644 --- a/historic/jam/src/rules.c +++ b/historic/jam/src/rules.c @@ -15,6 +15,7 @@ # include "search.h" # include "lists.h" # include "pathsys.h" +# include "timestamp.h" /* This file is ALSO: * (C) Copyright David Abrahams 2001. Permission to copy, use, @@ -68,7 +69,7 @@ static struct hash *located_targets = 0; * target_module. */ static RULE * -enter_rule( char *rulename, module *target_module ) +enter_rule( char *rulename, module_t *target_module ) { RULE rule, *r = &rule; @@ -93,7 +94,7 @@ enter_rule( char *rulename, module *target_module ) * src_module. */ static RULE * -define_rule( module *src_module, char *rulename, module *target_module ) +define_rule( module_t *src_module, char *rulename, module_t *target_module ) { RULE *r = enter_rule( rulename, target_module ); @@ -550,7 +551,7 @@ donerules() */ argument_list* args_new() { - argument_list* r = malloc( sizeof(argument_list) ); + argument_list* r = (argument_list*)malloc( sizeof(argument_list) ); r->reference_count = 0; lol_init(r->data); return r; @@ -657,7 +658,7 @@ static RULE* global_rule( RULE* r ) * true, the rule is exported to the global module as * modulename.rulename. */ -RULE* new_rule_body( module* m, char* rulename, argument_list* args, PARSE* procedure, int exported ) +RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int exported ) { RULE* local = define_rule( m, rulename, m ); local->exported = exported; @@ -687,7 +688,7 @@ static void set_rule_actions( RULE* rule, rule_actions* actions ) static rule_actions* actions_new( char* command, LIST* bindlist, int flags ) { - rule_actions* result = malloc(sizeof(rule_actions)); + rule_actions* result = (rule_actions*)malloc(sizeof(rule_actions)); result->command = copystr( command ); result->bindlist = bindlist; result->flags = flags; @@ -695,7 +696,7 @@ static rule_actions* actions_new( char* command, LIST* bindlist, int flags ) return result; } -RULE* new_rule_actions( module* m, char* rulename, char* command, LIST* bindlist, int flags ) +RULE* new_rule_actions( module_t* m, char* rulename, char* command, LIST* bindlist, int flags ) { RULE* local = define_rule( m, rulename, m ); RULE* global = global_rule( local ); @@ -704,7 +705,7 @@ RULE* new_rule_actions( module* m, char* rulename, char* command, LIST* bindlist return local; } -RULE *bindrule( char *rulename, module* m ) +RULE *bindrule( char *rulename, module_t* m ) { RULE rule, *r = &rule; r->name = rulename; @@ -715,7 +716,7 @@ RULE *bindrule( char *rulename, module* m ) return enter_rule( rulename, root_module() ); } -RULE* import_rule( RULE* source, module* m, char* name ) +RULE* import_rule( RULE* source, module_t* m, char* name ) { RULE* dest = define_rule( source->module, name, m ); set_rule_body( dest, source->arguments, source->procedure ); diff --git a/historic/jam/src/rules.h b/historic/jam/src/rules.h index d67d29054..4c10f42f3 100644 --- a/historic/jam/src/rules.h +++ b/historic/jam/src/rules.h @@ -223,7 +223,7 @@ struct _target { RULE *bindrule( char *rulename, module_t* ); RULE* import_rule( RULE* source, module_t* m, char* name ); -RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int export ); +RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int exprt ); RULE* new_rule_actions( module_t* m, char* rulename, char* command, LIST* bindlist, int flags ); TARGET *bindtarget( const char *targetname ); TARGET *copytarget( const TARGET *t ); diff --git a/historic/jam/src/variable.c b/historic/jam/src/variable.c index 1399723b0..3a5e773f8 100644 --- a/historic/jam/src/variable.c +++ b/historic/jam/src/variable.c @@ -375,7 +375,7 @@ var_dump( */ static void delete_var_( void* xvar, void* data ) { - VARIABLE *v = xvar; + VARIABLE *v = (VARIABLE*)xvar; freestr( v->symbol ); list_free( v-> value ); } diff --git a/jam_src/builtins.c b/jam_src/builtins.c index dc2f3ccb0..6f3008b36 100644 --- a/jam_src/builtins.c +++ b/jam_src/builtins.c @@ -19,6 +19,7 @@ # include "pwd.h" # include "pathsys.h" # include "make.h" +# include "hdrmacro.h" # include /* @@ -503,8 +504,8 @@ builtin_hdrmacro( /* helper function for builtin_rulenames(), below */ static void add_rule_name( void* r_, void* result_ ) { - RULE* r = r_; - LIST** result = result_; + RULE* r = (RULE*)r_; + LIST** result = (LIST**)result_; if ( r->exported ) *result = list_new( *result, copystr( r->name ) ); @@ -517,7 +518,7 @@ builtin_rulenames( { LIST *arg0 = lol_get( frame->args, 0 ); LIST *result = L0; - module* source_module = bindmodule( arg0 ? arg0->string : 0 ); + module_t* source_module = bindmodule( arg0 ? arg0->string : 0 ); if ( source_module->rules ) hashenumerate( source_module->rules, add_rule_name, &result ); @@ -536,7 +537,7 @@ builtin_rulenames( */ static void add_hash_key( void* np, void* result_ ) { - LIST** result = result_; + LIST** result = (LIST**)result_; *result = list_new( *result, copystr( *(char**)np ) ); } @@ -548,7 +549,7 @@ builtin_varnames( { LIST *arg0 = lol_get( frame->args, 0 ); LIST *result = L0; - module* source_module = bindmodule( arg0 ? arg0->string : 0 ); + module_t* source_module = bindmodule( arg0 ? arg0->string : 0 ); if ( source_module->variables ) hashenumerate( source_module->variables, add_hash_key, &result ); @@ -567,7 +568,7 @@ builtin_delete_module( { LIST *arg0 = lol_get( frame->args, 0 ); LIST *result = L0; - module* source_module = bindmodule( arg0 ? arg0->string : 0 ); + module_t* source_module = bindmodule( arg0 ? arg0->string : 0 ); delete_module( source_module ); return result; @@ -608,8 +609,8 @@ builtin_import( LIST *target_rules = lol_get( frame->args, 3 ); LIST *localize = lol_get( frame->args, 4 ); - module* target_module = bindmodule( target_module_list ? target_module_list->string : 0 ); - module* source_module = bindmodule( source_module_list ? source_module_list->string : 0 ); + module_t* target_module = bindmodule( target_module_list ? target_module_list->string : 0 ); + module_t* source_module = bindmodule( source_module_list ? source_module_list->string : 0 ); LIST *source_name, *target_name; @@ -666,7 +667,7 @@ builtin_export( LIST *module_list = lol_get( frame->args, 0 ); LIST *rules = lol_get( frame->args, 1 ); - module* m = bindmodule( module_list ? module_list->string : 0 ); + module_t* m = bindmodule( module_list ? module_list->string : 0 ); for ( ; rules; rules = list_next( rules ) ) diff --git a/jam_src/compile.c b/jam_src/compile.c index 551a5817f..a3a54068a 100644 --- a/jam_src/compile.c +++ b/jam_src/compile.c @@ -27,6 +27,7 @@ # include "hash.h" # include "modules.h" # include "strings.h" +# include "builtins.h" # include # include @@ -390,7 +391,7 @@ compile_module( LIST* module_name = parse_evaluate( p->left, frame ); LIST* result; - module* outer_module = frame->module; + module_t* outer_module = frame->module; frame->module = module_name ? bindmodule( module_name->string ) : root_module(); if ( outer_module != frame->module ) @@ -631,7 +632,7 @@ arg_modifier( LIST* formal ) static void type_check( char* type_name, LIST *values, FRAME* caller, RULE* called, LIST* arg_name ) { - static module *typecheck = 0; + static module_t *typecheck = 0; /* if nothing to check, bail now */ if ( !values || !type_name ) @@ -841,7 +842,7 @@ static void profile_exit(profile_frame* frame) static void dump_profile_entry(void* p_, void* ignored) { - profile_info* p = p_; + profile_info* p = (profile_info*)p_; printf("%10d %10d %10d %s\n", p->cumulative, p->net, p->num_entries, p->name); } @@ -866,7 +867,7 @@ evaluate_rule( LIST *result = L0; RULE *rule; profile_frame prof[1]; - module *prev_module = frame->module; + module_t *prev_module = frame->module; LIST *l; { diff --git a/jam_src/execunix.c b/jam_src/execunix.c index 2b297a341..1861cd400 100644 --- a/jam_src/execunix.c +++ b/jam_src/execunix.c @@ -9,7 +9,6 @@ # include "execcmd.h" # include - #if defined(sun) || defined(__sun) #include // need to include unistd.h on sun for the vfork prototype #include diff --git a/jam_src/filesys.h b/jam_src/filesys.h index 5d4523363..44b4021dc 100644 --- a/jam_src/filesys.h +++ b/jam_src/filesys.h @@ -19,6 +19,8 @@ #ifndef FILESYS_DWA20011025_H # define FILESYS_DWA20011025_H +# include "pathsys.h" + typedef void (*scanback)( void *closure, char *file, int found, time_t t ); void file_dirscan( char *dir, scanback func, void *closure ); @@ -26,4 +28,6 @@ void file_archscan( char *arch, scanback func, void *closure ); int file_time( char *filename, time_t *time ); +void file_build1(PATHNAME *f, string* file) ; + #endif diff --git a/jam_src/fileunix.c b/jam_src/fileunix.c index 28b7f3bc1..896b4f8b3 100644 --- a/jam_src/fileunix.c +++ b/jam_src/fileunix.c @@ -24,6 +24,10 @@ # ifdef USE_FILEUNIX +#if defined(sun) || defined(__sun) +# include // needed for read and close prototype +#endif + # if defined( OS_SEQUENT ) || \ defined( OS_DGUX ) || \ defined( OS_SCO ) || \ diff --git a/jam_src/frames.h b/jam_src/frames.h index 41cb02bf9..8541af1c0 100644 --- a/jam_src/frames.h +++ b/jam_src/frames.h @@ -18,7 +18,7 @@ struct frame { FRAME* prev; LOL args[1]; - module* module; + module_t* module; PARSE* procedure; char* rulename; }; diff --git a/jam_src/jam.c b/jam_src/jam.c index 4d92d3e9e..695b7c351 100644 --- a/jam_src/jam.c +++ b/jam_src/jam.c @@ -122,6 +122,7 @@ # include "timestamp.h" # include "make.h" # include "strings.h" +# include "expand.h" /* Macintosh is "special" */ diff --git a/jam_src/make1.c b/jam_src/make1.c index 744906f88..4cc0737e5 100644 --- a/jam_src/make1.c +++ b/jam_src/make1.c @@ -55,6 +55,7 @@ # include "assert.h" # include "variable.h" # include "rules.h" +# include "headers.h" # include "search.h" # include "newstr.h" @@ -62,6 +63,10 @@ # include "command.h" # include "execcmd.h" +#if defined(sun) || defined(__sun) +#include /* for unlink */ +#endif + static CMD *make1cmds( TARGET *t ); static LIST *make1list( LIST *l, TARGETS *targets, int flags ); static SETTINGS *make1settings( LIST *vars ); @@ -733,9 +738,9 @@ make1d(state *pState) * target with those from the new module and target */ static void swap_settings( - module** current_module + module_t** current_module , TARGET** current_target - , module* new_module + , module_t* new_module , TARGET* new_target) { if (new_module == root_module()) @@ -779,7 +784,7 @@ make1cmds( TARGET *t ) CMD *cmds = 0; LIST *shell = 0; - module *settings_module = 0; + module_t *settings_module = 0; TARGET *settings_target = 0; /* Step through actions */ diff --git a/jam_src/modules.c b/jam_src/modules.c index f80ef405d..4d9985c1c 100644 --- a/jam_src/modules.c +++ b/jam_src/modules.c @@ -17,7 +17,7 @@ static struct hash* module_hash = 0; -static char* new_module_str( module* m, char* suffix ) +static char* new_module_str( module_t* m, char* suffix ) { char* result; string s; @@ -28,13 +28,13 @@ static char* new_module_str( module* m, char* suffix ) return result; } -module* bindmodule( char* name ) +module_t* bindmodule( char* name ) { string s; - module m_, *m = &m_; + module_t m_, *m = &m_; if( !module_hash ) - module_hash = hashinit( sizeof( module ), "modules" ); + module_hash = hashinit( sizeof( module_t ), "modules" ); string_new( &s ); if (name) @@ -58,7 +58,7 @@ module* bindmodule( char* name ) /* * demand_rules() - Get the module's "rules" hash on demand */ -struct hash* demand_rules( module* m ) +struct hash* demand_rules( module_t* m ) { if ( !m->rules ) m->rules = hashinit( sizeof( RULE ), new_module_str( m, "rules" ) ); @@ -73,7 +73,7 @@ static void delete_rule_( void* xrule, void* data ) rule_free( (RULE*)xrule ); } -void delete_module( module* m ) +void delete_module( module_t* m ) { /* clear out all the rules */ if ( m->rules ) @@ -92,20 +92,20 @@ void delete_module( module* m ) } } -module* root_module() +module_t* root_module() { - static module* root = 0; + static module_t* root = 0; if ( !root ) root = bindmodule(0); return root; } -void enter_module( module* m ) +void enter_module( module_t* m ) { var_hash_swap( &m->variables ); } -void exit_module( module* m ) +void exit_module( module_t* m ) { var_hash_swap( &m->variables ); } diff --git a/jam_src/newstr.c b/jam_src/newstr.c index 58668fcb6..117dfb9ab 100644 --- a/jam_src/newstr.c +++ b/jam_src/newstr.c @@ -74,7 +74,7 @@ static char* allocate(size_t n) nalloc = STRING_BLOCK; /* allocate a new block and link into the chain */ - new_block = malloc( offsetof( strblock, data[0] ) + nalloc * sizeof(new_block->data[0]) ); + new_block = (strblock*)malloc( offsetof( strblock, data[0] ) + nalloc * sizeof(new_block->data[0]) ); if ( new_block == 0 ) return 0; new_block->next = strblock_chain; diff --git a/jam_src/pathunix.c b/jam_src/pathunix.c index d2a4c42de..ad8fc9ec4 100644 --- a/jam_src/pathunix.c +++ b/jam_src/pathunix.c @@ -16,6 +16,7 @@ # include "pathsys.h" # include "strings.h" # include "newstr.h" +# include "filesys.h" # ifdef USE_PATHUNIX diff --git a/jam_src/rules.c b/jam_src/rules.c index 0d3a748a8..fac0894e8 100644 --- a/jam_src/rules.c +++ b/jam_src/rules.c @@ -15,6 +15,7 @@ # include "search.h" # include "lists.h" # include "pathsys.h" +# include "timestamp.h" /* This file is ALSO: * (C) Copyright David Abrahams 2001. Permission to copy, use, @@ -68,7 +69,7 @@ static struct hash *located_targets = 0; * target_module. */ static RULE * -enter_rule( char *rulename, module *target_module ) +enter_rule( char *rulename, module_t *target_module ) { RULE rule, *r = &rule; @@ -93,7 +94,7 @@ enter_rule( char *rulename, module *target_module ) * src_module. */ static RULE * -define_rule( module *src_module, char *rulename, module *target_module ) +define_rule( module_t *src_module, char *rulename, module_t *target_module ) { RULE *r = enter_rule( rulename, target_module ); @@ -550,7 +551,7 @@ donerules() */ argument_list* args_new() { - argument_list* r = malloc( sizeof(argument_list) ); + argument_list* r = (argument_list*)malloc( sizeof(argument_list) ); r->reference_count = 0; lol_init(r->data); return r; @@ -657,7 +658,7 @@ static RULE* global_rule( RULE* r ) * true, the rule is exported to the global module as * modulename.rulename. */ -RULE* new_rule_body( module* m, char* rulename, argument_list* args, PARSE* procedure, int exported ) +RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int exported ) { RULE* local = define_rule( m, rulename, m ); local->exported = exported; @@ -687,7 +688,7 @@ static void set_rule_actions( RULE* rule, rule_actions* actions ) static rule_actions* actions_new( char* command, LIST* bindlist, int flags ) { - rule_actions* result = malloc(sizeof(rule_actions)); + rule_actions* result = (rule_actions*)malloc(sizeof(rule_actions)); result->command = copystr( command ); result->bindlist = bindlist; result->flags = flags; @@ -695,7 +696,7 @@ static rule_actions* actions_new( char* command, LIST* bindlist, int flags ) return result; } -RULE* new_rule_actions( module* m, char* rulename, char* command, LIST* bindlist, int flags ) +RULE* new_rule_actions( module_t* m, char* rulename, char* command, LIST* bindlist, int flags ) { RULE* local = define_rule( m, rulename, m ); RULE* global = global_rule( local ); @@ -704,7 +705,7 @@ RULE* new_rule_actions( module* m, char* rulename, char* command, LIST* bindlist return local; } -RULE *bindrule( char *rulename, module* m ) +RULE *bindrule( char *rulename, module_t* m ) { RULE rule, *r = &rule; r->name = rulename; @@ -715,7 +716,7 @@ RULE *bindrule( char *rulename, module* m ) return enter_rule( rulename, root_module() ); } -RULE* import_rule( RULE* source, module* m, char* name ) +RULE* import_rule( RULE* source, module_t* m, char* name ) { RULE* dest = define_rule( source->module, name, m ); set_rule_body( dest, source->arguments, source->procedure ); diff --git a/jam_src/rules.h b/jam_src/rules.h index d67d29054..4c10f42f3 100644 --- a/jam_src/rules.h +++ b/jam_src/rules.h @@ -223,7 +223,7 @@ struct _target { RULE *bindrule( char *rulename, module_t* ); RULE* import_rule( RULE* source, module_t* m, char* name ); -RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int export ); +RULE* new_rule_body( module_t* m, char* rulename, argument_list* args, PARSE* procedure, int exprt ); RULE* new_rule_actions( module_t* m, char* rulename, char* command, LIST* bindlist, int flags ); TARGET *bindtarget( const char *targetname ); TARGET *copytarget( const TARGET *t ); diff --git a/jam_src/variable.c b/jam_src/variable.c index 1399723b0..3a5e773f8 100644 --- a/jam_src/variable.c +++ b/jam_src/variable.c @@ -375,7 +375,7 @@ var_dump( */ static void delete_var_( void* xvar, void* data ) { - VARIABLE *v = xvar; + VARIABLE *v = (VARIABLE*)xvar; freestr( v->symbol ); list_free( v-> value ); }