Browse Source

fix compile issues in cygwin

pull/35/head
Max Lv 10 years ago
parent
commit
b0bcda7a3e
2 changed files with 5 additions and 5 deletions
  1. 6
      src/json.c
  2. 4
      src/udprelay.c

6
src/json.c

@ -508,14 +508,14 @@ whitespace:
default:
if (isdigit (b) || b == '-')
if (isdigit ((unsigned char)b) || b == '-')
{
if (!new_value (&state, &top, &root, &alloc, json_integer))
goto e_alloc_failure;
if (!state.first_pass)
{
while (isdigit (b) || b == '+' || b == '-'
while (isdigit ((unsigned char)b) || b == '+' || b == '-'
|| b == 'e' || b == 'E' || b == '.')
{
b = *++ i;
@ -600,7 +600,7 @@ whitespace:
case json_integer:
case json_double:
if (isdigit (b))
if (isdigit ((unsigned char)b))
{
++ num_digits;

4
src/udprelay.c

@ -445,7 +445,7 @@ static void remote_recv_cb (EV_P_ ev_io *w, int revents)
ev_timer_again(EV_A_ &remote_ctx->watcher);
struct sockaddr src_addr;
unsigned int addr_len = sizeof(src_addr);
socklen_t addr_len = sizeof(src_addr);
unsigned int addr_header_len = remote_ctx->addr_header_len;
char *buf = malloc(BUF_SIZE);
@ -512,7 +512,7 @@ static void server_recv_cb (EV_P_ ev_io *w, int revents)
struct sockaddr src_addr;
char *buf = malloc(BUF_SIZE);
unsigned int addr_len = sizeof(src_addr);
socklen_t addr_len = sizeof(src_addr);
unsigned int offset = 0;
ssize_t buf_len = recvfrom(server_ctx->fd, buf, BUF_SIZE, 0, &src_addr, &addr_len);

Loading…
Cancel
Save