Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1191)

Unified Diff: courgette/assembly_program.cc

Issue 613893002: Fix more MSVC warnings, courgette/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static_cast Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « courgette/assembly_program.h ('k') | courgette/disassembler_elf_32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/assembly_program.cc
diff --git a/courgette/assembly_program.cc b/courgette/assembly_program.cc
index bfdf6efe0877fb63e21745471ea4069d59d6d885..4718cbfb54ab096a552ac9f99a6905fb3a2237a2 100644
--- a/courgette/assembly_program.cc
+++ b/courgette/assembly_program.cc
@@ -90,16 +90,16 @@ class ByteInstruction : public Instruction {
// Emits a single byte.
class BytesInstruction : public Instruction {
public:
- BytesInstruction(const uint8* values, uint32 len)
+ BytesInstruction(const uint8* values, size_t len)
: Instruction(DEFBYTES, 0),
values_(values),
len_(len) {}
const uint8* byte_values() const { return values_; }
- uint32 len() const { return len_; }
+ size_t len() const { return len_; }
private:
const uint8* values_;
- uint32 len_;
+ size_t len_;
};
// A ABS32 to REL32 instruction emits a reference to a label's address.
@@ -179,7 +179,7 @@ CheckBool AssemblyProgram::EmitByteInstruction(uint8 byte) {
}
CheckBool AssemblyProgram::EmitBytesInstruction(const uint8* values,
- uint32 len) {
+ size_t len) {
return Emit(new(std::nothrow) BytesInstruction(values, len));
}
@@ -421,7 +421,7 @@ EncodedProgram* AssemblyProgram::Encode() const {
case DEFBYTES: {
const uint8* byte_values =
static_cast<BytesInstruction*>(instruction)->byte_values();
- uint32 len = static_cast<BytesInstruction*>(instruction)->len();
+ size_t len = static_cast<BytesInstruction*>(instruction)->len();
if (!encoded->AddCopy(len, byte_values))
return NULL;
@@ -547,19 +547,6 @@ CheckBool AssemblyProgram::TrimLabels() {
return true;
}
-void AssemblyProgram::PrintLabelCounts(RVAToLabel* labels) {
- for (RVAToLabel::const_iterator p = labels->begin(); p != labels->end();
- ++p) {
- Label* current = p->second;
- if (current->index_ != Label::kNoIndex)
- printf("%d\n", current->count_);
- }
-}
-
-void AssemblyProgram::CountRel32ARM() {
- PrintLabelCounts(&rel32_labels_);
-}
-
////////////////////////////////////////////////////////////////////////////////
Status TrimLabels(AssemblyProgram* program) {
« no previous file with comments | « courgette/assembly_program.h ('k') | courgette/disassembler_elf_32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698