diff options
Diffstat (limited to 'ext/snmp/snmp.c')
-rw-r--r-- | ext/snmp/snmp.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 63e8095ed7..cabfa9e7df 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -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 @@ -1755,7 +1752,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; } } @@ -2088,12 +2085,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); } @@ -2194,7 +2190,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) { @@ -2221,7 +2217,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; } @@ -2271,7 +2267,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; } @@ -2423,11 +2419,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; } @@ -2459,14 +2451,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 |