idmap2 code cleanup
- proper use of random number generators in FileUtils
- get rid of <iostream> include where possible
- replace std::endl with '\n' as we don't really need stream
flushes
- added a few missed moves
Bug: 282215580
Test: build, UTs and boot
Change-Id: I2dbe5e7c240acd0f344158ae6d9f2ee2b9c2c6ab
diff --git a/cmds/idmap2/libidmap2/RawPrintVisitor.cpp b/cmds/idmap2/libidmap2/RawPrintVisitor.cpp
index 3531cd7..174d85c 100644
--- a/cmds/idmap2/libidmap2/RawPrintVisitor.cpp
+++ b/cmds/idmap2/libidmap2/RawPrintVisitor.cpp
@@ -161,7 +161,7 @@
va_end(ap);
stream_ << base::StringPrintf("%08zx: %02x", offset_, value) << " " << comment
- << std::endl;
+ << '\n';
offset_ += sizeof(uint8_t);
}
@@ -173,7 +173,7 @@
base::StringAppendV(&comment, fmt, ap);
va_end(ap);
- stream_ << base::StringPrintf("%08zx: %04x", offset_, value) << " " << comment << std::endl;
+ stream_ << base::StringPrintf("%08zx: %04x", offset_, value) << " " << comment << '\n';
offset_ += sizeof(uint16_t);
}
@@ -185,7 +185,7 @@
base::StringAppendV(&comment, fmt, ap);
va_end(ap);
- stream_ << base::StringPrintf("%08zx: %08x", offset_, value) << " " << comment << std::endl;
+ stream_ << base::StringPrintf("%08zx: %08x", offset_, value) << " " << comment << '\n';
offset_ += sizeof(uint32_t);
}
@@ -198,7 +198,7 @@
va_end(ap);
stream_ << base::StringPrintf("%08zx: %08x", offset_, (uint32_t)value.size()) << " " << comment
- << " size" << std::endl;
+ << " size" << '\n';
offset_ += sizeof(uint32_t);
stream_ << base::StringPrintf("%08zx: ", offset_) << "........ " << comment;
@@ -207,7 +207,7 @@
if (print_value) {
stream_ << ": " << value;
}
- stream_ << std::endl;
+ stream_ << '\n';
}
void RawPrintVisitor::align() {