Commit 2a8ca777 authored by deuce's avatar deuce
Browse files

Fix sign related warnings.

parent 4e7d587a
......@@ -314,7 +314,7 @@ static uint8_t lzh_d_len[256] = {
};
static int lzh_getbit(lzh_t* lzh, uint8_t *inbuf, long *incnt, long inlen) /* get one bit */
static int lzh_getbit(lzh_t* lzh, uint8_t *inbuf, int32_t *incnt, long inlen) /* get one bit */
{
short int i;
......@@ -332,7 +332,7 @@ static int lzh_getbit(lzh_t* lzh, uint8_t *inbuf, long *incnt, long inlen) /*
return (i < 0);
}
static short int lzh_getbyte(lzh_t* lzh, uint8_t *inbuf, long *incnt, long inlen) /* get a byte */
static short int lzh_getbyte(lzh_t* lzh, uint8_t *inbuf, int32_t *incnt, long inlen) /* get a byte */
{
unsigned short i;
......@@ -352,7 +352,7 @@ static short int lzh_getbyte(lzh_t* lzh, uint8_t *inbuf, long *incnt, long inlen
/* output c bits */
static void lzh_putcode(lzh_t* lzh, short int l, unsigned short c, uint8_t *outbuf, long *outlen)
static void lzh_putcode(lzh_t* lzh, short int l, unsigned short c, uint8_t *outbuf, int32_t *outlen)
{
lzh->putbuf |= c >> lzh->putlen;
if ((lzh->putlen += l) >= 8) {
......@@ -471,7 +471,7 @@ static void lzh_update(lzh_t* lzh, short int c)
} while ((c = lzh->prnt[c]) != 0); /* do it until reaching the root */
}
static void lzh_encode_char(lzh_t* lzh, unsigned short c, uint8_t *outbuf, long *outlen)
static void lzh_encode_char(lzh_t* lzh, unsigned short c, uint8_t *outbuf, int32_t *outlen)
{
unsigned short i;
short int j, k;
......@@ -498,7 +498,7 @@ static void lzh_encode_char(lzh_t* lzh, unsigned short c, uint8_t *outbuf, long
lzh_update(lzh,c);
}
static void lzh_encode_position(lzh_t* lzh, unsigned short c, uint8_t *outbuf, long *outlen)
static void lzh_encode_position(lzh_t* lzh, unsigned short c, uint8_t *outbuf, int32_t *outlen)
{
unsigned short i;
......@@ -510,14 +510,14 @@ static void lzh_encode_position(lzh_t* lzh, unsigned short c, uint8_t *outbuf, l
lzh_putcode(lzh, 6, (unsigned short)((c & 0x3f) << 10), outbuf, outlen);
}
static void lzh_encode_end(lzh_t* lzh, uint8_t *outbuf, long *outlen)
static void lzh_encode_end(lzh_t* lzh, uint8_t *outbuf, int32_t *outlen)
{
if (lzh->putlen) {
outbuf[(*outlen)++]=(lzh->putbuf >> 8);
}
}
static short int lzh_decode_char(lzh_t* lzh, uint8_t *inbuf, long *incnt, long inlen)
static short int lzh_decode_char(lzh_t* lzh, uint8_t *inbuf, int32_t *incnt, long inlen)
{
unsigned short c;
......@@ -537,7 +537,7 @@ static short int lzh_decode_char(lzh_t* lzh, uint8_t *inbuf, long *incnt, long i
return c;
}
static short int lzh_decode_position(lzh_t* lzh, uint8_t *inbuf, long *incnt, long inlen)
static short int lzh_decode_position(lzh_t* lzh, uint8_t *inbuf, int32_t *incnt, long inlen)
{
unsigned short i, j, c;
......
......@@ -210,7 +210,7 @@ void MD5CALL MD5_digest(MD5 *md5, const void *input, size_t inputLen)
memcpy(&md5->buffer[index], input, partLen);
MD5Transform(md5->state, md5->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
MD5Transform(md5->state, (char *) input + i);
MD5Transform(md5->state, (BYTE *) input + i);
index = 0;
}
else
......
......@@ -99,10 +99,10 @@ int SMBCALL smb_addmsg(smb_t* smb, smbmsg_t* msg, int storage, long dupechk_hash
}
}
if(tail!=NULL && (taillen=strlen(tail))>0)
if(tail!=NULL && (taillen=strlen((const char *)tail))>0)
taillen+=sizeof(xlat); /* xlat string terminator */
if(body!=NULL && (bodylen=strlen(body))>0) {
if(body!=NULL && (bodylen=strlen((const char *)body))>0) {
/* Remove white-space from end of message text */
chklen=bodylen;
......
......@@ -37,6 +37,7 @@
#include <time.h> /* time() */
#include <string.h> /* strdup() */
#include <ctype.h> /* isspace()*/
#include "smblib.h"
#include "md5.h"
#include "crc16.h"
......@@ -158,7 +159,7 @@ int SMBCALL smb_addhashes(smb_t* smb, hash_t** hashes, BOOL skip_marked)
static char* strip_chars(uchar* dst, const uchar* src, uchar* set)
{
while(*src) {
if(strchr(set,*src)==NULL)
if(strchr((char *)set,*src)==NULL)
*(dst++)=*src;
src++;
}
......@@ -218,24 +219,23 @@ hash_t* SMBCALL smb_hash(ulong msgnum, uint32_t t, unsigned source, unsigned fla
hash_t* SMBCALL smb_hashstr(ulong msgnum, uint32_t t, unsigned source, unsigned flags
,const char* str)
{
char* p=(char *)str;
char* p=NULL;
hash_t* hash;
if(flags&SMB_HASH_PROC_MASK) { /* string pre-processing */
if((p=strdup(str))==NULL)
return(NULL);
if(flags&SMB_HASH_STRIP_CTRL_A)
strip_ctrla(p,p);
strip_ctrla((uchar *)p,(uchar *)p);
if(flags&SMB_HASH_STRIP_WSP)
strip_chars(p,p," \t\r\n");
strip_chars((uchar *)p,(uchar *)p,(uchar *)" \t\r\n");
if(flags&SMB_HASH_LOWERCASE)
strlwr(p);
}
hash=smb_hash(msgnum, t, source, flags, p, strlen(p));
hash=smb_hash(msgnum, t, source, flags, p?p:str, strlen(p));
if(p!=str) /* duped string */
free(p);
FREE_AND_NULL(p);
return(hash);
}
......@@ -264,7 +264,7 @@ hash_t** SMBCALL smb_msghashes(smbmsg_t* msg, const uchar* body, long source_mas
hashes[h++]=hash;
if(body!=NULL && (source_mask&(1<<SMB_HASH_SOURCE_BODY)) &&
(hash=smb_hashstr(msg->hdr.number, (uint32_t)t, SMB_HASH_SOURCE_BODY, flags|SMB_HASH_STRIP_WSP|SMB_HASH_STRIP_CTRL_A, body))!=NULL)
(hash=smb_hashstr(msg->hdr.number, (uint32_t)t, SMB_HASH_SOURCE_BODY, flags|SMB_HASH_STRIP_WSP|SMB_HASH_STRIP_CTRL_A, (const char *)body))!=NULL)
hashes[h++]=hash;
if(msg->subj!=NULL && (source_mask&(1<<SMB_HASH_SOURCE_SUBJECT))) {
......
......@@ -125,7 +125,7 @@ char* SMBCALL smb_getmsgtxt(smb_t* smb, smbmsg_t* msg, ulong mode)
return(buf);
}
buf=p;
lzh_decode((char*)lzhbuf,length,(char*)buf+l);
lzh_decode((uint8_t *)lzhbuf,length,(uint8_t *)buf+l);
free(lzhbuf);
l+=lzhlen;
}
......
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