From dcdcbda2c20b25f9584db633e0b63d49e3c53247 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 1 Sep 2022 10:25:23 +0200 Subject: rebuild for PHP 8.2.0RC1 --- apcu-php82.patch | 948 +++++++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-apcu.spec | 30 +- 2 files changed, 965 insertions(+), 13 deletions(-) create mode 100644 apcu-php82.patch diff --git a/apcu-php82.patch b/apcu-php82.patch new file mode 100644 index 0000000..285bbc7 --- /dev/null +++ b/apcu-php82.patch @@ -0,0 +1,948 @@ +diff --git a/apc.h b/apc.h +index 4a011ee..a00f560 100644 +--- a/apc.h ++++ b/apc.h +@@ -76,13 +76,6 @@ PHP_APCU_API void apc_debug(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(print + /* apc_flip_hash flips keys and values for faster searching */ + PHP_APCU_API HashTable* apc_flip_hash(HashTable *hash); + +-#define apc_time() \ +- (APCG(use_request_time) \ +- ? (APCG(request_time) \ +- ? APCG(request_time) \ +- : (APCG(request_time) = (time_t) sapi_get_request_time())) \ +- : time(0)) +- + #if defined(__GNUC__) + # define APC_UNUSED __attribute__((unused)) + # define APC_USED __attribute__((used)) +@@ -131,7 +124,7 @@ PHP_APCU_API int _apc_register_serializer( + + /* {{{ apc_get_serializers + fetches the list of serializers */ +-PHP_APCU_API apc_serializer_t* apc_get_serializers(); /* }}} */ ++PHP_APCU_API apc_serializer_t* apc_get_serializers(void); /* }}} */ + + /* {{{ apc_find_serializer + finds a previously registered serializer by name */ +diff --git a/apc.php b/apc.php +index 76c7a6b..dd143b3 100644 +--- a/apc.php ++++ b/apc.php +@@ -228,48 +228,53 @@ if (isset($MYREQUEST['IMG'])) + + function fill_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1,$color2,$text='',$placeindex=0) { + $r=$diameter/2; +- $w=deg2rad((360+$start+($end-$start)/2)%360); +- ++ $w=deg2rad(round(360+$start+($end-$start)/2)%360); + + if (function_exists("imagefilledarc")) { + // exists only if GD 2.0.1 is available +- imagefilledarc($im, $centerX+1, $centerY+1, $diameter, $diameter, $start, $end, $color1, IMG_ARC_PIE); +- imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE); +- imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL|IMG_ARC_EDGED); ++ imagefilledarc($im, $centerX+1, $centerY+1, $diameter, $diameter, round($start), round($end), $color1, IMG_ARC_PIE); ++ imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, round($start), round($end), $color2, IMG_ARC_PIE); ++ imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, round($start), round($end), $color1, IMG_ARC_NOFILL|IMG_ARC_EDGED); + } else { +- imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2); +- imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2); +- imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start+1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2); +- imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end-1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2); +- imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2); +- imagefill($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2, $color2); ++ imagearc($im, $centerX, $centerY, $diameter, $diameter, round($start), round($end), $color2); ++ imageline($im, $centerX, $centerY, $centerX + round(cos(deg2rad($start)) * $r), $centerY + round(sin(deg2rad($start)) * $r), $color2); ++ imageline($im, $centerX, $centerY, $centerX + round(cos(deg2rad($start+1)) * $r), $centerY + round(sin(deg2rad($start)) * $r), $color2); ++ imageline($im, $centerX, $centerY, $centerX + round(cos(deg2rad($end-1)) * $r), $centerY + round(sin(deg2rad($end)) * $r), $color2); ++ imageline($im, $centerX, $centerY, $centerX + round(cos(deg2rad($end)) * $r), $centerY + round(sin(deg2rad($end)) * $r), $color2); ++ imagefill($im,$centerX + round($r*cos($w)/2), $centerY + round($r*sin($w)/2), $color2); + } + if ($text) { + if ($placeindex>0) { +- imageline($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$diameter, $placeindex*12,$color1); ++ imageline($im,$centerX + round($r*cos($w)/2), $centerY + round($r*sin($w)/2),$diameter, $placeindex*12,$color1); + imagestring($im,4,$diameter, $placeindex*12,$text,$color1); + + } else { +- imagestring($im,4,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$text,$color1); ++ imagestring($im,4,$centerX + round($r*cos($w)/2), $centerY + round($r*sin($w)/2),$text,$color1); + } + } + } + + function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1,$text,$placeindex=0) { + $r=$diameter/2; +- $w=deg2rad((360+$start+($end-$start)/2)%360); ++ $w=deg2rad((360+round($start)+round(($end-$start)/2))%360); + + if ($placeindex>0) { +- imageline($im,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$diameter, $placeindex*12,$color1); ++ imageline($im,$centerX + round($r*cos($w)/2), $centerY + round($r*sin($w)/2),$diameter, $placeindex*12,$color1); + imagestring($im,4,$diameter, $placeindex*12,$text,$color1); + + } else { +- imagestring($im,4,$centerX + $r*cos($w)/2, $centerY + $r*sin($w)/2,$text,$color1); ++ imagestring($im,4,$centerX + round($r*cos($w)/2), $centerY + round($r*sin($w)/2),$text,$color1); + } + } + + function fill_box($im, $x, $y, $w, $h, $color1, $color2,$text='',$placeindex='') { + global $col_black; ++ ++ $x = round($x); ++ $y = round($y); ++ $w = round($w); ++ $h = round($h); ++ + $x1=$x+$w-1; + $y1=$y+$h-1; + +@@ -285,7 +290,7 @@ if (isset($MYREQUEST['IMG'])) + $px=5; + $py=$placeindex*12+6; + imagefilledrectangle($im, $px+90, $py+3, $px+90-4, $py-3, $color2); +- imageline($im,$x,$y+$h/2,$px+90,$py,$color2); ++ imageline($im,$x,$y+round($h/2),$px+90,$py,$color2); + imagestring($im,2,$px,$py-6,$text,$color1); + + } else { +@@ -297,7 +302,7 @@ if (isset($MYREQUEST['IMG'])) + $py=($placeindex%15)*12+6; + } + imagefilledrectangle($im, $px, $py+3, $px-4, $py-3, $color2); +- imageline($im,$x+$w,$y+$h/2,$px,$py,$color2); ++ imageline($im,$x+$w,$y+round($h/2),$px,$py,$color2); + imagestring($im,2,$px+2,$py-6,$text,$color1); + } + } else { +@@ -707,7 +712,7 @@ input { + +
+

+- ++ +
User Cache
+

+