more alpha portability fixes

This commit is contained in:
Bill Currie 2001-11-29 19:35:25 +00:00
parent 95fe4d07b1
commit 12a0a10d33
4 changed files with 27 additions and 27 deletions

View file

@ -33,19 +33,19 @@
#define __pr_debug_h
typedef struct pr_auxfunction_s {
unsigned long function; // function def this aux info is for
unsigned long source_line; // first source line for this function
unsigned long line_info; // index to first lineno entry
unsigned long local_defs; // index to the first local def
unsigned long num_locals; // number of local defs
unsigned int function; // function def this aux info is for
unsigned int source_line; // first source line for this function
unsigned int line_info; // index to first lineno entry
unsigned int local_defs; // index to the first local def
unsigned int num_locals; // number of local defs
} pr_auxfunction_t;
typedef struct pr_lineno_s {
union {
unsigned long func; // (line==0) index of function aux info
unsigned long addr; // (line!=0) dstatement_t address
unsigned int func; // (line==0) index of function aux info
unsigned int addr; // (line!=0) dstatement_t address
} fa;
unsigned long line;
unsigned int line;
} pr_lineno_t;
#define PROG_DEBUG_VERSION 0x00001001 // MMmmmRRR 0.001.001 (hex)
@ -54,12 +54,12 @@ typedef struct pr_debug_header_s {
int version;
unsigned short crc; // of the progs.dat this progs.sym file is for
unsigned short you_tell_me_and_we_will_both_know;
unsigned long auxfunctions;
unsigned long num_auxfunctions;
unsigned long linenos;
unsigned long num_linenos;
unsigned long locals;
unsigned long num_locals;
unsigned int auxfunctions;
unsigned int num_auxfunctions;
unsigned int linenos;
unsigned int num_linenos;
unsigned int locals;
unsigned int num_locals;
} pr_debug_header_t;
#endif//__pr_debug_h

View file

@ -183,11 +183,11 @@ void PR_GarbageCollect (progs_t *pr);
void PR_Debug_Init (void);
void PR_Debug_Init_Cvars (void);
pr_auxfunction_t *PR_Get_Lineno_Func (progs_t *pr, pr_lineno_t *lineno);
unsigned long PR_Get_Lineno_Addr (progs_t *pr, pr_lineno_t *lineno);
unsigned long PR_Get_Lineno_Line (progs_t *pr, pr_lineno_t *lineno);
pr_lineno_t *PR_Find_Lineno (progs_t *pr, unsigned long addr);
unsigned int PR_Get_Lineno_Addr (progs_t *pr, pr_lineno_t *lineno);
unsigned int PR_Get_Lineno_Line (progs_t *pr, pr_lineno_t *lineno);
pr_lineno_t *PR_Find_Lineno (progs_t *pr, unsigned int addr);
const char *PR_Get_Source_File (progs_t *pr, pr_lineno_t *lineno);
const char *PR_Get_Source_Line (progs_t *pr, unsigned long addr);
const char *PR_Get_Source_Line (progs_t *pr, unsigned int addr);
ddef_t *PR_Get_Local_Def (progs_t *pr, int offs);
void PR_DumpState (progs_t *pr);
void PR_StackTrace (progs_t * pr);

View file

@ -260,7 +260,7 @@ PR_Get_Lineno_Func (progs_t *pr, pr_lineno_t *lineno)
return &pr->auxfunctions[lineno->fa.func];
}
unsigned long
unsigned int
PR_Get_Lineno_Addr (progs_t *pr, pr_lineno_t *lineno)
{
pr_auxfunction_t *f;
@ -271,7 +271,7 @@ PR_Get_Lineno_Addr (progs_t *pr, pr_lineno_t *lineno)
return pr->pr_functions[f->function].first_statement;
}
unsigned long
unsigned int
PR_Get_Lineno_Line (progs_t *pr, pr_lineno_t *lineno)
{
pr_auxfunction_t *f;
@ -283,7 +283,7 @@ PR_Get_Lineno_Line (progs_t *pr, pr_lineno_t *lineno)
}
pr_lineno_t *
PR_Find_Lineno (progs_t *pr, unsigned long addr)
PR_Find_Lineno (progs_t *pr, unsigned int addr)
{
int i;
pr_lineno_t *lineno = 0;
@ -311,11 +311,11 @@ PR_Get_Source_File (progs_t *pr, pr_lineno_t *lineno)
}
const char *
PR_Get_Source_Line (progs_t *pr, unsigned long addr)
PR_Get_Source_Line (progs_t *pr, unsigned int addr)
{
char *str;
const char *fname;
unsigned long line;
unsigned int line;
file_t *file;
pr_auxfunction_t *func;
@ -332,13 +332,13 @@ PR_Get_Source_Line (progs_t *pr, unsigned long addr)
file = PR_Load_Source_File (pr, fname);
str = Hunk_TempAlloc (strlen (fname) + 12);
sprintf (str, "%s:%ld", fname, line);
sprintf (str, "%s:%d", fname, line);
if (!file || line > file->num_lines)
return str;
str = Hunk_TempAlloc (strlen (str) + file->lines[line - 1].len + 2);
sprintf (str, "%s:%ld:%.*s", fname, line,
sprintf (str, "%s:%d:%.*s", fname, line,
(int)file->lines[line - 1].len, file->lines[line - 1].text);
return str;
}

View file

@ -667,7 +667,7 @@ PR_PrintFunction (def_t *def)
d->name ? d->name : "<temp>",
d->ofs, d->type->type, pr_type_size[d->type->type]);
for (r = d->refs; r; r = r->next)
printf (" %d", r->statement - statements);
printf (" %ld", (long)(r->statement - statements));
printf ("\n");
}
}
@ -886,7 +886,7 @@ main (int argc, char **argv)
{
char *src;
char filename[1024];
long int crc;
int crc;
double start, stop;
start = Sys_DoubleTime ();