Prevent compilation warnings when compiled x64 target with VS2008

This commit is contained in:
Serge Lamikhov-Center 2012-07-24 12:10:16 +03:00
parent bf2efcc32f
commit 3203483e34
5 changed files with 8 additions and 8 deletions

View File

@ -281,7 +281,7 @@ class elfio
return 0;
}
new_section->set_index( sections_.size() );
new_section->set_index( (Elf_Half)sections_.size() );
sections_.push_back( new_section );
return new_section;

View File

@ -40,7 +40,7 @@ class note_section_accessor
Elf_Word
get_notes_num() const
{
return note_start_positions.size();
return (Elf_Word)note_start_positions.size();
}
//------------------------------------------------------------------------------
@ -85,7 +85,7 @@ class note_section_accessor
{
const endianess_convertor& convertor = elf_file.get_convertor();
Elf_Word nameLen = name.size() + 1;
Elf_Word nameLen = (Elf_Word)name.size() + 1;
Elf_Word nameLenConv = convertor( nameLen );
std::string buffer( reinterpret_cast<char*>( &nameLenConv ), sizeof( nameLenConv ) );
Elf_Word descSizeConv = convertor( descSize );

View File

@ -162,7 +162,7 @@ class section_impl : public section
void
set_data( const std::string& str_data )
{
return set_data( str_data.c_str(), str_data.size() );
return set_data( str_data.c_str(), (Elf_Word)str_data.size() );
}
//------------------------------------------------------------------------------
@ -191,7 +191,7 @@ class section_impl : public section
void
append_data( const std::string& str_data )
{
return append_data( str_data.c_str(), str_data.size() );
return append_data( str_data.c_str(), (Elf_Word)str_data.size() );
}
//------------------------------------------------------------------------------

View File

@ -112,14 +112,14 @@ class segment_impl : public segment
set_align( addr_align );
}
return sections.size();
return (Elf_Half)sections.size();
}
//------------------------------------------------------------------------------
Elf_Half
get_sections_num() const
{
return sections.size();
return (Elf_Half)sections.size();
}
//------------------------------------------------------------------------------

View File

@ -67,7 +67,7 @@ class string_section_accessor
string_section->append_data( empty_string, 1 );
current_position++;
}
string_section->append_data( str, std::strlen( str ) + 1 );
string_section->append_data( str, (Elf_Word)std::strlen( str ) + 1 );
return current_position;
}