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))
|
if(feof(fp))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
p = fgets(buf, buflen, fp);
|
p = fgets(buf, (int)buflen, fp);
|
||||||
|
|
||||||
if(!p)
|
if(!p)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -255,7 +255,7 @@ config_t *parse_config_line(char *line, const char *fname, int lineno) {
|
||||||
while(strchr("\t ", *--eol))
|
while(strchr("\t ", *--eol))
|
||||||
*eol = '\0';
|
*eol = '\0';
|
||||||
|
|
||||||
len = strcspn(value, "\t =");
|
len = (int)strcspn(value, "\t =");
|
||||||
value += len;
|
value += len;
|
||||||
value += strspn(value, "\t ");
|
value += strspn(value, "\t ");
|
||||||
if(*value == '=') {
|
if(*value == '=') {
|
||||||
|
|
|
@ -28,8 +28,8 @@ static uint32_t hash_function(const void *p, size_t len) {
|
||||||
const uint8_t *q = p;
|
const uint8_t *q = p;
|
||||||
uint32_t hash = 0;
|
uint32_t hash = 0;
|
||||||
while(true) {
|
while(true) {
|
||||||
for(int i = len > 4 ? 4 : len; --i;)
|
for(size_t i = len > 4 ? 4 : len; --i;)
|
||||||
hash += q[len - i] << (8 * i);
|
hash += (uint32_t)(q[len - i] << (8 * i));
|
||||||
hash *= 0x9e370001UL; // Golden ratio prime.
|
hash *= 0x9e370001UL; // Golden ratio prime.
|
||||||
if(len <= 4)
|
if(len <= 4)
|
||||||
break;
|
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) {
|
bool receive_meta(connection_t *c) {
|
||||||
int inlen;
|
ssize_t inlen;
|
||||||
char inbuf[MAXBUFSIZE];
|
char inbuf[MAXBUFSIZE];
|
||||||
char *bufp = inbuf, *endp;
|
char *bufp = inbuf, *endp;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue