php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #58757
Patch fix-types-for-php5-x86_64 revision 2013-01-26 14:23 UTC by iliya at automattic dot com

Patch fix-types-for-php5-x86_64 for big_int Bug #58757

Patch version 2013-01-26 14:23 UTC

Return to Bug #58757 | Download this patch
Patch Revisions:

Developer: iliya@automattic.com

--- big_int-1.0.7.orig/libbig_int/include/service_funcs.h	2005-05-30 12:08:32.000000000 +0000
+++ big_int-1.0.7/libbig_int/include/service_funcs.h	2011-04-12 13:41:06.000000000 +0000
@@ -43,16 +43,16 @@
 
 BIG_INT_API int big_int_realloc(big_int *a, size_t len);
 
-BIG_INT_API int big_int_from_str(const big_int_str *s, unsigned int base, big_int *answer);
+BIG_INT_API int big_int_from_str(const big_int_str *s, long int base, big_int *answer);
 
-BIG_INT_API int big_int_to_str(const big_int *a, unsigned int base, big_int_str *s);
+BIG_INT_API int big_int_to_str(const big_int *a, long int base, big_int_str *s);
 
 BIG_INT_API int big_int_from_int(int value, big_int *a);
 
 BIG_INT_API int big_int_to_int(const big_int *a, int *value);
 
 BIG_INT_API int big_int_base_convert(const big_int_str *src, big_int_str *dst,
-    unsigned int base_from, unsigned int base_to);
+    long int base_from, long int base_to);
 
 BIG_INT_API int big_int_serialize(const big_int *a, int is_sign, big_int_str *s);
 
--- big_int-1.0.7.orig/libbig_int/src/service_funcs.c	2005-05-30 12:08:32.000000000 +0000
+++ big_int-1.0.7/libbig_int/src/service_funcs.c	2011-04-12 13:42:16.000000000 +0000
@@ -252,7 +252,7 @@
         3 - length of the string must be greater than 0
         other - internal error
 */
-int big_int_from_str(const big_int_str *s, unsigned int base, big_int *answer)
+int big_int_from_str(const big_int_str *s, long int base, big_int *answer)
 {
     size_t str_length, len;
     big_int_word *a, *a_end, *aa;
@@ -380,7 +380,7 @@
         1 - wrong [base]. It can be from 2 to 36 inclusive
         other - internal error
 */
-int big_int_to_str(const big_int *a, unsigned int base, big_int_str *s)
+int big_int_to_str(const big_int *a, long int base, big_int_str *s)
 {
     size_t len;
     char *str, *str_end, *ss;
@@ -493,7 +493,7 @@
         other - internal error
 */
 int big_int_base_convert(const big_int_str *src, big_int_str *dst,
-                         unsigned int base_from, unsigned int base_to)
+                         long int base_from, long int base_to)
 {
     big_int *tmp = NULL;
     int result = 0;

--- big_int-1.0.7.orig/php_big_int.c	2005-05-30 12:08:32.000000000 +0000
+++ big_int-1.0.7/php_big_int.c	2011-04-12 13:18:15.000000000 +0000
@@ -395,7 +395,7 @@
 static void bin_op1(const char *func_name, bin_op1_func func, INTERNAL_FUNCTION_PARAMETERS)
 {
     const char *errstr = NULL;
-    int n_bit;
+    long n_bit;
     big_int *answer = NULL;
     zval *tmp;
     args_entry arg = {0};
@@ -520,7 +520,7 @@
 static void tri_op1(const char *func_name, tri_op1_func func, INTERNAL_FUNCTION_PARAMETERS)
 {
     const char *errstr = NULL;
-    int start_pos = 0;
+    long start_pos = 0;
     big_int *answer = NULL;
     zval *tmp[2];
     args_entry args[2] = {0};
@@ -573,7 +573,7 @@
 {
     bin_op1_func func;
     const char *errstr = NULL;
-    int n_bit;
+    long n_bit;
     big_int *answer = NULL;
     zval *tmp;
     args_entry arg = {0};
@@ -676,7 +676,7 @@
 {
     char *str = NULL;
     int str_len;
-    int base;
+    long base;
     big_int_str s;
     big_int *num = NULL;
     const char *errstr = NULL;
@@ -740,7 +740,7 @@
 ZEND_FUNCTION(bi_to_str)
 {
     zval *tmp = NULL;
-    int base;
+    long base;
     big_int_str *s_ptr = NULL;
     const char *errstr = NULL;
     args_entry arg = {0};
@@ -802,7 +802,7 @@
 {
     char *str = NULL;
     int str_len;
-    int base_from, base_to;
+    long base_from, base_to;
     big_int_str s, *s_ptr = NULL;
     const char *errstr = NULL;
 
@@ -1278,7 +1278,7 @@
 ZEND_FUNCTION(bi_rand)
 {
     const char *errstr = NULL;
-    int n_bits;
+    long n_bits;
     big_int *answer = NULL;
     zval *function_name = NULL;
 
@@ -1534,7 +1534,7 @@
 ZEND_FUNCTION(bi_test_bit)
 {
     const char *errstr = NULL;
-    int n_bit;
+    long n_bit;
     zval *tmp;
     args_entry arg = {0};
     int bit_value = 0;
@@ -1577,7 +1577,7 @@
 ZEND_FUNCTION(bi_scan0_bit)
 {
     const char *errstr = NULL;
-    int n_bit;
+    long n_bit;
     zval *tmp;
     args_entry arg = {0};
     size_t pos = 0;
@@ -1620,7 +1620,7 @@
 ZEND_FUNCTION(bi_scan1_bit)
 {
     const char *errstr = NULL;
-    int n_bit;
+    long n_bit;
     zval *tmp;
     args_entry arg = {0};
     size_t pos = 0;
@@ -1705,7 +1705,7 @@
 ZEND_FUNCTION(bi_subint)
 {
     const char *errstr = NULL;
-    int start_bit, len, is_invert;
+    long start_bit, len, is_invert;
     big_int *answer = NULL;
     zval *tmp;
     args_entry arg = {0};
@@ -1938,7 +1938,7 @@
 */
 ZEND_FUNCTION(bi_fact)
 {
-    int n;
+    long n;
     const char *errstr = NULL;
     big_int *answer = NULL;
 
@@ -1985,7 +1985,7 @@
     zval *tmp;
     args_entry arg = {0};
     big_int *answer = NULL;
-    size_t power;
+    long power;
 
     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &tmp, &power) == FAILURE) {
         /* error message was sent by zend_parse_parameters() */
@@ -2035,7 +2035,7 @@
     const char *errstr = NULL;
     args_entry arg = {0};
     big_int_str *s_ptr = NULL;
-    int is_sign;
+    zend_bool is_sign;
     zval *tmp;
 
     is_sign = 0;
@@ -2088,7 +2088,7 @@
     big_int *answer = NULL;
     char *str;
     int str_len;
-    int is_sign;
+	zend_bool is_sign;
     big_int_str s;
 
     is_sign = 0;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC