diff options
Diffstat (limited to 'ext/snmp/snmp.c')
-rw-r--r-- | ext/snmp/snmp.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 1605f0c6eb..c44eb699eb 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2017 The PHP Group | + | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -33,10 +33,7 @@ #include "php_snmp.h" #include "zend_exceptions.h" - -#if HAVE_SPL #include "ext/spl/spl_exceptions.h" -#endif #if HAVE_SNMP @@ -1749,7 +1746,7 @@ PHP_FUNCTION(snmp_set_valueretrieval) SNMP_G(valueretrieval) = method; RETURN_TRUE; } else { - php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", method); + php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '" ZEND_LONG_FMT "'", method); RETURN_FALSE; } } @@ -2082,12 +2079,11 @@ static HashTable *php_snmp_get_properties(zval *object) HashTable *props; zval rv; zend_string *key; - zend_ulong num_key; obj = Z_SNMP_P(object); props = zend_std_get_properties(object); - ZEND_HASH_FOREACH_KEY_PTR(&php_snmp_properties, num_key, key, hnd) { + ZEND_HASH_FOREACH_STR_KEY_PTR(&php_snmp_properties, key, hnd) { if (!hnd->read_func || hnd->read_func(obj, &rv) != SUCCESS) { ZVAL_NULL(&rv); } @@ -2188,7 +2184,7 @@ static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval) if (Z_LVAL_P(newval) > 0) { snmp_object->max_oids = Z_LVAL_P(newval); } else { - php_error_docref(NULL, E_WARNING, "max_oids should be positive integer or NULL, got %pd", Z_LVAL_P(newval)); + php_error_docref(NULL, E_WARNING, "max_oids should be positive integer or NULL, got " ZEND_LONG_FMT, Z_LVAL_P(newval)); } if (newval == &ztmp) { @@ -2215,7 +2211,7 @@ static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *new if (Z_LVAL_P(newval) >= 0 && Z_LVAL_P(newval) <= (SNMP_VALUE_LIBRARY|SNMP_VALUE_PLAIN|SNMP_VALUE_OBJECT)) { snmp_object->valueretrieval = Z_LVAL_P(newval); } else { - php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '%pd'", Z_LVAL_P(newval)); + php_error_docref(NULL, E_WARNING, "Unknown SNMP value retrieval method '" ZEND_LONG_FMT "'", Z_LVAL_P(newval)); ret = FAILURE; } @@ -2265,7 +2261,7 @@ static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval * snmp_object->oid_output_format = Z_LVAL_P(newval); break; default: - php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '%pd'", Z_LVAL_P(newval)); + php_error_docref(NULL, E_WARNING, "Unknown SNMP output print format '" ZEND_LONG_FMT "'", Z_LVAL_P(newval)); ret = FAILURE; break; } @@ -2417,11 +2413,7 @@ PHP_MINIT_FUNCTION(snmp) /* Register SNMPException class */ INIT_CLASS_ENTRY(cex, "SNMPException", NULL); -#ifdef HAVE_SPL php_snmp_exception_ce = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException); -#else - php_snmp_exception_ce = zend_register_internal_class_ex(&cex, zend_ce_exception); -#endif return SUCCESS; } @@ -2453,14 +2445,10 @@ PHP_MINFO_FUNCTION(snmp) /* {{{ snmp_module_deps[] */ -#if ZEND_MODULE_API_NO >= 20050922 static const zend_module_dep snmp_module_deps[] = { -#ifdef HAVE_SPL ZEND_MOD_REQUIRED("spl") -#endif ZEND_MOD_END }; -#endif /* }}} */ /* {{{ snmp_module_entry |