Skip to content

Commit

Permalink
Clang: Fixed compiler warnings about sizeof() usage
Browse files Browse the repository at this point in the history
Clang says that in these cases the value returned by sizeof() is not
what was intended. Modified the sizeof()s to behave correctly.
  • Loading branch information
skyjake committed Jul 19, 2012
1 parent 986e876 commit 819a3b5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/render/rend_bias.c
Expand Up @@ -628,7 +628,7 @@ static void updateAffected2(biassurface_t* bsuf, const struct rvertex_s* rvertic
bsuf->updated = lastChangeOnFrame;
aff.affected = bsuf->affected;
aff.numFound = 0;
memset(aff.affected, -1, sizeof(aff.affected));
memset(aff.affected, -1, sizeof(bsuf->affected)); // array of MAX_BIAS_AFFECTED

for(i = 0, src = sources; i < numSources; ++i, ++src)
{
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/render/rend_fakeradio.c
Expand Up @@ -472,7 +472,7 @@ static void scanEdges(shadowcorner_t topCorners[2],

side = line->L_sidedef(sid);

memset(sideCorners, 0, sizeof(sideCorners));
memset(sideCorners, 0, sizeof(shadowcorner_t) * 2);

// Find the sidecorners first: left and right neighbour.
for(i = 0; i < 2; ++i)
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/render/rend_font.c
Expand Up @@ -273,7 +273,7 @@ void FR_SetTracking(int value)
void FR_ColorAndAlpha(float rgba[4])
{
errorIfNotInited("FR_ColorAndAlpha");
memcpy(rgba, currentAttribs()->rgba, sizeof(rgba));
memcpy(rgba, currentAttribs()->rgba, sizeof(rgba[0]) * 4);
}

/// @note Member of the Doomsday public API.
Expand Down

0 comments on commit 819a3b5

Please sign in to comment.