From: Peter Johnson Date: Wed, 1 Dec 2004 08:09:43 +0000 (-0000) Subject: Since modules are now built into libyasm, it's no longer necessary to X-Git-Tag: v0.5.0rc1~190 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2fa2c1c110e7a89841544f850e7a5d7848ce8bf;p=yasm Since modules are now built into libyasm, it's no longer necessary to version them. * parser.h, dbgfmt.h, objfmt.h, listfmt.h, optimizer.h, preproc.h, arch.h: Remove YASM_xxx_VERSION and version module structure member. * (many) .c: Don't initialize version module structure member. svn path=/trunk/yasm/; revision=1184 --- diff --git a/libyasm/arch.h b/libyasm/arch.h index 896d4e54..ae033a60 100644 --- a/libyasm/arch.h +++ b/libyasm/arch.h @@ -90,18 +90,6 @@ typedef struct yasm_arch_machine { const char *keyword; } yasm_arch_machine; -/** Version number of #yasm_arch_module interface. Any functional change to - * the #yasm_arch_module interface should simultaneously increment this number. - * This version should be checked by #yasm_arch_module loaders (using - * yasm_arch_module_get_version()) to verify that the expected version (the - * version defined by its libyasm header files) matches the loaded module - * version (the version defined by the module's libyasm header files). Doing - * this will ensure that the module version's function definitions match the - * module loader's function definitions. The version number must never be - * decreased. - */ -#define YASM_ARCH_VERSION 4 - /** YASM architecture module interface. * \note All "data" in parser-related functions (yasm_arch_parse_*) needs to * start the parse initialized to 0 to make it okay for a parser-related @@ -109,12 +97,6 @@ typedef struct yasm_arch_machine { * called before on the same piece of data. */ typedef struct yasm_arch_module { - /** Version (see #YASM_ARCH_VERSION). Should always be set to - * #YASM_ARCH_VERSION by the module source and checked against - * #YASM_ARCH_VERSION by the module loader. - */ - unsigned int version; - /** One-line description of the architecture. * Call yasm_arch_name() to get the name of a particular #yasm_arch. */ diff --git a/libyasm/dbgfmt.h b/libyasm/dbgfmt.h index a61fbf30..e18182b3 100644 --- a/libyasm/dbgfmt.h +++ b/libyasm/dbgfmt.h @@ -44,25 +44,8 @@ typedef struct yasm_dbgfmt_base { } yasm_dbgfmt_base; #endif -/** Version number of #yasm_dbgfmt_module interface. Any functional change to - * the #yasm_dbgfmt_module interface should simultaneously increment this - * number. This version should be checked by #yasm_dbgfmt loaders to verify - * that the expected version (the version defined by its libyasm header files) - * matches the loaded module version (the version defined by the module's - * libyasm header files). Doing this will ensure that the module version's - * function definitions match the module loader's function definitions. The - * version number must never be decreased. - */ -#define YASM_DBGFMT_VERSION 3 - /** YASM debug format module interface. */ typedef struct yasm_dbgfmt_module { - /** Version (see #YASM_DBGFMT_VERSION). Should always be set to - * #YASM_DBGFMT_VERSION by the module source and checked against - * #YASM_DBGFMT_VERSION by the module loader. - */ - unsigned int version; - /** One-line description of the debug format. */ const char *name; diff --git a/libyasm/listfmt.h b/libyasm/listfmt.h index 7abd92d9..3d3a72a4 100644 --- a/libyasm/listfmt.h +++ b/libyasm/listfmt.h @@ -44,25 +44,8 @@ typedef struct yasm_listfmt_base { } yasm_listfmt_base; #endif -/** Version number of #yasm_listfmt_module interface. Any functional change - * to the #yasm_listfmt_module interface should simultaneously increment this - * number. This version should be checked by #yasm_listfmt loaders to verify - * that the expected version (the version defined by its libyasm header files) - * matches the loaded module version (the version defined by the module's - * libyasm header files). Doing this will ensure that the module version's - * function definitions match the module loader's function definitions. The - * version number must never be decreased. - */ -#define YASM_LISTFMT_VERSION 0 - /** YASM list format module interface. */ typedef struct yasm_listfmt_module { - /** Version (see #YASM_LISTFMT_VERSION). Should always be set to - * #YASM_LISTFMT_VERSION by the module source and checked against - * #YASM_LISTFMT_VERSION by the module loader. - */ - unsigned int version; - /** One-line description of the list format. */ const char *name; diff --git a/libyasm/objfmt.h b/libyasm/objfmt.h index c9e29bc3..0bdd6483 100644 --- a/libyasm/objfmt.h +++ b/libyasm/objfmt.h @@ -44,25 +44,8 @@ typedef struct yasm_objfmt_base { } yasm_objfmt_base; #endif -/** Version number of #yasm_objfmt_module interface. Any functional change to - * the #yasm_objfmt_module interface should simultaneously increment this - * number. This version should be checked by #yasm_objfmt loaders to verify - * that the expected version (the version defined by its libyasm header files) - * matches the loaded module version (the version defined by the module's - * libyasm header files). Doing this will ensure that the module version's - * function definitions match the module loader's function definitions. The - * version number must never be decreased. - */ -#define YASM_OBJFMT_VERSION 1 - /** YASM object format module interface. */ typedef struct yasm_objfmt_module { - /** Version (see #YASM_OBJFMT_VERSION). Should always be set to - * #YASM_OBJFMT_VERSION by the module source and checked against - * #YASM_OBJFMT_VERSION by the module loader. - */ - unsigned int version; - /** One-line description of the object format. */ const char *name; diff --git a/libyasm/optimizer.h b/libyasm/optimizer.h index edc746ba..f986bd15 100644 --- a/libyasm/optimizer.h +++ b/libyasm/optimizer.h @@ -34,25 +34,8 @@ #ifndef YASM_OPTIMIZER_H #define YASM_OPTIMIZER_H -/** Version number of #yasm_optimizer_module interface. Any functional change - * to the #yasm_optimizer_module interface should simultaneously increment this - * number. This version should be checked by #yasm_optimizer loaders to verify - * that the expected version (the version defined by its libyasm header files) - * matches the loaded module version (the version defined by the module's - * libyasm header files). Doing this will ensure that the module version's - * function definitions match the module loader's function definitions. The - * version number must never be decreased. - */ -#define YASM_OPTIMIZER_VERSION 1 - /** YASM optimizer module interface. */ typedef struct yasm_optimizer_module { - /** Version (see #YASM_OPTIMIZER_VERSION). Should always be set to - * #YASM_OPTIMIZER_VERSION by the module source and checked against - * #YASM_OPTIMIZER_VERSION by the module loader. - */ - unsigned int version; - /** One-line description of the optimizer */ const char *name; diff --git a/libyasm/parser.h b/libyasm/parser.h index dd989b80..1a94bbb5 100644 --- a/libyasm/parser.h +++ b/libyasm/parser.h @@ -34,25 +34,8 @@ #ifndef YASM_PARSER_H #define YASM_PARSER_H -/** Version number of #yasm_parser_module interface. Any functional change to - * the #yasm_parser_module interface should simultaneously increment this - * number. This version should be checked by #yasm_parser_module loaders to - * verify that the expected version (the version defined by its libyasm header - * files) matches the loaded module version (the version defined by the - * module's libyasm header files). Doing this will ensure that the module - * version's function definitions match the module loader's function - * definitions. The version number must never be decreased. - */ -#define YASM_PARSER_VERSION 1 - /** YASM parser module interface. The "front end" of the assembler. */ typedef struct yasm_parser_module { - /** Version (see #YASM_PARSER_VERSION). Should always be set to - * #YASM_PARSER_VERSION by the module source and checked against - * #YASM_PARSER_VERSION by the module loader. - */ - unsigned int version; - /** One-line description of the parser */ const char *name; diff --git a/libyasm/preproc.h b/libyasm/preproc.h index 89e0124a..d7f83050 100644 --- a/libyasm/preproc.h +++ b/libyasm/preproc.h @@ -44,25 +44,8 @@ typedef struct yasm_preproc_base { } yasm_preproc_base; #endif -/** Version number of #yasm_preproc_module interface. Any functional change to - * the #yasm_preproc_module interface should simultaneously increment this - * number. This version should be checked by #yasm_preproc loaders to verify - * that the expected version (the version defined by its libyasm header files) - * matches the loaded module version (the version defined by the module's - * libyasm header files). Doing this will ensure that the module version's - * function definitions match the module loader's function definitions. The - * version number must never be decreased. - */ -#define YASM_PREPROC_VERSION 2 - /** YASM preprocesor module interface. */ typedef struct yasm_preproc_module { - /** Version (see #YASM_PREPROC_VERSION). Should always be set to - * #YASM_PREPROC_VERSION by the module source and checked against - * #YASM_PREPROC_VERSION by the module loader. - */ - unsigned int version; - /** One-line description of the preprocessor. */ const char *name; diff --git a/modules/arch/lc3b/lc3barch.c b/modules/arch/lc3b/lc3barch.c index 64a5b38d..3b274aa2 100644 --- a/modules/arch/lc3b/lc3barch.c +++ b/modules/arch/lc3b/lc3barch.c @@ -115,7 +115,6 @@ static yasm_arch_machine lc3b_machines[] = { /* Define arch structure -- see arch.h for details */ yasm_arch_module yasm_lc3b_LTX_arch = { - YASM_ARCH_VERSION, "LC-3b", "lc3b", lc3b_create, diff --git a/modules/arch/x86/x86arch.c b/modules/arch/x86/x86arch.c index 54b60db7..f9cade13 100644 --- a/modules/arch/x86/x86arch.c +++ b/modules/arch/x86/x86arch.c @@ -216,7 +216,6 @@ static yasm_arch_machine x86_machines[] = { /* Define arch structure -- see arch.h for details */ yasm_arch_module yasm_x86_LTX_arch = { - YASM_ARCH_VERSION, "x86 (IA-32 and derivatives), AMD64", "x86", x86_create, diff --git a/modules/dbgfmts/null/null-dbgfmt.c b/modules/dbgfmts/null/null-dbgfmt.c index a6d0913e..ef118840 100644 --- a/modules/dbgfmts/null/null-dbgfmt.c +++ b/modules/dbgfmts/null/null-dbgfmt.c @@ -64,7 +64,6 @@ null_dbgfmt_generate(yasm_dbgfmt *dbgfmt) /* Define dbgfmt structure -- see dbgfmt.h for details */ yasm_dbgfmt_module yasm_null_LTX_dbgfmt = { - YASM_DBGFMT_VERSION, "No debugging info", "null", null_dbgfmt_create, diff --git a/modules/dbgfmts/stabs/stabs-dbgfmt.c b/modules/dbgfmts/stabs/stabs-dbgfmt.c index 861fac06..8fd8b9c4 100644 --- a/modules/dbgfmts/stabs/stabs-dbgfmt.c +++ b/modules/dbgfmts/stabs/stabs-dbgfmt.c @@ -500,7 +500,6 @@ stabs_dbgfmt_directive(yasm_dbgfmt *dbgfmt, const char *name, /* Define dbgfmt structure -- see dbgfmt.h for details */ yasm_dbgfmt_module yasm_stabs_LTX_dbgfmt = { - YASM_DBGFMT_VERSION, "Stabs debugging format", "stabs", stabs_dbgfmt_create, diff --git a/modules/listfmts/nasm/nasm-listfmt.c b/modules/listfmts/nasm/nasm-listfmt.c index 9dcd8063..45ecf59e 100644 --- a/modules/listfmts/nasm/nasm-listfmt.c +++ b/modules/listfmts/nasm/nasm-listfmt.c @@ -277,7 +277,6 @@ nasm_listfmt_output(yasm_listfmt *listfmt, FILE *f, yasm_linemap *linemap, /* Define listfmt structure -- see listfmt.h for details */ yasm_listfmt_module yasm_nasm_LTX_listfmt = { - YASM_LISTFMT_VERSION, "NASM-style list format", "nasm", nasm_listfmt_create, diff --git a/modules/objfmts/bin/bin-objfmt.c b/modules/objfmts/bin/bin-objfmt.c index f2ee7e61..53a0e2dc 100644 --- a/modules/objfmts/bin/bin-objfmt.c +++ b/modules/objfmts/bin/bin-objfmt.c @@ -557,7 +557,6 @@ static const char *bin_objfmt_dbgfmt_keywords[] = { /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_bin_LTX_objfmt = { - YASM_OBJFMT_VERSION, "Flat format binary", "bin", NULL, diff --git a/modules/objfmts/coff/coff-objfmt.c b/modules/objfmts/coff/coff-objfmt.c index ff919681..ec948746 100644 --- a/modules/objfmts/coff/coff-objfmt.c +++ b/modules/objfmts/coff/coff-objfmt.c @@ -1251,7 +1251,6 @@ static const char *coff_objfmt_dbgfmt_keywords[] = { /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_coff_LTX_objfmt = { - YASM_OBJFMT_VERSION, "COFF (DJGPP)", "coff", "o", @@ -1271,7 +1270,6 @@ yasm_objfmt_module yasm_coff_LTX_objfmt = { /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_win32_LTX_objfmt = { - YASM_OBJFMT_VERSION, "Win32", "win32", "obj", diff --git a/modules/objfmts/dbg/dbg-objfmt.c b/modules/objfmts/dbg/dbg-objfmt.c index b5f4ba03..0aef687c 100644 --- a/modules/objfmts/dbg/dbg-objfmt.c +++ b/modules/objfmts/dbg/dbg-objfmt.c @@ -214,7 +214,6 @@ static const char *dbg_objfmt_dbgfmt_keywords[] = { /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_dbg_LTX_objfmt = { - YASM_OBJFMT_VERSION, "Trace of all info passed to object format module", "dbg", "dbg", diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index 9172b64d..8b5c84ae 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -927,7 +927,6 @@ static const char *elf_objfmt_dbgfmt_keywords[] = { /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_elf_LTX_objfmt = { - YASM_OBJFMT_VERSION, "ELF", "elf", "o", diff --git a/modules/objfmts/xdf/xdf-objfmt.c b/modules/objfmts/xdf/xdf-objfmt.c index b4434035..02c54626 100644 --- a/modules/objfmts/xdf/xdf-objfmt.c +++ b/modules/objfmts/xdf/xdf-objfmt.c @@ -893,7 +893,6 @@ static const char *xdf_objfmt_dbgfmt_keywords[] = { /* Define objfmt structure -- see objfmt.h for details */ yasm_objfmt_module yasm_xdf_LTX_objfmt = { - YASM_OBJFMT_VERSION, "Extended Dynamic Object", "xdf", "xdf", diff --git a/modules/optimizers/basic/basic-optimizer.c b/modules/optimizers/basic/basic-optimizer.c index 3e53eaf4..685abfa0 100644 --- a/modules/optimizers/basic/basic-optimizer.c +++ b/modules/optimizers/basic/basic-optimizer.c @@ -227,7 +227,6 @@ basic_optimize(yasm_object *object) /* Define optimizer structure -- see optimizer.h for details */ yasm_optimizer_module yasm_basic_LTX_optimizer = { - YASM_OPTIMIZER_VERSION, "Only the most basic optimizations", "basic", basic_optimize diff --git a/modules/parsers/nasm/nasm-parser.c b/modules/parsers/nasm/nasm-parser.c index 1671a086..95f23c96 100644 --- a/modules/parsers/nasm/nasm-parser.c +++ b/modules/parsers/nasm/nasm-parser.c @@ -95,7 +95,6 @@ static const char *nasm_parser_preproc_keywords[] = { /* Define parser structure -- see parser.h for details */ yasm_parser_module yasm_nasm_LTX_parser = { - YASM_PARSER_VERSION, "NASM-compatible parser", "nasm", nasm_parser_preproc_keywords, diff --git a/modules/preprocs/nasm/nasm-preproc.c b/modules/preprocs/nasm/nasm-preproc.c index 123636fe..088cc355 100644 --- a/modules/preprocs/nasm/nasm-preproc.c +++ b/modules/preprocs/nasm/nasm-preproc.c @@ -225,7 +225,6 @@ nasm_preproc_undefine_macro(yasm_preproc *preproc, const char *macroname) /* Define preproc structure -- see preproc.h for details */ yasm_preproc_module yasm_nasm_LTX_preproc = { - YASM_PREPROC_VERSION, "Real NASM Preprocessor", "nasm", nasm_preproc_create, diff --git a/modules/preprocs/raw/raw-preproc.c b/modules/preprocs/raw/raw-preproc.c index ea8d7bd1..85e6a926 100644 --- a/modules/preprocs/raw/raw-preproc.c +++ b/modules/preprocs/raw/raw-preproc.c @@ -115,7 +115,6 @@ raw_preproc_undefine_macro(yasm_preproc *preproc, const char *macroname) /* Define preproc structure -- see preproc.h for details */ yasm_preproc_module yasm_raw_LTX_preproc = { - YASM_PREPROC_VERSION, "Disable preprocessing", "raw", raw_preproc_create,