Skip to content

Commit

Permalink
Fix build warnings (#667)
Browse files Browse the repository at this point in the history
* fix [-Wunused-variable]

* Fix [-Wunused-function]

comment out the function as its usage if also commented out

* Fix various [-Wsign-compare]

---------

Co-authored-by: eeliu <27064129+eeliu@users.noreply.github.com>
  • Loading branch information
remicollet and eeliu authored Aug 8, 2024
1 parent 6a89839 commit 057ed05
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pinpoint_php.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ZEND_GET_MODULE(pinpoint_php)
#endif

ZEND_DECLARE_MODULE_GLOBALS(pinpoint_php);
static void pinpoint_log(char *msg);
//static void pinpoint_log(char *msg);

// clang-format off
/* {{{ PHP_INI
Expand Down Expand Up @@ -206,7 +206,7 @@ void (*old_error_cb)(int type, const char *error_filename,
}

PHP_FUNCTION(_pinpoint_drop_trace) {
NodeID id = E_ROOT_NODE, cur_id = E_ROOT_NODE;
NodeID id = E_ROOT_NODE;
#if PHP_VERSION_ID < 70000
size_t _id = -1;
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &_id);
Expand Down Expand Up @@ -614,7 +614,7 @@ static inline zend_string *merge_pp_style_name(zend_string *scope,
#if (PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION >= 2)

// ref from php-8.2.19/ext/standard/var.c:137
static zval *zend_array_index(zval *ar, int index) {
static zval *zend_array_index(zval *ar, uint32_t index) {
HashTable *__ht = Z_ARRVAL_P(ar);
uint32_t _idx = 0;
uint32_t _count = __ht->nNumUsed - _idx;
Expand Down Expand Up @@ -768,7 +768,7 @@ static void replace_ex_caller_parameters(zval *argv) {
return;
}

int size = zend_array_count(Z_ARRVAL_P(argv));
uint32_t size = zend_array_count(Z_ARRVAL_P(argv));
pp_trace("argv size:%d", size);
uint32_t param_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
if (size != param_count) {
Expand All @@ -777,7 +777,7 @@ static void replace_ex_caller_parameters(zval *argv) {
return;
}

int i = 0;
uint32_t i = 0;
zval *ex_param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);

// check old and new
Expand Down Expand Up @@ -1271,6 +1271,7 @@ PHP_MINFO_FUNCTION(pinpoint_php) {
}
/* }}} */

/*
void pinpoint_log(char *msg) {
#if PHP_VERSION_ID >= 70100
php_log_err_with_severity(msg, LOG_DEBUG);
Expand All @@ -1279,3 +1280,4 @@ void pinpoint_log(char *msg) {
php_log_err(msg TSRMLS_CC);
#endif
}
*/

0 comments on commit 057ed05

Please sign in to comment.