As the width and height are defined as static, no need to initialize it again to zero. Also removed checks for 'valid pointers' as it is redundant.

Thanks,
Vikram
>From f87e11aa9067237ad6a5edd722d873960171604e Mon Sep 17 00:00:00 2001
From: Vikram Narayanan <vikram...@gmail.com>
Date: Sat, 17 Mar 2012 14:21:32 +0530
Subject: [PATCH] ecore/ecore_fb: Tweaks in _ecore_fb_size_get

As the width and height are defined as static, no need
to initialize it again to zero.

Signed-off-by: Vikram Narayanan <vikram...@gmail.com>
---
 src/lib/ecore_fb/ecore_fb.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/lib/ecore_fb/ecore_fb.c b/src/lib/ecore_fb/ecore_fb.c
index ca7d73d..daeea0f 100644
--- a/src/lib/ecore_fb/ecore_fb.c
+++ b/src/lib/ecore_fb/ecore_fb.c
@@ -92,21 +92,18 @@ _ecore_fb_size_get(int *w, int *h)
 
    fb = open("/dev/fb0", O_RDWR);
    if (fb < 0)
-     {
-        if (w) *w = 0;
-        if (h) *h = 0;
-        return;
-     }
+      goto exit;
+
    if (ioctl(fb, FBIOGET_VSCREENINFO, &fb_var) == -1)
-     {
-        if (w) *w = 0;
-        if (h) *h = 0;
-        close(fb);
-        return;
-     }
+      goto err_ioctl;
+
+   *w = fb_var.xres;
+   *h = fb_var.yres;
+
+err_ioctl:
    close(fb);
-   if (w) *w = fb_var.xres;
-   if (h) *h = fb_var.yres;
+exit:
+   return;
 }
 
 /**
-- 
1.7.4.1

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to