Commit 44335bcf authored by rswindell's avatar rswindell
Browse files

Address warnings reported by gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516

parent 55a2e1e4
......@@ -679,7 +679,7 @@ bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user, client_t* client)
}
break;
case AR_COLS:
if((equal && cols != n) || (!equal && cols < (long)n))
if((equal && cols != (long)n) || (!equal && cols < (long)n))
result=_not;
else
result=!_not;
......@@ -689,7 +689,7 @@ bool sbbs_t::ar_exp(const uchar **ptrptr, user_t* user, client_t* client)
}
break;
case AR_ROWS:
if((equal && rows != n) || (!equal && rows < (long)n))
if((equal && rows != (long)n) || (!equal && rows < (long)n))
result=_not;
else
result=!_not;
......
......@@ -279,7 +279,7 @@ int main(int argc, char **argv)
off_t sid_length = filelength(fileno(smb.sid_fp));
if(sid_length != smb.status.total_msgs * sizeof(idxrec_t)) {
printf("!Size of index file (%ld) is incorrect (expected: %ld)\n", sid_length, smb.status.total_msgs * sizeof(idxrec_t));
printf("!Size of index file (%ld) is incorrect (expected: %ld)\n", sid_length, (long)(smb.status.total_msgs * sizeof(idxrec_t)));
smb_close(&smb);
errors++;
continue;
......
......@@ -199,7 +199,7 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
safe_snprintf(smb->last_error,sizeof(smb->last_error)
,"%s writing body (%ld bytes)"
,__FUNCTION__
,bodylen);
,(long)bodylen);
retval=SMB_ERR_WRITE;
break;
}
......@@ -222,7 +222,7 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
safe_snprintf(smb->last_error,sizeof(smb->last_error)
,"%s writing tail (%ld bytes)"
,__FUNCTION__
,taillen-sizeof(xlat));
,(long)(taillen-sizeof(xlat)));
retval=SMB_ERR_WRITE;
break;
}
......
......@@ -988,8 +988,8 @@ int SMBCALL smb_getmsghdr(smb_t* smb, smbmsg_t* msg)
&& (msg->dfield = malloc(sizeof(*msg->dfield)*msg->hdr.total_dfields)) == NULL) {
smb_freemsgmem(msg);
safe_snprintf(smb->last_error,sizeof(smb->last_error)
,"%s malloc failure of %lu bytes for %u data fields", __FUNCTION__
,sizeof(*msg->dfield ) * msg->hdr.total_dfields, msg->hdr.total_dfields);
,"%s malloc failure of %ld bytes for %u data fields", __FUNCTION__
,(long)(sizeof(*msg->dfield) * msg->hdr.total_dfields), msg->hdr.total_dfields);
return(SMB_ERR_MEM);
}
i = fread(msg->dfield, sizeof(*msg->dfield), msg->hdr.total_dfields, smb->shd_fp);
......@@ -1119,8 +1119,8 @@ int SMBCALL smb_copymsgmem(smb_t* smb, smbmsg_t* msg, smbmsg_t* srcmsg)
if((msg->dfield=(dfield_t *)malloc(msg->hdr.total_dfields*sizeof(dfield_t)))==NULL) {
if(smb!=NULL)
safe_snprintf(smb->last_error,sizeof(smb->last_error)
,"%s malloc failure of %lu bytes for %d data fields", __FUNCTION__
,msg->hdr.total_dfields*sizeof(dfield_t), msg->hdr.total_dfields);
,"%s malloc failure of %ld bytes for %d data fields", __FUNCTION__
,(long)(msg->hdr.total_dfields*sizeof(dfield_t)), msg->hdr.total_dfields);
return(SMB_ERR_MEM);
}
memcpy(msg->dfield,srcmsg->dfield,msg->hdr.total_dfields*sizeof(dfield_t));
......@@ -1131,8 +1131,8 @@ int SMBCALL smb_copymsgmem(smb_t* smb, smbmsg_t* msg, smbmsg_t* srcmsg)
if((msg->hfield=(hfield_t *)malloc(msg->total_hfields*sizeof(hfield_t)))==NULL) {
if(smb!=NULL)
safe_snprintf(smb->last_error,sizeof(smb->last_error)
,"%s malloc failure of %lu bytes for %d header fields", __FUNCTION__
,msg->total_hfields*sizeof(hfield_t), msg->total_hfields);
,"%s malloc failure of %ld bytes for %d header fields", __FUNCTION__
,(long)(msg->total_hfields*sizeof(hfield_t)), msg->total_hfields);
return(SMB_ERR_MEM);
}
memcpy(msg->hfield,srcmsg->hfield,msg->total_hfields*sizeof(hfield_t));
......@@ -1141,8 +1141,8 @@ int SMBCALL smb_copymsgmem(smb_t* smb, smbmsg_t* msg, smbmsg_t* srcmsg)
if((msg->hfield_dat=(void**)malloc(msg->total_hfields*sizeof(void*)))==NULL) {
if(smb!=NULL)
safe_snprintf(smb->last_error,sizeof(smb->last_error)
,"%s malloc failure of %lu bytes for %d header fields", __FUNCTION__
,msg->total_hfields*sizeof(void*), msg->total_hfields);
,"%s malloc failure of %ld bytes for %d header fields", __FUNCTION__
,(long)(msg->total_hfields*sizeof(void*)), msg->total_hfields);
return(SMB_ERR_MEM);
}
......@@ -1505,8 +1505,8 @@ int SMBCALL smb_addcrc(smb_t* smb, uint32_t crc)
if(wr!=sizeof(crc)) {
safe_snprintf(smb->last_error,sizeof(smb->last_error)
,"%s %d '%s' writing %lu bytes", __FUNCTION__
,get_errno(),STRERROR(get_errno()),sizeof(crc));
,"%s %d '%s' writing %ld bytes", __FUNCTION__
,get_errno(),STRERROR(get_errno()),(long)sizeof(crc));
return(SMB_ERR_WRITE);
}
......@@ -1553,7 +1553,7 @@ int SMBCALL smb_addmsghdr(smb_t* smb, smbmsg_t* msg, int storage)
if(idxlen != (smb->status.total_msgs * sizeof(idxrec_t))) {
safe_snprintf(smb->last_error, sizeof(smb->last_error)
,"%s index file length (%ld) unexpected (%ld)", __FUNCTION__
,idxlen, smb->status.total_msgs * sizeof(idxrec_t));
,idxlen, (long)(smb->status.total_msgs * sizeof(idxrec_t)));
smb_unlocksmbhdr(smb);
return SMB_ERR_FILE_LEN;
}
......@@ -1764,8 +1764,8 @@ int SMBCALL smb_putmsgidx(smb_t* smb, smbmsg_t* msg)
length = filelength(fileno(smb->sid_fp));
if(length < (long)(msg->offset*sizeof(idxrec_t))) {
safe_snprintf(smb->last_error,sizeof(smb->last_error)
,"%s invalid index offset: %ld, byte offset: %lu, length: %lu", __FUNCTION__
,(long)msg->offset, msg->offset*sizeof(idxrec_t), length);
,"%s invalid index offset: %ld, byte offset: %ld, length: %lu", __FUNCTION__
,(long)msg->offset, (long)(msg->offset*sizeof(idxrec_t)), length);
return(SMB_ERR_HDR_OFFSET);
}
if(fseek(smb->sid_fp,msg->offset*sizeof(idxrec_t),SEEK_SET)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment