diff --git a/database/DBundo.c b/database/DBundo.c index 56a6bc94..73b98414 100644 --- a/database/DBundo.c +++ b/database/DBundo.c @@ -260,7 +260,7 @@ dbUndoSplitForw(us) { /* Create internal fracture */ if (dbUndoLastCell == NULL) return; - DBSplitTile(dbUndoLastCell->cd_planes[us->sue_plane], &us->sue_point, + DBSplitTile(dbUndoLastCell->cd_planes[(unsigned char)us->sue_plane], &us->sue_point, us->sue_splitx); } @@ -276,7 +276,7 @@ dbUndoSplitBack(us) srect.r_ur.p_y = us->sue_point.p_y + 1; /* Remove internal fracture and restore original split tile */ - DBMergeNMTiles0(dbUndoLastCell->cd_planes[us->sue_plane], &srect, + DBMergeNMTiles0(dbUndoLastCell->cd_planes[(unsigned char)us->sue_plane], &srect, (PaintUndoInfo *)NULL, TRUE); } @@ -314,20 +314,20 @@ dbUndoPaintForw(up) loctype = (up->pue_oldtype & TT_LEFTMASK); dinfo = TT_DIAGONAL | (up->pue_oldtype & TT_DIRECTION); - DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], - dinfo, &up->pue_rect, DBStdEraseTbl(loctype, up->pue_plane), + DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], + dinfo, &up->pue_rect, DBStdEraseTbl(loctype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); loctype = (up->pue_oldtype & TT_RIGHTMASK) >> 14; dinfo |= TT_SIDE; - DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], - dinfo, &up->pue_rect, DBStdEraseTbl(loctype, up->pue_plane), + DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], + dinfo, &up->pue_rect, DBStdEraseTbl(loctype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); } else - DBPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], &up->pue_rect, - DBStdEraseTbl(up->pue_oldtype, up->pue_plane), + DBPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], &up->pue_rect, + DBStdEraseTbl(up->pue_oldtype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); if (up->pue_newtype & TT_DIAGONAL) @@ -335,20 +335,20 @@ dbUndoPaintForw(up) loctype = (up->pue_newtype & TT_LEFTMASK); dinfo = TT_DIAGONAL | (up->pue_newtype & TT_DIRECTION); - DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], - dinfo, &up->pue_rect, DBStdPaintTbl(loctype, up->pue_plane), + DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], + dinfo, &up->pue_rect, DBStdPaintTbl(loctype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); loctype = (up->pue_newtype & TT_RIGHTMASK) >> 14; dinfo |= TT_SIDE; - DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], - dinfo, &up->pue_rect, DBStdPaintTbl(loctype, up->pue_plane), + DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], + dinfo, &up->pue_rect, DBStdPaintTbl(loctype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); } else - DBPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], &up->pue_rect, - DBStdPaintTbl(up->pue_newtype, up->pue_plane), + DBPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], &up->pue_rect, + DBStdPaintTbl(up->pue_newtype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); endPaintFor: dbUndoUndid = TRUE; @@ -368,20 +368,20 @@ dbUndoPaintBack(up) loctype = (up->pue_newtype & TT_LEFTMASK); dinfo = TT_DIAGONAL | (up->pue_newtype & TT_DIRECTION); - DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], - dinfo, &up->pue_rect, DBStdEraseTbl(loctype, up->pue_plane), + DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], + dinfo, &up->pue_rect, DBStdEraseTbl(loctype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); loctype = (up->pue_newtype & TT_RIGHTMASK) >> 14; dinfo |= TT_SIDE; - DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], - dinfo, &up->pue_rect, DBStdEraseTbl(loctype, up->pue_plane), + DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], + dinfo, &up->pue_rect, DBStdEraseTbl(loctype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); } else - DBPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], &up->pue_rect, - DBStdEraseTbl(up->pue_newtype, up->pue_plane), + DBPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], &up->pue_rect, + DBStdEraseTbl(up->pue_newtype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); if (up->pue_oldtype & TT_DIAGONAL) @@ -389,23 +389,23 @@ dbUndoPaintBack(up) loctype = (up->pue_oldtype & TT_LEFTMASK); dinfo = TT_DIAGONAL | (up->pue_oldtype & TT_DIRECTION); - DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], dinfo, - &up->pue_rect, DBStdPaintTbl(loctype, up->pue_plane), + DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], dinfo, + &up->pue_rect, DBStdPaintTbl(loctype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); loctype = (up->pue_oldtype & TT_RIGHTMASK) >> 14; dinfo |= TT_SIDE; - DBNMPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], dinfo, - &up->pue_rect, DBStdPaintTbl(loctype, up->pue_plane), + DBNMPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], dinfo, + &up->pue_rect, DBStdPaintTbl(loctype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); - DBMergeNMTiles0(dbUndoLastCell->cd_planes[up->pue_plane], + DBMergeNMTiles0(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], &up->pue_rect, (PaintUndoInfo *)NULL, TRUE); } else - DBPaintPlane(dbUndoLastCell->cd_planes[up->pue_plane], &up->pue_rect, - DBStdPaintTbl(up->pue_oldtype, up->pue_plane), + DBPaintPlane(dbUndoLastCell->cd_planes[(unsigned char)up->pue_plane], &up->pue_rect, + DBStdPaintTbl(up->pue_oldtype, (unsigned char)up->pue_plane), (PaintUndoInfo *) NULL); endPaintBack: diff --git a/extflat/EFbuild.c b/extflat/EFbuild.c index 684f2895..20c31830 100644 --- a/extflat/EFbuild.c +++ b/extflat/EFbuild.c @@ -1045,7 +1045,7 @@ efBuildDevice(def, class, type, r, argc, argv) && (ttype != extGetDevType(EFDevTypes[newdev->dev_type])))) { TxError("Device %s %s at (%d, %d) overlaps incompatible device %s %s!\n", - extDevTable[class], type, r->r_xbot, r->r_ybot, + extDevTable[(unsigned char)class], type, r->r_xbot, r->r_ybot, extDevTable[newdev->dev_class], EFDevTypes[newdev->dev_type]); return 0; } @@ -1053,7 +1053,7 @@ efBuildDevice(def, class, type, r, argc, argv) { TxError("Device %s %s at (%d, %d) overlaps device with incompatible" " number of terminals (%d vs. %d)!\n", - extDevTable[class], type, r->r_xbot, r->r_ybot, nterminals, + extDevTable[(unsigned char)class], type, r->r_xbot, r->r_ybot, nterminals, newdev->dev_nterm); return 0; } diff --git a/extract/ExtBasic.c b/extract/ExtBasic.c index a776b893..2c73d98c 100644 --- a/extract/ExtBasic.c +++ b/extract/ExtBasic.c @@ -2355,7 +2355,7 @@ extOutputDevices(def, transList, outFile) { case DEV_FET: /* old style, perimeter & area */ fprintf(outFile, "%s %s", - extDevTable[devptr->exts_deviceClass], + extDevTable[(unsigned char)devptr->exts_deviceClass], devptr->exts_deviceName); fprintf(outFile, " %d %d %d %d", @@ -2490,7 +2490,7 @@ extOutputDevices(def, transList, outFile) devptr = extDevFindParamMatch(devptr, length, width); fprintf(outFile, "%s %s", - extDevTable[devptr->exts_deviceClass], + extDevTable[(unsigned char)devptr->exts_deviceClass], devptr->exts_deviceName); fprintf(outFile, " %d %d %d %d", @@ -2516,7 +2516,7 @@ extOutputDevices(def, transList, outFile) case DEV_PDIODE: devptr = extDevFindParamMatch(devptr, length, width); fprintf(outFile, "%s %s", - extDevTable[devptr->exts_deviceClass], + extDevTable[(unsigned char)devptr->exts_deviceClass], devptr->exts_deviceName); fprintf(outFile, " %d %d %d %d", @@ -2641,7 +2641,7 @@ extOutputDevices(def, transList, outFile) devptr = extDevFindParamMatch(devptr, length, width); fprintf(outFile, "%s %s", - extDevTable[devptr->exts_deviceClass], + extDevTable[(unsigned char)devptr->exts_deviceClass], devptr->exts_deviceName); fprintf(outFile, " %d %d %d %d", @@ -2675,7 +2675,7 @@ extOutputDevices(def, transList, outFile) case DEV_CAPREV: case DEV_CSUBCKT: fprintf(outFile, "%s %s", - extDevTable[devptr->exts_deviceClass], + extDevTable[(unsigned char)devptr->exts_deviceClass], devptr->exts_deviceName); fprintf(outFile, " %d %d %d %d", diff --git a/plot/plotRutils.c b/plot/plotRutils.c index ec0e2485..8b4b22ee 100644 --- a/plot/plotRutils.c +++ b/plot/plotRutils.c @@ -710,7 +710,7 @@ PlotTextSize(font, string, area) { if ((*string == ' ') || (*string == '\t')) d = &font->fo_chars['t']; - else d = &font->fo_chars[*string]; + else d = &font->fo_chars[(unsigned char)*string]; if (d->nbytes == 0) continue; if (d->up > area->r_ytop) area->r_ytop = d->up; @@ -783,7 +783,7 @@ PlotRasterText(raster, clip, font, string, point) * area of the raster. */ - d = &font->fo_chars[*string]; + d = &font->fo_chars[(unsigned char)*string]; cBytesPerLine = (d->left + d->right + 7) >> 3; for (i = 0; i < d->up + d->down; i++) { diff --git a/resis/ResPrint.c b/resis/ResPrint.c index 49e8c537..50397eca 100644 --- a/resis/ResPrint.c +++ b/resis/ResPrint.c @@ -140,7 +140,7 @@ ResPrintExtDev(outextfile, devices) fprintf(outextfile,"device "); fprintf(outextfile,"%s %s %d %d %d %d ", - extDevTable[devptr->exts_deviceClass], + extDevTable[(unsigned char)devptr->exts_deviceClass], devptr->exts_deviceName, devices->layout->rd_inside.r_ll.p_x, devices->layout->rd_inside.r_ll.p_y,