Loading applypatch/Makefile 0 → 100644 +32 −0 Original line number Diff line number Diff line # Copyright (C) 2016 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # This file is for building imgdiff in Chrome OS. CPPFLAGS += -iquote.. CXXFLAGS += -std=c++11 -O3 -Wall -Werror LDLIBS += -lbz2 -lz .PHONY: all clean all: imgdiff libimgpatch.a clean: rm -f *.o imgdiff libimgpatch.a imgdiff: imgdiff.o bsdiff.o utils.o $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDLIBS) -o $@ $^ libimgpatch.a: imgpatch.o bspatch.o utils.o ${AR} rcs $@ $^ applypatch/applypatch.h +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #ifndef _APPLYPATCH_H #define _APPLYPATCH_H #include <stdint.h> #include <sys/stat.h> #include <vector> Loading applypatch/bsdiff.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,6 @@ static void offtout(off_t x,u_char *buf) int bsdiff(u_char* old, off_t oldsize, off_t** IP, u_char* newdata, off_t newsize, const char* patch_filename) { int fd; off_t *I; off_t scan,pos,len; off_t lastscan,lastpos,lastoffset; Loading applypatch/bspatch.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,6 @@ int ApplyBSDiffPatchMem(const unsigned char* old_data, ssize_t old_size, off_t oldpos = 0, newpos = 0; off_t ctrl[3]; off_t len_read; int i; unsigned char buf[24]; while (newpos < new_size) { Loading applypatch/imgdiff.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -598,7 +598,6 @@ int ReconstructDeflateChunk(ImageChunk* chunk) { return -1; } size_t p = 0; unsigned char* out = reinterpret_cast<unsigned char*>(malloc(BUFFER_SIZE)); // We only check two combinations of encoder parameters: level 6 Loading Loading @@ -844,7 +843,6 @@ int main(int argc, char** argv) { } if (argc != 4) { usage: printf("usage: %s [-z] [-b <bonus-file>] <src-img> <tgt-img> <patch-file>\n", argv[0]); return 2; Loading Loading
applypatch/Makefile 0 → 100644 +32 −0 Original line number Diff line number Diff line # Copyright (C) 2016 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # This file is for building imgdiff in Chrome OS. CPPFLAGS += -iquote.. CXXFLAGS += -std=c++11 -O3 -Wall -Werror LDLIBS += -lbz2 -lz .PHONY: all clean all: imgdiff libimgpatch.a clean: rm -f *.o imgdiff libimgpatch.a imgdiff: imgdiff.o bsdiff.o utils.o $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDLIBS) -o $@ $^ libimgpatch.a: imgpatch.o bspatch.o utils.o ${AR} rcs $@ $^
applypatch/applypatch.h +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #ifndef _APPLYPATCH_H #define _APPLYPATCH_H #include <stdint.h> #include <sys/stat.h> #include <vector> Loading
applypatch/bsdiff.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -224,7 +224,6 @@ static void offtout(off_t x,u_char *buf) int bsdiff(u_char* old, off_t oldsize, off_t** IP, u_char* newdata, off_t newsize, const char* patch_filename) { int fd; off_t *I; off_t scan,pos,len; off_t lastscan,lastpos,lastoffset; Loading
applypatch/bspatch.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,6 @@ int ApplyBSDiffPatchMem(const unsigned char* old_data, ssize_t old_size, off_t oldpos = 0, newpos = 0; off_t ctrl[3]; off_t len_read; int i; unsigned char buf[24]; while (newpos < new_size) { Loading
applypatch/imgdiff.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -598,7 +598,6 @@ int ReconstructDeflateChunk(ImageChunk* chunk) { return -1; } size_t p = 0; unsigned char* out = reinterpret_cast<unsigned char*>(malloc(BUFFER_SIZE)); // We only check two combinations of encoder parameters: level 6 Loading Loading @@ -844,7 +843,6 @@ int main(int argc, char** argv) { } if (argc != 4) { usage: printf("usage: %s [-z] [-b <bonus-file>] <src-img> <tgt-img> <patch-file>\n", argv[0]); return 2; Loading