Skip to content

Commit 25d0e21

Browse files
committed
Use PGSQL_RETURN_OID() in more places
1 parent 47688ab commit 25d0e21

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

ext/pgsql/pgsql.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,15 +1572,7 @@ PHP_FUNCTION(pg_field_table)
15721572
}
15731573

15741574
if (return_oid) {
1575-
#if UINT_MAX > ZEND_LONG_MAX /* Oid is unsigned int, we don't need this code, where LONG is wider */
1576-
if (oid > ZEND_LONG_MAX) {
1577-
smart_str oidstr = {0};
1578-
smart_str_append_unsigned(&oidstr, oid);
1579-
smart_str_0(&oidstr);
1580-
RETURN_NEW_STR(oidstr.s);
1581-
} else
1582-
#endif
1583-
RETURN_LONG((zend_long)oid);
1575+
PGSQL_RETURN_OID(oid);
15841576
}
15851577

15861578
/* 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
16751667
case PHP_PG_FIELD_TYPE_OID:
16761668

16771669
oid = PQftype(pgsql_result, (int)field);
1678-
#if UINT_MAX > ZEND_LONG_MAX
1679-
if (oid > ZEND_LONG_MAX) {
1680-
smart_str s = {0};
1681-
smart_str_append_unsigned(&s, oid);
1682-
smart_str_0(&s);
1683-
RETURN_NEW_STR(s.s);
1684-
} else
1685-
#endif
1686-
{
1687-
RETURN_LONG((zend_long)oid);
1688-
}
1670+
PGSQL_RETURN_OID(oid);
16891671
break;
16901672
EMPTY_SWITCH_DEFAULT_CASE()
16911673
}

0 commit comments

Comments
 (0)