Skip to content

Commit

Permalink
Merge pull request #1675 from wdoekes/fix-compiler-warnings-2.4
Browse files Browse the repository at this point in the history
Work around a few poor compiler warnings (2.4 branch)
  • Loading branch information
liviuchircu committed Apr 24, 2019
2 parents f1c5a7e + 70ca163 commit 37e732d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 32 deletions.
2 changes: 1 addition & 1 deletion modules/rabbitmq/rmq_servers.c
Expand Up @@ -292,7 +292,7 @@ int rmq_server_add(modparam_t type, void * val)
char uri_pending = 0;
unsigned flags = 0;
char *uri;
int retries;
int retries = 0;
int max_frames = RMQ_DEFAULT_FRAMES;
int heartbeat = RMQ_DEFAULT_HEARTBEAT;
str exchange = {0, 0};
Expand Down
44 changes: 20 additions & 24 deletions modules/sip_i/isup.c
Expand Up @@ -677,14 +677,13 @@ int called_party_num_writef(int param_idx, int subfield_idx, unsigned char *para
isup_put_number(param_val + 2, num, &num_len, &oddeven);
/* also set oddeven, just in case it wasn't already */
param_val[0] = SET_BITS(param_val[0], 0x80, 7, oddeven);
} else
*len = num_len + 2;
} else {
param_val[idx[subfield_idx]] = SET_BITS(param_val[idx[subfield_idx]],
mask[subfield_idx], shift[subfield_idx], new_val);

if (subfield_idx == 4)
*len = num_len + 2;
else if (*len == 0)
*len = 2;
if (*len == 0)
*len = 2;
}

return 0;
}
Expand Down Expand Up @@ -735,14 +734,13 @@ int calling_party_num_writef(int param_idx, int subfield_idx, unsigned char *par
isup_put_number(param_val + 2, num, &num_len, &oddeven);
/* also set oddeven, just in case it wasn't already */
param_val[0] = SET_BITS(param_val[0], 0x80, 7, oddeven);
} else
*len = num_len + 2;
} else {
param_val[idx[subfield_idx]] = SET_BITS(param_val[idx[subfield_idx]],
mask[subfield_idx], shift[subfield_idx], new_val);

if (subfield_idx == 6)
*len = num_len + 2;
else if (*len == 0)
*len = 2;
if (*len == 0)
*len = 2;
}

return 0;
}
Expand Down Expand Up @@ -870,14 +868,13 @@ int connected_num_writef(int param_idx, int subfield_idx, unsigned char *param_v
isup_put_number(param_val + 2, num, &num_len, &oddeven);
/* also set oddeven, just in case it wasn't already */
param_val[0] = SET_BITS(param_val[0], 0x80, 7, oddeven);
} else
*len = num_len + 2;
} else {
param_val[idx[subfield_idx]] = SET_BITS(param_val[idx[subfield_idx]],
mask[subfield_idx], shift[subfield_idx], new_val);

if (subfield_idx == 5)
*len = num_len + 2;
else if (*len == 0)
*len = 2;
if (*len == 0)
*len = 2;
}

return 0;
}
Expand Down Expand Up @@ -928,14 +925,13 @@ int original_called_num_writef(int param_idx, int subfield_idx,
isup_put_number(param_val + 2, num, &num_len, &oddeven);
/* also set oddeven, just in case it wasn't already */
param_val[0] = SET_BITS(param_val[0], 0x80, 7, oddeven);
} else
*len = num_len + 2;
} else {
param_val[idx[subfield_idx]] = SET_BITS(param_val[idx[subfield_idx]],
mask[subfield_idx], shift[subfield_idx], new_val);

if (subfield_idx == 4)
*len = num_len + 2;
else if (*len == 0)
*len = 2;
if (*len == 0)
*len = 2;
}

return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions modules/siptrace/siptrace.c
Expand Up @@ -473,7 +473,7 @@ static int parse_siptrace_id(str *suri)
str name={NULL, 0};
str trace_uri;
str param1={NULL, 0};
tlist_elem_p elem;
tlist_elem_p elem;
enum types uri_type;


Expand All @@ -494,7 +494,8 @@ static int parse_siptrace_id(str *suri)
LM_ERR("bad format for uri {%.*s}\n", suri->len, suri->s);
return -1;
} else {
(suri->s++, suri->len--); \
suri->s++;
suri->len--;
}

PARSE_NAME(suri, name); /*parse '[<name>]'*/
Expand Down Expand Up @@ -2220,7 +2221,6 @@ static void trace_tm_out(struct cell* t, int type, struct tmcb_params *ps)
}
}


/**
* MI command format:
* name: sip_trace
Expand Down
8 changes: 4 additions & 4 deletions modules/usrloc/dlist.c
Expand Up @@ -290,7 +290,7 @@ static int get_domain_db_ucontacts(udomain_t *d, void *buf, int *len,
/* write path */
memcpy(buf, &p1_len, sizeof p1_len);
buf += sizeof p1_len;
memcpy(buf, p1, p1_len);
memcpy(buf, p1, (unsigned)p1_len);
if (p1_len > 0)
next_hop_host = buf + next_hop_offset;
buf += p1_len;
Expand Down Expand Up @@ -388,7 +388,7 @@ cdb_pack_ping_data(const str *aor, const cdb_pair_t *contact,
struct socket_info *sock = NULL;
struct proxy_l next_hop;
str ct_uri, received = STR_NULL, path, next_hop_uri;
char *next_hop_host;
char *next_hop_host = NULL;
int needed;
char *cp = *cpos;
int cols_needed = COL_CONTACT | COL_RECEIVED | COL_PATH | COL_CFLAGS;
Expand Down Expand Up @@ -650,7 +650,7 @@ get_domain_mem_ucontacts(udomain_t *d,void *buf, int *len, unsigned int flags,
int needed;
int count;
int i = 0;
char *next_hop_host;
char *next_hop_host = NULL;
int cur_node_idx = 0, nr_nodes = 0;

cp = buf;
Expand Down Expand Up @@ -738,7 +738,7 @@ get_domain_mem_ucontacts(udomain_t *d,void *buf, int *len, unsigned int flags,
memcpy(cp, &c->path.len, sizeof(c->path.len));
cp = (char*)cp + sizeof(c->path.len);
memcpy(cp, c->path.s, c->path.len);
if (c->path.len)
if (c->path.len != 0)
next_hop_host = cp + (c->next_hop.name.s - c->path.s);
cp = (char*)cp + c->path.len;
memcpy(cp, &c->sock, sizeof(c->sock));
Expand Down

0 comments on commit 37e732d

Please sign in to comment.