summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrique Dante de Almeida <hdante@profusion.mobi>2013-01-24 16:57:42 -0200
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2013-02-26 10:55:04 -0300
commitca8fc827a380c3525793dbaae7cdc7f8901bf0b6 (patch)
tree91b856b42924ad70e33eb6c91b00636af62d710e
parentcbc203e0bf56c116c17859a064c23eb82e2d669b (diff)
efl: Fixes to support compiling with CFLAGS=-Werror
This allows compiling with gcc 4.7.2 without errors (using the default configuration).
Diffstat (limited to '')
-rw-r--r--Makefile.am3
-rw-r--r--configure.ac6
-rw-r--r--m4/gcc_check_builtin.m420
-rw-r--r--src/bin/embryo/embryo_cc_sc1.c34
-rw-r--r--src/lib/ecore_con/dns.c15
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_randr.c7
-rw-r--r--src/modules/ecore_imf/scim/scim_imcontext.cpp4
-rw-r--r--src/modules/evas/engines/software_x11/evas_xlib_swapper.c4
8 files changed, 67 insertions, 26 deletions
diff --git a/Makefile.am b/Makefile.am
index 4a6d8eb075..aadfb3283b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -51,7 +51,8 @@ m4/eio_check_options.m4 \
51m4/evas_check_engine.m4 \ 51m4/evas_check_engine.m4 \
52m4/evas_check_loader.m4 \ 52m4/evas_check_loader.m4 \
53m4/evil_windows.m4 \ 53m4/evil_windows.m4 \
54m4/libgcrypt.m4 54m4/libgcrypt.m4 \
55m4/gcc_check_builtin.m4
55 56
56EXTRA_DIST += \ 57EXTRA_DIST += \
57autogen.sh \ 58autogen.sh \
diff --git a/configure.ac b/configure.ac
index 29301b88c9..e1c90cda9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1534,7 +1534,11 @@ AC_CHECK_TYPES([struct sigaction], [], [],
1534 1534
1535AC_CHECK_FUNCS([siglongjmp]) 1535AC_CHECK_FUNCS([siglongjmp])
1536 1536
1537AC_CHECK_LIB([m], [lround], [AC_DEFINE([HAVE_LROUND], [1], [C99 lround function exists])]) 1537AC_CHECK_LIB([m], [lround],
1538[AC_DEFINE([HAVE_LROUND], [1], [C99 lround function exists])],
1539[EFL_CHECK_GCC_BUILTIN([lround], [HAVE_LROUND])]
1540)
1541
1538 1542
1539if test "x${want_evas_image_loader_generic}" = "xyes" || test "x${want_evas_cserve2}" = "xyes" ; then 1543if test "x${want_evas_image_loader_generic}" = "xyes" || test "x${want_evas_cserve2}" = "xyes" ; then
1540 EFL_ADD_LIBS([EVAS], [${requirements_libs_shm}]) 1544 EFL_ADD_LIBS([EVAS], [${requirements_libs_shm}])
diff --git a/m4/gcc_check_builtin.m4 b/m4/gcc_check_builtin.m4
new file mode 100644
index 0000000000..1434c5f80a
--- /dev/null
+++ b/m4/gcc_check_builtin.m4
@@ -0,0 +1,20 @@
1AC_DEFUN([EFL_CHECK_GCC_BUILTIN],
2[efl_check_gcc_builtin_save_libs=$LIBS
3LIBS="-lm $LIBS"
4AC_LINK_IFELSE(
5[AC_LANG_PROGRAM(
6[[#ifndef __GNUC__
7choke me
8#else
9#undef $1
10/* Declare this function with same prototype as __builtin_$1.
11 This removes warning about conflicting type with builtin */
12__typeof__(__builtin_$1) $1;
13
14__typeof__(__builtin_$1) *f = $1;
15#endif
16]], [[return f != $1;]]
17)],
18[AC_DEFINE([$2], [123], [GCC builtin $1 exists])])
19LIBS=$efl_check_gcc_builtin_save_libs])
20
diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c
index 58b4b3cc3f..9fd75092a4 100644
--- a/src/bin/embryo/embryo_cc_sc1.c
+++ b/src/bin/embryo/embryo_cc_sc1.c
@@ -3521,18 +3521,18 @@ doif(void)
3521static void 3521static void
3522dowhile(void) 3522dowhile(void)
3523{ 3523{
3524 int wq[wqSIZE]; /* allocate local queue */ 3524 int lwq[wqSIZE]; /* allocate local queue */
3525 3525
3526 addwhile(wq); /* add entry to queue for "break" */ 3526 addwhile(lwq); /* add entry to queue for "break" */
3527 setlabel(wq[wqLOOP]); /* loop label */ 3527 setlabel(lwq[wqLOOP]); /* loop label */
3528 /* The debugger uses the "line" opcode to be able to "break" out of 3528 /* The debugger uses the "line" opcode to be able to "break" out of
3529 * a loop. To make sure that each loop has a line opcode, even for the 3529 * a loop. To make sure that each loop has a line opcode, even for the
3530 * tiniest loop, set it below the top of the loop */ 3530 * tiniest loop, set it below the top of the loop */
3531 setline(fline, fcurrent); 3531 setline(fline, fcurrent);
3532 test(wq[wqEXIT], TRUE, FALSE); /* branch to wq[wqEXIT] if false */ 3532 test(lwq[wqEXIT], TRUE, FALSE); /* branch to lwq[wqEXIT] if false */
3533 statement(NULL, FALSE); /* if so, do a statement */ 3533 statement(NULL, FALSE); /* if so, do a statement */
3534 jumplabel(wq[wqLOOP]); /* and loop to "while" start */ 3534 jumplabel(lwq[wqLOOP]); /* and loop to "while" start */
3535 setlabel(wq[wqEXIT]); /* exit label */ 3535 setlabel(lwq[wqEXIT]); /* exit label */
3536 delwhile(); /* delete queue entry */ 3536 delwhile(); /* delete queue entry */
3537} 3537}
3538 3538
@@ -3543,18 +3543,18 @@ dowhile(void)
3543static void 3543static void
3544dodo(void) 3544dodo(void)
3545{ 3545{
3546 int wq[wqSIZE], top; 3546 int lwq[wqSIZE], top;
3547 3547
3548 addwhile(wq); /* see "dowhile" for more info */ 3548 addwhile(lwq); /* see "dowhile" for more info */
3549 top = getlabel(); /* make a label first */ 3549 top = getlabel(); /* make a label first */
3550 setlabel(top); /* loop label */ 3550 setlabel(top); /* loop label */
3551 statement(NULL, FALSE); 3551 statement(NULL, FALSE);
3552 needtoken(tWHILE); 3552 needtoken(tWHILE);
3553 setlabel(wq[wqLOOP]); /* "continue" always jumps to WQLOOP. */ 3553 setlabel(lwq[wqLOOP]); /* "continue" always jumps to WQLOOP. */
3554 setline(fline, fcurrent); 3554 setline(fline, fcurrent);
3555 test(wq[wqEXIT], TRUE, FALSE); 3555 test(lwq[wqEXIT], TRUE, FALSE);
3556 jumplabel(top); 3556 jumplabel(top);
3557 setlabel(wq[wqEXIT]); 3557 setlabel(lwq[wqEXIT]);
3558 delwhile(); 3558 delwhile();
3559 needtoken(tTERM); 3559 needtoken(tTERM);
3560} 3560}
@@ -3562,7 +3562,7 @@ dodo(void)
3562static void 3562static void
3563dofor(void) 3563dofor(void)
3564{ 3564{
3565 int wq[wqSIZE], skiplab; 3565 int lwq[wqSIZE], skiplab;
3566 cell save_decl; 3566 cell save_decl;
3567 int save_nestlevel, idx; 3567 int save_nestlevel, idx;
3568 int *ptr; 3568 int *ptr;
@@ -3570,7 +3570,7 @@ dofor(void)
3570 save_decl = declared; 3570 save_decl = declared;
3571 save_nestlevel = nestlevel; 3571 save_nestlevel = nestlevel;
3572 3572
3573 addwhile(wq); 3573 addwhile(lwq);
3574 skiplab = getlabel(); 3574 skiplab = getlabel();
3575 needtoken('('); 3575 needtoken('(');
3576 if (matchtoken(';') == 0) 3576 if (matchtoken(';') == 0)
@@ -3600,7 +3600,7 @@ dofor(void)
3600 ptr[wqBRK] = (int)declared; 3600 ptr[wqBRK] = (int)declared;
3601 ptr[wqCONT] = (int)declared; 3601 ptr[wqCONT] = (int)declared;
3602 jumplabel(skiplab); /* skip expression 3 1st time */ 3602 jumplabel(skiplab); /* skip expression 3 1st time */
3603 setlabel(wq[wqLOOP]); /* "continue" goes to this label: expr3 */ 3603 setlabel(lwq[wqLOOP]); /* "continue" goes to this label: expr3 */
3604 setline(fline, fcurrent); 3604 setline(fline, fcurrent);
3605 /* Expressions 2 and 3 are reversed in the generated code: 3605 /* Expressions 2 and 3 are reversed in the generated code:
3606 * expression 3 precedes expression 2. 3606 * expression 3 precedes expression 2.
@@ -3617,7 +3617,7 @@ dofor(void)
3617 setlabel(skiplab); /*jump to this point after 1st expression */ 3617 setlabel(skiplab); /*jump to this point after 1st expression */
3618 if (matchtoken(';') == 0) 3618 if (matchtoken(';') == 0)
3619 { 3619 {
3620 test(wq[wqEXIT], FALSE, FALSE); /* expression 2 3620 test(lwq[wqEXIT], FALSE, FALSE); /* expression 2
3621 *(jump to wq[wqEXIT] if false) */ 3621 *(jump to wq[wqEXIT] if false) */
3622 needtoken(';'); 3622 needtoken(';');
3623 } /* if */ 3623 } /* if */
@@ -3632,8 +3632,8 @@ dofor(void)
3632 stgout(idx); 3632 stgout(idx);
3633 stgset(FALSE); /* stop staging */ 3633 stgset(FALSE); /* stop staging */
3634 statement(NULL, FALSE); 3634 statement(NULL, FALSE);
3635 jumplabel(wq[wqLOOP]); 3635 jumplabel(lwq[wqLOOP]);
3636 setlabel(wq[wqEXIT]); 3636 setlabel(lwq[wqEXIT]);
3637 delwhile(); 3637 delwhile();
3638 3638
3639 assert(nestlevel >= save_nestlevel); 3639 assert(nestlevel >= save_nestlevel);
diff --git a/src/lib/ecore_con/dns.c b/src/lib/ecore_con/dns.c
index 15d9bb0baf..87ecbffc7b 100644
--- a/src/lib/ecore_con/dns.c
+++ b/src/lib/ecore_con/dns.c
@@ -1114,6 +1114,7 @@ void dns_p_dictadd(struct dns_packet *P, unsigned short dn) {
1114int dns_p_push(struct dns_packet *P, enum dns_section section, const void *dn, size_t dnlen, enum dns_type type, enum dns_class class, unsigned ttl, const void *any) { 1114int dns_p_push(struct dns_packet *P, enum dns_section section, const void *dn, size_t dnlen, enum dns_type type, enum dns_class class, unsigned ttl, const void *any) {
1115 size_t end = P->end; 1115 size_t end = P->end;
1116 int error; 1116 int error;
1117 uint16_t v;
1117 1118
1118 if ((error = dns_d_push(P, dn, dnlen))) 1119 if ((error = dns_d_push(P, dn, dnlen)))
1119 goto error; 1120 goto error;
@@ -1150,7 +1151,8 @@ update:
1150 if (!P->qd.base && (error = dns_p_study(P))) 1151 if (!P->qd.base && (error = dns_p_study(P)))
1151 goto error; 1152 goto error;
1152 1153
1153 dns_header(P)->qdcount = htons(ntohs(dns_header(P)->qdcount) + 1); 1154 v = ntohs(dns_header(P)->qdcount);
1155 dns_header(P)->qdcount = htons(v + 1);
1154 1156
1155 P->qd.end = P->end; 1157 P->qd.end = P->end;
1156 P->an.base = P->end; 1158 P->an.base = P->end;
@@ -1168,7 +1170,8 @@ update:
1168 if (!P->an.base && (error = dns_p_study(P))) 1170 if (!P->an.base && (error = dns_p_study(P)))
1169 goto error; 1171 goto error;
1170 1172
1171 dns_header(P)->ancount = htons(ntohs(dns_header(P)->ancount) + 1); 1173 v = ntohs(dns_header(P)->ancount);
1174 dns_header(P)->ancount = htons(v + 1);
1172 1175
1173 P->an.end = P->end; 1176 P->an.end = P->end;
1174 P->ns.base = P->end; 1177 P->ns.base = P->end;
@@ -1184,7 +1187,8 @@ update:
1184 if (!P->ns.base && (error = dns_p_study(P))) 1187 if (!P->ns.base && (error = dns_p_study(P)))
1185 goto error; 1188 goto error;
1186 1189
1187 dns_header(P)->nscount = htons(ntohs(dns_header(P)->nscount) + 1); 1190 v = ntohs(dns_header(P)->nscount);
1191 dns_header(P)->nscount = htons(v + 1);
1188 1192
1189 P->ns.end = P->end; 1193 P->ns.end = P->end;
1190 P->ar.base = P->end; 1194 P->ar.base = P->end;
@@ -1195,7 +1199,8 @@ update:
1195 if (!P->ar.base && (error = dns_p_study(P))) 1199 if (!P->ar.base && (error = dns_p_study(P)))
1196 goto error; 1200 goto error;
1197 1201
1198 dns_header(P)->arcount = htons(ntohs(dns_header(P)->arcount) + 1); 1202 v = ntohs(dns_header(P)->arcount);
1203 dns_header(P)->arcount = htons(v + 1);
1199 1204
1200 P->ar.end = P->end; 1205 P->ar.end = P->end;
1201 1206
@@ -4399,7 +4404,7 @@ int dns_nssconf_loadfile(struct dns_resolv_conf *resconf, FILE *fp) {
4399 dns_anyconf_skip("] \t", fp); 4404 dns_anyconf_skip("] \t", fp);
4400 } 4405 }
4401 4406
4402 if (endof(lookup) - lp < cf.count + 1) /* +1 for '\0' */ 4407 if ((unsigned)(endof(lookup) - lp) < cf.count + 1) /* +1 for '\0' */
4403 goto nextsrc; 4408 goto nextsrc;
4404 4409
4405 source = dns_nssconf_keyword(cf.token[0]); 4410 source = dns_nssconf_keyword(cf.token[0]);
diff --git a/src/lib/ecore_x/xlib/ecore_x_randr.c b/src/lib/ecore_x/xlib/ecore_x_randr.c
index bda1c9e428..22b7e1cbd1 100644
--- a/src/lib/ecore_x/xlib/ecore_x_randr.c
+++ b/src/lib/ecore_x/xlib/ecore_x_randr.c
@@ -2170,6 +2170,8 @@ ecore_x_randr_crtc_gamma_size_get(Ecore_X_Randr_Crtc crtc)
2170#ifdef ECORE_XRANDR 2170#ifdef ECORE_XRANDR
2171 if (_randr_version < RANDR_VERSION_1_2) return 0; 2171 if (_randr_version < RANDR_VERSION_1_2) return 0;
2172 return XRRGetCrtcGammaSize(_ecore_x_disp, crtc); 2172 return XRRGetCrtcGammaSize(_ecore_x_disp, crtc);
2173#else
2174 (void)crtc;
2173#endif 2175#endif
2174 return 0; 2176 return 0;
2175} 2177}
@@ -2198,6 +2200,8 @@ ecore_x_randr_crtc_gamma_get(Ecore_X_Randr_Crtc crtc)
2198 XRRFreeGamma(xgamma); 2200 XRRFreeGamma(xgamma);
2199 2201
2200 return info; 2202 return info;
2203#else
2204 (void)crtc;
2201#endif 2205#endif
2202 return NULL; 2206 return NULL;
2203} 2207}
@@ -2217,6 +2221,9 @@ ecore_x_randr_crtc_gamma_set(Ecore_X_Randr_Crtc crtc, const Ecore_X_Randr_Crtc_G
2217 */ 2221 */
2218 XRRSetCrtcGamma(_ecore_x_disp, crtc, (XRRCrtcGamma *)gamma); 2222 XRRSetCrtcGamma(_ecore_x_disp, crtc, (XRRCrtcGamma *)gamma);
2219 return EINA_TRUE; 2223 return EINA_TRUE;
2224#else
2225 (void)crtc;
2226 (void)gamma;
2220#endif 2227#endif
2221 return EINA_FALSE; 2228 return EINA_FALSE;
2222} 2229}
diff --git a/src/modules/ecore_imf/scim/scim_imcontext.cpp b/src/modules/ecore_imf/scim/scim_imcontext.cpp
index 5cd96e52d0..43392bb5b6 100644
--- a/src/modules/ecore_imf/scim/scim_imcontext.cpp
+++ b/src/modules/ecore_imf/scim/scim_imcontext.cpp
@@ -23,7 +23,11 @@
23#include <X11/keysym.h> 23#include <X11/keysym.h>
24#include <X11/Xutil.h> 24#include <X11/Xutil.h>
25 25
26#pragma GCC diagnostic push
27#pragma GCC diagnostic ignored "-Wshadow"
26#include <scim.h> 28#include <scim.h>
29#pragma GCC diagnostic pop
30
27#include "scim_imcontext.h" 31#include "scim_imcontext.h"
28 32
29using namespace scim; 33using namespace scim;
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_swapper.c b/src/modules/evas/engines/software_x11/evas_xlib_swapper.c
index 47468c9485..b3f19e9008 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_swapper.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_swapper.c
@@ -341,7 +341,7 @@ typedef struct _drm_slp_bo *drm_slp_bo;
341static drm_slp_bo (*sym_drm_slp_bo_import) (drm_slp_bufmgr bufmgr, unsigned int key) = NULL; 341static drm_slp_bo (*sym_drm_slp_bo_import) (drm_slp_bufmgr bufmgr, unsigned int key) = NULL;
342// XXXX: sym_drm_slp_bo_map() is incorrectly defined - it SHOULD return a 342// XXXX: sym_drm_slp_bo_map() is incorrectly defined - it SHOULD return a
343// void * at least 343// void * at least
344static unsigned int (*sym_drm_slp_bo_map) (drm_slp_bo bo, int device, int opt) = NULL; 344static void *(*sym_drm_slp_bo_map) (drm_slp_bo bo, int device, int opt) = NULL;
345static int (*sym_drm_slp_bo_unmap) (drm_slp_bo bo, int device) = NULL; 345static int (*sym_drm_slp_bo_unmap) (drm_slp_bo bo, int device) = NULL;
346static void (*sym_drm_slp_bo_unref) (drm_slp_bo bo) = NULL; 346static void (*sym_drm_slp_bo_unref) (drm_slp_bo bo) = NULL;
347static drm_slp_bufmgr (*sym_drm_slp_bufmgr_init) (int fd, void *arg) = NULL; 347static drm_slp_bufmgr (*sym_drm_slp_bufmgr_init) (int fd, void *arg) = NULL;
@@ -755,7 +755,7 @@ evas_xlib_swapper_buffer_map(X_Swapper *swp, int *bpl, int *w, int *h)
755 } 755 }
756 // XXXX: sym_drm_slp_bo_map() is incorrectly defined - it SHOULD return a 756 // XXXX: sym_drm_slp_bo_map() is incorrectly defined - it SHOULD return a
757 // void * at least 757 // void * at least
758 swp->buf_data = (void *)sym_drm_slp_bo_map(swp->buf_bo, DRM_SLP_DEVICE_CPU, 758 swp->buf_data = sym_drm_slp_bo_map(swp->buf_bo, DRM_SLP_DEVICE_CPU,
759 DRM_SLP_OPTION_READ | 759 DRM_SLP_OPTION_READ |
760 DRM_SLP_OPTION_WRITE); 760 DRM_SLP_OPTION_WRITE);
761 if (!swp->buf_data) 761 if (!swp->buf_data)