File php-odbc-cmp-int-cast.patch of Package php7

https://bugs.php.net/bug.php?id=53007
Index: php-7.4.13/ext/odbc/php_odbc.c
===================================================================
--- php-7.4.13.orig/ext/odbc/php_odbc.c	2020-11-24 11:03:41.000000000 +0100
+++ php-7.4.13/ext/odbc/php_odbc.c	2020-11-26 08:19:46.512139501 +0100
@@ -1811,7 +1811,7 @@ static void php_odbc_fetch_hash(INTERNAL
 				} else if (rc != SQL_SUCCESS) {
 					php_error_docref(NULL, E_WARNING, "Cannot get data of column #%d (retcode %u)", i + 1, rc);
 					ZVAL_FALSE(&tmp);
-				} else if (result->values[i].vallen == SQL_NULL_DATA) {
+				} else if ((int)result->values[i].vallen == (int)SQL_NULL_DATA) {
 					ZVAL_NULL(&tmp);
 					break;
 				} else {
@@ -1820,7 +1820,7 @@ static void php_odbc_fetch_hash(INTERNAL
 				break;
 
 			default:
-				if (result->values[i].vallen == SQL_NULL_DATA) {
+				if ((int)result->values[i].vallen == (int)SQL_NULL_DATA) {
 					ZVAL_NULL(&tmp);
 					break;
 				}
@@ -1967,7 +1967,7 @@ PHP_FUNCTION(odbc_fetch_into)
 				} else if (rc != SQL_SUCCESS) {
 					php_error_docref(NULL, E_WARNING, "Cannot get data of column #%d (retcode %u)", i + 1, rc);
 					ZVAL_FALSE(&tmp);
-				} else if (result->values[i].vallen == SQL_NULL_DATA) {
+				} else if ((int)result->values[i].vallen == (int)SQL_NULL_DATA) {
 					ZVAL_NULL(&tmp);
 					break;
 				} else {
@@ -1976,7 +1976,7 @@ PHP_FUNCTION(odbc_fetch_into)
 				break;
 
 			default:
-				if (result->values[i].vallen == SQL_NULL_DATA) {
+				if ((int)result->values[i].vallen == (int)SQL_NULL_DATA) {
 					ZVAL_NULL(&tmp);
 					break;
 				}
@@ -2208,13 +2208,13 @@ PHP_FUNCTION(odbc_result)
 				zend_string_efree(field_str);
 				php_error_docref(NULL, E_WARNING, "Cannot get data of column #%d (retcode %u)", field_ind + 1, rc);
 				RETURN_FALSE;
-			} else if (result->values[field_ind].vallen == SQL_NULL_DATA) {
+			} else if ((int)result->values[field_ind].vallen == (int)SQL_NULL_DATA) {
 				zend_string_efree(field_str);
 				RETURN_NULL();
 			}
 			/* Reduce fieldlen by 1 if we have char data. One day we might
 			   have binary strings... */
-			if ((result->values[field_ind].coltype == SQL_LONGVARCHAR)
+			if (((int)result->values[field_ind].coltype == (int)SQL_LONGVARCHAR)
 #if defined(ODBCVER) && (ODBCVER >= 0x0300)
 			    || (result->values[field_ind].coltype == SQL_WLONGVARCHAR)
 #endif
@@ -2232,7 +2232,7 @@ PHP_FUNCTION(odbc_result)
 			break;
 
 		default:
-			if (result->values[field_ind].vallen == SQL_NULL_DATA) {
+			if ((int)result->values[field_ind].vallen == (int)SQL_NULL_DATA) {
 				RETURN_NULL();
 			} else {
 				RETURN_STRINGL(result->values[field_ind].value, result->values[field_ind].vallen);
@@ -2262,7 +2262,7 @@ PHP_FUNCTION(odbc_result)
 			RETURN_FALSE;
 		}
 
-		if (result->values[field_ind].vallen == SQL_NULL_DATA) {
+		if ((int)result->values[field_ind].vallen == (int)SQL_NULL_DATA) {
 			efree(field);
 			RETURN_NULL();
 		}
@@ -2376,7 +2376,7 @@ PHP_FUNCTION(odbc_result_all)
 						php_error_docref(NULL, E_WARNING, "Cannot get data of column #%zu (retcode %u)", i + 1, rc);
 						efree(buf);
 						RETURN_FALSE;
-					} else if (result->values[i].vallen == SQL_NULL_DATA) {
+					} else if ((int)result->values[i].vallen == (int)SQL_NULL_DATA) {
 						php_printf("<td>NULL</td>");
 						break;
 					} else {
@@ -2385,7 +2385,7 @@ PHP_FUNCTION(odbc_result_all)
 					php_printf("</td>");
 					break;
 				default:
-					if (result->values[i].vallen == SQL_NULL_DATA) {
+					if ((int)result->values[i].vallen == (int)SQL_NULL_DATA) {
 						php_printf("<td>NULL</td>");
 					} else {
 						php_printf("<td>%s</td>", result->values[i].value);
openSUSE Build Service is sponsored by