From: Boris Lytochkin Date: Fri, 4 Mar 2011 18:58:01 +0000 (+0000) Subject: * fix warning about redefining REGISTER_PDO_CLASS_CONST_LONG (damn copy'n'paste) X-Git-Tag: php-5.4.0alpha1~191^2~188 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3c0f1d5b95da76cfad63089394d58921ecf9278a;p=php * fix warning about redefining REGISTER_PDO_CLASS_CONST_LONG (damn copy'n'paste) * tuned two unit test that failed at gcov.php.net/PHP_HEAD --- diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h index 62d1f28532..b4b6f560ab 100644 --- a/ext/snmp/php_snmp.h +++ b/ext/snmp/php_snmp.h @@ -124,7 +124,7 @@ ZEND_END_MODULE_GLOBALS(snmp) #define SNMP_G(v) (snmp_globals.v) #endif -#define REGISTER_PDO_CLASS_CONST_LONG(const_name, value) \ +#define REGISTER_SNMP_CLASS_CONST_LONG(const_name, value) \ zend_declare_class_constant_long(php_snmp_get_ce(), const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); #else diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index fe5c39caef..14ff21455e 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -2436,11 +2436,11 @@ PHP_MINIT_FUNCTION(snmp) REGISTER_LONG_CONSTANT("SNMP_VERSION_2c", SNMP_VERSION_2c, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SNMP_VERSION_3", SNMP_VERSION_3, CONST_CS | CONST_PERSISTENT); - REGISTER_PDO_CLASS_CONST_LONG("ERRNO_NOERROR", (long)PHP_SNMP_ERRNO_NOERROR); - REGISTER_PDO_CLASS_CONST_LONG("ERRNO_GENERIC", (long)PHP_SNMP_ERRNO_GENERIC); - REGISTER_PDO_CLASS_CONST_LONG("ERRNO_TIMEOUT", (long)PHP_SNMP_ERRNO_TIMEOUT); - REGISTER_PDO_CLASS_CONST_LONG("ERRNO_ERROR_IN_REPLY", (long)PHP_SNMP_ERRNO_ERROR_IN_REPLY); - REGISTER_PDO_CLASS_CONST_LONG("ERRNO_OID_NOT_INCREASING", (long)PHP_SNMP_ERRNO_OID_NOT_INCREASING); + REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_NOERROR", (long)PHP_SNMP_ERRNO_NOERROR); + REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_GENERIC", (long)PHP_SNMP_ERRNO_GENERIC); + REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_TIMEOUT", (long)PHP_SNMP_ERRNO_TIMEOUT); + REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_ERROR_IN_REPLY", (long)PHP_SNMP_ERRNO_ERROR_IN_REPLY); + REGISTER_SNMP_CLASS_CONST_LONG("ERRNO_OID_NOT_INCREASING", (long)PHP_SNMP_ERRNO_OID_NOT_INCREASING); return SUCCESS; } diff --git a/ext/snmp/tests/snmp2_set.phpt b/ext/snmp/tests/snmp2_set.phpt index d7c1364b4b..b833b9b504 100644 --- a/ext/snmp/tests/snmp2_set.phpt +++ b/ext/snmp/tests/snmp2_set.phpt @@ -224,13 +224,13 @@ bool(true) bool(true) Multiple OID, 1st bogus, single type, multiple value -Warning: snmp2_set(): Error in packet at '%s': noCreation (That table does not support row creation or that object can not ever be created) in %s on line %d +Warning: snmp2_set(): Error in packet at '%s': %rnoCreation|notWritable%r (%s) in %s on line %d bool(false) bool(true) bool(true) Multiple OID, 2nd bogus, single type, multiple value -Warning: snmp2_set(): Error in packet at '%s': noCreation (That table does not support row creation or that object can not ever be created) in %s on line %d +Warning: snmp2_set(): Error in packet at '%s': %rnoCreation|notWritable%r (%s) in %s on line %d bool(false) bool(true) bool(true) diff --git a/ext/snmp/tests/wrong_hostname.phpt b/ext/snmp/tests/wrong_hostname.phpt index e7e18fc1a6..7b56e5c294 100644 --- a/ext/snmp/tests/wrong_hostname.phpt +++ b/ext/snmp/tests/wrong_hostname.phpt @@ -18,5 +18,5 @@ var_dump(snmpget('192.168..6.1', 'community', '.1.3.6.1.2.1.1.1.0', $timeout, $r ?> --EXPECTF-- -Warning: snmpget(): Could not open snmp connection: Unknown host (192.168..6.1) (Bad file descriptor) in %s on line %d +Warning: snmpget(): Could not open snmp connection: Unknown host (192.168..6.1) (%s) in %s on line %d bool(false) \ No newline at end of file