From 9bb53bf8b866ee59d66c14250aee4bfaed0604ca Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 19 Dec 2007 01:18:41 +0000 Subject: Avoid some warnings which showed up in 64-bit mode. --- gold/dynobj.cc | 38 ++++++++++++++++++++++---------------- gold/fileread.cc | 2 +- gold/gold.h | 2 +- 3 files changed, 24 insertions(+), 18 deletions(-) (limited to 'gold') diff --git a/gold/dynobj.cc b/gold/dynobj.cc index 7ebd758..18ae92c 100644 --- a/gold/dynobj.cc +++ b/gold/dynobj.cc @@ -464,7 +464,7 @@ Sized_dynobj::make_verdef_map( return; } - const unsigned int vd_ndx = verdef.get_vd_ndx(); + const section_size_type vd_ndx = verdef.get_vd_ndx(); // The GNU linker clears the VERSYM_HIDDEN bit. I'm not // sure why. @@ -472,36 +472,40 @@ Sized_dynobj::make_verdef_map( // The first Verdaux holds the name of this version. Subsequent // ones are versions that this one depends upon, which we don't // care about here. - const unsigned int vd_cnt = verdef.get_vd_cnt(); + const section_size_type vd_cnt = verdef.get_vd_cnt(); if (vd_cnt < 1) { - this->error(_("verdef vd_cnt field too small: %u"), vd_cnt); + this->error(_("verdef vd_cnt field too small: %u"), + static_cast(vd_cnt)); return; } - const unsigned int vd_aux = verdef.get_vd_aux(); + const section_size_type vd_aux = verdef.get_vd_aux(); if ((p - pverdef) + vd_aux >= verdef_size) { - this->error(_("verdef vd_aux field out of range: %u"), vd_aux); + this->error(_("verdef vd_aux field out of range: %u"), + static_cast(vd_aux)); return; } const unsigned char* pvda = p + vd_aux; elfcpp::Verdaux verdaux(pvda); - const unsigned int vda_name = verdaux.get_vda_name(); + const section_size_type vda_name = verdaux.get_vda_name(); if (vda_name >= names_size) { - this->error(_("verdaux vda_name field out of range: %u"), vda_name); + this->error(_("verdaux vda_name field out of range: %u"), + static_cast(vda_name)); return; } this->set_version_map(version_map, vd_ndx, names + vda_name); - const unsigned int vd_next = verdef.get_vd_next(); + const section_size_type vd_next = verdef.get_vd_next(); if ((p - pverdef) + vd_next >= verdef_size) { - this->error(_("verdef vd_next field out of range: %u"), vd_next); + this->error(_("verdef vd_next field out of range: %u"), + static_cast(vd_next)); return; } @@ -539,11 +543,12 @@ Sized_dynobj::make_verneed_map( return; } - const unsigned int vn_aux = verneed.get_vn_aux(); + const section_size_type vn_aux = verneed.get_vn_aux(); if ((p - pverneed) + vn_aux >= verneed_size) { - this->error(_("verneed vn_aux field out of range: %u"), vn_aux); + this->error(_("verneed vn_aux field out of range: %u"), + static_cast(vn_aux)); return; } @@ -557,28 +562,29 @@ Sized_dynobj::make_verneed_map( if (vna_name >= names_size) { this->error(_("vernaux vna_name field out of range: %u"), - vna_name); + static_cast(vna_name)); return; } this->set_version_map(version_map, vernaux.get_vna_other(), names + vna_name); - const unsigned int vna_next = vernaux.get_vna_next(); + const section_size_type vna_next = vernaux.get_vna_next(); if ((pvna - pverneed) + vna_next >= verneed_size) { this->error(_("verneed vna_next field out of range: %u"), - vna_next); + static_cast(vna_next)); return; } pvna += vna_next; } - const unsigned int vn_next = verneed.get_vn_next(); + const section_size_type vn_next = verneed.get_vn_next(); if ((p - pverneed) + vn_next >= verneed_size) { - this->error(_("verneed vn_next field out of range: %u"), vn_next); + this->error(_("verneed vn_next field out of range: %u"), + static_cast(vn_next)); return; } diff --git a/gold/fileread.cc b/gold/fileread.cc index 338a943..3050154 100644 --- a/gold/fileread.cc +++ b/gold/fileread.cc @@ -291,7 +291,7 @@ File_read::find_or_make_view(off_t start, section_size_type size, bool cache) if (poff + psize >= this->size_) { psize = this->size_ - poff; - gold_assert(psize >= size); + gold_assert(psize >= static_cast(size)); } File_read::View* v; diff --git a/gold/gold.h b/gold/gold.h index 8ea24d2..520f2e3 100644 --- a/gold/gold.h +++ b/gold/gold.h @@ -264,7 +264,7 @@ inline To convert_types(const From from) { To to = from; - gold_assert(to == from); + gold_assert(static_cast(to) == from); return to; } -- cgit v1.1