Re: [E-devel] [PATCHES] Some random warning fixes for our beloved buildbot as well as a DSO fix

2012-05-04 Thread Stefan Schmidt
Hello.

> From: ChunEon Park [mailto:her...@naver.com] 
>
> Hi stefan, this is Hermet :)

Hi hermet :)

> I reviewed your patch but just submitted 2 patches, 0002, 0004

Thanks for this!

> I didn't understand why is 0001_patch needed. could you explain to me?

It shadows another variable name
ecore/src/modules/immodules/xim/ecore_imf_xim.c:116: warning: declaration of 
'index' shadows a global declaration
/usr/include/string.h:487: warning: shadowed declaration is here

Not a big deal as we should still handle it correctly but to avoid the warning 
I just renamed the variable.

> and 0003 looks it has incorrect indentations. You might know about that.

Thanks for letting me know. Need to fix this and resubmit later today or at the 
weekend.

Regards
Stefan Schmidt


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [PATCHES] Some random warning fixes for our beloved buildbot as well as a DSO fix

2012-05-04 Thread ChunEon Park
Hi stefan, this is Hermet :)


 I reviewed your patch but just submitted 2 patches, 0002, 0004


I didn't understand why is 0001_patch needed. could you explain to me?


and 0003 looks it has incorrect indentations. You might know about that.



Anyway thank you.


 
-Regards, Hermet-


-Original Message-
From: "Stefan Schmidt"<ste...@datenfreihafen.org> 
To: <enlightenment-devel@lists.sourceforge.net>; 
Cc: 
Sent: 2012-05-04 (금) 02:17:37
Subject: [E-devel] [PATCHES] Some random warning fixes for our beloved buildbot 
as well as a DSO fix

Hello.

Just 3 small fixes to get our warning count down. The tempget one
should actually save us against wrong reads.

Also a small DSO fix reported and confirmed in IRC.

Please review and apply.

regards
Stefan Schmidt
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] [PATCHES] Some random warning fixes for our beloved buildbot as well as a DSO fix

2012-05-03 Thread Stefan Schmidt
Hello.

Just 3 small fixes to get our warning count down. The tempget one
should actually save us against wrong reads.

Also a small DSO fix reported and confirmed in IRC.

Please review and apply.

regards
Stefan Schmidt
>From 2bfa5810d01c4e39fd0f8c84eed45812e39adb8a Mon Sep 17 00:00:00 2001
From: Stefan Schmidt 
Date: Wed, 18 Apr 2012 16:12:50 +0100
Subject: [PATCH 1/4] ecore_imf_xim: Rename variable to avoid shadowing

index is already used in string.h, avoid it here.
src/modules/immodules/xim/ecore_imf_xim.c:116: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:487: warning: shadowed declaration is here

---
 ecore/src/modules/immodules/xim/ecore_imf_xim.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ecore/src/modules/immodules/xim/ecore_imf_xim.c b/ecore/src/modules/immodules/xim/ecore_imf_xim.c
index 01a3576..103df66 100644
--- a/ecore/src/modules/immodules/xim/ecore_imf_xim.c
+++ b/ecore/src/modules/immodules/xim/ecore_imf_xim.c
@@ -113,14 +113,14 @@ static void  xim_destroy_callback(XIM xim,
 static unsigned int
 utf8_offset_to_index(const char *str, int offset)
 {
-   int index = 0;
+   int idx = 0;
int i;
for (i = 0; i < offset; i++)
  {
-eina_unicode_utf8_get_next(str, &index);
+eina_unicode_utf8_get_next(str, &idx);
  }
 
-   return index;
+   return idx;
 }
 
 #endif
-- 
1.7.10
>From 11ed418500dcbd2b107fd95fce8e194fbe41b8c2 Mon Sep 17 00:00:00 2001
From: Stefan Schmidt 
Date: Wed, 18 Apr 2012 16:21:12 +0100
Subject: [PATCH 2/4] ecore_test_ecore: Mark unused parameter and remove
 unused variable

Buildbot should be a bit happier with these annotations now. :)

