You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2019/02/04 07:19:21 UTC

[royale-asjs] branch develop updated: Avoid a GCC warning after recent compiler changes: 'WARNING - Suspicious code. The result of the ‘rsh’ operator is not being used. v < 0 && (v = (-(v ^ org.apache.royale.net.remoting.amf.AMFBinaryData.UINT_MAX_VALUE) - 1)) >> 0;'

This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 4c27828  Avoid a GCC warning after recent compiler changes: 'WARNING - Suspicious code. The result of the ‘rsh’ operator is not being used.  v < 0 && (v = (-(v ^ org.apache.royale.net.remoting.amf.AMFBinaryData.UINT_MAX_VALUE) - 1)) >> 0;'
     new 2f19a69  Merge branch 'develop' of https://github.com/apache/royale-asjs into develop
4c27828 is described below

commit 4c27828483a6c6e9a712caa65b55e14fa944a794
Author: greg-dove <gr...@gmail.com>
AuthorDate: Mon Feb 4 20:18:53 2019 +1300

    Avoid a GCC warning after recent compiler changes:
    'WARNING - Suspicious code. The result of the ‘rsh’ operator is not being used.
     v < 0 && (v = (-(v ^ org.apache.royale.net.remoting.amf.AMFBinaryData.UINT_MAX_VALUE) - 1)) >> 0;'
---
 .../main/royale/org/apache/royale/net/remoting/amf/AMFBinaryData.as | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFBinaryData.as b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFBinaryData.as
index d1076da..db1a4e9 100644
--- a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFBinaryData.as
+++ b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/remoting/amf/AMFBinaryData.as
@@ -271,7 +271,11 @@ package org.apache.royale.net.remoting.amf {
 		}
 		
 		public function writeUInt32(v:int):void {
-			v < 0 && (v = -(v ^ UINT_MAX_VALUE) - 1);
+		//	v < 0 && (v = -(v ^ UINT_MAX_VALUE) - 1);
+			//avoid compiler warning after numeric coercion changes:
+			if (v <0) {
+				v = -(v ^ UINT_MAX_VALUE) - 1;
+			}
 			v &= UINT_MAX_VALUE;
 			this.write((v >>> 24) & 255);
 			this.write((v >>> 16) & 255);