Remove compile warning messages 78/51978/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 18 Nov 2015 00:53:48 +0000 (09:53 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 18 Nov 2015 00:53:48 +0000 (09:53 +0900)
Change-Id: I6871c7d8da024c1ef428cbb0fed7ab8df8552ed5
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
include/appcore-common.h
include/appcore-internal.h
src/appcore-X.c
src/appcore-efl.c
src/appcore-i18n.c
src/appcore-rotation.c
src/appcore-util.c

index e3d83048a8da1b0781ec0e7b3d4a944dc27fcefb..a1303366a3d7e31bb4842617d842c9fe078fb6a7 100644 (file)
@@ -143,10 +143,10 @@ struct appcore_ops {
  *
  * @par Typical use case:
  * To do something when predefined events (enum appcore_event) occur, use this API
- * 
+ *
  * @par Method of function operation:
  * Using Heynoti subscription, Vconf changed callback, and AUL, Appcore invokes the registered callback function.
- * 
+ *
  * @par Important notes:
  * Only one callback function can be set. If <I>cb</I> is NULL, unset the callback function about the event.\n
  * Default behavior is performed when the specified event callback doesn't have registered.
@@ -155,7 +155,7 @@ struct appcore_ops {
  * @param[in] cb callback function
  * @param[in] data callback function data
  *
- * @return 0 on success, -1 on error (<I>errno</I> set) 
+ * @return 0 on success, -1 on error (<I>errno</I> set)
  *
  * @par Errors:
  * EINVAL - Invalid event type
@@ -221,18 +221,18 @@ int appcore_set_event_callback(enum appcore_event event,
  *
  * @par Typical use case:
  * To do something when the rotation mode is changed, use this API
- * 
+ *
  * @par Method of function operation:
  * Appcore receives rotation change from Sensor framework. When Appcore receive the change, it invokes the registered callback function.
- * 
+ *
  * @par Important notes:
  * Locks the rotation mode, the registered callback is not invoked.
  *
  * @param[in] cb callback function
  * @param[in] data callback function data
  *
- * @return 0 on success, -1 on error (<I>errno</I> set) 
- * 
+ * @return 0 on success, -1 on error (<I>errno</I> set)
+ *
  * @par Errors:
  * EINVAL - <I>cb</I> is NULL
  * EALREADY - rotation callback function already registered
@@ -275,7 +275,7 @@ int appcore_set_rotation_cb(int (*cb) (void *event_info, enum appcore_rm, void *
  * This function unsets a callback function for rotation events.
  *
  * @return 0 on success, -1 on error
- * 
+ *
  * @pre Callback is set by appcore_set_rotation_cb().
  * @post None.
  * @see appcore_set_rotation_cb(), appcore_get_rotation_state()
@@ -312,12 +312,12 @@ int appcore_unset_rotation_cb(void);
  *
  * @par Method of function operation:
  * This function gets the current rotation mode from Sensor framework.
- * 
+ *
  * @param[out] curr current rotation mode\n
  * If Sensor framework is not working, curr is set to APPCORE_RM_UNKNOWN.
  *
- * @return 0 on success, -1 on error (<I>errno</I> set) 
- * 
+ * @return 0 on success, -1 on error (<I>errno</I> set)
+ *
  * @par Errors:
  * EINVAL - <I>curr</I> is NULL
  *
@@ -337,7 +337,7 @@ int appcore_unset_rotation_cb(void);
        enum appcore_rm curr;
 
        ...
-       
+
        r = appcore_get_rotation_state(&curr);
        if (r == -1) {
                // add exception handling
@@ -358,12 +358,12 @@ int appcore_get_rotation_state(enum appcore_rm *curr);
  *
  * @par Method of function operation:
  * This function gets the current time format from vconf.
- * 
+ *
  * @param[out] timeformat current time format\n
  * If vconf is not working, timeformat is set to APPCORE_TIME_FORMAT_UNKNOWN.
  *
- * @return 0 on success, -1 on error (<I>errno</I> set) 
- * 
+ * @return 0 on success, -1 on error (<I>errno</I> set)
+ *
  * @par Errors:
  * EINVAL - <I>timeformat</I> is NULL
  *
@@ -383,7 +383,7 @@ int appcore_get_rotation_state(enum appcore_rm *curr);
        enum appcore_time_format timeformat;
 
        ...
-       
+
        r = appcore_get_timeformat(&timeformat);
        if (r == -1) {
                // add exception handling
@@ -404,18 +404,18 @@ int appcore_get_timeformat(enum appcore_time_format *timeformat);
  *
  * @par Typical use case:
  * This function provides convenience for using gettext.
- * 
+ *
  * @par Method of function operation:
  * Calls setlocale(), bindtextdomain() and textdomain() internally.
- * 
+ *
  * @par Corner cases/exceptions:
  * If <I>dirname</I> is NULL, the previously set base directory is used. Typically, it is /usr/share/locale.
  *
  * @param[in] domainname a message domain name(text domain name) \n Must be a non-empty string.
- * @param[in] dirname the base directory for message catalogs belonging to the specified domain \n 
+ * @param[in] dirname the base directory for message catalogs belonging to the specified domain \n
+ *
+ * @return 0 on success, -1 on error (<I>errno</I> set)
  *
- * @return 0 on success, -1 on error (<I>errno</I> set) 
- * 
  * @par Errors:
  * EINVAL - <I>domain</I> is NULL
  *
@@ -437,7 +437,7 @@ int appcore_get_timeformat(enum appcore_time_format *timeformat);
 
        r = appcore_set_i18n("i18n_example", NULL);
        if (r == -1) {
-               // add exception handling       
+               // add exception handling
        }
        ...
 }
@@ -448,18 +448,18 @@ int appcore_set_i18n(const char *domainname, const char *dirname);
 
 /**
  * @par Description:
- * Set the measuring start time 
+ * Set the measuring start time
  *
  * @par Purpose:
  * To measure the time, the start time should be set. This function set the start point.
  *
  * @par Typical use case:
  * It is used to measure the time for doing something. \n
- * This function set the start point. And, appcore_measure_time() returns 
+ * This function set the start point. And, appcore_measure_time() returns
  * the elapsed time from the start point.
  *
  * @see appcore_measure_time()
- * 
+ *
  * @par Method of function operation:
  * Store the current time to the internal variable.
  *
@@ -499,7 +499,7 @@ void appcore_measure_start(void);
  * This function returns the elapsed time from the start point set by appcore_measure_start().
  *
  * @see appcore_measure_start()
- * 
+ *
  * @par Method of function operation:
  * This function subtracts the current time from the start point.
  *
@@ -544,7 +544,7 @@ int appcore_measure_time(void);
  * This function returns the elapsed time from a time specified in environment variable.
  *
  * @see appcore_measure_start()
- * 
+ *
  * @par Method of function operation:
  * This function subtracts the current time from a time specified in environment variable.
  *
@@ -552,7 +552,7 @@ int appcore_measure_time(void);
  * If <I>envnm</I> is NULL, "APP_START_TIME" set by launcher is used.
  * If the environment variable is not set or invalid format, returns 0.
  *
- * @param[in] envnm environment variable name which has 
+ * @param[in] envnm environment variable name which has
  *  the start time (format: "%u %u", seconds, micro seconds)
  *
  * @return Milliseconds from a time specified in environment variable
@@ -570,9 +570,9 @@ int appcore_measure_time(void);
 {
        ...
 
-       // do something 
+       // do something
 
-       printf("it takes %d msec from APP_START\n", 
+       printf("it takes %d msec from APP_START\n",
                appcore_measure_time_from("APP_START_TIME"));
        ...
 }
@@ -589,7 +589,7 @@ struct ui_ops;
 /**
  * @par Description:
  * Appcore init. Internal use only
- * 
+ *
  * @par Important notes:
  * Except special case, NEVER use this. Use the appcore EFL or GTK instead of this.
  *
@@ -616,7 +616,7 @@ int appcore_init(const char *name, const struct ui_ops *ops,
 /**
  * @par Description:
  * Appcore exit. Internal use only.
- * 
+ *
  * @par Important notes:
  * Except special case, NEVER use this.
  *
@@ -641,9 +641,9 @@ void appcore_exit(void);
  * sqlite3_release_memory() if sqlite3 is used, and malloc_trim(). Also, trims native stack.
  *
  * @par Important notes:
- * Currently, this function is automatically called in the following 2 cases:\n 
+ * Currently, this function is automatically called in the following 2 cases:\n
  * (1) when the application enters into the pause state and\n
- * (2) when low memory event is invoked and the application is on pause.\n 
+ * (2) when low memory event is invoked and the application is on pause.\n
  * Developers can use this function when they want extra memory flush utility.
  *
  * @return 0 on success, -1 on error
@@ -678,8 +678,8 @@ int appcore_flush_memory(void);
 /**
  * @par Description:
  * Set a open callback
- * Only when application is running, if aul_open api is called, then this callback function is called. 
- * If your open_cb function return -1, then appcore doesn't raise window. 
+ * Only when application is running, if aul_open api is called, then this callback function is called.
+ * If your open_cb function return -1, then appcore doesn't raise window.
  *
  * @param[in] cb callback function
  * @param[in] data callback function data
index 0e3c0d8ba2c30fd8bc265cbccbc114da12a35f4f..7bd3db8f1de753ee22f0da6aa0087132c9cc62ca 100644 (file)
@@ -179,17 +179,20 @@ int appcore_pause_rotation_cb(void);
 int appcore_resume_rotation_cb(void);
 
 struct ui_wm_rotate {
-   int (*set_rotation_cb) (int (*cb) (void *event_info, enum appcore_rm, void *), void *data);
-   int (*unset_rotation_cb) (void);
-   int (*get_rotation_state) (enum appcore_rm *curr);
-   int (*pause_rotation_cb) (void);
-   int (*resume_rotation_cb) (void);
+       int (*set_rotation_cb) (int (*cb)(void *event_info, enum appcore_rm, void *), void *data);
+       int (*unset_rotation_cb) (void);
+       int (*get_rotation_state) (enum appcore_rm *curr);
+       int (*pause_rotation_cb) (void);
+       int (*resume_rotation_cb) (void);
 };
 int appcore_set_wm_rotation(struct ui_wm_rotate* wm_rotate);
 
 void appcore_group_attach();
 void appcore_group_lower();
 unsigned int appcore_get_main_window(void);
+#if defined(WAYLAND)
+unsigned int appcore_get_main_surface(void);
+#endif
 void appcore_get_app_core(struct appcore **ac);
 #ifdef _APPFW_FEATURE_BACKGROUND_MANAGEMENT
 int _appcore_init_suspend_dbus_handler(void *data);
index 7faa26010a196cec9aea3a113c8498960821c34e..b87f3bf59f5fb9938570949f7a98964b37b0642d 100644 (file)
@@ -106,18 +106,18 @@ static int __find_win(Display *d, Window *win, pid_t pid)
 
 static void __add_win_list(Eina_List **list, Window *win)
 {
-       Window w;
+       void *w;
        Eina_List *l;
 
        if (!list || !win)
                return;
 
        EINA_LIST_FOREACH(*list, l, w) {
-               if (w == *win)
+               if ((Window)w == *win)
                        return;
        }
 
-       *list = eina_list_append(*list, *win);
+       *list = eina_list_append(*list, (void *)*win);
 }
 
 static void __foreach_win(Eina_List **list, Display *d, Window *win, pid_t pid)
@@ -134,23 +134,23 @@ static void __foreach_win(Eina_List **list, Display *d, Window *win, pid_t pid)
 
        r = XQueryTree(d, *win, &root, &parent, &child, &n);
        if (r) {
-               for (i = 0; i < n; i++) {
+               for (i = 0; i < n; i++)
                        __foreach_win(list, d, &child[i], pid);
-               }
+
                XFree(child);
        }
 }
 
 static int __iconify_win(Eina_List *list, Display *d)
 {
-       Window w;
+       void *w;
        Eina_List *l;
 
        if (!list || !d)
                return -1;
 
        EINA_LIST_FOREACH(list, l, w) {
-               XIconifyWindow(d, w, 0);
+               XIconifyWindow(d, (Window)w, 0);
        }
 
        return 0;
index 2f6e358ccd810457772d2453149d83eced1deb4f..98bade9ab184b4d7b368535748b0c017d425a2c8 100644 (file)
@@ -128,7 +128,9 @@ struct win_node {
        bool bfobscured;
 };
 
+#if defined(X11)
 static struct ui_wm_rotate wm_rotate;
+#endif
 static Eina_Bool __visibility_cb(void *data, int type, void *event);
 
 static void _send_to_resourced(enum proc_status_type type)
@@ -699,8 +701,6 @@ static Eina_Bool __show_cb(void *data, int type, void *event)
 
 #elif defined(X11)
        Ecore_X_Event_Window_Show *ev;
-       int ret;
-       Ecore_X_Window parent;
 
        ev = event;
 
@@ -793,7 +793,7 @@ static Eina_Bool __visibility_cb(void *data, int type, void *event)
 
 }
 
-#ifdef X11
+#if defined(X11)
 /* WM_ROTATE */
 static Eina_Bool __cmsg_cb(void *data, int type, void *event)
 {
@@ -1018,6 +1018,7 @@ static void __unset_data(struct ui_priv *ui)
        memset(ui, 0, sizeof(struct ui_priv));
 }
 
+#if defined(X11)
 /* WM_ROTATE */
 static int __wm_set_rotation_cb(int (*cb) (void *event_info, enum appcore_rm, void *), void *data)
 {
@@ -1087,6 +1088,7 @@ static struct ui_wm_rotate wm_rotate = {
        __wm_pause_rotation_cb,
        __wm_resume_rotation_cb
 };
+#endif
 
 EXPORT_API int appcore_efl_init(const char *name, int *argc, char ***argv,
                     struct appcore_ops *ops)
index ef2c95b2dfe95f88076573fe963fe48390669936..ae853f68c2ed05a6082e9e2e37bbe20cf0107db8 100644 (file)
@@ -68,9 +68,9 @@ void update_region(void)
                setenv("LC_MEASUREMENT", region, 1);
                setenv("LC_IDENTIFICATION", region, 1);
                r = setlocale(LC_ALL, "");
-               if (r == NULL) {
+               if (r == NULL)
                        _DBG("*****appcore setlocale=%s\n", r);
-               }
+
                free(region);
        }
 }
@@ -90,27 +90,20 @@ static int __set_i18n(const char *domain, const char *dir)
                r = setlocale(LC_ALL, vconf_get_str(VCONFKEY_LANGSET));
                _DBG("*****appcore setlocale=%s\n", r);
        }
-       if (r == NULL) {
+       if (r == NULL)
                _ERR("appcore: setlocale() error");
-       }
-       //_retvm_if(r == NULL, -1, "appcore: setlocale() error");
 
        r = bindtextdomain(domain, dir);
-       if (r == NULL) {
+       if (r == NULL)
                _ERR("appcore: bindtextdomain() error");
-       }
-       //_retvm_if(r == NULL, -1, "appcore: bindtextdomain() error");
 
        r = textdomain(domain);
-       if (r == NULL) {
+       if (r == NULL)
                _ERR("appcore: textdomain() error");
-       }
-       //_retvm_if(r == NULL, -1, "appcore: textdomain() error");
 
        return 0;
 }
 
-
 EXPORT_API int appcore_set_i18n(const char *domainname, const char *dirname)
 {
        int r;
index f0280f02b6911fe44759e027a3e228c73ac805e8..fec0ed5b2b89c301a4c28900584b22077beaa059 100644 (file)
 #include <Ecore_X.h>
 #include <X11/Xlib.h>
 
-/*Fixme: to be added for wayland works*/
-#define _MAKE_ATOM(a, s)                              \
-   do {                                               \
-        a = ecore_x_atom_get(s);                      \
-        if (!a)                                       \
-          _ERR("##s creation failed.\n");             \
-   } while(0)
+/* Fixme: to be added for wayland works */
+#define _MAKE_ATOM(a, s)                               \
+       do {                                            \
+               a = ecore_x_atom_get(s);                \
+               if (!a)                                 \
+                       _ERR("##s creation failed.\n"); \
+       } while (0)
 
-#define STR_ATOM_ROTATION_LOCK                "_E_ROTATION_LOCK"
+#define STR_ATOM_ROTATION_LOCK "_E_ROTATION_LOCK"
 
 static Ecore_X_Atom ATOM_ROTATION_LOCK = 0;
 static Ecore_X_Window root;
@@ -106,7 +106,6 @@ static void __changed_cb(unsigned int event_type, sensor_event_data_t *event,
 {
        int *cb_event_data;
        enum appcore_rm m;
-       int ret;
 
        if (rot.lock)
                return;
@@ -135,7 +134,6 @@ static void __lock_cb(keynode_t *node, void *data)
 {
        int r;
        enum appcore_rm m;
-       int ret;
 
        rot.lock = !vconf_keynode_get_bool(node);
 
@@ -170,9 +168,8 @@ static void __add_rotlock(void *data)
 
        lock = 0;
        r = vconf_get_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &lock);
-       if (r) {
+       if (r)
                _DBG("[APP %d] Rotation vconf get bool failed", getpid());
-       }
 
        rot.lock = !lock;
 
@@ -189,9 +186,8 @@ static void __del_rotlock(void)
 EXPORT_API int appcore_set_rotation_cb(int (*cb) (void *evnet_info, enum appcore_rm, void *),
                                       void *data)
 {
-       if (rot.wm_rotate) {
+       if (rot.wm_rotate)
                return rot.wm_rotate->set_rotation_cb(cb, data);
-       }
        else {
                int r;
                int handle;
@@ -228,9 +224,9 @@ EXPORT_API int appcore_set_rotation_cb(int (*cb) (void *evnet_info, enum appcore
                if (r < 0) {
                        _ERR("sf_start failed: %d", r);
                        r = sf_unregister_event(handle, ACCELEROMETER_EVENT_ROTATION_CHECK);
-                       if (r < 0) {
+                       if (r < 0)
                                _ERR("sf_unregister_event failed: %d", r);
-                       }
+
                        rot.callback = NULL;
                        rot.cbdata = NULL;
                        rot.cb_set = 0;
@@ -244,7 +240,7 @@ EXPORT_API int appcore_set_rotation_cb(int (*cb) (void *evnet_info, enum appcore
                __add_rotlock(data);
 
 #ifdef X11
-               _MAKE_ATOM(ATOM_ROTATION_LOCK, STR_ATOM_ROTATION_LOCK );
+               _MAKE_ATOM(ATOM_ROTATION_LOCK, STR_ATOM_ROTATION_LOCK);
                root =  ecore_x_window_root_first_get();
                XSelectInput(ecore_x_display_get(), root, PropertyChangeMask);
 #endif
@@ -254,9 +250,8 @@ EXPORT_API int appcore_set_rotation_cb(int (*cb) (void *evnet_info, enum appcore
 
 EXPORT_API int appcore_unset_rotation_cb(void)
 {
-       if (rot.wm_rotate) {
+       if (rot.wm_rotate)
                return rot.wm_rotate->unset_rotation_cb();
-       }
        else {
                int r;
 
@@ -297,9 +292,8 @@ EXPORT_API int appcore_unset_rotation_cb(void)
 
 EXPORT_API int appcore_get_rotation_state(enum appcore_rm *curr)
 {
-       if (rot.wm_rotate) {
+       if (rot.wm_rotate)
                return rot.wm_rotate->get_rotation_state(curr);
-       }
        else {
                int r;
                unsigned long event;
@@ -323,9 +317,8 @@ EXPORT_API int appcore_get_rotation_state(enum appcore_rm *curr)
 
 EXPORT_API int appcore_pause_rotation_cb(void)
 {
-       if (rot.wm_rotate) {
+       if (rot.wm_rotate)
                return rot.wm_rotate->pause_rotation_cb();
-       }
        else {
                int r;
 
@@ -360,11 +353,11 @@ EXPORT_API int appcore_pause_rotation_cb(void)
 
 EXPORT_API int appcore_resume_rotation_cb(void)
 {
-       if (rot.wm_rotate) {
+       if (rot.wm_rotate)
                return rot.wm_rotate->resume_rotation_cb();
-       }
        else {
-               int r,ret;
+               int r;
+               int ret;
                enum appcore_rm m;
 
                _retv_if(rot.callback == NULL, 0);
index f0cb2fe3a9962044e72d09554a392267fdd029c5..9e2ede7dc77b2b89e7d8aab62e7a104811fc8f91 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "appcore-internal.h"
 
-#define GETSP() ({ unsigned int sp; asm volatile ("mov %0,sp " : "=r"(sp) ); sp;})
+#define GETSP() ({ unsigned int sp; asm volatile ("mov %0,sp " : "=r"(sp)); sp; })
 #define BUF_SIZE                               256
 #define PAGE_SIZE                      (1 << 12)
 #define _ALIGN_UP(addr , size)    (((addr)+((size)-1))&(~((size)-1)))