mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-09-01 10:39:43 +02:00
Fixed unused-parameters/unused-variables warnings
Added a ARG_UNUSED macro in utils/magic.h, which produces a simple cast to void to silence the warnings. The reasons this is used as opposed to an attribute is that most compilers should support this. Besides this, the macro can be easily searched for in the future to potentially remove (where possible) the unused parameters.
This commit is contained in:
+1
-1
@@ -90,6 +90,7 @@ CmdPlot(w, cmd)
|
||||
MagWindow *w;
|
||||
TxCommand *cmd;
|
||||
{
|
||||
ARG_UNUSED(w);
|
||||
int option;
|
||||
const char * const *msg;
|
||||
MagWindow *window;
|
||||
@@ -97,7 +98,6 @@ CmdPlot(w, cmd)
|
||||
TileTypeBitMask mask;
|
||||
CellDef *boxRootDef;
|
||||
SearchContext scx;
|
||||
float width;
|
||||
int iwidth, scale;
|
||||
|
||||
#if defined(HAVE_LIBCAIRO) && defined(MAGIC_WRAPPER)
|
||||
|
||||
@@ -211,6 +211,9 @@ PlotGremlinTechLine(sectionName, argc, argv)
|
||||
int argc; /* Number of arguments on line (unused). */
|
||||
char *argv[]; /* Pointers to fields of line (unused). */
|
||||
{
|
||||
ARG_UNUSED(sectionName);
|
||||
ARG_UNUSED(argc);
|
||||
ARG_UNUSED(argv);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -299,7 +299,7 @@ PlotDumpHPRTL(hpfile, kRaster, cRaster, mRaster, yRaster)
|
||||
Raster *mRaster;
|
||||
Raster *yRaster;
|
||||
{
|
||||
int line, count, line_offset = 0;
|
||||
int line, count;
|
||||
int ipl, bpl;
|
||||
register int *c, *m, *y, *k;
|
||||
unsigned char *obytes; /* bytes to output (compressed) */
|
||||
|
||||
+4
-4
@@ -398,7 +398,7 @@ pnmTile (tile, cxp)
|
||||
if (IsSplit(tile))
|
||||
{
|
||||
TileType dinfo;
|
||||
int w, h, llx, lly, urx, ury;
|
||||
int llx, lly, urx, ury;
|
||||
Rect scaledClip;
|
||||
|
||||
type = (SplitSide(tile)) ? SplitRightType(tile) : SplitLeftType(tile);
|
||||
@@ -577,9 +577,8 @@ PlotPNM(fileName, scx, layers, xMask, width)
|
||||
*/
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
Rect bbox;
|
||||
int bb_ysize, bb_xsize;
|
||||
int i, x, y, tile_ydelta;
|
||||
int x, y, tile_ydelta;
|
||||
int save_ds, iter;
|
||||
int scale_over_2, ds_over_2;
|
||||
float *strip = NULL;
|
||||
@@ -1132,6 +1131,7 @@ PlotPNMTechLine(sectionName, argc, argv)
|
||||
int argc; /* Number of arguments on line. */
|
||||
char *argv[]; /* Pointers to fields of line. */
|
||||
{
|
||||
ARG_UNUSED(sectionName);
|
||||
int i, j, k, style;
|
||||
void PlotPNMSetDefaults(); /* Forward declaration */
|
||||
|
||||
@@ -1356,7 +1356,7 @@ PlotLoadStyles(filename)
|
||||
char fullName[256];
|
||||
char *buf;
|
||||
int newsec;
|
||||
int ord, mask, color, outline, nfill, stipple;
|
||||
int ord, mask, color, outline, stipple;
|
||||
int ir, ig, ib;
|
||||
char shortname;
|
||||
char longname[128];
|
||||
|
||||
+3
-5
@@ -111,7 +111,6 @@ static PSStyle *curStyle; /* Current style being output. */
|
||||
static PSColor *curColor; /* Current color being output. */
|
||||
static PSPattern *curPattern; /* Current pattern being output. */
|
||||
static int curLineWidth; /* Current line width */
|
||||
static int curFont; /* Current font */
|
||||
static TileTypeBitMask curMask; /* Layers currently being searched: this
|
||||
* is the AND of the mask from curStyle and
|
||||
* the layers that the user specified.
|
||||
@@ -174,7 +173,6 @@ PSReset()
|
||||
void
|
||||
PlotPSTechInit()
|
||||
{
|
||||
int i, j;
|
||||
PSStyle *style;
|
||||
PSColor *color;
|
||||
PSPattern *pattern;
|
||||
@@ -230,6 +228,7 @@ PlotPSTechLine(sectionName, argc, argv)
|
||||
int argc; /* Number of arguments on line. */
|
||||
char *argv[]; /* Pointers to fields of line. */
|
||||
{
|
||||
ARG_UNUSED(sectionName);
|
||||
PSStyle *newstyle;
|
||||
PSColor *newcolor;
|
||||
PSPattern *newpattern;
|
||||
@@ -382,7 +381,7 @@ plotPSLine(p1, p2)
|
||||
* coordinates.
|
||||
*/
|
||||
{
|
||||
int x1, x2, y1, y2, limit, diff;
|
||||
int x1, x2, y1, y2, limit;
|
||||
bool tmptf;
|
||||
|
||||
/* Clip the line to the rectangular area being output. First,
|
||||
@@ -525,7 +524,6 @@ plotPSPaint(tile, cxp)
|
||||
* to corner, and skip the rest of this procedure.
|
||||
*/
|
||||
|
||||
Point ul, lr;
|
||||
|
||||
if (curLineWidth != PS_MEDIUM) {
|
||||
fprintf(file, "l2\n");
|
||||
@@ -1135,7 +1133,7 @@ PlotPS(fileName, scx, layers, xMask)
|
||||
{
|
||||
int xsize, ysize;
|
||||
float yscale;
|
||||
int i, j;
|
||||
int j;
|
||||
int twidth, theight;
|
||||
char *fontptr, *fptr2, *fptr3;
|
||||
char line_in[100];
|
||||
|
||||
@@ -177,6 +177,9 @@ PlotPixTechLine(sectionName, argc, argv)
|
||||
int argc; /* Number of arguments on line. */
|
||||
char *argv[]; /* Pointers to fields of line. */
|
||||
{
|
||||
ARG_UNUSED(sectionName);
|
||||
ARG_UNUSED(argc);
|
||||
ARG_UNUSED(argv);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -321,8 +321,8 @@ PlotVersTechLine(sectionName, argc, argv)
|
||||
int argc; /* Number of arguments on line. */
|
||||
char *argv[]; /* Pointers to fields of line. */
|
||||
{
|
||||
ARG_UNUSED(sectionName);
|
||||
VersatecStyle *new;
|
||||
int i;
|
||||
|
||||
new = (VersatecStyle *) mallocMagic(sizeof(VersatecStyle));
|
||||
|
||||
@@ -408,6 +408,7 @@ PlotColorVersTechLine(sectionName, argc, argv)
|
||||
int argc; /* Number of arguments on line. */
|
||||
char *argv[]; /* Pointers to fields of line. */
|
||||
{
|
||||
ARG_UNUSED(sectionName);
|
||||
VersatecStyle *new;
|
||||
static const struct { const char *l_str; int l_color; } colors[] = {
|
||||
{"black", BLACK},
|
||||
@@ -420,7 +421,6 @@ PlotColorVersTechLine(sectionName, argc, argv)
|
||||
{"Y", YELLOW},
|
||||
{0}
|
||||
};
|
||||
int i;
|
||||
|
||||
new = (VersatecStyle *)mallocMagic(sizeof(VersatecStyle));
|
||||
|
||||
@@ -696,7 +696,6 @@ plotVersTile(tile, cxp)
|
||||
|
||||
if (IsSplit(tile))
|
||||
{
|
||||
int i, j;
|
||||
TileType dinfo;
|
||||
Rect r;
|
||||
|
||||
@@ -855,6 +854,7 @@ plotVersLabel(scx, label, tpath, raster)
|
||||
TerminalPath *tpath; /* Ignored. */
|
||||
Raster *raster; /* Raster to write to */
|
||||
{
|
||||
ARG_UNUSED(tpath);
|
||||
Rect rootArea, swathArea, labelSize;
|
||||
Point point;
|
||||
int pos;
|
||||
|
||||
Reference in New Issue
Block a user