summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2014-02-28 11:10:02 -0600
committerAndroid Git Automerger2014-02-28 11:10:02 -0600
commit470185211b09472ef11f826c5bf0d154c541040a (patch)
tree0075a5103ef405f3690be8e5e30a32614bf43a62 /libsparse
parent128a26bf7bbc3479b3413d6119efc5bb0f540b3d (diff)
parentd9f1702a10541b59cfc9582762360d3347712e09 (diff)
downloadplatform-system-core-470185211b09472ef11f826c5bf0d154c541040a.tar.gz
platform-system-core-470185211b09472ef11f826c5bf0d154c541040a.tar.xz
platform-system-core-470185211b09472ef11f826c5bf0d154c541040a.zip
am d9f1702a: am 2b6791d0: am 0577a067: Merge "libsparse: deal with build warning messages"
* commit 'd9f1702a10541b59cfc9582762360d3347712e09': libsparse: deal with build warning messages
Diffstat (limited to 'libsparse')
-rw-r--r--libsparse/defs.h23
-rw-r--r--libsparse/output_file.c9
-rw-r--r--libsparse/sparse.c3
-rw-r--r--libsparse/sparse_read.c5
4 files changed, 34 insertions, 6 deletions
diff --git a/libsparse/defs.h b/libsparse/defs.h
new file mode 100644
index 000000000..34e63c57c
--- /dev/null
+++ b/libsparse/defs.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _LIBSPARSE_DEFS_H_
18
19#ifndef __unused
20#define __unused __attribute__((__unused__))
21#endif
22
23#endif /* _LIBSPARSE_DEFS_H_ */
diff --git a/libsparse/output_file.c b/libsparse/output_file.c
index e63c4a929..1cf8d8dcf 100644
--- a/libsparse/output_file.c
+++ b/libsparse/output_file.c
@@ -29,6 +29,7 @@
29#include <unistd.h> 29#include <unistd.h>
30#include <zlib.h> 30#include <zlib.h>
31 31
32#include "defs.h"
32#include "output_file.h" 33#include "output_file.h"
33#include "sparse_format.h" 34#include "sparse_format.h"
34#include "sparse_crc32.h" 35#include "sparse_crc32.h"
@@ -264,7 +265,7 @@ static struct output_file_ops gz_file_ops = {
264 .close = gz_file_close, 265 .close = gz_file_close,
265}; 266};
266 267
267static int callback_file_open(struct output_file *out, int fd) 268static int callback_file_open(struct output_file *out __unused, int fd __unused)
268{ 269{
269 return 0; 270 return 0;
270} 271}
@@ -287,7 +288,7 @@ static int callback_file_skip(struct output_file *out, int64_t off)
287 return 0; 288 return 0;
288} 289}
289 290
290static int callback_file_pad(struct output_file *out, int64_t len) 291static int callback_file_pad(struct output_file *out __unused, int64_t len __unused)
291{ 292{
292 return -1; 293 return -1;
293} 294}
@@ -631,8 +632,8 @@ static struct output_file *output_file_new_normal(void)
631} 632}
632 633
633struct output_file *output_file_open_callback(int (*write)(void *, const void *, int), 634struct output_file *output_file_open_callback(int (*write)(void *, const void *, int),
634 void *priv, unsigned int block_size, int64_t len, int gz, int sparse, 635 void *priv, unsigned int block_size, int64_t len,
635 int chunks, int crc) 636 int gz __unused, int sparse, int chunks, int crc)
636{ 637{
637 int ret; 638 int ret;
638 struct output_file_callback *outc; 639 struct output_file_callback *outc;
diff --git a/libsparse/sparse.c b/libsparse/sparse.c
index 741e8c6fc..0f107b00f 100644
--- a/libsparse/sparse.c
+++ b/libsparse/sparse.c
@@ -19,6 +19,7 @@
19 19
20#include <sparse/sparse.h> 20#include <sparse/sparse.h>
21 21
22#include "defs.h"
22#include "sparse_file.h" 23#include "sparse_file.h"
23 24
24#include "output_file.h" 25#include "output_file.h"
@@ -189,7 +190,7 @@ int sparse_file_callback(struct sparse_file *s, bool sparse, bool crc,
189 return ret; 190 return ret;
190} 191}
191 192
192static int out_counter_write(void *priv, const void *data, int len) 193static int out_counter_write(void *priv, const void *data __unused, int len)
193{ 194{
194 int64_t *count = priv; 195 int64_t *count = priv;
195 *count += len; 196 *count += len;
diff --git a/libsparse/sparse_read.c b/libsparse/sparse_read.c
index 704bcfadd..873c87c7a 100644
--- a/libsparse/sparse_read.c
+++ b/libsparse/sparse_read.c
@@ -29,6 +29,8 @@
29 29
30#include <sparse/sparse.h> 30#include <sparse/sparse.h>
31 31
32#include "defs.h"
33#include "output_file.h"
32#include "sparse_crc32.h" 34#include "sparse_crc32.h"
33#include "sparse_file.h" 35#include "sparse_file.h"
34#include "sparse_format.h" 36#include "sparse_format.h"
@@ -175,7 +177,8 @@ static int process_fill_chunk(struct sparse_file *s, unsigned int chunk_size,
175} 177}
176 178
177static int process_skip_chunk(struct sparse_file *s, unsigned int chunk_size, 179static int process_skip_chunk(struct sparse_file *s, unsigned int chunk_size,
178 int fd, unsigned int blocks, unsigned int block, uint32_t *crc32) 180 int fd __unused, unsigned int blocks,
181 unsigned int block __unused, uint32_t *crc32)
179{ 182{
180 int ret; 183 int ret;
181 int chunk; 184 int chunk;