summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-15 21:37:34 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-15 21:37:34 +0000
commitf870b91e85a415c73a6c5f8c45b79c3aa7aea865 (patch)
tree6a5fca95ce93294ff06b53dbdfd4e3a81548cea3
parent4d69b98301594411cbca8ca82bec1bb2656ecb1b (diff)
parent069316a93cb305bf016310fa1bcbe6a34e83804c (diff)
downloadbsdiff-f870b91e85a415c73a6c5f8c45b79c3aa7aea865.tar.gz
Change-Id: If8f430ba8b1ef09476ba19773edf43b99a5162c3
-rw-r--r--Android.bp1
-rw-r--r--OWNERS2
-rw-r--r--TEST_MAPPING5
-rw-r--r--bspatch.cc2
-rw-r--r--compressor_interface.h (renamed from include/bsdiff/compressor_interface.h)0
-rw-r--r--decompressor_interface.h (renamed from include/bsdiff/decompressor_interface.h)0
-rw-r--r--file.h (renamed from include/bsdiff/file.h)0
-rw-r--r--include/bsdiff/control_entry.h15
-rw-r--r--memory_file.h (renamed from include/bsdiff/memory_file.h)0
-rw-r--r--patch_reader.cc2
-rw-r--r--patch_reader.h (renamed from include/bsdiff/patch_reader.h)0
-rw-r--r--patch_writer.cc7
-rw-r--r--patch_writer.h (renamed from include/bsdiff/patch_writer.h)9
-rw-r--r--suffix_array_index.cc1
14 files changed, 16 insertions, 28 deletions
diff --git a/Android.bp b/Android.bp
index 3541d03..ee6dc4f 100644
--- a/Android.bp
+++ b/Android.bp
@@ -73,7 +73,6 @@ cc_library_static {
cc_library_static {
name: "libbsdiff",
- recovery_available: true,
defaults: ["bsdiff_defaults"],
srcs: [
diff --git a/OWNERS b/OWNERS
index b730db9..ab036c1 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,5 +1,3 @@
deymo@google.com
senj@google.com
xunchang@google.com
-zhangkelvin@google.com
-
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 570788d..598f4c9 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -3,10 +3,5 @@
{
"name": "bsdiff_unittest"
}
- ],
- "hwasan-postsubmit": [
- {
- "name": "bsdiff_unittest"
- }
]
}
diff --git a/bspatch.cc b/bspatch.cc
index e95b9a2..d7f1710 100644
--- a/bspatch.cc
+++ b/bspatch.cc
@@ -33,8 +33,8 @@ __FBSDID("$FreeBSD: src/usr.bin/bsdiff/bspatch/bspatch.c,v 1.1 2005/08/06 01:59:
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
-#include <stdint.h>
#include <stdio.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
diff --git a/include/bsdiff/compressor_interface.h b/compressor_interface.h
index c0ff18d..c0ff18d 100644
--- a/include/bsdiff/compressor_interface.h
+++ b/compressor_interface.h
diff --git a/include/bsdiff/decompressor_interface.h b/decompressor_interface.h
index 46ee444..46ee444 100644
--- a/include/bsdiff/decompressor_interface.h
+++ b/decompressor_interface.h
diff --git a/include/bsdiff/file.h b/file.h
index 959c53e..959c53e 100644
--- a/include/bsdiff/file.h
+++ b/file.h
diff --git a/include/bsdiff/control_entry.h b/include/bsdiff/control_entry.h
index 3d2d96c..2c849f6 100644
--- a/include/bsdiff/control_entry.h
+++ b/include/bsdiff/control_entry.h
@@ -8,24 +8,23 @@
#include <stdint.h>
struct ControlEntry {
- constexpr ControlEntry(uint64_t diff_size,
- uint64_t extra_size,
- int64_t offset_increment)
+ ControlEntry(uint64_t diff_size,
+ uint64_t extra_size,
+ int64_t offset_increment)
: diff_size(diff_size),
extra_size(extra_size),
offset_increment(offset_increment) {}
- constexpr ControlEntry() = default;
// The number of bytes to copy from the source and diff stream.
- uint64_t diff_size{0};
+ uint64_t diff_size;
// The number of bytes to copy from the extra stream.
- uint64_t extra_size{0};
+ uint64_t extra_size;
// The value to add to the source pointer after patching from the diff stream.
- int64_t offset_increment{0};
+ int64_t offset_increment;
- [[nodiscard]] bool operator==(const ControlEntry& o) const {
+ bool operator==(const ControlEntry& o) const {
return diff_size == o.diff_size && extra_size == o.extra_size &&
offset_increment == o.offset_increment;
}
diff --git a/include/bsdiff/memory_file.h b/memory_file.h
index 4100fd6..4100fd6 100644
--- a/include/bsdiff/memory_file.h
+++ b/memory_file.h
diff --git a/patch_reader.cc b/patch_reader.cc
index 6d317f3..e863b9a 100644
--- a/patch_reader.cc
+++ b/patch_reader.cc
@@ -32,7 +32,7 @@ bool BsdiffPatchReader::Init(const uint8_t* patch_data, size_t patch_size) {
// extra block; seek forwards in oldfile by z bytes".
if (patch_size < 32) {
- LOG(ERROR) << "Too small to be a bspatch. " << patch_size;
+ LOG(ERROR) << "Too small to be a bspatch.";
return false;
}
// Check for appropriate magic.
diff --git a/include/bsdiff/patch_reader.h b/patch_reader.h
index fe0451b..fe0451b 100644
--- a/include/bsdiff/patch_reader.h
+++ b/patch_reader.h
diff --git a/patch_writer.cc b/patch_writer.cc
index b7d9b08..52982e0 100644
--- a/patch_writer.cc
+++ b/patch_writer.cc
@@ -15,6 +15,13 @@
namespace {
+void EncodeInt64(int64_t x, uint8_t* buf) {
+ uint64_t y = x < 0 ? (1ULL << 63ULL) - x : x;
+ for (int i = 0; i < 8; ++i) {
+ buf[i] = y & 0xff;
+ y /= 256;
+ }
+}
} // namespace
diff --git a/include/bsdiff/patch_writer.h b/patch_writer.h
index 6d2bcf5..8ad4cde 100644
--- a/include/bsdiff/patch_writer.h
+++ b/patch_writer.h
@@ -14,15 +14,6 @@
namespace bsdiff {
-
-constexpr void EncodeInt64(int64_t x, uint8_t* buf) {
- uint64_t y = x < 0 ? (1ULL << 63ULL) - x : x;
- for (int i = 0; i < 8; ++i) {
- buf[i] = y & 0xff;
- y /= 256;
- }
-}
-
// A PatchWriterInterface class with three compressors and a 32-byte header.
class BsdiffPatchWriter : public PatchWriterInterface {
public:
diff --git a/suffix_array_index.cc b/suffix_array_index.cc
index 710249c..b02655c 100644
--- a/suffix_array_index.cc
+++ b/suffix_array_index.cc
@@ -4,7 +4,6 @@
#include "bsdiff/suffix_array_index.h"
-#include <algorithm>
#include <limits>
#include <vector>