Skip to content

Commit 7e7ea81

Browse files
committed
Avoid problem on negation
1 parent bb2a4d8 commit 7e7ea81

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

libogc/pad.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ static s8 __pad_clampS8(s8 var,s8 org)
159159
printf("__pad_clampS8(%d,%d)\n",var,org);
160160
#endif
161161
siorg = (s32)org;
162-
if(siorg>0) {
163-
siorg -= 128;
162+
if(siorg>=0) {
163+
siorg -= INT8_MAX;
164164
if((s32)var<siorg) var = siorg;
165-
} else if(siorg<0) {
166-
siorg += 127;
165+
} else {
166+
siorg += INT8_MAX;
167167
if(siorg<(s32)var) var = siorg;
168168
}
169169
#ifdef _PAD_DEBUG

0 commit comments

Comments
 (0)