Skip to content

Commit

Permalink
gcc11 -Wall -Wpedantic cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dlmiles committed Jan 6, 2025
1 parent 3df2aaa commit 07f9bbe
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 31 deletions.
4 changes: 2 additions & 2 deletions calma/CalmaWrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ calmaWriteUseFunc(
if (whichangle)
{
calmaOutRH(12, CALMA_ANGLE, CALMA_R8, f);
calmaOut8(whichangle, f);
calmaOut8((char *)whichangle, f);
}

/* Translation */
Expand Down Expand Up @@ -1638,7 +1638,7 @@ calmaWriteUseFunc(
if (whichangle)
{
calmaOutRH(12, CALMA_ANGLE, CALMA_R8, f);
calmaOut8(whichangle, f);
calmaOut8((char *)whichangle, f);
}

/* If array, number of columns and rows in the array */
Expand Down
4 changes: 2 additions & 2 deletions calma/CalmaWriteZ.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ calmaWriteUseFuncZ(
if (whichangle)
{
calmaOutRHZ(12, CALMA_ANGLE, CALMA_R8, f);
calmaOut8Z(whichangle, f);
calmaOut8Z((char *)whichangle, f);
}

/* Translation */
Expand Down Expand Up @@ -1479,7 +1479,7 @@ calmaWriteUseFuncZ(
if (whichangle)
{
calmaOutRHZ(12, CALMA_ANGLE, CALMA_R8, f);
calmaOut8Z(whichangle, f);
calmaOut8Z((char *)whichangle, f);
}

/* If array, number of columns and rows in the array */
Expand Down
6 changes: 3 additions & 3 deletions cmwind/CMWmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ extern void CMWundoInit(void);
* which pump is hit and which mouse button is used to hit it.
*/

const ColorBar const colorBars[] =
const ColorBar colorBars[] =
{
{"Red", CB_RED, STYLE_RED, {{ 2000, 8000}, {10000, 9000}},
{{ 2000, 9500}, {10000, 10500}}},
Expand All @@ -106,7 +106,7 @@ const ColorBar const colorBars[] =
{0}
};

const ColorPump const colorPumps[] =
const ColorPump colorPumps[] =
{
{CB_RED, -.0078, {{ 500, 8000}, { 1500, 9000}}},
{CB_RED, .0078, {{10500, 8000}, {11500, 9000}}},
Expand Down Expand Up @@ -155,7 +155,7 @@ CMWcreate(
char *argv[])
{
CMWclientRec *crec;
int color;
unsigned int color;

crec = (CMWclientRec *) mallocMagic(sizeof(CMWclientRec));
window->w_clientData = (ClientData) crec;
Expand Down
2 changes: 1 addition & 1 deletion commands/CmdE.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ cmdEditRedisplayFunc(
MagWindow *w, /* Window containing edit cell. */
Rect *area) /* Area to be redisplayed. */
{
static const Rect origin = {-1, -1, 1, 1};
static const Rect origin = {{-1, -1}, {1, 1}};
Rect tmp;
DBWclientRec *crec = (DBWclientRec *) w->w_clientData;

Expand Down
2 changes: 1 addition & 1 deletion commands/CmdTZ.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ CmdTech(
Tcl_SetResult(magicinterp, DBTechName, NULL);
break;
case TECH_FILE:
Tcl_SetResult(magicinterp, TechFileName, NULL);
Tcl_SetResult(magicinterp, (char *)TechFileName, NULL);
break;
case TECH_VERSION:
Tcl_SetResult(magicinterp, DBTechVersion, NULL);
Expand Down
4 changes: 2 additions & 2 deletions dbwind/DBWdisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ dbwTileFunc(tile)
}
else
{
(void) sprintf(string, "%p", tile);
(void) sprintf(string, "%p", (void *) tile);
}

GeoClip(&r2, &rootClip);
Expand Down Expand Up @@ -1258,7 +1258,7 @@ dbwTileFunc(tile)
}
else if (!dbwSeeTypes)
{
(void) sprintf(string, "%p", stitch);
(void) sprintf(string, "%p", (void *) stitch);
GrPutText(string, STYLE_DRAWTILE, &p, pos,
GR_TEXT_SMALL, FALSE, &r2, (Rect *) NULL);
}
Expand Down
2 changes: 1 addition & 1 deletion drc/DRCtech.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ DRCPrintStyle(dolist, doforall, docurrent)
if (!dolist) TxPrintf("The current style is \"");
#ifdef MAGIC_WRAPPER
if (dolist)
Tcl_SetResult(magicinterp, DRCCurStyle->ds_name, NULL);
Tcl_SetResult(magicinterp, (char *)DRCCurStyle->ds_name, NULL);
else
#endif
TxPrintf("%s", DRCCurStyle->ds_name);
Expand Down
2 changes: 1 addition & 1 deletion ext2spice/ext2spice.c
Original file line number Diff line number Diff line change
Expand Up @@ -3810,7 +3810,7 @@ nodeVisitDebug(node, res, cap)

printf("\t client.name=%s, client.m_w=%p\n",
((nodeClient *)node->efnode_client)->spiceNodeName,
((nodeClient *)node->efnode_client)->m_w.widths);
(void *)((nodeClient *)node->efnode_client)->m_w.widths);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion extract/ExtTech.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ ExtPrintStyle(dolist, doforall, docurrent)
if (!dolist) TxPrintf("The current style is \"");
#ifdef MAGIC_WRAPPER
if (dolist)
Tcl_SetResult(magicinterp, ExtCurStyle->exts_name, NULL);
Tcl_SetResult(magicinterp, (char *) ExtCurStyle->exts_name, NULL);
else
#endif
TxPrintf("%s", ExtCurStyle->exts_name);
Expand Down
2 changes: 1 addition & 1 deletion gcr/gcrDebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ gcrSaveChannel(ch)
char name[128];
int flags, i, j;

(void) sprintf(name, "chan.%p", ch);
(void) sprintf(name, "chan.%p", (void *) ch);
fp = fopen(name, "w");
if (fp == NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion gcr/gcrShwFlgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ gcrDumpChannel(ch)
FILE * fp, * fopen();

netNames[0]=(GCRNet *) 0;
(void) snprintf(name, sizeof(name), "channel.%p", ch);
(void) snprintf(name, sizeof(name), "channel.%p", (void *) ch);
if((fp = fopen(name, "w")) == NULL)
{
TxError("Can't open file %s to dump channel.\n", name);
Expand Down
12 changes: 10 additions & 2 deletions graphics/grDStyle.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,16 @@ styleBuildDisplayStyle(line, version)
*/

/* Allow colors to be specified by index or by name */
if (sscanf(colorName, ((version > 6) ? "%i" : "%o"), &color) <= 0)
color = GrNameToColor(colorName);
if (version > 6)
{
if (sscanf(colorName, "%i", &color) <= 0)
color = GrNameToColor(colorName);
}
else
{
if (sscanf(colorName, "%o", (unsigned int *)&color) <= 0)
color = GrNameToColor(colorName);
}

newstyle->style.mask = (mask & grBitPlaneMask);
newstyle->style.color = (color & grBitPlaneMask);
Expand Down
6 changes: 3 additions & 3 deletions grouter/grouteChan.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ glChanCheckFunc(tile, ch)
{
TITORECT(tile, &r);
(void) sprintf(mesg, "Tile client 0x%"DLONG_PREFIX"x doesn't match chan %p",
(dlong) tile->ti_client, ch);
(dlong) tile->ti_client, (void *) ch);
DBWFeedbackAdd(&r, mesg, EditCellUse->cu_def,
1, STYLE_MEDIUMHIGHLIGHTS);
}
Expand Down Expand Up @@ -421,7 +421,7 @@ glChanClip(ch)
{
char mesg[256];

(void) sprintf(mesg, "After clipping chan %p", ch);
(void) sprintf(mesg, "After clipping chan %p", (void *) ch);
glChanShowTiles(mesg);
}

Expand Down Expand Up @@ -471,7 +471,7 @@ glChanShowFunc(tile)
return 0;
ch = (GCRChannel *) tile->ti_client;
ShowRect(EditCellUse->cu_def, &ch->gcr_area, STYLE_MEDIUMHIGHLIGHTS);
(void) sprintf(mesg, "chan %p type=%d", ch, ch->gcr_type);
(void) sprintf(mesg, "chan %p type=%d", (void *) ch, ch->gcr_type);
TxMore(mesg);
ShowRect(EditCellUse->cu_def, &ch->gcr_area, STYLE_ERASEHIGHLIGHTS);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion mzrouter/mzEstimate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ mzDumpEstFunc(tile, fd)
if(fd)
{
fprintf(fd,"\ntile %p\t\t (x: %d to %d, y: %d to %d)\n",
tile, r.r_xbot, r.r_xtop, r.r_ybot, r.r_ytop);
(void *) tile, r.r_xbot, r.r_xtop, r.r_ybot, r.r_ytop);
fprintf(fd,"\thcost = %d ",
tilec->tc_hCost);
fprintf(fd,"vcost = %d \n",
Expand Down
6 changes: 4 additions & 2 deletions plot/plotVers.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ PlotVersTechLine(sectionName, argc, argv)
}
else
{
int i, value;
unsigned int value;
int i;

if (argc != 17)
{
Expand Down Expand Up @@ -440,7 +441,8 @@ PlotColorVersTechLine(sectionName, argc, argv)
}
else
{
int i, j, value;
unsigned int value;
int i, j;

if (argc != 3 && argc != 4 && argc != 6 && argc != 10 && argc != 18)
{
Expand Down
2 changes: 1 addition & 1 deletion resis/ResDebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ResPrintNodeList(fp, list)
for (; list != NULL; list = list->rn_more)
{
fprintf(fp, "node %p: (%d %d) r= %d\n",
list, list->rn_loc.p_x, list->rn_loc.p_y, list->rn_noderes);
(void *) list, list->rn_loc.p_x, list->rn_loc.p_y, list->rn_noderes);
}
}

Expand Down
4 changes: 2 additions & 2 deletions router/rtrFdback.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ RtrChannelError(ch, col, track, msg, net)
netname = NLNetName(net);
if ((strlen(netname) + strlen(msg)) >= 2048)
netname = "too long";
(void) sprintf(buff, "Net `%s', channel %p: ", netname, ch);
(void) sprintf(buff, "Net `%s', channel %p: ", netname, (void *) ch);
}
else
{
(void) sprintf(buff, "channel %p: ", ch);
(void) sprintf(buff, "channel %p: ", (void *) ch);
}
(void) strcat(buff, msg);
old.p_x = col;
Expand Down
2 changes: 1 addition & 1 deletion router/rtrPin.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void rtrPinShow(pin)
pin->gcr_ch->gcr_type,
pin->gcr_x, pin->gcr_y,
pin->gcr_point.p_x, pin->gcr_point.p_y,
(dlong) pin->gcr_pId, pin->gcr_linked);
(dlong) pin->gcr_pId, (void *) pin->gcr_linked);
if (pin->gcr_pId || pin->gcr_linked == NULL)
(void) strcat(mesg, " **BLOCKED**");
else DBWFeedbackAdd(&r, mesg, EditCellUse->cu_def, 1, STYLE_PALEHIGHLIGHTS);
Expand Down
5 changes: 3 additions & 2 deletions tiles/tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,9 @@ tiPrint(tp)
Tile *tp;
{
printf("tp=%p LL=(%d,%d) body=0x%"DLONG_PREFIX"x\n",
tp, LEFT(tp), BOTTOM(tp), (dlong) tp->ti_body);
printf("BL=%p LB=%p RT=%p TR=%p\n", BL(tp), LB(tp), RT(tp), TR(tp));
(void *) tp, LEFT(tp), BOTTOM(tp), (dlong) tp->ti_body);
printf("BL=%p LB=%p RT=%p TR=%p\n",
(void *) BL(tp), (void *) LB(tp), (void *) RT(tp), (void *) TR(tp));
}

void
Expand Down
2 changes: 1 addition & 1 deletion utils/netlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ NLNetName(net)
term = net->nnet_terms;
if (term == NULL || term->nterm_name == NULL)
{
(void) sprintf(tempId, "[%p]", net);
(void) sprintf(tempId, "[%p]", (void *) net);
return tempId;
}

Expand Down

0 comments on commit 07f9bbe

Please sign in to comment.