diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2010-11-07 16:47:20 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2010-11-07 16:47:20 +0000 |
commit | 75fe1e3d0b617ca6ef19f145f8df0ca57977eaf6 (patch) | |
tree | 667f3defed0b014a30478e441907d479016d66b5 /xdelta3 | |
parent | 5c20b63301a8f58096fe32926a6ab53d6e2d2017 (diff) |
Fix examples directory
Diffstat (limited to 'xdelta3')
-rw-r--r-- | xdelta3/examples/checksum_test.cc | 1 | ||||
-rw-r--r-- | xdelta3/examples/encode_decode_test.c | 4 | ||||
-rwxr-xr-x | xdelta3/examples/small_page_test.c | 7 | ||||
-rw-r--r-- | xdelta3/examples/test.h | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/xdelta3/examples/checksum_test.cc b/xdelta3/examples/checksum_test.cc index ab3ef6c..028922b 100644 --- a/xdelta3/examples/checksum_test.cc +++ b/xdelta3/examples/checksum_test.cc | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | extern "C" { | 3 | extern "C" { |
4 | #include "test.h" | 4 | #include "test.h" |
5 | #include <assert.h> | ||
5 | } | 6 | } |
6 | 7 | ||
7 | #include <list> | 8 | #include <list> |
diff --git a/xdelta3/examples/encode_decode_test.c b/xdelta3/examples/encode_decode_test.c index 353d8db..9f43092 100644 --- a/xdelta3/examples/encode_decode_test.c +++ b/xdelta3/examples/encode_decode_test.c | |||
@@ -43,7 +43,7 @@ int code ( | |||
43 | r = fstat(fileno(SrcFile), &statbuf); | 43 | r = fstat(fileno(SrcFile), &statbuf); |
44 | if (r) | 44 | if (r) |
45 | return r; | 45 | return r; |
46 | source.size = statbuf.st_size; | 46 | |
47 | source.blksize = BufSize; | 47 | source.blksize = BufSize; |
48 | source.curblk = malloc(source.blksize); | 48 | source.curblk = malloc(source.blksize); |
49 | 49 | ||
@@ -157,7 +157,7 @@ int main(int argc, char* argv[]) | |||
157 | int r; | 157 | int r; |
158 | 158 | ||
159 | if (argc != 3) { | 159 | if (argc != 3) { |
160 | fprintf (stderr, "usage: %s source input output\n", argv[0]); | 160 | fprintf (stderr, "usage: %s source input\n", argv[0]); |
161 | return 1; | 161 | return 1; |
162 | } | 162 | } |
163 | 163 | ||
diff --git a/xdelta3/examples/small_page_test.c b/xdelta3/examples/small_page_test.c index 2d9ae93..e4b5a1b 100755 --- a/xdelta3/examples/small_page_test.c +++ b/xdelta3/examples/small_page_test.c | |||
@@ -82,14 +82,13 @@ process_page (int is_encode, | |||
82 | config.freef = &process_free; | 82 | config.freef = &process_free; |
83 | config.opaque = (void*) ctx; | 83 | config.opaque = (void*) ctx; |
84 | 84 | ||
85 | src.size = PAGE_SIZE; | ||
86 | src.blksize = PAGE_SIZE; | 85 | src.blksize = PAGE_SIZE; |
87 | src.onblk = PAGE_SIZE; | 86 | src.onblk = PAGE_SIZE; |
88 | src.curblk = source; | 87 | src.curblk = source; |
89 | src.curblkno = 0; | 88 | src.curblkno = 0; |
90 | 89 | ||
91 | if ((ret = xd3_config_stream (&stream, &config)) != 0 || | 90 | if ((ret = xd3_config_stream (&stream, &config)) != 0 || |
92 | (ret = xd3_set_source (&stream, &src)) != 0 || | 91 | (ret = xd3_set_source_and_size (&stream, &src, PAGE_SIZE)) != 0 || |
93 | (ret = xd3_process_stream (is_encode, | 92 | (ret = xd3_process_stream (is_encode, |
94 | &stream, | 93 | &stream, |
95 | func, 1, | 94 | func, 1, |
@@ -144,7 +143,7 @@ int test(int stride, int encode_flags) | |||
144 | &output_size, OUTPUT_MAX, | 143 | &output_size, OUTPUT_MAX, |
145 | encode_flags)) != 0) | 144 | encode_flags)) != 0) |
146 | { | 145 | { |
147 | fprintf (stderr, "encode failed: stride %u flags 0x%x\n", | 146 | fprintf (stderr, "encode failed: stride %u flags 0x%x\n", |
148 | stride, encode_flags); | 147 | stride, encode_flags); |
149 | return ret; | 148 | return ret; |
150 | } | 149 | } |
@@ -175,7 +174,7 @@ int test(int stride, int encode_flags) | |||
175 | } | 174 | } |
176 | } | 175 | } |
177 | 176 | ||
178 | fprintf(stderr, "stride %d flags 0x%x size %u ", | 177 | fprintf(stderr, "stride %d flags 0x%x size %u ", |
179 | stride, encode_flags, output_size); | 178 | stride, encode_flags, output_size); |
180 | fprintf(stderr, "%s\n", (ret == 0) ? "OK" : "FAIL"); | 179 | fprintf(stderr, "%s\n", (ret == 0) ? "OK" : "FAIL"); |
181 | 180 | ||
diff --git a/xdelta3/examples/test.h b/xdelta3/examples/test.h index e8016bb..f31ae49 100644 --- a/xdelta3/examples/test.h +++ b/xdelta3/examples/test.h | |||
@@ -19,7 +19,7 @@ static int read_whole_file(const char *name, | |||
19 | fprintf(stderr, "open failed\n"); | 19 | fprintf(stderr, "open failed\n"); |
20 | goto exit; | 20 | goto exit; |
21 | } | 21 | } |
22 | ret = main_file_stat(&file, &len, 0); | 22 | ret = main_file_stat(&file, &len); |
23 | if (ret != 0) { | 23 | if (ret != 0) { |
24 | fprintf(stderr, "stat failed\n"); | 24 | fprintf(stderr, "stat failed\n"); |
25 | goto exit; | 25 | goto exit; |