AU: Class to perform delta updates.
A class to perform delta updates and the associated unittests. Also,
change the delta diff generator executable to be able to apply a
delta, which is handy for debugging.
TEST=Attached unit test, hand-tested on real build images
BUG=552
Review URL: http://codereview.chromium.org/1718001
diff --git a/extent_writer.cc b/extent_writer.cc
index 9f6fbf0..baac66c 100644
--- a/extent_writer.cc
+++ b/extent_writer.cc
@@ -6,6 +6,7 @@
#include <errno.h>
#include <unistd.h>
#include <algorithm>
+#include "update_engine/graph_types.h"
#include "update_engine/utils.h"
using std::min;
@@ -19,12 +20,12 @@
size_t bytes_written = 0;
while (count - bytes_written > 0) {
TEST_AND_RETURN_FALSE(next_extent_index_ < extents_.size());
- uint64 bytes_remaining_next_extent =
+ uint64_t bytes_remaining_next_extent =
extents_[next_extent_index_].num_blocks() * block_size_ -
extent_bytes_written_;
CHECK_NE(bytes_remaining_next_extent, 0);
size_t bytes_to_write =
- static_cast<size_t>(min(static_cast<uint64>(count - bytes_written),
+ static_cast<size_t>(min(static_cast<uint64_t>(count - bytes_written),
bytes_remaining_next_extent));
TEST_AND_RETURN_FALSE(bytes_to_write > 0);