From cc635cc237c72a84fe1e926aa8cd61ce16c17a07 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 9 Jan 2002 09:10:36 +0000 Subject: [PATCH] Change return type of calc_len() family back to int from unsigned long. svn path=/trunk/yasm/; revision=448 --- libyasm/arch.h | 4 ++-- libyasm/bytecode.c | 2 +- libyasm/bytecode.h | 4 ++-- modules/arch/x86/x86-int.h | 3 +-- modules/arch/x86/x86bc.c | 4 ++-- src/arch.h | 4 ++-- src/arch/x86/x86-int.h | 3 +-- src/arch/x86/x86bc.c | 4 ++-- src/bytecode.c | 2 +- src/bytecode.h | 4 ++-- 10 files changed, 16 insertions(+), 18 deletions(-) diff --git a/libyasm/arch.h b/libyasm/arch.h index aae614cd..b8996795 100644 --- a/libyasm/arch.h +++ b/libyasm/arch.h @@ -40,8 +40,8 @@ struct arch { void (*bc_print) (FILE *f, const bytecode *bc); /* See bytecode.h comments on bc_calc_len() */ - unsigned long (*bc_calc_len) (bytecode *bc, - intnum *(*resolve_label) (symrec *sym)); + int (*bc_calc_len) (bytecode *bc, + intnum *(*resolve_label) (symrec *sym)); } bc; }; diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index bed8f7d9..86ee2859 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -307,7 +307,7 @@ bc_print(FILE *f, const bytecode *bc) fprintf(f, "%*sOffset=%lx\n", indent_level, "", bc->offset); } -unsigned long +int bc_calc_len(bytecode *bc, intnum *(*resolve_label) (symrec *sym)) { switch (bc->type) { diff --git a/libyasm/bytecode.h b/libyasm/bytecode.h index cbe3d0d0..c295f15c 100644 --- a/libyasm/bytecode.h +++ b/libyasm/bytecode.h @@ -63,8 +63,8 @@ void bc_print(FILE *f, const bytecode *bc); * resolve_label is the function used to determine the value (offset) of a * in-file label (eg, not an EXTERN variable, which is indeterminate). */ -unsigned long bc_calc_len(bytecode *bc, - intnum *(*resolve_label) (symrec *sym)); +int bc_calc_len(bytecode *bc, + intnum *(*resolve_label) (symrec *sym)); /* void bcs_initialize(bytecodehead *headp); */ #define bcs_initialize(headp) STAILQ_INIT(headp) diff --git a/modules/arch/x86/x86-int.h b/modules/arch/x86/x86-int.h index a491c312..d07a43bd 100644 --- a/modules/arch/x86/x86-int.h +++ b/modules/arch/x86/x86-int.h @@ -96,8 +96,7 @@ typedef struct x86_jmprel { void x86_bc_delete(bytecode *bc); void x86_bc_print(FILE *f, const bytecode *bc); -unsigned long x86_bc_calc_len(bytecode *bc, - intnum *(*resolve_label) (symrec *sym)); +int x86_bc_calc_len(bytecode *bc, intnum *(*resolve_label) (symrec *sym)); int x86_expr_checkea(expr **ep, unsigned char *addrsize, unsigned char bits, unsigned char nosplit, unsigned char *displen, diff --git a/modules/arch/x86/x86bc.c b/modules/arch/x86/x86bc.c index 46a259c7..70e59ff9 100644 --- a/modules/arch/x86/x86bc.c +++ b/modules/arch/x86/x86bc.c @@ -463,7 +463,7 @@ x86_bc_print(FILE *f, const bytecode *bc) } } -static unsigned long +static int x86_bc_calc_len_insn(x86_insn *insn, intnum *(*resolve_label) (symrec *sym)) { effaddr *ea = insn->ea; @@ -519,7 +519,7 @@ x86_bc_calc_len_insn(x86_insn *insn, intnum *(*resolve_label) (symrec *sym)) return 0; } -unsigned long +int x86_bc_calc_len(bytecode *bc, intnum *(*resolve_label) (symrec *sym)) { diff --git a/src/arch.h b/src/arch.h index aae614cd..b8996795 100644 --- a/src/arch.h +++ b/src/arch.h @@ -40,8 +40,8 @@ struct arch { void (*bc_print) (FILE *f, const bytecode *bc); /* See bytecode.h comments on bc_calc_len() */ - unsigned long (*bc_calc_len) (bytecode *bc, - intnum *(*resolve_label) (symrec *sym)); + int (*bc_calc_len) (bytecode *bc, + intnum *(*resolve_label) (symrec *sym)); } bc; }; diff --git a/src/arch/x86/x86-int.h b/src/arch/x86/x86-int.h index a491c312..d07a43bd 100644 --- a/src/arch/x86/x86-int.h +++ b/src/arch/x86/x86-int.h @@ -96,8 +96,7 @@ typedef struct x86_jmprel { void x86_bc_delete(bytecode *bc); void x86_bc_print(FILE *f, const bytecode *bc); -unsigned long x86_bc_calc_len(bytecode *bc, - intnum *(*resolve_label) (symrec *sym)); +int x86_bc_calc_len(bytecode *bc, intnum *(*resolve_label) (symrec *sym)); int x86_expr_checkea(expr **ep, unsigned char *addrsize, unsigned char bits, unsigned char nosplit, unsigned char *displen, diff --git a/src/arch/x86/x86bc.c b/src/arch/x86/x86bc.c index 46a259c7..70e59ff9 100644 --- a/src/arch/x86/x86bc.c +++ b/src/arch/x86/x86bc.c @@ -463,7 +463,7 @@ x86_bc_print(FILE *f, const bytecode *bc) } } -static unsigned long +static int x86_bc_calc_len_insn(x86_insn *insn, intnum *(*resolve_label) (symrec *sym)) { effaddr *ea = insn->ea; @@ -519,7 +519,7 @@ x86_bc_calc_len_insn(x86_insn *insn, intnum *(*resolve_label) (symrec *sym)) return 0; } -unsigned long +int x86_bc_calc_len(bytecode *bc, intnum *(*resolve_label) (symrec *sym)) { diff --git a/src/bytecode.c b/src/bytecode.c index bed8f7d9..86ee2859 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -307,7 +307,7 @@ bc_print(FILE *f, const bytecode *bc) fprintf(f, "%*sOffset=%lx\n", indent_level, "", bc->offset); } -unsigned long +int bc_calc_len(bytecode *bc, intnum *(*resolve_label) (symrec *sym)) { switch (bc->type) { diff --git a/src/bytecode.h b/src/bytecode.h index cbe3d0d0..c295f15c 100644 --- a/src/bytecode.h +++ b/src/bytecode.h @@ -63,8 +63,8 @@ void bc_print(FILE *f, const bytecode *bc); * resolve_label is the function used to determine the value (offset) of a * in-file label (eg, not an EXTERN variable, which is indeterminate). */ -unsigned long bc_calc_len(bytecode *bc, - intnum *(*resolve_label) (symrec *sym)); +int bc_calc_len(bytecode *bc, + intnum *(*resolve_label) (symrec *sym)); /* void bcs_initialize(bytecodehead *headp); */ #define bcs_initialize(headp) STAILQ_INIT(headp) -- 2.40.0