diff options
author | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-09-16 22:37:24 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-09-16 22:37:24 +0000 |
commit | 1fa7c1c4c4195aa95b87b86752770bb7e1ad0f4c (patch) | |
tree | db3fc8ba53323cfa7ba2c68b49e1808706a2a7c9 /src/common | |
parent | Initialize variables that currently may theoretically be used uninitialized (diff) | |
download | breakpad-1fa7c1c4c4195aa95b87b86752770bb7e1ad0f4c.tar.xz |
Fix compilation of file_id_unittest.
Review URL: http://breakpad.appspot.com/198001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@689 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/linux/file_id_unittest.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/linux/file_id_unittest.cc b/src/common/linux/file_id_unittest.cc index e28a2f09..f5298b12 100644 --- a/src/common/linux/file_id_unittest.cc +++ b/src/common/linux/file_id_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009, Google Inc. +// Copyright (c) 2010, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -37,7 +37,6 @@ using namespace google_breakpad; - namespace { typedef testing::Test FileIDTest; } @@ -90,13 +89,14 @@ struct ElfClass64 { template<typename ElfClass> struct ElfishElf { + static const size_t kTextSectionSize = 128; typedef typename ElfClass::Ehdr Ehdr; typedef typename ElfClass::Shdr Shdr; Ehdr elf_header; Shdr text_header; Shdr string_header; - char text_section[128]; + char text_section[kTextSectionSize]; char string_section[8]; static void Populate(ElfishElf* elf) { @@ -109,8 +109,8 @@ struct ElfishElf { elf->text_header.sh_name = 0; elf->text_header.sh_type = SHT_PROGBITS; elf->text_header.sh_offset = offsetof(ElfishElf, text_section); - elf->text_header.sh_size = sizeof(text_section); - for (size_t i = 0; i < sizeof(text_section); ++i) { + elf->text_header.sh_size = kTextSectionSize; + for (size_t i = 0; i < kTextSectionSize; ++i) { elf->text_section[i] = i * 3; } elf->string_header.sh_offset = offsetof(ElfishElf, string_section); |