Changeset e2707e9 in buchla-68k


Ignore:
Timestamp:
11/12/2017 09:06:15 PM (6 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
57425b6
Parents:
bbf1e66
Message:

Fixed dec2fr.c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ram/dec2fr.c

    rbbf1e66 re2707e9  
    4949
    5050                                if (s[3] EQ '-')
    51                                         return(0x8000);  /* -100 */
     51                                        return(-32768);  /* -100 */
    5252                                else
    53                                         return(0x7FFF);  /* +100 */
     53                                        return(32767);  /* +100 */
    5454
    5555                        } else {
    5656
    57                                 return(0xFFFF); /* ERROR */
     57                                return(-1);     /* ERROR */
    5858                        }
    5959
    6060                } else {
    6161
    62                         return(0xFFFF); /* ERROR */
     62                        return(-1);     /* ERROR */
    6363
    6464                }
     
    6666        } else if (s[0] EQ '0') {
    6767
    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);
    6969
    7070                if (s[3] EQ '-') {
     
    8181        }
    8282
    83         return(0xFFFF); /* ERROR */
     83        return(-1);     /* ERROR */
    8484}
    8585
     
    110110        }
    111111
    112         if (v & 0x8000) {
     112        if (v & (int16_t)0x8000) {
    113113
    114114                v = ~v;         /* negative number */
Note: See TracChangeset for help on using the changeset viewer.