Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Krautz <mikkel@krautz.dk>2015-11-01 14:16:40 +0300
committerMikkel Krautz <mikkel@krautz.dk>2015-11-09 00:50:54 +0300
commite4c80dac75bd45f4fb18ff4a97a47a939d275919 (patch)
tree98e883117efb210a49bce3d08e56f38f38d30e75 /overlay_gl
parentc1b6110b68a34857ed9ead7f9b35bd1d59e9cec8 (diff)
Fix warnings in overlay_gl when built with GCC 5.2.1 for i386.
Diffstat (limited to 'overlay_gl')
-rw-r--r--overlay_gl/overlay.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/overlay_gl/overlay.c b/overlay_gl/overlay.c
index b63e54cd3..28ee4f40c 100644
--- a/overlay_gl/overlay.c
+++ b/overlay_gl/overlay.c
@@ -345,7 +345,7 @@ static void drawOverlay(Context *ctx, unsigned int width, unsigned int height) {
disconnect(ctx);
return;
} 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);
return;
}
@@ -363,10 +363,11 @@ static void drawOverlay(Context *ctx, unsigned int width, unsigned int height) {
struct stat buf;
if (fstat(fd, &buf) != -1) {
- if (buf.st_size >= ctx->uiWidth * ctx->uiHeight * 4
- && buf.st_size < 512 * 1024 * 1024) {
- ctx->uiMappedLength = (unsigned int)buf.st_size;
- ctx->a_ucTexture = mmap(NULL, (size_t)buf.st_size, PROT_READ, MAP_SHARED, fd, 0);
+ unsigned int buflen = buf.st_size;
+ if (buflen >= ctx->uiWidth * ctx->uiHeight * 4
+ && buflen < 512 * 1024 * 1024) {
+ ctx->uiMappedLength = buflen;
+ ctx->a_ucTexture = mmap(NULL, (size_t)buflen, PROT_READ, MAP_SHARED, fd, 0);
if (ctx->a_ucTexture != MAP_FAILED) {
// mmap successfull; send a new bodyless sharedmemory overlay message and regenerate the overlay texture
struct OverlayMsg om;