Type casting fixes
This commit is contained in:
parent
3a61d104d4
commit
dbfc168fa4
3 changed files with 5 additions and 5 deletions
|
@ -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 == '=') {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue