mirror of
https://github.com/open-goal/jak-project
synced 2026-08-01 16:29:37 -04:00
[decompiler] Make addition nicer (#733)
* temp * update refs * update reference * fix tests
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
;; definition for method 5 of type string
|
||||
(defmethod asize-of string ((obj string))
|
||||
(+ (+ (-> obj allocated-length) 1) (the-as int (-> string size)))
|
||||
(+ (-> obj allocated-length) 1 (-> string size))
|
||||
)
|
||||
|
||||
;; definition for function copy-string<-string
|
||||
@@ -46,7 +46,7 @@
|
||||
(object-new
|
||||
allocation
|
||||
type-to-make
|
||||
(+ (+ s2-1 1) (the-as int (-> type-to-make size)))
|
||||
(+ s2-1 1 (-> type-to-make size))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -57,11 +57,7 @@
|
||||
(else
|
||||
(let
|
||||
((v0-2
|
||||
(object-new
|
||||
allocation
|
||||
type-to-make
|
||||
(+ (+ arg0 1) (the-as int (-> type-to-make size)))
|
||||
)
|
||||
(object-new allocation type-to-make (+ arg0 1 (-> type-to-make size)))
|
||||
)
|
||||
)
|
||||
(set! (-> v0-2 allocated-length) arg0)
|
||||
@@ -532,34 +528,16 @@
|
||||
(>= (-> next-char-2 0) (the-as uint 65))
|
||||
(>= (the-as uint 70) (-> next-char-2 0))
|
||||
)
|
||||
(set!
|
||||
result
|
||||
(the-as
|
||||
int
|
||||
(+ (+ (-> next-char-2 0) -55) (the-as uint (* result 16)))
|
||||
)
|
||||
)
|
||||
(set! result (the-as int (+ (-> next-char-2 0) -55 (* result 16))))
|
||||
)
|
||||
((and
|
||||
(>= (-> next-char-2 0) (the-as uint 97))
|
||||
(>= (the-as uint 102) (-> next-char-2 0))
|
||||
)
|
||||
(set!
|
||||
result
|
||||
(the-as
|
||||
int
|
||||
(+ (+ (-> next-char-2 0) -87) (the-as uint (* result 16)))
|
||||
)
|
||||
)
|
||||
(set! result (the-as int (+ (-> next-char-2 0) -87 (* result 16))))
|
||||
)
|
||||
(else
|
||||
(set!
|
||||
result
|
||||
(the-as
|
||||
int
|
||||
(+ (+ (-> next-char-2 0) -48) (the-as uint (* result 16)))
|
||||
)
|
||||
)
|
||||
(set! result (the-as int (+ (-> next-char-2 0) -48 (* result 16))))
|
||||
)
|
||||
)
|
||||
(set! next-char-2 (&-> next-char-2 1))
|
||||
@@ -573,10 +551,7 @@
|
||||
(>= (-> a0-4 0) (the-as uint 48))
|
||||
(>= (the-as uint 49) (-> a0-4 0))
|
||||
)
|
||||
(set!
|
||||
result
|
||||
(the-as int (+ (+ (-> a0-4 0) -48) (the-as uint (* result 2))))
|
||||
)
|
||||
(set! result (the-as int (+ (-> a0-4 0) -48 (* result 2))))
|
||||
(set! a0-4 (&-> a0-4 1))
|
||||
)
|
||||
)
|
||||
@@ -594,10 +569,7 @@
|
||||
(>= (-> str-ptr 0) (the-as uint 48))
|
||||
(>= (the-as uint 57) (-> str-ptr 0))
|
||||
)
|
||||
(set!
|
||||
result
|
||||
(the-as int (+ (+ (-> str-ptr 0) -48) (the-as uint (* 10 result))))
|
||||
)
|
||||
(set! result (the-as int (+ (-> str-ptr 0) -48 (* 10 result))))
|
||||
(set! str-ptr (&-> str-ptr 1))
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user