From: Petr Machata Date: Mon, 7 Mar 2011 12:35:53 +0000 (+0100) Subject: dwarflint: Rename readctx.{c,h} to .{cc,hh} X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=acec19c3083d6acfe8797702e0d33e4fef674b23;p=thirdparty%2Felfutils.git dwarflint: Rename readctx.{c,h} to .{cc,hh} - I had something in mind that needed the C++ bits from the rest of dwarflint, but that turned out to be too convoluted to be practical --- diff --git a/dwarflint/Makefile.am b/dwarflint/Makefile.am index 05fea4d46..d9ef2ab2d 100644 --- a/dwarflint/Makefile.am +++ b/dwarflint/Makefile.am @@ -63,7 +63,7 @@ dwarflint_SOURCES = \ misc.cc misc.hh \ option.cc option.hh option.ii \ pri.cc pri.hh \ - readctx.c readctx.h \ + readctx.cc readctx.hh \ reloc.cc reloc.hh \ section_id.cc section_id.hh \ sections.cc sections.hh sections.ii \ diff --git a/dwarflint/checked_read.hh b/dwarflint/checked_read.hh index 0843aaf17..4171b57a6 100644 --- a/dwarflint/checked_read.hh +++ b/dwarflint/checked_read.hh @@ -26,7 +26,7 @@ #ifndef DWARFLINT_CHECKED_READ_HH #define DWARFLINT_CHECKED_READ_HH -#include "readctx.h" +#include "readctx.hh" #include "where.h" #include "dwarf_version.hh" diff --git a/dwarflint/main.cc b/dwarflint/main.cc index c68e35da4..818d30f69 100644 --- a/dwarflint/main.cc +++ b/dwarflint/main.cc @@ -34,7 +34,7 @@ #include #include "dwarflint.hh" -#include "readctx.h" +#include "readctx.hh" #include "checks.hh" #include "option.hh" #include "messages.hh" diff --git a/dwarflint/readctx.c b/dwarflint/readctx.cc similarity index 95% rename from dwarflint/readctx.c rename to dwarflint/readctx.cc index 8807215f6..d7ed1c164 100644 --- a/dwarflint/readctx.c +++ b/dwarflint/readctx.cc @@ -24,7 +24,7 @@ Network licensing program, please visit www.openinventionnetwork.com . */ -#include "readctx.h" +#include "readctx.hh" #include "../libdw/dwarf.h" #include @@ -47,7 +47,7 @@ union unaligned static uint16_t read_2ubyte_unaligned (const void *p, bool other_byte_order) { - const union unaligned *up = p; + const union unaligned *up = (const union unaligned *)p; if (other_byte_order) return bswap_16 (up->u2); return up->u2; @@ -58,7 +58,7 @@ read_2ubyte_unaligned (const void *p, bool other_byte_order) uint32_t dwarflint_read_4ubyte_unaligned (const void *p, bool other_byte_order) { - const union unaligned *up = p; + const union unaligned *up = (const union unaligned *)p; if (other_byte_order) return bswap_32 (up->u4); return up->u4; @@ -67,7 +67,7 @@ dwarflint_read_4ubyte_unaligned (const void *p, bool other_byte_order) uint64_t dwarflint_read_8ubyte_unaligned (const void *p, bool other_byte_order) { - const union unaligned *up = p; + const union unaligned *up = (const union unaligned *)p; if (other_byte_order) return bswap_64 (up->u8); return up->u8; @@ -98,9 +98,9 @@ read_ctx_init (struct read_ctx *ctx, Elf_Data *data, bool other_byte_order) abort (); ctx->data = data; - ctx->begin = data->d_buf; - ctx->end = data->d_buf + data->d_size; - ctx->ptr = data->d_buf; + ctx->begin = (const unsigned char *)data->d_buf; + ctx->end = (const unsigned char *)data->d_buf + data->d_size; + ctx->ptr = (const unsigned char *)data->d_buf; ctx->other_byte_order = other_byte_order; } diff --git a/dwarflint/readctx.h b/dwarflint/readctx.hh similarity index 100% rename from dwarflint/readctx.h rename to dwarflint/readctx.hh diff --git a/dwarflint/reloc.cc b/dwarflint/reloc.cc index 8edc78b2d..da389d930 100644 --- a/dwarflint/reloc.cc +++ b/dwarflint/reloc.cc @@ -30,7 +30,7 @@ #include "elf_file.hh" #include "messages.hh" #include "misc.hh" -#include "readctx.h" +#include "readctx.hh" #include #include