Quellcode durchsuchen

Use unsigned values with bits.

woollybah vor 6 Jahren
Ursprung
Commit
5f06341a44
1 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen
  1. 8 2
      ctranslator.bmx

+ 8 - 2
ctranslator.bmx

@@ -2103,8 +2103,14 @@ t:+"NULLNULLNULL"
 			End If
 		End If
 		
-		If (expr.op = "shr" Or expr.op = "&" Or expr.op = "|") And TIntType(expr.exprType) Then
-			t_lhs = "(unsigned int)(" + t_lhs + ")"
+		If (expr.op = "shr" Or expr.op = "&" Or expr.op = "|") Then
+			If TIntType(expr.exprType) Then
+				t_lhs = "(unsigned int)(" + t_lhs + ")"
+				t_rhs = "(unsigned int)(" + t_rhs + ")"
+			Else If TLongType(expr.exprType) Then
+				t_lhs = "(unsigned long long)(" + t_lhs + ")"
+				t_rhs = "(unsigned long long)(" + t_rhs + ")"
+			End If
 		End If
 
 		If TBinaryCompareExpr(expr) Then