diff options
author | Kissaki <kissaki@gmx.de> | 2013-06-12 00:21:42 +0400 |
---|---|---|
committer | Kissaki <kissaki@gmx.de> | 2013-06-12 01:03:32 +0400 |
commit | 07c78b1481c4a3d889bcffd5cdbe8ab0776c4f53 (patch) | |
tree | 9598d83aa212e2a1aaf46f3d7809b1c0e44c4221 /overlay_gl | |
parent | f09e943b6cc6965578dc41ae5dbde89b11729aa0 (diff) |
Refac: Use constant to check return value
* mmap supposedly returns MAP_FAILED on errors, which is supposedly
defined in <sys/mman.h>, which is already being included in this file.
Diffstat (limited to 'overlay_gl')
-rw-r--r-- | overlay_gl/overlay.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/overlay_gl/overlay.c b/overlay_gl/overlay.c index b20f47091..3f9e6c957 100644 --- a/overlay_gl/overlay.c +++ b/overlay_gl/overlay.c @@ -329,8 +329,7 @@ static void drawOverlay(Context *ctx, unsigned int width, unsigned int height) { if (buf.st_size >= ctx->uiWidth * ctx->uiHeight * 4) { ctx->uiMappedLength = buf.st_size; ctx->a_ucTexture = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0); - //TODO shouldn't -1 be MAP_FAILED ? - if (ctx->a_ucTexture != (unsigned char *) -1) { + if (ctx->a_ucTexture != MAP_FAILED) { // mmap successfull; send a new bodyless sharedmemory overlay message and regenerate the overlay texture struct OverlayMsg om; om.omh.uiMagic = OVERLAY_MAGIC_NUMBER; |