Skip to content

Commit

Permalink
Merge pull request laruence#7 from remicollet/issue-wall
Browse files Browse the repository at this point in the history
Issue build warnings
  • Loading branch information
laruence committed Jul 17, 2013
2 parents 19fe20e + c8d9382 commit 1ab9ac6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 1 addition & 3 deletions transports/curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ yar_response_t * php_yar_curl_exec(yar_transport_interface_t* self, yar_request_
} /* }}} */

int php_yar_curl_send(yar_transport_interface_t* self, yar_request_t *request, char **msg TSRMLS_DC) /* {{{ */ {
CURL *cp;
zval *payload;
yar_header_t header = {0};
yar_curl_data_t *data = (yar_curl_data_t *)self->data;
Expand All @@ -432,7 +431,6 @@ int php_yar_curl_send(yar_transport_interface_t* self, yar_request_t *request, c

php_yar_protocol_render(&header, request->id, data->host->user, data->host->pass, Z_STRLEN_P(payload), 0 TSRMLS_CC);

cp = data->cp;
smart_str_appendl(&data->postfield, (char *)&header, sizeof(yar_header_t));
smart_str_appendl(&data->postfield, Z_STRVAL_P(payload), Z_STRLEN_P(payload));
zval_ptr_dtor(&payload);
Expand Down Expand Up @@ -723,7 +721,7 @@ int php_yar_curl_multi_exec(yar_transport_multi_interface_t *self, yar_concurren
goto onerror;
} else {
/* timeout */
php_error_docref(NULL TSRMLS_CC, E_WARNING, "select timeout '%d' seconds reached", YAR_G(timeout));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "select timeout '%ld' seconds reached", YAR_G(timeout));
goto onerror;
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions transports/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ int php_yar_socket_send(yar_transport_interface_t* self, yar_request_t *request,
fd_set rfds;
zval *payload;
struct timeval tv;
int ret, fd, retval;
int ret = -1, fd, retval;
char buf[SEND_BUF_SIZE];
yar_header_t header = {0};
yar_socket_data_t *data = (yar_socket_data_t *)self->data;
Expand Down Expand Up @@ -242,11 +242,11 @@ int php_yar_socket_send(yar_transport_interface_t* self, yar_request_t *request,

if (retval == -1) {
zval_ptr_dtor(&payload);
spprintf(msg, 0, "select error '%s'", fd, strerror(errno));
spprintf(msg, 0, "select error '%s'", strerror(errno));
return 0;
} else if (retval == 0) {
zval_ptr_dtor(&payload);
spprintf(msg, 0, "select timeout '%d' seconds reached", YAR_G(timeout));
spprintf(msg, 0, "select timeout '%ld' seconds reached", YAR_G(timeout));
return 0;
}

Expand Down Expand Up @@ -277,11 +277,11 @@ int php_yar_socket_send(yar_transport_interface_t* self, yar_request_t *request,

if (retval == -1) {
zval_ptr_dtor(&payload);
spprintf(msg, 0, "select error '%s'", fd, strerror(errno));
spprintf(msg, 0, "select error '%s'", strerror(errno));
return 0;
} else if (retval == 0) {
zval_ptr_dtor(&payload);
spprintf(msg, 0, "select timeout '%d' seconds reached", YAR_G(timeout));
spprintf(msg, 0, "select timeout '%ld' seconds reached", YAR_G(timeout));
return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions yar_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ static zval * php_yar_client_handle(int protocol, zval *client, char *method, lo
factory = php_yar_transport_get(ZEND_STRL("curl") TSRMLS_CC);
} else if (protocol == YAR_CLIENT_PROTOCOL_TCP || protocol == YAR_CLIENT_PROTOCOL_UNIX) {
factory = php_yar_transport_get(ZEND_STRL("sock") TSRMLS_CC);
} else {
return NULL;
}

transport = factory->init(TSRMLS_C);
Expand Down
3 changes: 1 addition & 2 deletions yar_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,10 @@ static int php_yar_print_info(void *ptr, void *argument TSRMLS_DC) /* {{{ */ {
char *prototype = NULL;
if ((prototype = php_yar_get_function_declaration(f TSRMLS_CC))) {
char *buf, *doc_comment = NULL;
uint buf_len;
if (f->type == ZEND_USER_FUNCTION) {
doc_comment = (char *)f->op_array.doc_comment;
}
buf_len = spprintf(&buf, 0, HTML_MARKUP_ENTRY, prototype, doc_comment? doc_comment : "");
spprintf(&buf, 0, HTML_MARKUP_ENTRY, prototype, doc_comment? doc_comment : "");
efree(prototype);
PHPWRITE(buf, strlen(buf));
efree(buf);
Expand Down

0 comments on commit 1ab9ac6

Please sign in to comment.