Skip to content

Commit df652b4

Browse files
committed
[mscgen] Declared some variables as pointer to const
Found by Cppcheck (constVariablePointer)
1 parent 8c2a629 commit df652b4

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

deps/libmscgen/gd_lodepng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BGD_DECLARE(void) gdImagePng (gdImagePtr im, FILE * outFile)
1414
int *pThisRow = *ptpixels++;
1515
for (x=0;x<im->sx;x++)
1616
{
17-
int thisPixel = *pThisRow++;
17+
const int thisPixel = *pThisRow++;
1818
*pOut++ = gdTrueColorGetRed(thisPixel);
1919
*pOut++ = gdTrueColorGetGreen(thisPixel);
2020
*pOut++ = gdTrueColorGetBlue(thisPixel);

deps/libmscgen/mscgen_gd_out.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ void gdoTextR(struct ADrawTag *ctx,
287287
unsigned int y,
288288
const char *string)
289289
{
290-
GdoContext *context = getGdoCtx(ctx);
290+
const GdoContext *context = getGdoCtx(ctx);
291291
#ifdef USE_FREETYPE
292292
int rect[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
293293
const char *r;

deps/libmscgen/mscgen_msc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ const char *MscGetCurrentArcAttrib(struct MscTag *m, MscAttribType a)
746746

747747
Boolean MscGetOptAsFloat(struct MscTag *m, MscOptType type, float *const f)
748748
{
749-
struct MscOptTag *opt = MscFindOpt(m->optList, type);
749+
const struct MscOptTag *opt = MscFindOpt(m->optList, type);
750750

751751
if(opt != NULL)
752752
{

deps/libmscgen/mscgen_ps_out.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ void PsTextR(struct ADrawTag *ctx,
268268
unsigned int y,
269269
const char *string)
270270
{
271-
PsContext *context = getPsCtx(ctx);
271+
const PsContext *context = getPsCtx(ctx);
272272

273273
/* Push the string and get its width */
274274
fprintf(getPsFile(ctx), "(");
@@ -300,7 +300,7 @@ void PsTextL(struct ADrawTag *ctx,
300300
unsigned int y,
301301
const char *string)
302302
{
303-
PsContext *context = getPsCtx(ctx);
303+
const PsContext *context = getPsCtx(ctx);
304304

305305
/* Draw the background box */
306306
setColour(ctx, context->penBgColour);
@@ -327,7 +327,7 @@ void PsTextC(struct ADrawTag *ctx,
327327
unsigned int y,
328328
const char *string)
329329
{
330-
PsContext *context = getPsCtx(ctx);
330+
const PsContext *context = getPsCtx(ctx);
331331

332332
/* Push the string and get its width */
333333
fprintf(getPsFile(ctx), "(");

deps/libmscgen/mscgen_svg_out.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ void SvgTextR(struct ADrawTag *ctx,
301301
unsigned int y,
302302
const char *string)
303303
{
304-
SvgContext *context = getSvgCtx(ctx);
304+
const SvgContext *context = getSvgCtx(ctx);
305305

306306
svgRect(ctx, getSvgBgPen(ctx), x - 2, y - SvgTextHeight(ctx) + 1, x + SvgTextWidth(ctx, string), y - 1);
307307

@@ -320,7 +320,7 @@ void SvgTextL(struct ADrawTag *ctx,
320320
unsigned int y,
321321
const char *string)
322322
{
323-
SvgContext *context = getSvgCtx(ctx);
323+
const SvgContext *context = getSvgCtx(ctx);
324324

325325
svgRect(ctx, getSvgBgPen(ctx), x - (SvgTextWidth(ctx, string) + 2), y - SvgTextHeight(ctx) + 1, x, y - 1);
326326

@@ -341,7 +341,7 @@ void SvgTextC(struct ADrawTag *ctx,
341341
unsigned int y,
342342
const char *string)
343343
{
344-
SvgContext *context = getSvgCtx(ctx);
344+
const SvgContext *context = getSvgCtx(ctx);
345345
unsigned int hw = SvgTextWidth(ctx, string) / 2;
346346

347347
svgRect(ctx, getSvgBgPen(ctx), x - (hw + 2), y - SvgTextHeight(ctx) + 1, x + hw, y - 1);

0 commit comments

Comments
 (0)