Skip to content

Commit

Permalink
Merge pull request #657 from linuxmaniac/vseva/fix_warnings
Browse files Browse the repository at this point in the history
fix compilation warnings
  • Loading branch information
linuxmaniac committed Jun 7, 2016
2 parents 1d53ef3 + f0ac15d commit 5fdd5f7
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion modules/app_java/java_msgobj.c
Expand Up @@ -230,7 +230,7 @@ jobject *fill_sipmsg_object(JNIEnv *env, struct sip_msg *msg)
LM_ERR("%s: Can't find symbol org.siprouter.SipMsg.add_to_branch_s\n", APP_NAME);
return NULL;
}
jStrParam = (*env)->NewStringUTF(env, (msg->add_to_branch_len <= 0 || msg->add_to_branch_s == NULL) ? "" : strdup(msg->add_to_branch_s));
jStrParam = (*env)->NewStringUTF(env, (msg->add_to_branch_len <= 0) ? "" : strdup(msg->add_to_branch_s));
(*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam);
if ((*env)->ExceptionCheck(env))
{
Expand Down
2 changes: 1 addition & 1 deletion modules/auth_radius/authorize.c
Expand Up @@ -74,7 +74,7 @@ static inline int authorize(struct sip_msg* _msg, pv_elem_t* _realm,
pv_spec_t * _uri_user, hdr_types_t _hftype)
{
int res;
auth_result_t ret;
auth_cfg_result_t ret;
struct hdr_field* h;
auth_body_t* cred;
str *uri_user;
Expand Down
2 changes: 1 addition & 1 deletion modules/cdp/diameter_api.h
Expand Up @@ -76,7 +76,7 @@ typedef AAAReturnCode (*AAAFreeAVPList_f)(AAA_AVP_LIST *avpList);



AAAResultCode AAASetMessageResultCode(AAAMessage *message,AAAResultCode resultCode);
AAAReturnCode AAASetMessageResultCode(AAAMessage *message,AAAResultCode resultCode);

void AAAPrintMessage(AAAMessage *msg);

Expand Down
2 changes: 1 addition & 1 deletion modules/cdp/diameter_msg.c
Expand Up @@ -434,7 +434,7 @@ AAAReturnCode AAAFreeMessage(AAAMessage **msg)
* @param resultCode - code to set as result
* \note This function is taken from DISC http://developer.berlios.de/projects/disc/
*/
AAAResultCode AAASetMessageResultCode(
AAAReturnCode AAASetMessageResultCode(
AAAMessage *message,
AAAResultCode resultCode)
{
Expand Down
2 changes: 1 addition & 1 deletion modules/cdp/peerstatemachine.c
Expand Up @@ -519,7 +519,7 @@ int sm_process(peer *p,peer_event_t event,AAAMessage *msg,int peer_locked,int so
* @param p - peer to send to
* @returns the new state for the peer
*/
peer_state_t I_Snd_Conn_Req(peer *p)
peer_event_t I_Snd_Conn_Req(peer *p)
{
LM_INFO("I_Snd_Conn_Req(): Peer %.*s \n",
p->fqdn.len,p->fqdn.s);
Expand Down
2 changes: 1 addition & 1 deletion modules/cdp/peerstatemachine.h
Expand Up @@ -50,7 +50,7 @@

int sm_process(peer *p,peer_event_t event,AAAMessage *msg,int peer_locked,int sock);

peer_state_t I_Snd_Conn_Req(peer *p);
peer_event_t I_Snd_Conn_Req(peer *p);
void Cleanup(peer *p,int sock);
void Error(peer *p, int sock);
void I_Snd_CER(peer *p);
Expand Down
6 changes: 3 additions & 3 deletions modules/cdp/session.c
Expand Up @@ -73,7 +73,7 @@ unsigned int *session_id2; /**< counter for second part of the session id */
inline void AAASessionsLock(unsigned int hash)
{
if(destroy_modules_phase()) return;
if ( hash >=0 && hash < sessions_hash_size ){
if ( hash < sessions_hash_size ){
lock_get(sessions[hash].lock);
}
else {
Expand All @@ -88,7 +88,7 @@ inline void AAASessionsUnlock(unsigned int hash)
{
if(destroy_modules_phase()) return;

if ( hash >=0 && hash < sessions_hash_size ){
if ( hash < sessions_hash_size ){
lock_release(sessions[hash].lock);
}
else {
Expand Down Expand Up @@ -330,7 +330,7 @@ void del_session(cdp_session_t *x)
if (!x) return;

hash = x->hash;
if (hash < 0 || hash >= sessions_hash_size) {
if (hash >= sessions_hash_size) {
LM_ERR("del_session: x->hash :%d out of range of sessions_hash_size: %d !\n",hash, sessions_hash_size);
return;
}
Expand Down
3 changes: 2 additions & 1 deletion modules/db_berkeley/km_db_berkeley.c
Expand Up @@ -362,9 +362,10 @@ int km_bdb_query(db1_con_t* _con, db_key_t* _k, db_op_t* _op, db_val_t* _v,
table_p _tp = NULL;
char kbuf[MAX_ROW_SIZE];
char dbuf[MAX_ROW_SIZE];
u_int32_t i, len, ret;
u_int32_t i, len;
int klen=MAX_ROW_SIZE;
int *lkey=NULL, *lres=NULL;
int ret;
DBT key, data;
DB *db;
DBC *dbcp;
Expand Down
2 changes: 1 addition & 1 deletion modules/ims_auth/cxdx_avp.c
Expand Up @@ -658,7 +658,7 @@ int cxdx_get_auth_data_item_answer(AAAMessage *msg, AAA_AVP **auth_data,

avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Item_Number,
IMS_vendor_id_3GPP,0);
if (!avp||!avp->data.len==4) *item_number=0;
if (!avp||avp->data.len!=4) *item_number=0;
else *item_number = get_4bytes(avp->data.s);

avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Authentication_Scheme,
Expand Down
2 changes: 1 addition & 1 deletion modules/ims_auth/cxdx_mar.c
Expand Up @@ -373,7 +373,7 @@ void async_cdp_callback(int is_timeout, void *param, AAAMessage *maa, long elaps
&scscf_name_str, 0, result_hex);
pkg_free(etsi_nonce.s);

if (!tmp->response_auth.len == 32
if (tmp->response_auth.len != 32
|| strncasecmp(tmp->response_auth.s, result_hex, 32)) {
LM_ERR("The HSS' Response-Auth is different from what we compute locally!\n"
" BUT! If you sent an MAR with auth scheme unknown (HSS-Selected Authentication), this is normal.\n"
Expand Down
2 changes: 1 addition & 1 deletion modules/ims_dialog/dlg_handlers.c
Expand Up @@ -1342,7 +1342,7 @@ void dlg_onreply(struct cell* t, int type, struct tmcb_params *param) {

if (!dlg_out) {
if (rpl->first_line.u.reply.statuscode < 299) { /*we don't care about failure responses to dialog - not necessary to create dialog out...*/
if (rpl->via1->branch && (&rpl->via1->branch->value) && (rpl->via1->branch->value.len > 0)) {
if (rpl->via1->branch && (rpl->via1->branch->value.len > 0)) {
branch = rpl->via1->branch->value;
}

Expand Down
2 changes: 1 addition & 1 deletion modules/misc_radius/functions.c
Expand Up @@ -44,7 +44,7 @@ static inline int extract_avp(VALUE_PAIR* vp, unsigned short *flags,
char *end;

/* empty? */
if (vp->lvalue==0 || vp->strvalue==0)
if (vp->lvalue==0)
goto error;

p = vp->strvalue;
Expand Down
2 changes: 1 addition & 1 deletion modules/peering/verify.c
Expand Up @@ -55,7 +55,7 @@ static inline int extract_avp(VALUE_PAIR* vp, unsigned short *flags,
char *end;

/* empty? */
if (vp->lvalue==0 || vp->strvalue==0)
if (vp->lvalue==0)
goto error;

p = vp->strvalue;
Expand Down
2 changes: 1 addition & 1 deletion modules/pua_xmpp/xmpp2simple.c
Expand Up @@ -369,7 +369,7 @@ int build_publish(xmlNodePtr pres_node, int expires)
return -1;
}
strcpy(resource, slash+1);
slash= '\0';
slash= NULL;
}
pres_uri= euri_xmpp_sip(uri);
xmlFree(uri);
Expand Down
8 changes: 6 additions & 2 deletions modules/tls/tls_config.c
Expand Up @@ -400,12 +400,16 @@ tls_domains_cfg_t* tls_load_config(str* filename)
pkg_free(file_path);
file_path = NULL;
while (read(in_fd, &ch, 1)) {
write(out_fd, &ch, 1);
if (write(out_fd, &ch, 1)<0) {
LOG(L_ERR, "write error: %s\n", strerror(errno));
}
}
close(in_fd);
in_fd = 0;
ch = '\n';
write(out_fd, &ch, 1);
if (write(out_fd, &ch, 1)<0) {
LOG(L_ERR, "write error: %s\n", strerror(errno));
}
}
}
closedir(dir);
Expand Down

0 comments on commit 5fdd5f7

Please sign in to comment.