Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion detok/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ STRIP ?= strip
INCLUDES = -I../shared

# Normal Flags:
CFLAGS ?= -O2 -Wall #-Wextra
CFLAGS ?= -O2 -Wall -Werror #-Wextra
LDFLAGS ?=

# Coverage:
Expand Down
2 changes: 1 addition & 1 deletion detok/addfcodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ bool add_fcodes_from_list(char *vf_file_name)
int indx;
for (indx = 0; indx < spcl_func_count; indx++) {
if ( strcmp( vs_fc_name, spcl_func_list[indx].name) == 0 ) {
char strbuf[64];
char strbuf[90];
found_spf = true;
spcl_func_list[indx].fcode = vs_fc_number;
link_token( &spcl_func_list[indx]);
Expand Down
4 changes: 1 addition & 3 deletions detok/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,8 @@ static void decode_branch(void)

static void decode_two(void)
{
u16 token;

output_token();
token = next_token();
next_token();
output_token_name();
printf("\n");
}
Expand Down
2 changes: 1 addition & 1 deletion romheaders/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PROGRAM = romheaders
DESTDIR ?= /usr/local
CC ?= gcc
STRIP ?= strip
CFLAGS ?= -O2 -Wall -Wextra
CFLAGS ?= -O2 -Wall -Werror -Wextra
LDFLAGS ?=
INCLUDES = -I../shared

Expand Down
2 changes: 1 addition & 1 deletion toke/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ STRIP ?= strip
INCLUDES = -I../shared

# Normal flags
CFLAGS ?= -O2 -Wall #-Wextra
CFLAGS ?= -O2 -Wall -Werror #-Wextra
LDFLAGS ?=

# Coverage:
Expand Down
14 changes: 7 additions & 7 deletions toke/conditl.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static bool already_ignoring = false;
*
**************************************************************************** */

void skip_a_word( tic_bool_param_t pfield )
void skip_a_word( tic_param_t pfield )
{
/* signed long wlen = */ get_word();
}
Expand Down Expand Up @@ -238,7 +238,7 @@ void skip_a_word( tic_bool_param_t pfield )
* get_word_in_line() will check and report if no word on same line.
*
**************************************************************************** */
void skip_a_word_in_line( tic_bool_param_t pfield )
void skip_a_word_in_line( tic_param_t pfield )
{
/* bool isokay = */ get_word_in_line( statbuf);
}
Expand Down Expand Up @@ -271,7 +271,7 @@ void skip_a_word_in_line( tic_bool_param_t pfield )
*
**************************************************************************** */

void skip_two_words_in_line( tic_bool_param_t pfield )
void skip_two_words_in_line( tic_param_t pfield )
{
char *func_cpy = strupr( strdup( statbuf));
if ( get_word_in_line( func_cpy) )
Expand Down Expand Up @@ -646,7 +646,7 @@ static void if_exists( tic_param_t pfield )
*
**************************************************************************** */

static void if_not_exist( tic_bool_param_t pfield )
static void if_not_exist( tic_param_t pfield )
{
bool alr_ign = *pfield.bool_ptr;
conditional_word_in_line( alr_ign, false, exists_in_current );
Expand All @@ -663,7 +663,7 @@ static void if_not_exist( tic_bool_param_t pfield )
*
**************************************************************************** */

static void if_defined( tic_bool_param_t pfield )
static void if_defined( tic_param_t pfield )
{
bool alr_ign = *pfield.bool_ptr;
conditional_word_in_line( alr_ign, true, exists_as_user_symbol );
Expand All @@ -680,7 +680,7 @@ static void if_defined( tic_bool_param_t pfield )
*
**************************************************************************** */

static void if_not_defined( tic_bool_param_t pfield )
static void if_not_defined( tic_param_t pfield )
{
bool alr_ign = *pfield.bool_ptr;
conditional_word_in_line( alr_ign, false, exists_as_user_symbol );
Expand All @@ -704,7 +704,7 @@ static void if_not_defined( tic_bool_param_t pfield )
*
**************************************************************************** */

static void if_from_stack( tic_bool_param_t pfield )
static void if_from_stack( tic_param_t pfield )
{
bool alr_ign = *pfield.bool_ptr;
bool cond = false;
Expand Down
6 changes: 3 additions & 3 deletions toke/conditl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

void init_conditionals_vocab( tic_hdr_t **tic_vocab_ptr );

void skip_a_word( tic_bool_param_t pfield );
void skip_a_word_in_line( tic_bool_param_t pfield );
void skip_two_words_in_line( tic_bool_param_t pfield );
void skip_a_word( tic_param_t pfield );
void skip_a_word_in_line( tic_param_t pfield );
void skip_two_words_in_line( tic_param_t pfield );

#endif /* _TOKE_CONDITL_H */
2 changes: 0 additions & 2 deletions toke/emit.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,6 @@ void finish_pcihdr(void)
u32 imageblocks;
int padding;

rom_header_t *pci_hdr;
pci_data_t *pci_data_blk;

if( pci_data_blk_ob_off == -1 )
Expand All @@ -570,7 +569,6 @@ void finish_pcihdr(void)
return ;
}

pci_hdr = (rom_header_t *)(ostart + pci_hdr_ob_off);
pci_data_blk = (pci_data_t *)(ostart + pci_data_blk_ob_off);

/* fix up vpd */
Expand Down
11 changes: 6 additions & 5 deletions toke/macros.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ static void macro_recursion_error( tic_param_t pfield)
*
**************************************************************************** */

typedef void (*vfunct)(); /* Pointer to function returning void */
static vfunct sav_mac_funct ;
static void (*sav_mac_funct)(tic_param_t);


/* **************************************************************************
Expand All @@ -222,8 +221,9 @@ static vfunct sav_mac_funct ;
*
**************************************************************************** */

static void mac_string_recovery( tic_hdr_t *macro_entry)
static void mac_string_recovery( _PTR param)
{
tic_hdr_t *macro_entry = (tic_hdr_t *)param;
(*macro_entry).funct = sav_mac_funct;
(*macro_entry).ign_func = sav_mac_funct;
}
Expand Down Expand Up @@ -455,8 +455,9 @@ static void print_if_mac_err( bool failure, char *func_cpy)
/* This pointer is exported to this file only */
extern tic_hdr_t *tokz_esc_vocab ;

void add_user_macro( void)
void add_user_macro( tic_param_t pfield )
{
(void)pfield;
char *macroname;
char *macrobody;
bool failure = true;
Expand Down Expand Up @@ -533,7 +534,7 @@ void add_user_macro( void)
* invokes a directive that alters Conditional processing...
*
**************************************************************************** */
void skip_user_macro( tic_bool_param_t pfield )
void skip_user_macro( tic_param_t pfield )
{
bool failure = true;
char *func_cpy = strdup( statbuf);
Expand Down
4 changes: 2 additions & 2 deletions toke/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
**************************************************************************** */

void init_macros( tic_hdr_t **tic_vocab_ptr );
void add_user_macro( void);
void skip_user_macro( tic_bool_param_t pfield );
void add_user_macro( tic_param_t pfield );
void skip_user_macro( tic_param_t pfield );
#if 0 /* What's this doing here? */
char *lookup_macro(char *name);
bool exists_as_macro(char *name);
Expand Down
8 changes: 4 additions & 4 deletions toke/parselocals.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static char *int_to_str( int num, char *bufr)

static void invoke_local( tic_param_t pfield )
{
char local_num_buf[10];
char local_num_buf[14];
int loc_num = (int)pfield.deflt_elem;

int_to_str(loc_num, local_num_buf);
Expand Down Expand Up @@ -515,8 +515,8 @@ static bool gather_locals( bool initted, int *counter )

static void activate_locals( void )
{
char ilocals_buf[10];
char ulocals_buf[10];
char ilocals_buf[14];
char ulocals_buf[14];

int_to_str(num_ilocals, ilocals_buf );
int_to_str(num_ulocals, ulocals_buf );
Expand Down Expand Up @@ -896,7 +896,7 @@ void finish_locals ( void )
/* Don't do anything if Locals are not in use */
if ( localno > 0 )
{
char nlocals_buf[10];
char nlocals_buf[14];

int_to_str(localno, nlocals_buf );
sprintf( eval_buf,"%s %s",nlocals_buf, pop_locals);
Expand Down
14 changes: 5 additions & 9 deletions toke/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ static source_state_t *saved_source = NULL;
*
**************************************************************************** */

void push_source( void (*res_func)(), _PTR res_parm, bool file_chg )
void push_source( void (*res_func)(_PTR), _PTR res_parm, bool file_chg )
{
source_state_t *new_sav_src;

Expand Down Expand Up @@ -1539,15 +1539,14 @@ static signed long get_string( bool pack_str)

static void handle_user_message( char delim, bool print_it )
{
signed long wlen;
unsigned int start_lineno = lineno;
unsigned int multiline_start = lineno; /* For warning message */
bool check_multiline = false;
const char *ug_msg = "user-generated message";

if ( delim == '"' )
{
wlen = get_string( false);
get_string( false);
}else{
/*
* When the message-delimiter is a new-line, and the
Expand All @@ -1567,7 +1566,7 @@ static void handle_user_message( char delim, bool print_it )
multiline_start = lineno;
check_multiline = true;
}
wlen = get_until( delim );
get_until( delim );
}

if ( print_it )
Expand Down Expand Up @@ -4060,9 +4059,8 @@ static bool abort_quote( fwtoken tok)
{
/* ABORT" is not enabled; we'd better consume the string */
char *save_statbuf;
signed long wlen;
save_statbuf = strdup( (char *)statbuf);
wlen = get_string( false);
get_string( false);
strcpy( statbuf, save_statbuf);
free( save_statbuf);
}else{
Expand All @@ -4074,7 +4072,6 @@ static bool abort_quote( fwtoken tok)
* Presumably, Apple Source supplies its own
* IF ... THEN
*/
char *abort_string;
signed long wlen;

retval = true;
Expand All @@ -4099,8 +4096,7 @@ static bool abort_quote( fwtoken tok)
}

if ( sun_style_abort_quote ) emit_then();
/* Sun Style */
abort_string = " type -2 THROW THEN:" ;
/* Sun Style: type -2 THROW THEN:" */
}
}
return( retval );
Expand Down
2 changes: 1 addition & 1 deletion toke/scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void init_scan_state( void );
void fcode_ender( void );

bool skip_until( char lim_ch);
void push_source( void (*res_func)(), _PTR res_parm, bool is_f_chg );
void push_source( void (*res_func)(_PTR), _PTR res_parm, bool is_f_chg );
signed long get_word( void);
bool get_word_in_line( char *func_nam);
bool get_rest_of_line( void);
Expand Down
16 changes: 6 additions & 10 deletions toke/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,27 +909,24 @@ static char *expand_pathname( const char *input_pathname)
{
FILE *temp_file;
int syst_stat;
const char *temp_file_name = tmpnam( NULL);

/* Use the expansion buffer for our temporary command string */
sprintf( expansion_buffer,
"echo %s>%s\n", input_pathname, temp_file_name);
syst_stat = system( expansion_buffer);
if ( syst_stat != 0 )
sprintf( expansion_buffer, "echo %s\n", input_pathname);
temp_file = popen( expansion_buffer, "r" );
if ( temp_file == NULL )
{
tokenization_error( TKERROR,
"Expansion Syntax.\n");
/* The "File-Opening" error message will show the input string */
return( NULL);
}

temp_file = fopen( temp_file_name, "r"); /* Cannot fail. */
syst_stat = fread( expansion_buffer, 1, buffer_max, temp_file);
/* Error test. Length of what we read is not a good indicator;
* it's limited anyway by buffer_max.
* Valid test is if last character read was the new-line.
*/
if ( expansion_buffer[syst_stat-1] != '\n' )
if ( syst_stat == 0 || expansion_buffer[syst_stat-1] != '\n' )
{
tokenization_error( TKERROR,
"Expansion buffer overflow. Max length is %d.\n",
Expand All @@ -942,8 +939,7 @@ static char *expand_pathname( const char *input_pathname)
expanded_name();
}

fclose( temp_file);
remove( temp_file_name);
pclose( temp_file);
}

return( retval);
Expand Down Expand Up @@ -1256,7 +1252,7 @@ bool init_stream( const char *name)
static char *extend_filename( const char *base_name, const char *new_ext)
{
char *retval;
char *ext;
const char *ext;
unsigned int len; /* should this be size_t? */
const char *root;

Expand Down
8 changes: 4 additions & 4 deletions toke/ticvocab.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,12 @@ void init_tic_vocab( tic_hdr_t *tic_vocab_tbl,
**************************************************************************** */

static tic_hdr_t *make_tic_entry( char *tname,
void (*tfunct)(),
void (*tfunct)(tic_param_t),
TIC_P_DEFLT_TYPE tparam,
fwtoken fw_defr,
int pfldsiz,
bool is_single,
void (*ign_fnc)(),
void (*ign_fnc)(tic_param_t),
bool trace_this,
tic_hdr_t **tic_vocab )
{
Expand Down Expand Up @@ -285,12 +285,12 @@ static tic_hdr_t *make_tic_entry( char *tname,
**************************************************************************** */

void add_tic_entry( char *tname,
void (*tfunct)(),
void (*tfunct)(tic_param_t),
TIC_P_DEFLT_TYPE tparam,
fwtoken fw_defr,
int pfldsiz,
bool is_single,
void (*ign_fnc)(),
void (*ign_fnc)(tic_param_t),
tic_hdr_t **tic_vocab )
{
bool trace_this = is_on_trace_list( tname);
Expand Down
Loading