mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 22:41:30 +03:00
Fix some cppcheck variableHidingTypedef warnings
This commit is contained in:
parent
65adc17121
commit
ba5bae389b
@ -337,20 +337,20 @@ APTR ami_colormap_to_clut(struct ColorMap *cmap)
|
||||
{
|
||||
int i;
|
||||
UBYTE *clut = AllocVecTags(256 * 4, AVT_ClearWithValue, 0, TAG_DONE); /* NB: Was not MEMF_PRIVATE */
|
||||
ULONG colour[256 * 4];
|
||||
ULONG colr[256 * 4];
|
||||
|
||||
if(!clut) return NULL;
|
||||
|
||||
/* Get the palette from the ColorMap */
|
||||
GetRGB32(cmap, 0, 256, (ULONG *)&colour);
|
||||
GetRGB32(cmap, 0, 256, (ULONG *)&colr);
|
||||
|
||||
/* convert it to a table of ARGB values */
|
||||
for(i = 0; i < 1024; i += 4)
|
||||
{
|
||||
clut[i] = (0xff << 24) |
|
||||
((colour[i] & 0xff000000) >> 8) |
|
||||
((colour[i + 1] & 0xff000000) >> 16) |
|
||||
((colour[i + 2] & 0xff000000) >> 24);
|
||||
((colr[i] & 0xff000000) >> 8) |
|
||||
((colr[i + 1] & 0xff000000) >> 16) |
|
||||
((colr[i + 2] & 0xff000000) >> 24);
|
||||
}
|
||||
|
||||
return clut;
|
||||
|
@ -31,7 +31,7 @@ ULONG numcols;
|
||||
ULONG findcolour(ULONG newcol)
|
||||
{
|
||||
ULONG i;
|
||||
ULONG colour = 0xFFFFFFFF;
|
||||
ULONG colr = 0xFFFFFFFF;
|
||||
UBYTE red,grn,blu;
|
||||
|
||||
red = svgtiny_RED(newcol);
|
||||
@ -41,20 +41,20 @@ ULONG findcolour(ULONG newcol)
|
||||
for(i=0;i<numcols;i++)
|
||||
{
|
||||
if((cm[i].red == red) && (cm[i].green == grn) && (cm[i].blue == blu))
|
||||
colour = i;
|
||||
colr = i;
|
||||
}
|
||||
|
||||
return colour;
|
||||
return colr;
|
||||
}
|
||||
|
||||
void addcolour(ULONG newcol)
|
||||
{
|
||||
ULONG colour;
|
||||
ULONG colr;
|
||||
UBYTE red,grn,blu;
|
||||
|
||||
colour = findcolour(newcol);
|
||||
colr = findcolour(newcol);
|
||||
|
||||
if(colour == 0xFFFFFFFF)
|
||||
if(colr == 0xFFFFFFFF)
|
||||
{
|
||||
cm[numcols].red = svgtiny_RED(newcol);
|
||||
cm[numcols].green = svgtiny_GREEN(newcol);
|
||||
|
@ -239,16 +239,16 @@ void ami_clearclipreg(struct gui_globals *gg)
|
||||
gg->rect.MaxY = scrn->Height-1;
|
||||
}
|
||||
|
||||
static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colour)
|
||||
static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colr)
|
||||
{
|
||||
struct ami_plot_pen *node;
|
||||
ULONG pen = ObtainBestPenA(scrn->ViewPort.ColorMap,
|
||||
(colour & 0x000000ff) << 24,
|
||||
(colour & 0x0000ff00) << 16,
|
||||
(colour & 0x00ff0000) << 8,
|
||||
(colr & 0x000000ff) << 24,
|
||||
(colr & 0x0000ff00) << 16,
|
||||
(colr & 0x00ff0000) << 8,
|
||||
NULL);
|
||||
|
||||
if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colour));
|
||||
if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colr));
|
||||
|
||||
if(shared_pens != NULL) {
|
||||
if(node = (struct ami_plot_pen *)AllocVecTagList(sizeof(struct ami_plot_pen), NULL)) {
|
||||
@ -278,26 +278,26 @@ void ami_plot_release_pens(struct MinList *shared_pens)
|
||||
}while(node = nnode);
|
||||
}
|
||||
|
||||
static void ami_plot_setapen(ULONG colour)
|
||||
static void ami_plot_setapen(ULONG colr)
|
||||
{
|
||||
if(palette_mapped == false) {
|
||||
SetRPAttrs(glob->rp, RPTAG_APenColor,
|
||||
ns_color_to_nscss(colour),
|
||||
ns_color_to_nscss(colr),
|
||||
TAG_DONE);
|
||||
} else {
|
||||
ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour);
|
||||
ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
|
||||
if(pen != -1) SetAPen(glob->rp, pen);
|
||||
}
|
||||
}
|
||||
|
||||
static void ami_plot_setopen(ULONG colour)
|
||||
static void ami_plot_setopen(ULONG colr)
|
||||
{
|
||||
if(palette_mapped == false) {
|
||||
SetRPAttrs(glob->rp, RPTAG_OPenColor,
|
||||
ns_color_to_nscss(colour),
|
||||
ns_color_to_nscss(colr),
|
||||
TAG_DONE);
|
||||
} else {
|
||||
ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour);
|
||||
ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
|
||||
if(pen != -1) SetOPen(glob->rp, pen);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user