Skip to content

Commit

Permalink
Clean up compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lakeman committed Oct 19, 2015
1 parent 3049252 commit 35e368f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SQLITE3_INC := $(LOCAL_PATH)/sqlite-amalgamation-3070900

SERVALD_LOCAL_CFLAGS = \
-g \
-Wall -Wno-unused-value -Werror \
-Wall -Wno-unused-variable -Wno-unused-value -Werror \
-DSERVALD_VERSION="\"Android\"" -DSERVALD_COPYRIGHT="\"Android\"" \
-DINSTANCE_PATH="\"/data/data/org.servalproject/var/serval-node\"" \
-DSHELL -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" \
Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ CFLAGS= -Isqlite-amalgamation-3070900 @CPPFLAGS@ @CFLAGS@ -Inacl/include
CFLAGS+=-DSYSCONFDIR="\"$(sysconfdir)\"" -DLOCALSTATEDIR="\"$(localstatedir)\""
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
CFLAGS+=-fPIC
CFLAGS+=-Wall -Wno-unused-value -Werror
CFLAGS+=-Wall -Werror
# Solaris magic
CFLAGS+=-DSHA2_USE_INTTYPES_H -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1
# OSX magic to compensate for the Solaris magic
Expand Down
1 change: 0 additions & 1 deletion fdqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ unsigned fd_depth();

#define OUT() fd_func_exit(__HERE__, &_this_call)
#define RETURN(X) do { OUT(); return (X); } while (0)
#define RETURNNULL(X) do { X; OUT(); return (NULL); } while (0)
#define RETURNVOID do { OUT(); return; } while (0)

DECLARE_ALARM(fd_periodicstats);
Expand Down
13 changes: 0 additions & 13 deletions http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,6 @@ static inline int _skip_any(struct http_request *r)
return 1;
}

static inline int _skip_if(struct http_request *r, int (*predicate)(int))
{
if (_run_out(r) || !predicate(*r->cursor))
return 0;
++r->cursor;
return 1;
}

static inline int _skip_while(struct http_request *r, int (*predicate)(int))
{
while (!_run_out(r) && predicate(*r->cursor))
Expand Down Expand Up @@ -600,11 +592,6 @@ static inline int _parse_uint32(struct http_request *r, uint32_t *uint32p)
return !_run_out(r) && isdigit(*r->cursor) && str_to_uint32(r->cursor, 10, uint32p, (const char **)&r->cursor);
}

static inline int _parse_uint16(struct http_request *r, uint16_t *uint16p)
{
return !_run_out(r) && isdigit(*r->cursor) && str_to_uint16(r->cursor, 10, uint16p, (const char **)&r->cursor);
}

static unsigned _parse_ranges(struct http_request *r, struct http_range *range, unsigned nrange)
{
unsigned i = 0;
Expand Down
2 changes: 1 addition & 1 deletion httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void httpd_server_poll(struct sched_ent *alarm)
{
if (alarm->poll.revents & (POLLIN | POLLOUT)) {
struct sockaddr addr;
unsigned int addr_len = sizeof addr;
socklen_t addr_len = sizeof addr;
int sock;
if ((sock = accept(httpd_server_socket, &addr, &addr_len)) == -1) {
if (errno && errno != EAGAIN)
Expand Down
4 changes: 2 additions & 2 deletions keyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ struct keypair *keyring_find_sas_private(keyring_file *k, keyring_identity *iden

keypair *kp = keyring_identity_keytype(identity, KEYTYPE_CRYPTOSIGN);
if (kp==NULL)
RETURNNULL(WHYNULL("Identity lacks SAS"));
RETURN(WHYNULL("Identity lacks SAS"));

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

/* work out where to store it */
if (nm_slots_used<NM_CACHE_SLOTS) {
Expand Down
3 changes: 2 additions & 1 deletion rhizome_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ static int app_rhizome_add_file(const struct cli_parsed *parsed, struct cli_cont
if (cli_arg(parsed, "author_sid", &authorSidHex, cli_optional_sid, "") == -1)
return -1;
cli_arg(parsed, "manifestpath", &manifestpath, NULL, "");
cli_arg(parsed, "--bundle", &bundleIdHex, cli_bid, "") == 0 || cli_arg(parsed, "bundleid", &bundleIdHex, cli_optional_bid, "");
if (cli_arg(parsed, "--bundle", &bundleIdHex, cli_bid, "") != 0)
cli_arg(parsed, "bundleid", &bundleIdHex, cli_optional_bid, "");
if (cli_arg(parsed, "bsk", &bsktext, cli_optional_bundle_secret_key, NULL) == -1)
return -1;

Expand Down

0 comments on commit 35e368f

Please sign in to comment.