Type casting fixes

This commit is contained in:
thorkill 2015-06-29 15:53:22 +02:00
parent 3a61d104d4
commit dbfc168fa4
3 changed files with 5 additions and 5 deletions

View file

@ -227,7 +227,7 @@ static char *readline(FILE * fp, char *buf, size_t buflen) {
if(feof(fp))
return NULL;
p = fgets(buf, buflen, fp);
p = fgets(buf, (int)buflen, fp);
if(!p)
return NULL;
@ -255,7 +255,7 @@ config_t *parse_config_line(char *line, const char *fname, int lineno) {
while(strchr("\t ", *--eol))
*eol = '\0';
len = strcspn(value, "\t =");
len = (int)strcspn(value, "\t =");
value += len;
value += strspn(value, "\t ");
if(*value == '=') {

View file

@ -28,8 +28,8 @@ static uint32_t hash_function(const void *p, size_t len) {
const uint8_t *q = p;
uint32_t hash = 0;
while(true) {
for(int i = len > 4 ? 4 : len; --i;)
hash += q[len - i] << (8 * i);
for(size_t i = len > 4 ? 4 : len; --i;)
hash += (uint32_t)(q[len - i] << (8 * i));
hash *= 0x9e370001UL; // Golden ratio prime.
if(len <= 4)
break;

View file

@ -142,7 +142,7 @@ bool receive_meta_sptps(void *handle, uint8_t type, const void *vdata, uint16_t
}
bool receive_meta(connection_t *c) {
int inlen;
ssize_t inlen;
char inbuf[MAXBUFSIZE];
char *bufp = inbuf, *endp;