---
 ecore/src/tests/ecore_test_ecore.c |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ecore/src/tests/ecore_test_ecore.c b/ecore/src/tests/ecore_test_ecore.c
index 3649196..a37b00d 100644
--- a/ecore/src/tests/ecore_test_ecore.c
+++ b/ecore/src/tests/ecore_test_ecore.c
@@ -156,13 +156,13 @@ START_TEST(ecore_test_ecore_main_loop_timer)
 }
 END_TEST
 
-static Eina_Bool _timer3(void *data)
+static Eina_Bool _timer3(void *data __UNUSED__)
 {
/* timer 3, do nothing */
return EINA_FALSE;
 }
 
-static Eina_Bool _timer2(void *data)
+static Eina_Bool _timer2(void *data __UNUSED__)
 {
/* timer 2, quit inner mainloop */
ecore_main_loop_quit();
@@ -287,7 +287,7 @@ START_TEST(ecore_test_ecore_main_loop_event)
 END_TEST
 
 static Eina_Bool
-_timer_quit_recursive(void *data)
+_timer_quit_recursive(void *data __UNUSED__)
 {
INF("   _timer_quit_recursive: begin");
ecore_main_loop_quit(); /* quits inner main loop */
@@ -296,9 +296,8 @@ _timer_quit_recursive(void *data)
 }
 
 static Eina_Bool
-_event_recursive_cb(void *data, int type, void *event)
+_event_recursive_cb(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
 {
-   Ecore_Event *e;
static int guard = 0;
 
/* If we enter this callback more than once, it's wrong! */
-- 
1.7.10
>From ae615c9fc65bc6c17a18e1a9b4b9e8697cc77c47 Mon Sep 17 00:00:00 2001
From: Stefan Schmidt 
Date: Wed, 18 Apr 2012 16:54:13 +0100
Subject: [PATCH 3/4] tempget: Check return values from fgets()

Without this checking we might operate on wrong data read in. Better check.

---
 e/src/modules/temperature/tempget.c |   24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/e/src/modules/temperature/tempget.c b/e/src/modules/temperature/tempget.c
index 28d3be2..a253dda 100644
--- a/e/src/modules/temperature/tempget.c
+++ b/e/src/modules/temperature/tempget.c
@@ -401,7 +401,9 @@ check(void)
 	  {
 	 char dummy[4096];
 
-	 fgets(buf, sizeof(buf), f);
+	 if (fgets(buf, sizeof(buf), f) == NULL)
+   goto error;
+
  buf[sizeof(buf) - 1] = 0;
 	 if (sscanf(buf, "%s %s %i", dummy, dummy, &temp) == 3)
 	   ret = 1;
@@ -417,7 +419,9 @@ check(void)
 	f = fopen(sensor_path, "rb");
 	if (f)
 	  {
-	 fgets(buf, sizeof(buf), f);
+	 if (fgets(buf, sizeof(buf), f) == NULL)
+   goto error;
+
 	 fclose(f);
  buf[sizeof(buf) - 1] = 0;
 	 if (sscanf(buf, "%i", &temp) == 1)
@@ -434,7 +438,9 @@ check(void)
 	f = fopen(sensor_path, "r");
 	if (f)
 	  {
-	 fgets(buf, sizeof(buf), f);
+	 if (fgets(buf, sizeof(buf), f) == NULL)
+   goto error;
+
 	 buf[sizeof(buf) - 1] = 0;
 
 	 /* actually read the temp */
@@ -453,7 +459,9 @@ check(void)
 	f = fopen(sensor_path, "r");
 	if (f)
 	  {
-	 fgets(buf, sizeof(buf), f);
+	 if (fgets(buf, sizeof(buf), f) == NULL)
+   goto error;
+
 	 buf[sizeof(buf) - 1] = 0;
 
 	 /* actually read the temp */
@@ -474,7 +482,9 @@ check(void)
 	  {
 	 char *p, *q;
 
- fgets(buf, sizeof(buf), f);
+	 if (fgets(buf, sizeof(buf), f) == NULL)
+   goto error;
+
  buf[sizeof(buf) - 1] = 0;
 	 fclose(f);
 	 p = strchr(buf, ':');
@@