From: Nikita Popov Date: Wed, 9 Sep 2020 15:09:40 +0000 (+0200) Subject: Use PGSQL_RETURN_OID() in more places X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=25d0e21d771b94a6e0f06653a45a2e3c32e6a19f;p=php Use PGSQL_RETURN_OID() in more places --- diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index ec5a6dcee2..57feca194e 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1572,15 +1572,7 @@ PHP_FUNCTION(pg_field_table) } if (return_oid) { -#if UINT_MAX > ZEND_LONG_MAX /* Oid is unsigned int, we don't need this code, where LONG is wider */ - if (oid > ZEND_LONG_MAX) { - smart_str oidstr = {0}; - smart_str_append_unsigned(&oidstr, oid); - smart_str_0(&oidstr); - RETURN_NEW_STR(oidstr.s); - } else -#endif - RETURN_LONG((zend_long)oid); + PGSQL_RETURN_OID(oid); } /* try to lookup the table name in the resource list */ @@ -1675,17 +1667,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ case PHP_PG_FIELD_TYPE_OID: oid = PQftype(pgsql_result, (int)field); -#if UINT_MAX > ZEND_LONG_MAX - if (oid > ZEND_LONG_MAX) { - smart_str s = {0}; - smart_str_append_unsigned(&s, oid); - smart_str_0(&s); - RETURN_NEW_STR(s.s); - } else -#endif - { - RETURN_LONG((zend_long)oid); - } + PGSQL_RETURN_OID(oid); break; EMPTY_SWITCH_DEFAULT_CASE() }