[Scummvm-git-logs] scummvm master -> 231d7ffaeeb2f2feadffe1bd63024e28a2a16362

digitall noreply at scummvm.org
Sun Jun 25 14:45:49 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
231d7ffaee COMMON: Fix Signed vs. Unsigned GCC Compiler Warnings in Punycode


Commit: 231d7ffaeeb2f2feadffe1bd63024e28a2a16362
    https://github.com/scummvm/scummvm/commit/231d7ffaeeb2f2feadffe1bd63024e28a2a16362
Author: D G Turner (digitall at scummvm.org)
Date: 2023-06-25T15:45:26+01:00

Commit Message:
COMMON: Fix Signed vs. Unsigned GCC Compiler Warnings in Punycode

Changed paths:
    common/punycode.cpp


diff --git a/common/punycode.cpp b/common/punycode.cpp
index 1b9344beb80..43054152e1a 100644
--- a/common/punycode.cpp
+++ b/common/punycode.cpp
@@ -228,10 +228,10 @@ U32String punycode_decode(const String &src1) {
 		return src1;
 
 	String src(&src1.c_str()[4]); // Skip the prefix for simplification
-	int srclen = src.size();
+	uint srclen = src.size();
 
 	// Ensure that the input contains only ASCII characters.
-	for (int si = 0; si < srclen; si++) {
+	for (uint si = 0; si < srclen; si++) {
 		if (src[si] & 0x80) {
 			return src1;
 		}
@@ -266,7 +266,7 @@ U32String punycode_decode(const String &src1) {
 		bool noncode = false;
 
 		// Scan string to the end for illegal characters
-		for (int i = di + 1; i < srclen; i++) {
+		for (uint i = di + 1; i < srclen; i++) {
 			if (!((src[i] >= '0' && src[i] <= '9') || (src[i] >= 'a' && src[i] <= 'z'))) {
 				noncode = true;
 				break;
@@ -302,7 +302,7 @@ U32String punycode_decode(const String &src1) {
 	size_t n = INITIAL_N;
 	size_t bias = INITIAL_BIAS;
 
-	for (int si = b + (b > 0 ? 1 : 0); si < srclen; di++) {
+	for (int si = b + (b > 0 ? 1 : 0); si < (int)srclen; di++) {
 		size_t org_i = i;
 
 		for (size_t w = 1, k = BASE; true; k += BASE) {




More information about the Scummvm-git-logs mailing list