Changeset e2707e9 in buchla-68k
- Timestamp:
- 11/12/2017 09:06:15 PM (7 years ago)
- Branches:
- master
- Children:
- 57425b6
- Parents:
- bbf1e66
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ram/dec2fr.c
rbbf1e66 re2707e9 49 49 50 50 if (s[3] EQ '-') 51 return( 0x8000); /* -100 */51 return(-32768); /* -100 */ 52 52 else 53 return( 0x7FFF); /* +100 */53 return(32767); /* +100 */ 54 54 55 55 } else { 56 56 57 return( 0xFFFF); /* ERROR */57 return(-1); /* ERROR */ 58 58 } 59 59 60 60 } else { 61 61 62 return( 0xFFFF); /* ERROR */62 return(-1); /* ERROR */ 63 63 64 64 } … … 66 66 } else if (s[0] EQ '0') { 67 67 68 i = ( d2f[0][s[1] - '0'] + d2f[1][s[2] - '0']) >> 1;68 i = (int16_t)((d2f[0][s[1] - '0'] + d2f[1][s[2] - '0']) >> 1); 69 69 70 70 if (s[3] EQ '-') { … … 81 81 } 82 82 83 return( 0xFFFF); /* ERROR */83 return(-1); /* ERROR */ 84 84 } 85 85 … … 110 110 } 111 111 112 if (v & 0x8000) {112 if (v & (int16_t)0x8000) { 113 113 114 114 v = ~v; /* negative number */
Note:
See TracChangeset
for help on using the changeset viewer.