[php-src] master: Move bc_copy_num to header to allow inlining

From: Date: Thu, 02 May 2024 18:04:09 +0000
Subject: [php-src] master: Move bc_copy_num to header to allow inlining
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-128307@lists.php.net to get a copy of this message
Author: Niels Dossche (nielsdos) Date: 2024-05-02T20:03:59+02:00 Commit: https://github.com/php/php-src/commit/4964c5cb2313a91af9843cdd99099a05fe6cca0d Raw diff: https://github.com/php/php-src/commit/4964c5cb2313a91af9843cdd99099a05fe6cca0d.diff Move bc_copy_num to header to allow inlining Changed paths: M ext/bcmath/libbcmath/src/bcmath.h M ext/bcmath/libbcmath/src/init.c Diff: diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h index 9cd611a6fd5b..6d2163b023d2 100644 --- a/ext/bcmath/libbcmath/src/bcmath.h +++ b/ext/bcmath/libbcmath/src/bcmath.h @@ -88,7 +88,12 @@ bc_num _bc_new_num_ex(size_t length, size_t scale, bool persistent); void _bc_free_num_ex(bc_num *num, bool persistent); -bc_num bc_copy_num(bc_num num); +/* Make a copy of a number! Just increments the reference count! */ +static inline bc_num bc_copy_num(bc_num num) +{ + num->n_refs++; + return num; +} void bc_init_num(bc_num *num); diff --git a/ext/bcmath/libbcmath/src/init.c b/ext/bcmath/libbcmath/src/init.c index 959f47c21aa0..1db324aeee22 100644 --- a/ext/bcmath/libbcmath/src/init.c +++ b/ext/bcmath/libbcmath/src/init.c @@ -77,14 +77,6 @@ void bc_init_numbers(void) } -/* Make a copy of a number! Just increments the reference count! */ -bc_num bc_copy_num(bc_num num) -{ - num->n_refs++; - return num; -} - - /* Initialize a number NUM by making it a copy of zero. */ void bc_init_num(bc_num *num) {

« previous php.cvs (#128307) next »