summaryrefslogtreecommitdiffstats
path: root/courgette
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2014-12-04 14:14:22 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-04 22:15:43 +0000
commit8badc79882ad8723e60cf47aeb41c56adb2789b3 (patch)
tree88e106bc35a3c7b53d0e0ac326c09b9cb0489b5b /courgette
parentcde16351653d0bb86675647a67fca3326db8148b (diff)
downloadchromium_src-8badc79882ad8723e60cf47aeb41c56adb2789b3.zip
chromium_src-8badc79882ad8723e60cf47aeb41c56adb2789b3.tar.gz
chromium_src-8badc79882ad8723e60cf47aeb41c56adb2789b3.tar.bz2
Cleanup: Get rid of more base::ASCIIToWide usage.
Also do some lint cleanups. BUG=23581 Review URL: https://codereview.chromium.org/777623002 Cr-Commit-Position: refs/heads/master@{#306905}
Diffstat (limited to 'courgette')
-rw-r--r--courgette/encoded_program.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/courgette/encoded_program.cc b/courgette/encoded_program.cc
index b120246..f198a1b 100644
--- a/courgette/encoded_program.cc
+++ b/courgette/encoded_program.cc
@@ -12,8 +12,8 @@
#include "base/environment.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
-#include "base/strings/utf_string_conversions.h"
#include "courgette/courgette.h"
#include "courgette/disassembler_elf_32_arm.h"
#include "courgette/streams.h"
@@ -292,17 +292,14 @@ enum FieldSelect {
};
static FieldSelect GetFieldSelect() {
-#if 1
// TODO(sra): Use better configuration.
scoped_ptr<base::Environment> env(base::Environment::Create());
std::string s;
env->GetVar("A_FIELDS", &s);
- if (!s.empty()) {
- return static_cast<FieldSelect>(
- wcstoul(base::ASCIIToWide(s).c_str(), 0, 0));
- }
-#endif
- return static_cast<FieldSelect>(~0);
+ uint64 fields;
+ if (!base::StringToUint64(s, &fields))
+ return static_cast<FieldSelect>(~0);
+ return static_cast<FieldSelect>(fields);
}
CheckBool EncodedProgram::WriteTo(SinkStreamSet* streams) {
@@ -746,7 +743,7 @@ CheckBool EncodedProgram::GeneratePeRelocations(SinkStream* buffer,
block.pod.page_rva = page_rva;
}
if (ok)
- block.Add(((static_cast<uint16>(type)) << 12 ) | (rva & 0xFFF));
+ block.Add(((static_cast<uint16>(type)) << 12) | (rva & 0xFFF));
}
ok &= block.Flush(buffer);
return ok;
@@ -797,4 +794,4 @@ void DeleteEncodedProgram(EncodedProgram* encoded) {
delete encoded;
}
-} // end namespace
+} // namespace courgette