Skip to content

Commit 5480e6b

Browse files
committed
Accept bool in snmp_set_(quick|enum)_print()
The integer parameter here is actually a boolean. snmp_set_quick_print() already documented it as such, and snmp_get_quick_print() was already returning a boolean.
1 parent 1fba220 commit 5480e6b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

ext/snmp/snmp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,9 +1321,9 @@ PHP_FUNCTION(snmp_get_quick_print)
13211321
/* {{{ Return all objects including their respective object id within the specified one */
13221322
PHP_FUNCTION(snmp_set_quick_print)
13231323
{
1324-
zend_long a1;
1324+
zend_bool a1;
13251325

1326-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
1326+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &a1) == FAILURE) {
13271327
RETURN_THROWS();
13281328
}
13291329

@@ -1335,9 +1335,9 @@ PHP_FUNCTION(snmp_set_quick_print)
13351335
/* {{{ Return all values that are enums with their enum value instead of the raw integer */
13361336
PHP_FUNCTION(snmp_set_enum_print)
13371337
{
1338-
zend_long a1;
1338+
zend_bool a1;
13391339

1340-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &a1) == FAILURE) {
1340+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &a1) == FAILURE) {
13411341
RETURN_THROWS();
13421342
}
13431343

ext/snmp/snmp.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ function snmpset(string $host, string $community, array|string $object_id, array
1717

1818
function snmp_get_quick_print(): bool {}
1919

20-
function snmp_set_quick_print(int $quick_print): bool {}
20+
function snmp_set_quick_print(bool $quick_print): bool {}
2121

22-
function snmp_set_enum_print(int $enum_print): bool {}
22+
function snmp_set_enum_print(bool $enum_print): bool {}
2323

2424
function snmp_set_oid_output_format(int $oid_format): bool {}
2525

ext/snmp/snmp_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 31a125dde8e52e7849c8cd62ac410be9249a80df */
2+
* Stub hash: 4b1adaf7afe143328f1b05c7039fb3d974b29545 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_snmpget, 0, 3, stdClass, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL)
55
ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0)
@@ -37,11 +37,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_get_quick_print, 0, 0, _IS_
3737
ZEND_END_ARG_INFO()
3838

3939
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_quick_print, 0, 1, _IS_BOOL, 0)
40-
ZEND_ARG_TYPE_INFO(0, quick_print, IS_LONG, 0)
40+
ZEND_ARG_TYPE_INFO(0, quick_print, _IS_BOOL, 0)
4141
ZEND_END_ARG_INFO()
4242

4343
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_enum_print, 0, 1, _IS_BOOL, 0)
44-
ZEND_ARG_TYPE_INFO(0, enum_print, IS_LONG, 0)
44+
ZEND_ARG_TYPE_INFO(0, enum_print, _IS_BOOL, 0)
4545
ZEND_END_ARG_INFO()
4646

4747
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_snmp_set_oid_output_format, 0, 1, _IS_BOOL, 0)

0 commit comments

Comments
 (0)