Skip to content

Commit 6f342df

Browse files
committed
added missing sizeof() where applicable
1 parent 19a9505 commit 6f342df

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

SRC/BITMAP.C

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void gfx_drawBitmap(const gfx_Bitmap *bmp, int x, int y, gfx_drawBuffer *target)
142142
for(j = 0; j < height - offscreenY; ++j)
143143
{
144144
memcpy(&dstBuff[screenOffset + j * buffer->width],
145-
&bmpBuff[offscreenX + (j + offscreenY) * bmp->width], width);
145+
&bmpBuff[offscreenX + (j + offscreenY) * bmp->width], sizeof(uint8_t) * width);
146146
}
147147
}
148148

@@ -175,11 +175,11 @@ void gfx_drawBitmapOffset(const gfx_Bitmap *bmp, int x, int y, int xOffset, int
175175
if(scanlineLength > drawWidth) scanlineLength = drawWidth;
176176

177177
memcpy(&dstBuff[screenOffset + j * buffer->width],
178-
&bmpBuff[(xOffset + (j + yOffset + offscreenY) * bmp->width) % texArea], scanlineLength);
178+
&bmpBuff[(xOffset + (j + yOffset + offscreenY) * bmp->width) % texArea], sizeof(uint8_t) * scanlineLength);
179179

180180
if(drawWidth > scanlineLength)
181181
memcpy(&dstBuff[screenOffset + j * buffer->width + scanlineLength],
182-
&bmpBuff[(j + yOffset + offscreenY) * bmp->width % texArea], drawWidth - scanlineLength);
182+
&bmpBuff[(j + yOffset + offscreenY) * bmp->width % texArea], sizeof(uint8_t) * (drawWidth - scanlineLength));
183183
}
184184
}
185185

SRC/GRAPHICS.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ void gfx_blitBuffer(int x, int y, const gfx_drawBuffer *src, gfx_drawBuffer *dst
159159
for(i = 0; i < height - startY; ++i)
160160
{
161161
memcpy(&dstBuff[startX + x + (startY + i + y) * buffer->width],
162-
&srcBuff[startX + (startY + i ) * src->width], width);
162+
&srcBuff[startX + (startY + i ) * src->width], sizeof(uint8_t) * width);
163163
}
164164
}
165165

166166
/* ***** */
167167
void gfx_updateScreen(gfx_drawBuffer *src)
168168
{
169-
memcpy(VGA_BUFFER.colorBuffer, src->colorBuffer, VGA_BUFFER.width * VGA_BUFFER.height);
169+
memcpy(VGA_BUFFER.colorBuffer, src->colorBuffer, sizeof(uint8_t) * VGA_BUFFER.width * VGA_BUFFER.height);
170170
}
171171

172172
/* ***** */

0 commit comments

Comments
 (0)