TAPE: Simplify range expression to avoid cast size reduction

This commit is contained in:
Mark Pizzolato 2014-12-31 13:53:48 -08:00 committed by Leo Broukhis
parent 8d11de76c1
commit bb42ce6486

View file

@ -884,8 +884,9 @@ switch (f) { /* the read method depen
break; break;
} }
else if (uptr->pos < bufcap * sizeof (t_mtrlnt)) /* if less than a full buffer remains */ else if (uptr->pos < sizeof (buffer)) /* if less than a full buffer remains */
bufcap = (uint32)(uptr->pos / sizeof (t_mtrlnt));/* then reduce the capacity accordingly */ bufcap = (uint32) uptr->pos /* then reduce the capacity accordingly */
/ sizeof (t_mtrlnt);
sim_fseek (uptr->fileref, /* seek back to the location */ sim_fseek (uptr->fileref, /* seek back to the location */
uptr->pos - bufcap * sizeof (t_mtrlnt), /* corresponding to the start */ uptr->pos - bufcap * sizeof (t_mtrlnt), /* corresponding to the start */