From: Peter Johnson Date: Sat, 24 Feb 2007 04:16:05 +0000 (-0000) Subject: Move libyasm-stdint.h include out of util.h, as util.h is included from X-Git-Tag: v0.6.0~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a770e511c1707383f612732459d8399a0ce95f7d;p=yasm Move libyasm-stdint.h include out of util.h, as util.h is included from build platform files. While here, fix a few warnings by pushing uintptr_t to a few more register usages. Noticed by: rugxulo@gmail.com svn path=/trunk/yasm/; revision=1786 --- diff --git a/libyasm/arch.c b/libyasm/arch.c index 9fc8aea4..dd849ebc 100644 --- a/libyasm/arch.c +++ b/libyasm/arch.c @@ -29,6 +29,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "expr.h" @@ -131,7 +132,8 @@ yasm_operand_print(const yasm_insn_operand *op, FILE *f, int indent_level, fprintf(f, "\n"); break; } - fprintf(f, "%*sTargetMod=%lx\n", indent_level+1, "", op->targetmod); + fprintf(f, "%*sTargetMod=%lx\n", indent_level+1, "", + (unsigned long)op->targetmod); fprintf(f, "%*sSize=%u\n", indent_level+1, "", op->size); fprintf(f, "%*sDeref=%d, Strict=%d\n", indent_level+1, "", (int)op->deref, (int)op->strict); diff --git a/libyasm/bc-align.c b/libyasm/bc-align.c index 109d1b4a..0a3a3a78 100644 --- a/libyasm/bc-align.c +++ b/libyasm/bc-align.c @@ -28,6 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "errwarn.h" diff --git a/libyasm/bc-data.c b/libyasm/bc-data.c index c6b5e37a..8a32f72a 100644 --- a/libyasm/bc-data.c +++ b/libyasm/bc-data.c @@ -28,6 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "errwarn.h" diff --git a/libyasm/bc-incbin.c b/libyasm/bc-incbin.c index 1c51764e..79c1a9fb 100644 --- a/libyasm/bc-incbin.c +++ b/libyasm/bc-incbin.c @@ -28,6 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "linemap.h" diff --git a/libyasm/bc-insn.c b/libyasm/bc-insn.c index c7dd1891..b4d9ce1b 100644 --- a/libyasm/bc-insn.c +++ b/libyasm/bc-insn.c @@ -28,6 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "errwarn.h" diff --git a/libyasm/bc-org.c b/libyasm/bc-org.c index 646d43cc..67b278e8 100644 --- a/libyasm/bc-org.c +++ b/libyasm/bc-org.c @@ -28,6 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "file.h" diff --git a/libyasm/bc-reserve.c b/libyasm/bc-reserve.c index c8ec7aa0..ab1360bb 100644 --- a/libyasm/bc-reserve.c +++ b/libyasm/bc-reserve.c @@ -28,6 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "errwarn.h" diff --git a/libyasm/bytecode.c b/libyasm/bytecode.c index 7fe31be8..80fcaa88 100644 --- a/libyasm/bytecode.c +++ b/libyasm/bytecode.c @@ -28,6 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "errwarn.h" diff --git a/libyasm/expr-int.h b/libyasm/expr-int.h index 64762799..c5e0689e 100644 --- a/libyasm/expr-int.h +++ b/libyasm/expr-int.h @@ -50,7 +50,7 @@ struct yasm_expr__item { yasm_expr *expn; yasm_intnum *intn; yasm_floatnum *flt; - unsigned long reg; + uintptr_t reg; unsigned int subst; } data; }; diff --git a/libyasm/expr.c b/libyasm/expr.c index ea0cb133..461dd1bc 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c @@ -28,6 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "bitvect.h" @@ -185,7 +186,7 @@ yasm_expr_float(yasm_floatnum *f) } yasm_expr__item * -yasm_expr_reg(unsigned long reg) +yasm_expr_reg(uintptr_t reg) { yasm_expr__item *e = expr_get_item(); e->type = YASM_EXPR_REG; @@ -1283,7 +1284,7 @@ yasm_expr_get_symrec(yasm_expr **ep, int simplify) /*@=unqualifiedtrans =nullderef -nullstate -onlytrans@*/ /*@-unqualifiedtrans -nullderef -nullstate -onlytrans@*/ -const unsigned long * +const uintptr_t * yasm_expr_get_reg(yasm_expr **ep, int simplify) { if (simplify) diff --git a/libyasm/expr.h b/libyasm/expr.h index 2a9bd968..59f0cd00 100644 --- a/libyasm/expr.h +++ b/libyasm/expr.h @@ -82,7 +82,7 @@ typedef struct yasm_expr__item yasm_expr__item; * \param reg register * \return Newly allocated expression item. */ -/*@only@*/ yasm_expr__item *yasm_expr_reg(unsigned long reg); +/*@only@*/ yasm_expr__item *yasm_expr_reg(uintptr_t reg); /** Create a new expression tree e=l op r. * \param l expression for left side of new expression @@ -222,7 +222,7 @@ typedef /*@only@*/ yasm_expr * (*yasm_expr_xform_func) * \return NULL if the expression is too complex; otherwise the register value * of the expression. */ -/*@dependent@*/ /*@null@*/ const unsigned long *yasm_expr_get_reg +/*@dependent@*/ /*@null@*/ const uintptr_t *yasm_expr_get_reg (yasm_expr **ep, int simplify); /** Print an expression. For debugging purposes. diff --git a/libyasm/hamt.c b/libyasm/hamt.c index 2243bc62..746fb904 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -33,6 +33,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "hamt.h" diff --git a/libyasm/section.c b/libyasm/section.c index a4bc1464..357a69d2 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -30,6 +30,7 @@ #include +#include "libyasm-stdint.h" #include "coretype.h" #include "valparam.h" #include "assocdat.h" diff --git a/libyasm/symrec.c b/libyasm/symrec.c index 0a536406..2147a5c6 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -32,6 +32,7 @@ # include #endif +#include "libyasm-stdint.h" #include "coretype.h" #include "hamt.h" #include "assocdat.h" diff --git a/libyasm/valparam.c b/libyasm/valparam.c index 00516b58..7513b148 100644 --- a/libyasm/valparam.c +++ b/libyasm/valparam.c @@ -28,6 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "valparam.h" diff --git a/libyasm/value.c b/libyasm/value.c index 2c33da3b..1e530e9a 100644 --- a/libyasm/value.c +++ b/libyasm/value.c @@ -28,6 +28,7 @@ #include "util.h" /*@unused@*/ RCSID("$Id$"); +#include "libyasm-stdint.h" #include "coretype.h" #include "bitvect.h" diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index efbf1749..4d3684df 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -1929,7 +1929,7 @@ dir_pushreg(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, { yasm_valparam *vp = yasm_vps_first(valparams); coff_unwind_code *code; - const unsigned long *reg; + const uintptr_t *reg; if (!procframe_checkstate(objfmt_coff, "PUSHREG")) return; @@ -1957,7 +1957,7 @@ dir_setframe(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, { yasm_valparam *vp = yasm_vps_first(valparams); coff_unwind_code *code; - const unsigned long *reg; + const uintptr_t *reg; yasm_expr *off = NULL; if (!procframe_checkstate(objfmt_coff, "SETFRAME")) @@ -2031,7 +2031,7 @@ dir_save_common(yasm_objfmt_coff *objfmt_coff, yasm_valparamhead *valparams, { yasm_valparam *vp = yasm_vps_first(valparams); coff_unwind_code *code; - const unsigned long *reg; + const uintptr_t *reg; if (!procframe_checkstate(objfmt_coff, name)) return; diff --git a/modules/preprocs/nasm/nasm-eval.c b/modules/preprocs/nasm/nasm-eval.c index 66c5c6ed..2b10d7e7 100644 --- a/modules/preprocs/nasm/nasm-eval.c +++ b/modules/preprocs/nasm/nasm-eval.c @@ -8,6 +8,7 @@ * initial version 27/iii/95 by Simon Tatham */ #include +#include #include #include #include diff --git a/modules/preprocs/nasm/nasm-pp.c b/modules/preprocs/nasm/nasm-pp.c index c1ca6a80..f2147195 100644 --- a/modules/preprocs/nasm/nasm-pp.c +++ b/modules/preprocs/nasm/nasm-pp.c @@ -34,6 +34,7 @@ * detoken is used to convert the line back to text */ #include +#include #include #include #include diff --git a/util.h b/util.h index 2b953197..842f0211 100644 --- a/util.h +++ b/util.h @@ -60,8 +60,6 @@ #include #include -#include - #include #ifdef lint