瀏覽代碼

Now uses bbStringEquals() for string equality check. Resolves #471.

woollybah 6 年之前
父節點
當前提交
25881395de
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      ctranslator.bmx

+ 5 - 1
ctranslator.bmx

@@ -2292,7 +2292,11 @@ t:+"NULLNULLNULL"
 					t_rhs = "&bbEmptyString"
 					t_rhs = "&bbEmptyString"
 				End If
 				End If
 				If t_lhs <> "&bbEmptyString" And t_rhs <> "&bbEmptyString" Then
 				If t_lhs <> "&bbEmptyString" And t_rhs <> "&bbEmptyString" Then
-					Return "bbStringCompare" + Bra(t_lhs + ", " + t_rhs) + TransBinaryOp(expr.op, "") + "0"
+					If expr.op = "=" Or expr.op = "<>" Then
+						Return "bbStringEquals" + Bra(t_lhs + ", " + t_rhs) + TransBinaryOp(expr.op, "") + "1"
+					Else
+						Return "bbStringCompare" + Bra(t_lhs + ", " + t_rhs) + TransBinaryOp(expr.op, "") + "0"
+					End If
 				End If
 				End If
 			Else If IsPointerType(TBinaryCompareExpr(expr).ty, 0, TType.T_POINTER) Then
 			Else If IsPointerType(TBinaryCompareExpr(expr).ty, 0, TType.T_POINTER) Then
 				If t_lhs="&bbNullObject" Then
 				If t_lhs="&bbNullObject" Then