Skip to content

Commit 35e368f

Browse files
committed
Clean up compilation warnings
1 parent 3049252 commit 35e368f

File tree

7 files changed

+7
-20
lines changed

7 files changed

+7
-20
lines changed

Android.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SQLITE3_INC := $(LOCAL_PATH)/sqlite-amalgamation-3070900
1616

1717
SERVALD_LOCAL_CFLAGS = \
1818
-g \
19-
-Wall -Wno-unused-value -Werror \
19+
-Wall -Wno-unused-variable -Wno-unused-value -Werror \
2020
-DSERVALD_VERSION="\"Android\"" -DSERVALD_COPYRIGHT="\"Android\"" \
2121
-DINSTANCE_PATH="\"/data/data/org.servalproject/var/serval-node\"" \
2222
-DSHELL -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" \

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ CFLAGS= -Isqlite-amalgamation-3070900 @CPPFLAGS@ @CFLAGS@ -Inacl/include
5959
CFLAGS+=-DSYSCONFDIR="\"$(sysconfdir)\"" -DLOCALSTATEDIR="\"$(localstatedir)\""
6060
CFLAGS+=-DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_DATETIME_FUNCS -DSQLITE_OMIT_COMPILEOPTION_DIAGS -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_VIRTUALTABLE -DSQLITE_OMIT_AUTHORIZATION
6161
CFLAGS+=-fPIC
62-
CFLAGS+=-Wall -Wno-unused-value -Werror
62+
CFLAGS+=-Wall -Werror
6363
# Solaris magic
6464
CFLAGS+=-DSHA2_USE_INTTYPES_H -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1
6565
# OSX magic to compensate for the Solaris magic

fdqueue.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ unsigned fd_depth();
166166

167167
#define OUT() fd_func_exit(__HERE__, &_this_call)
168168
#define RETURN(X) do { OUT(); return (X); } while (0)
169-
#define RETURNNULL(X) do { X; OUT(); return (NULL); } while (0)
170169
#define RETURNVOID do { OUT(); return; } while (0)
171170

172171
DECLARE_ALARM(fd_periodicstats);

http_server.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,6 @@ static inline int _skip_any(struct http_request *r)
375375
return 1;
376376
}
377377

378-
static inline int _skip_if(struct http_request *r, int (*predicate)(int))
379-
{
380-
if (_run_out(r) || !predicate(*r->cursor))
381-
return 0;
382-
++r->cursor;
383-
return 1;
384-
}
385-
386378
static inline int _skip_while(struct http_request *r, int (*predicate)(int))
387379
{
388380
while (!_run_out(r) && predicate(*r->cursor))
@@ -600,11 +592,6 @@ static inline int _parse_uint32(struct http_request *r, uint32_t *uint32p)
600592
return !_run_out(r) && isdigit(*r->cursor) && str_to_uint32(r->cursor, 10, uint32p, (const char **)&r->cursor);
601593
}
602594

603-
static inline int _parse_uint16(struct http_request *r, uint16_t *uint16p)
604-
{
605-
return !_run_out(r) && isdigit(*r->cursor) && str_to_uint16(r->cursor, 10, uint16p, (const char **)&r->cursor);
606-
}
607-
608595
static unsigned _parse_ranges(struct http_request *r, struct http_range *range, unsigned nrange)
609596
{
610597
unsigned i = 0;

httpd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ void httpd_server_poll(struct sched_ent *alarm)
236236
{
237237
if (alarm->poll.revents & (POLLIN | POLLOUT)) {
238238
struct sockaddr addr;
239-
unsigned int addr_len = sizeof addr;
239+
socklen_t addr_len = sizeof addr;
240240
int sock;
241241
if ((sock = accept(httpd_server_socket, &addr, &addr_len)) == -1) {
242242
if (errno && errno != EAGAIN)

keyring.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ struct keypair *keyring_find_sas_private(keyring_file *k, keyring_identity *iden
15471547

15481548
keypair *kp = keyring_identity_keytype(identity, KEYTYPE_CRYPTOSIGN);
15491549
if (kp==NULL)
1550-
RETURNNULL(WHYNULL("Identity lacks SAS"));
1550+
RETURN(WHYNULL("Identity lacks SAS"));
15511551

15521552
if (!kp->verified){
15531553
if (!rhizome_verify_bundle_privatekey(kp->private_key,kp->public_key)){
@@ -1991,7 +1991,7 @@ unsigned char *keyring_get_nm_bytes(const sid_t *known_sidp, const sid_t *unknow
19911991
keyring_iterator it;
19921992
keyring_iterator_start(keyring, &it);
19931993
if (!keyring_find_sid(&it, known_sidp))
1994-
RETURNNULL(WHYNULL("known key is not in fact known."));
1994+
RETURN(WHYNULL("known key is not in fact known."));
19951995

19961996
/* work out where to store it */
19971997
if (nm_slots_used<NM_CACHE_SLOTS) {

rhizome_cli.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ static int app_rhizome_add_file(const struct cli_parsed *parsed, struct cli_cont
117117
if (cli_arg(parsed, "author_sid", &authorSidHex, cli_optional_sid, "") == -1)
118118
return -1;
119119
cli_arg(parsed, "manifestpath", &manifestpath, NULL, "");
120-
cli_arg(parsed, "--bundle", &bundleIdHex, cli_bid, "") == 0 || cli_arg(parsed, "bundleid", &bundleIdHex, cli_optional_bid, "");
120+
if (cli_arg(parsed, "--bundle", &bundleIdHex, cli_bid, "") != 0)
121+
cli_arg(parsed, "bundleid", &bundleIdHex, cli_optional_bid, "");
121122
if (cli_arg(parsed, "bsk", &bsktext, cli_optional_bundle_secret_key, NULL) == -1)
122123
return -1;
123124

0 commit comments

Comments
 (0)