Skip to content

Commit

Permalink
GC variables that is set but never used. This breaks builds with
Browse files Browse the repository at this point in the history
latest clang.
  • Loading branch information
sobomax committed Feb 16, 2023
1 parent 2e14407 commit 4f5380a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
9 changes: 0 additions & 9 deletions modules/avpops/avpops_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ int ops_dbstore_avps (struct sip_msg* msg, struct fis_param *sp,
struct sip_uri uri;
struct usr_avp **avp_list;
struct usr_avp *avp;
unsigned short name_type;
int avp_name;
int_str i_s;
str uuid;
Expand All @@ -566,7 +565,6 @@ int ops_dbstore_avps (struct sip_msg* msg, struct fis_param *sp,
str *sn;

s0 = s1 = s2 = NULL;
name_type = 0;
if (!((sp->opd&AVPOPS_VAL_PVAR)||(sp->opd&AVPOPS_VAL_STR))) {
LM_CRIT("invalid flag combination (%d/%d)\n", sp->opd, sp->ops);
goto error;
Expand Down Expand Up @@ -657,10 +655,8 @@ int ops_dbstore_avps (struct sip_msg* msg, struct fis_param *sp,
}
if(xvalue.flags&PV_TYPE_INT)
{
name_type = 0;
avp_name = xvalue.ri;
} else {
name_type = AVP_NAME_STR;
avp_name = -1;
}
if(xvalue.flags&PV_VAL_STR)
Expand All @@ -686,18 +682,13 @@ int ops_dbstore_avps (struct sip_msg* msg, struct fis_param *sp,
goto error;
}
} else {
name_type = dbp->a.u.sval.pvp.pvn.u.isname.type;
avp_name = dbp->a.u.sval.pvp.pvn.u.isname.name.n;
}
} else {
LM_WARN("TODO: avp is not a dynamic name <%.*s> name is %d\n", dbp->sa.len, dbp->sa.s, avp_name);
avp_name = -1;
}

/* set the script flags */
if(dbp->a.type==AVPOPS_VAL_PVAR)
name_type |= dbp->a.u.sval.pvp.pvn.u.isname.type&0xff00;

/* set uuid/(username and domain) fields */

n =0 ;
Expand Down
3 changes: 1 addition & 2 deletions modules/b2b_sca/sca_records.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@ void memcpy_watchers(str_lst_t *dest, str_lst_t *src, unsigned int size)
str_lst_t *from = src;
str_lst_t *to = dest;
char *p;
unsigned int len, total_len=0;
unsigned int len;

p = (char *)to;
while (from) {
len = sizeof(str_lst_t) + from->watcher.len;
total_len += len;
if (len > size) {
LM_CRIT("buffer overflow\n");
return;
Expand Down
3 changes: 1 addition & 2 deletions modules/proto_ws/ws_handshake_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ static inline int ws_client_handshake(struct tcp_connection *con)

static int ws_server_handshake(struct tcp_connection *con)
{
int bytes, total_bytes = 0;
int bytes;
long size = 0;
int msg_len;
char *msg_buf;
Expand Down Expand Up @@ -432,7 +432,6 @@ static int ws_server_handshake(struct tcp_connection *con)
goto error;
}

total_bytes+=bytes;
/* eof check:
* is EOF if eof on fd and r. not complete yet,
* if r. is complete we might have a second unparsed
Expand Down
3 changes: 0 additions & 3 deletions net/tcp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,11 @@ int tcp_async_write(struct tcp_connection* con,int fd)
static int tsend_stream_async(struct tcp_connection *c,
int fd, char* buf, unsigned int len, int timeout)
{
int written;
int n;
struct pollfd pf;

pf.fd=fd;
pf.events=POLLOUT;
written=0;

again:
n=send(fd, buf, len,0);
Expand All @@ -419,7 +417,6 @@ static int tsend_stream_async(struct tcp_connection *c,
goto poll_loop;
}

written+=n;
if (n < len) {
/* partial write */
buf += n;
Expand Down

0 comments on commit 4f5380a

Please sign in to comment.