Eliminate initialized, but unused variables (reported by gcc 4.6).
/* replace the temporary pre-fork pkg array (with only 1 row) with
the final shm version (with max_process_no rows) */
old = _cnts_vals;
- _cnts_vals = shm_malloc(max_process_no * row_size);
+ _cnts_vals = shm_malloc(size);
if (_cnts_vals == 0)
return -1;
- memset(_cnts_vals, 0, max_process_no * row_size);
+ memset(_cnts_vals, 0, size);
cnts_max_rows = max_process_no;
/* copy prefork values into the newly shm array */
if (old) {
{
struct dns_rr* rr;
int n;
- int flags;
#ifdef DNS_WATCHDOG_SUPPORT
int servers_up;
servers_up = atomic_get(dns_servers_up);
#endif
- flags=0;
for(rr=e->rr_lst, n=0;rr && (n<*no);rr=rr->next, n++);/* skip *no records*/
for(;rr;rr=rr->next){
if (
int sr_event_exec(int type, void *data)
{
int ret;
+#ifdef EXTRA_DEBUG
str *p;
+#endif /* EXTRA_DEBUG */
switch(type) {
case SREV_NET_DATA_IN:
if(unlikely(_sr_events_list.net_data_in!=0))
{
- p = (str*)data;
#ifdef EXTRA_DEBUG
+ p = (str*)data;
LM_DBG("PRE-IN ++++++++++++++++++++++++++++++++\n"
"%.*s\n+++++\n", p->len, p->s);
#endif /* EXTRA_DEBUG */
case SREV_NET_DATA_OUT:
if(unlikely(_sr_events_list.net_data_out!=0))
{
- p = (str*)data;
#ifdef EXTRA_DEBUG
+ p = (str*)data;
LM_DBG("PRE-OUT ++++++++++++++++++++\n"
"%.*s\n+++++++++++++++++++\n", p->len, p->s);
#endif /* EXTRA_DEBUG */
#endif
{
struct qm_frag* f;
- struct qm_frag* prev;
- struct qm_frag* next;
unsigned long size;
+#ifdef QM_JOIN_FREE
+ struct qm_frag* next;
+ struct qm_frag* prev;
+#endif /* QM_JOIN_FREE*/
#ifdef DBG_QM_MALLOC
MDBG("qm_free(%p, %p), called from %s: %s(%d)\n", qm, p, file, func, line);
LOG(L_WARN, "WARNING:qm_free: free(0) called\n");
return;
}
- prev=next=0;
+#ifdef QM_JOIN_FREE
+ next=prev=0;
+#endif /* QM_JOIN_FREE*/
f=(struct qm_frag*) ((char*)p-sizeof(struct qm_frag));
#ifdef DBG_QM_MALLOC
qm_debug_frag(qm, f);
str* port_str; /* port no displayed in via */
struct socket_info* send_sock;
int comp_len, comp_name_len;
+#ifdef USE_COMP
char* comp_name;
+#endif /* USE_COMP */
send_sock=send_info->send_sock;
/* use pre-set address in via or the outbound socket one */
port_str=&(send_sock->port_no_str);
comp_len=comp_name_len=0;
- comp_name=0;
#ifdef USE_COMP
+ comp_name=0;
switch(send_info->comp){
case COMP_NONE:
break;
char *tmp;
char* rest;
- char* first_via;
- char* second_via;
struct msg_start *fl;
int offset;
hdr_flags_t flags;
}
msg->unparsed=tmp;
/*find first Via: */
- first_via=0;
- second_via=0;
if (parse_headers(msg, flags, 0)==-1) goto error;
#ifdef EXTRA_DEBUG
param_t *params;
str s = *src;
str state;
- char *c, *end;
+ char *c;
/* initialization */
ss->expires_set = 0;
ss->expires = 0;
trim_leading(&s);
- end = s.s + s.len;
state = s;
*/
int pv_printf(struct sip_msg* msg, pv_elem_p list, char *buf, int *len)
{
- int n, h;
+ int n;
pv_value_t tok;
pv_elem_p it;
char *cur;
*buf = '\0';
cur = buf;
- h = 0;
n = 0;
for (it=list; it; it=it->next)
{
struct rvalue* rv;
struct rvalue* trv; /* used only for DBG() */
enum rval_expr_op op;
- int flags;
struct rval_expr tmp_rve;
enum rval_type type, l_type;
struct rval_expr* bad_rve;
enum rval_type bad_type, exp_type;
ret=0;
- flags=0;
rv=0;
if (scr_opt_lev<1)
return 0;
struct action** tail;
struct switch_jmp_table* jmp;
struct switch_cond_table* sct;
- int labels_no;
struct action** def_jmp_bm;
int* cond;
struct action*** jmp_bm;
cond=0;
jmp_bm=0;
def_jmp_bm=0;
- labels_no=0;
default_found=0;
/* check if string switch (first case is string or RE) */
for (c=(struct case_stms*)t->val[1].u.data; c && c->is_default; c=c->next);
goto error;
}
}
- labels_no=n;
cond=pkg_malloc(sizeof(cond[0])*n);
jmp_bm=pkg_malloc(sizeof(jmp_bm[0])*n);
if (cond==0 || jmp_bm==0){
struct action* action_lst;
struct action** tail;
struct match_cond_table* mct;
- int labels_no;
struct action** def_jmp_bm;
struct match_str* match;
struct action*** jmp_bm;
match=0;
jmp_bm=0;
def_jmp_bm=0;
- labels_no=0;
default_found=0;
rv=0;
s.s=0;
goto error;
}
}
- labels_no=n;
+ /* n is the number of labels here */
match=pkg_malloc(sizeof(match[0])*n);
jmp_bm=pkg_malloc(sizeof(jmp_bm[0])*n);
if (match==0 || jmp_bm==0){
int fd;
long response[2];
int n;
- int do_close_fd;
ticks_t con_lifetime;
#ifdef USE_TLS
const char* rest_buf;
snd_flags_t t_send_flags;
#endif /* USE_TLS */
- do_close_fd=1; /* close the fd on exit */
port=su_getport(&dst->to);
con_lifetime=cfg_get(tcp, tcp_cfg, con_lifetime);
if (likely(port)){
long size;
struct tcp_req* req;
struct dest_info dst;
- int s;
char c;
int ret;
bytes=-1;
total_bytes=0;
resp=CONN_RELEASE;
- s=con->fd;
req=&con->req;
again:
unsigned short ret;
int i;
unsigned char *limit;
- unsigned char *init;
unsigned char* str;
/*init*/
str=(unsigned char*)s;
ret=i=0;
limit=str+len;
- init=str;
for(;str<limit ;str++){
if ( (*str <= '9' ) && (*str >= '0') ){
return ret;
error_digits:
- /*DBG("str2s: ERROR: too many letters in [%.*s]\n", (int)len, init); */
if (err) *err=1;
return 0;
error_char:
- /*DBG("str2s: ERROR: unexpected char %c in %.*s\n", *str, (int)len, init);
- * */
if (err) *err=1;
return 0;
}