Browse Source

Remove redundant parentheses from conditionals

no longer needed since #8353
Jens Fischer 6 years ago
parent
commit
d69665e1a2

+ 1 - 1
std/UnicodeString.hx

@@ -103,7 +103,7 @@ abstract UnicodeString(String) from String to String {
 		}
 		}
 	}
 	}
 
 
-#if (target.unicode)
+#if target.unicode
 
 
 	/**
 	/**
 		The number of characters in `this` String.
 		The number of characters in `this` String.

+ 1 - 1
std/haxe/EntryPoint.hx

@@ -1,6 +1,6 @@
 package haxe;
 package haxe;
 
 
-#if (target.threaded)
+#if target.threaded
 import sys.thread.Lock;
 import sys.thread.Lock;
 import sys.thread.Mutex;
 import sys.thread.Mutex;
 import sys.thread.Thread;
 import sys.thread.Thread;

+ 2 - 2
std/haxe/crypto/Md5.hx

@@ -133,7 +133,7 @@ class Md5 {
 	}
 	}
 
 
 	static function str2blks( str : String ){
 	static function str2blks( str : String ){
-#if (target.unicode)
+#if target.unicode
 		var str = haxe.io.Bytes.ofString(str);
 		var str = haxe.io.Bytes.ofString(str);
 #end
 #end
 		var nblk = ((str.length + 8) >> 6) + 1;
 		var nblk = ((str.length + 8) >> 6) + 1;
@@ -153,7 +153,7 @@ class Md5 {
 		var max = str.length;
 		var max = str.length;
 		var l = max * 8;
 		var l = max * 8;
 		while( i < max ) {
 		while( i < max ) {
-			blks[i >> 2] |= #if (target.unicode) str.get(i) #else StringTools.fastCodeAt(str, i) #end << (((l + i) % 4) * 8);
+			blks[i >> 2] |= #if target.unicode str.get(i) #else StringTools.fastCodeAt(str, i) #end << (((l + i) % 4) * 8);
 			i++;
 			i++;
 		}
 		}
 		blks[i >> 2] |= 0x80 << (((l + i) % 4) * 8);
 		blks[i >> 2] |= 0x80 << (((l + i) % 4) * 8);

+ 2 - 2
std/haxe/crypto/Sha1.hx

@@ -95,7 +95,7 @@ class Sha1 {
 		Append padding bits and the length, as described in the SHA1 standard.
 		Append padding bits and the length, as described in the SHA1 standard.
 	 */
 	 */
 	static function str2blks( s :String ) : Array<Int> {
 	static function str2blks( s :String ) : Array<Int> {
-#if (target.unicode)
+#if target.unicode
 		var s = haxe.io.Bytes.ofString(s);
 		var s = haxe.io.Bytes.ofString(s);
 #end
 #end
 		var nblk = ((s.length + 8) >> 6) + 1;
 		var nblk = ((s.length + 8) >> 6) + 1;
@@ -105,7 +105,7 @@ class Sha1 {
 			blks[i] = 0;
 			blks[i] = 0;
 		for (i in 0...s.length){
 		for (i in 0...s.length){
 			var p = i >> 2;
 			var p = i >> 2;
-			blks[p] |= #if (target.unicode) s.get(i) #else StringTools.fastCodeAt(s,i) #end << (24 - ((i & 3) << 3));
+			blks[p] |= #if target.unicode s.get(i) #else StringTools.fastCodeAt(s,i) #end << (24 - ((i & 3) << 3));
 		}
 		}
 		var i = s.length;
 		var i = s.length;
 		var p = i >> 2;
 		var p = i >> 2;

+ 2 - 2
std/haxe/crypto/Sha256.hx

@@ -105,7 +105,7 @@ class Sha256 {
 		Append padding bits and the length, as described in the SHA1 standard.
 		Append padding bits and the length, as described in the SHA1 standard.
 	 */
 	 */
 	static function str2blks( s :String ) : Array<Int> {
 	static function str2blks( s :String ) : Array<Int> {
-#if (target.unicode)
+#if target.unicode
 		var s = haxe.io.Bytes.ofString(s);
 		var s = haxe.io.Bytes.ofString(s);
 #end
 #end
 		var nblk = ((s.length + 8) >> 6) + 1;
 		var nblk = ((s.length + 8) >> 6) + 1;
@@ -115,7 +115,7 @@ class Sha256 {
 			blks[i] = 0;
 			blks[i] = 0;
 		for (i in 0...s.length){
 		for (i in 0...s.length){
 			var p = i >> 2;
 			var p = i >> 2;
-			blks[p] |= #if (target.unicode) s.get(i) #else s.charCodeAt(i) #end << (24 - ((i & 3) << 3));
+			blks[p] |= #if target.unicode s.get(i) #else s.charCodeAt(i) #end << (24 - ((i & 3) << 3));
 		}
 		}
 		var i = s.length;
 		var i = s.length;
 		var p = i >> 2;
 		var p = i >> 2;

+ 4 - 4
std/haxe/format/JsonParser.hx

@@ -152,7 +152,7 @@ class JsonParser {
 	function parseString() {
 	function parseString() {
 		var start = pos;
 		var start = pos;
 		var buf:StringBuf = null;
 		var buf:StringBuf = null;
-		#if (target.unicode)
+		#if target.unicode
 		var prev = -1;
 		var prev = -1;
 		inline function cancelSurrogate() {
 		inline function cancelSurrogate() {
 			// invalid high surrogate (not followed by low surrogate)
 			// invalid high surrogate (not followed by low surrogate)
@@ -170,7 +170,7 @@ class JsonParser {
 				}
 				}
 				buf.addSub(str,start, pos - start - 1);
 				buf.addSub(str,start, pos - start - 1);
 				c = nextChar();
 				c = nextChar();
-				#if (target.unicode)
+				#if target.unicode
 				if( c != "u".code && prev != -1 ) cancelSurrogate();
 				if( c != "u".code && prev != -1 ) cancelSurrogate();
 				#end
 				#end
 				switch( c ) {
 				switch( c ) {
@@ -183,7 +183,7 @@ class JsonParser {
 				case 'u'.code:
 				case 'u'.code:
 					var uc:Int = Std.parseInt("0x" + str.substr(pos, 4));
 					var uc:Int = Std.parseInt("0x" + str.substr(pos, 4));
 					pos += 4;
 					pos += 4;
-					#if !(target.unicode)
+					#if !target.unicode
 					if( uc <= 0x7F )
 					if( uc <= 0x7F )
 						buf.addChar(uc);
 						buf.addChar(uc);
 					else if( uc <= 0x7FF ) {
 					else if( uc <= 0x7FF ) {
@@ -230,7 +230,7 @@ class JsonParser {
 			else if( StringTools.isEof(c) )
 			else if( StringTools.isEof(c) )
 				throw "Unclosed string";
 				throw "Unclosed string";
 		}
 		}
-		#if (target.unicode)
+		#if target.unicode
 		if( prev != -1 )
 		if( prev != -1 )
 			cancelSurrogate();
 			cancelSurrogate();
 		#end
 		#end

+ 1 - 1
tests/unit/src/unit/issues/Issue7449.hx

@@ -4,7 +4,7 @@ class Issue7449 extends unit.Test {
 	/**
 	/**
 	 * Not happens since https://github.com/HaxeFoundation/haxe/pull/8141
 	 * Not happens since https://github.com/HaxeFoundation/haxe/pull/8141
 	 */
 	 */
-	// #if (target.unicode)
+	// #if target.unicode
 	// function test() {
 	// function test() {
 	// 	eq(220, "\xDC".charCodeAt(0));
 	// 	eq(220, "\xDC".charCodeAt(0));
 	// }
 	// }

+ 2 - 2
tests/unit/src/unitstd/String.unit.hx

@@ -204,13 +204,13 @@ testKeyCodes([for(i => c in iterator) [i, c]]);
 ("a" > "b") == false;
 ("a" > "b") == false;
 ("a" >= "b") == false;
 ("a" >= "b") == false;
 
 
-#if (target.unicode)
+#if target.unicode
 ("𠜎zя" > "abя") == true;
 ("𠜎zя" > "abя") == true;
 ("𠜎zя" >= "abя") == true;
 ("𠜎zя" >= "abя") == true;
 ("𠜎zя" < "abя") == false;
 ("𠜎zя" < "abя") == false;
 ("𠜎zя" <= "abя") == false;
 ("𠜎zя" <= "abя") == false;
 
 
-#if (target.utf16)
+#if target.utf16
 // since U+10002 in UTF16 is D800 DC02
 // since U+10002 in UTF16 is D800 DC02
 ("\u{FF61}" < "\u{10002}") == false;
 ("\u{FF61}" < "\u{10002}") == false;
 #else
 #else

+ 1 - 1
tests/unit/src/unitstd/Unicode.unit.hx

@@ -1,4 +1,4 @@
-#if (target.unicode) // neko and cpp with -D disable_unicode_strings will not be made Unicode compatible
+#if target.unicode // neko and cpp with -D disable_unicode_strings will not be made Unicode compatible
 
 
 
 
 var s = String.fromCharCode(0xE9);
 var s = String.fromCharCode(0xE9);

+ 1 - 1
tests/unit/src/unitstd/UnicodeString.unit.hx

@@ -1,4 +1,4 @@
-#if (target.unicode)
+#if target.unicode
 var s = new UnicodeString("𠜎zя");
 var s = new UnicodeString("𠜎zя");
 var codes = [132878, 122, 1103];
 var codes = [132878, 122, 1103];
 
 

+ 1 - 1
tests/unit/src/unitstd/haxe/iterators/StringIteratorUnicode.unit.hx

@@ -6,7 +6,7 @@ function traverse(s:String) {
 	return a;
 	return a;
 }
 }
 
 
-#if (target.unicode)
+#if target.unicode
 
 
 traverse("abcde") == ["a".code, "b".code, "c".code, "d".code, "e".code];
 traverse("abcde") == ["a".code, "b".code, "c".code, "d".code, "e".code];
 traverse("aa😂éé") == ["a".code, "a".code, "😂".code, "é".code, "é".code];
 traverse("aa😂éé") == ["a".code, "a".code, "😂".code, "é".code, "é".code];

+ 1 - 1
tests/unit/src/unitstd/haxe/iterators/StringKeyValueIteratorUnicode.unit.hx

@@ -8,7 +8,7 @@ function traverse(s:String) {
 	return { k: ak, v: av };
 	return { k: ak, v: av };
 }
 }
 
 
-#if (target.unicode)
+#if target.unicode
 
 
 var r = traverse("abcde");
 var r = traverse("abcde");
 r.k == [0, 1, 2, 3, 4];
 r.k == [0, 1, 2, 3, 4];