Changeset 5c977dd in buchla-68k


Ignore:
Timestamp:
11/11/2017 10:35:13 PM (6 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
f537c48
Parents:
572daa7
Message:

Fixed etioas.c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ram/etioas.c

    r572daa7 r5c977dd  
    5959                if (E_NULL NE (ep = findev(p_cur, t_cur, EV_ASGN, -1, -1))) {
    6060
    61                         ep->e_data1 = ival;
     61                        ep->e_data1 = (int8_t)ival;
    6262
    6363                } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
    6464
    6565                        ep->e_type  = EV_ASGN;
    66                         ep->e_data1 = ival;
     66                        ep->e_data1 = (int8_t)ival;
    6767                        ep->e_time  = t_cur;
    6868                        p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
     
    109109
    110110        ec = stccol - cfetp->flcol;
    111         ebuf[ec]  = k + '0';
     111        ebuf[ec]  = (int8_t)(k + '0');
    112112
    113113        if (v_regs[5] & 0x0180)
     
    135135        (void)n;
    136136
    137         ebuf[0] = '0' + curtun;
     137        ebuf[0] = (int8_t)('0' + curtun);
    138138        ebuf[1] = '\0';
    139139        ebflag = TRUE;
     
    163163                if (E_NULL NE (ep = findev(p_cur, t_cur, EV_TUNE, -1, -1))) {
    164164
    165                         ep->e_data1 = ival;
     165                        ep->e_data1 = (int8_t)ival;
    166166
    167167                } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
    168168
    169169                        ep->e_type = EV_TUNE;
    170                         ep->e_data1 = ival;
     170                        ep->e_data1 = (int8_t)ival;
    171171                        ep->e_time = t_cur;
    172172                        p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
     
    209209        (void)n;
    210210
    211         ebuf[0]  = k + '0';
     211        ebuf[0]  = (int8_t)(k + '0');
    212212
    213213        if (v_regs[5] & 0x0180)
     
    269269                if (E_NULL NE (ep = findev(p_cur, t_cur, EV_TMPO, -1, -1))) {
    270270
    271                         ep->e_data1 = ival;
     271                        ep->e_data1 = (int8_t)ival;
    272272
    273273                } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
    274274
    275275                        ep->e_type  = EV_TMPO;
    276                         ep->e_data1 = ival;
     276                        ep->e_data1 = (int8_t)ival;
    277277                        ep->e_time  = t_cur;
    278278                        p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
     
    320320
    321321        ec = stccol - cfetp->flcol;
    322         ebuf[ec]  = k + '0';
     322        ebuf[ec]  = (int8_t)(k + '0');
    323323
    324324        if (v_regs[5] & 0x0180)
     
    353353        sf = 100L;
    354354        tt = fromfpu(curintp);
    355         th = tt / sc;
    356         tl = (tt - (th * sc)) / sf;
     355        th = (int16_t)(tt / sc);
     356        tl = (int16_t)((tt - (th * sc)) / sf);
    357357
    358358        sprintf(ebuf, "%02d.%d", th, tl);
     
    382382
    383383        for (i = 0; i < 2; i++)         /* convert from ASCII to binary */
    384                 tmpval = (tmpval * 10) + (ebuf[i] - '0');
    385 
    386         tmpval = ((tmpval * 10) + (ebuf[3] - '0')) * 100;
     384                tmpval = (tmpval * 10) + (uint16_t)(ebuf[i] - '0');
     385
     386        tmpval = ((tmpval * 10) + (uint16_t)(ebuf[3] - '0')) * 100;
    387387
    388388        if (tmpval > (uint16_t)64900)
     
    398398                if (E_NULL NE (ep = findev(p_cur, t_cur, EV_INTP, -1, -1))) {
    399399
    400                         ep->e_data1 = (curintp >> 8);
    401                         ep->e_data2 = 0x00FF & curintp;
     400                        ep->e_data1 = (int8_t)(curintp >> 8);
     401                        ep->e_data2 = (int8_t)(0x00FF & curintp);
    402402
    403403                } else if (E_NULL NE (ep = e_alc(E_SIZE3))) {
     
    405405                        ep->e_type  = EV_INTP;
    406406                        ep->e_time  = t_cur;
    407                         ep->e_data1 = (curintp >> 8);
    408                         ep->e_data2 = 0x00FF & curintp;
     407                        ep->e_data1 = (int8_t)(curintp >> 8);
     408                        ep->e_data2 = (int8_t)(0x00FF & curintp);
    409409                        p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
    410410                        eh_ins(ep, EH_INTP);
     
    434434        sf = 100L;
    435435        tt = fromfpu(curintp);
    436         th = tt / sc;
    437         tl = (tt - (th * sc)) / sf;
     436        th = (int16_t)(tt / sc);
     437        tl = (int16_t)((tt - (th * sc)) / sf);
    438438
    439439        sprintf(dspbuf, "%02d.%d", th, tl);     /* convert to ASCII */
     
    469469                return(FAILURE);
    470470
    471         ebuf[ec] = k + '0';
     471        ebuf[ec] = (int8_t)(k + '0');
    472472        ebuf[2] = '.';
    473473        ebuf[4] = '\0';
    474474
    475         dspbuf[0] = k + '0';
     475        dspbuf[0] = (int8_t)(k + '0');
    476476        dspbuf[1] = '\0';
    477477
Note: See TracChangeset for help on using the changeset viewer.