From: Peter Johnson Date: Tue, 14 Feb 2006 03:32:52 +0000 (-0000) Subject: Remove some unused variables/functions. X-Git-Tag: v0.5.0rc2~5^2~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=faee015579cb9b6175e42fd2958ca0a67e3aaffd;p=yasm Remove some unused variables/functions. * dwarf2-info.c (dwarf2_info_head_*): Remove. * dwarf2-line.c (dwarf2_spp_bc_tobytes): Remove unused variable. * dwarf2-dbgfmt.c (dwarf2_dbgfmt_generate, dwarf2_head_bc_tobytes): Likewise. * leb128_test.c (run_input_test): Likewise. svn path=/trunk/yasm/; revision=1387 --- diff --git a/libyasm/tests/leb128_test.c b/libyasm/tests/leb128_test.c index 100e4837..b572eff2 100644 --- a/libyasm/tests/leb128_test.c +++ b/libyasm/tests/leb128_test.c @@ -135,8 +135,7 @@ run_input_test(Test_Entry *test) char *valstr = yasm__xstrdup(test->input); yasm_intnum *intn = yasm_intnum_create_hex(valstr, 0); yasm_intnum *testn; - unsigned long size, i; - unsigned char out[100]; + unsigned long size; yasm_xfree(valstr); diff --git a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c index 3cd717ea..af39fb60 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c +++ b/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c @@ -155,7 +155,6 @@ static void dwarf2_dbgfmt_generate(yasm_dbgfmt *dbgfmt) { yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = (yasm_dbgfmt_dwarf2 *)dbgfmt; - int new; size_t num_line_sections; /*@null@*/ yasm_section *debug_info, *debug_line, *main_code; @@ -268,7 +267,6 @@ dwarf2_head_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = head->dbgfmt_dwarf2; unsigned char *buf = *bufp; yasm_intnum *intn, *cval; - size_t i, len; if (dbgfmt_dwarf2->format == DWARF2_FORMAT_64BIT) { YASM_WRITE_8(buf, 0xff); diff --git a/modules/dbgfmts/dwarf2/dwarf2-info.c b/modules/dbgfmts/dwarf2/dwarf2-info.c index b961ff68..a739772f 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-info.c +++ b/modules/dbgfmts/dwarf2/dwarf2-info.c @@ -185,13 +185,6 @@ typedef enum { DW_AT_vtable_elem_location = 0x4d } dwarf_attribute; -typedef struct dwarf2_info_head { - yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2; - yasm_bytecode *info_start_prevbc; - yasm_bytecode *info_end_prevbc; - /*@owned@*/ yasm_expr *debug_abbrev_expr; /* points to debug_abbrev */ -} dwarf2_info_head; - typedef struct dwarf2_abbrev_attr { STAILQ_ENTRY(dwarf2_abbrev_attr) link; dwarf_attribute name; @@ -207,16 +200,6 @@ typedef struct dwarf2_abbrev { /* Bytecode callback function prototypes */ -static void dwarf2_info_head_bc_destroy(void *contents); -static void dwarf2_info_head_bc_print(const void *contents, FILE *f, - int indent_level); -static yasm_bc_resolve_flags dwarf2_info_head_bc_resolve - (yasm_bytecode *bc, int save, yasm_calc_bc_dist_func calc_bc_dist); -static int dwarf2_info_head_bc_tobytes - (yasm_bytecode *bc, unsigned char **bufp, void *d, - yasm_output_expr_func output_expr, - /*@null@*/ yasm_output_reloc_func output_reloc); - static void dwarf2_abbrev_bc_destroy(void *contents); static void dwarf2_abbrev_bc_print(const void *contents, FILE *f, int indent_level); @@ -229,14 +212,6 @@ static int dwarf2_abbrev_bc_tobytes /* Bytecode callback structures */ -static const yasm_bytecode_callback dwarf2_info_head_bc_callback = { - dwarf2_info_head_bc_destroy, - dwarf2_info_head_bc_print, - yasm_bc_finalize_common, - dwarf2_info_head_bc_resolve, - dwarf2_info_head_bc_tobytes -}; - static const yasm_bytecode_callback dwarf2_abbrev_bc_callback = { dwarf2_abbrev_bc_destroy, dwarf2_abbrev_bc_print, @@ -386,77 +361,6 @@ yasm_dwarf2__generate_info(yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2, return debug_info; } -static void -dwarf2_info_head_bc_destroy(void *contents) -{ - dwarf2_info_head *ih = (dwarf2_info_head *)contents; - yasm_xfree(contents); -} - -static void -dwarf2_info_head_bc_print(const void *contents, FILE *f, int indent_level) -{ - /* TODO */ -} - -static yasm_bc_resolve_flags -dwarf2_info_head_bc_resolve(yasm_bytecode *bc, int save, - yasm_calc_bc_dist_func calc_bc_dist) -{ - yasm_internal_error(N_("tried to resolve a dwarf2 info head bytecode")); - /*@notreached@*/ - return YASM_BC_RESOLVE_MIN_LEN; -} - -static int -dwarf2_info_head_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, - yasm_output_expr_func output_expr, - yasm_output_reloc_func output_reloc) -{ - dwarf2_info_head *ih = (dwarf2_info_head *)bc->contents; - yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = ih->dbgfmt_dwarf2; - unsigned char *buf = *bufp; - yasm_intnum *intn, *cval; - size_t i, len; - - if (dbgfmt_dwarf2->format == DWARF2_FORMAT_64BIT) { - YASM_WRITE_8(buf, 0xff); - YASM_WRITE_8(buf, 0xff); - YASM_WRITE_8(buf, 0xff); - YASM_WRITE_8(buf, 0xff); - } - - /* Total length of info (following this field) */ - cval = yasm_intnum_create_uint(dbgfmt_dwarf2->sizeof_offset); - intn = yasm_common_calc_bc_dist(ih->info_start_prevbc, ih->info_end_prevbc); - yasm_intnum_calc(intn, YASM_EXPR_SUB, cval, bc->line); - yasm_arch_intnum_tobytes(dbgfmt_dwarf2->arch, intn, buf, - dbgfmt_dwarf2->sizeof_offset, - dbgfmt_dwarf2->sizeof_offset*8, 0, bc, 0, 0); - buf += dbgfmt_dwarf2->sizeof_offset; - yasm_intnum_destroy(intn); - - /* DWARF version */ - yasm_intnum_set_uint(cval, 2); - yasm_arch_intnum_tobytes(dbgfmt_dwarf2->arch, cval, buf, 2, 16, 0, bc, 0, - 0); - buf += 2; - - /* Pointer to our debug_abbrev */ - output_expr(&ih->debug_abbrev_expr, buf, dbgfmt_dwarf2->sizeof_offset, - dbgfmt_dwarf2->sizeof_offset*8, 0, (unsigned long)(buf-*bufp), - bc, 0, 0, d); - buf += dbgfmt_dwarf2->sizeof_offset; - - /* Size of the offset portion of the address */ - YASM_WRITE_8(buf, dbgfmt_dwarf2->sizeof_address); - - *bufp = buf; - - yasm_intnum_destroy(cval); - return 0; -} - static void dwarf2_abbrev_bc_destroy(void *contents) { diff --git a/modules/dbgfmts/dwarf2/dwarf2-line.c b/modules/dbgfmts/dwarf2/dwarf2-line.c index a8a11e6d..6f0f801d 100644 --- a/modules/dbgfmts/dwarf2/dwarf2-line.c +++ b/modules/dbgfmts/dwarf2/dwarf2-line.c @@ -708,7 +708,7 @@ dwarf2_spp_bc_tobytes(yasm_bytecode *bc, unsigned char **bufp, void *d, dwarf2_spp *spp = (dwarf2_spp *)bc->contents; yasm_dbgfmt_dwarf2 *dbgfmt_dwarf2 = spp->dbgfmt_dwarf2; unsigned char *buf = *bufp; - yasm_intnum *intn, *cval; + yasm_intnum *cval; size_t i, len; /* Prologue length (following this field) */