Skip to content
Permalink
Browse files

Fix warnings in overlay_gl when built with GCC 5.2.1 for i386.

  • Loading branch information...
mkrautz committed Nov 1, 2015
1 parent c1b6110 commit e4c80dac75bd45f4fb18ff4a97a47a939d275919
Showing with 6 additions and 5 deletions.
  1. +6 −5 overlay_gl/overlay.c
@@ -345,7 +345,7 @@ static void drawOverlay(Context *ctx, unsigned int width, unsigned int height) {
disconnect(ctx); disconnect(ctx);
return; return;
} else if (length != ctx->omMsg.omh.iLength) { } else if (length != ctx->omMsg.omh.iLength) {
ods("Short overlay message read %x %ld/%d", ctx->omMsg.omh.uiType, length, ctx->omMsg.omh.iLength); ods("Short overlay message read %x %zd/%d", ctx->omMsg.omh.uiType, length, ctx->omMsg.omh.iLength);
disconnect(ctx); disconnect(ctx);
return; return;
} }
@@ -363,10 +363,11 @@ static void drawOverlay(Context *ctx, unsigned int width, unsigned int height) {
struct stat buf; struct stat buf;


if (fstat(fd, &buf) != -1) { if (fstat(fd, &buf) != -1) {
if (buf.st_size >= ctx->uiWidth * ctx->uiHeight * 4 unsigned int buflen = buf.st_size;
&& buf.st_size < 512 * 1024 * 1024) { if (buflen >= ctx->uiWidth * ctx->uiHeight * 4
ctx->uiMappedLength = (unsigned int)buf.st_size; && buflen < 512 * 1024 * 1024) {
ctx->a_ucTexture = mmap(NULL, (size_t)buf.st_size, PROT_READ, MAP_SHARED, fd, 0); ctx->uiMappedLength = buflen;
ctx->a_ucTexture = mmap(NULL, (size_t)buflen, PROT_READ, MAP_SHARED, fd, 0);
if (ctx->a_ucTexture != MAP_FAILED) { if (ctx->a_ucTexture != MAP_FAILED) {
// mmap successfull; send a new bodyless sharedmemory overlay message and regenerate the overlay texture // mmap successfull; send a new bodyless sharedmemory overlay message and regenerate the overlay texture
struct OverlayMsg om; struct OverlayMsg om;

0 comments on commit e4c80da

Please sign in to comment.
You can’t perform that action at this time.