remove fprintf/printf
authorHeebum Kwak <heebum0.kwak@samsung.com>
Tue, 7 May 2013 01:57:40 +0000 (10:57 +0900)
committerBoram Park <boram1288.park@samsung.com>
Mon, 17 Jun 2013 08:44:34 +0000 (17:44 +0900)
Change-Id: I0e5d9e1ed60d4c01af8aa604c62eae457d82e8aa

12 files changed:
common/xdbg_dbus_client.c
common/xdbg_evlog.c
common/xdbg_evlog_composite.c
common/xdbg_evlog_core.c
common/xdbg_evlog_damage.c
common/xdbg_evlog_dri2.c
common/xdbg_evlog_gesture.c
common/xdbg_evlog_randr.c
common/xdbg_evlog_xext.c
common/xdbg_evlog_xinput.c
common/xdbg_evlog_xv.c
common/xdbg_types.h

index 5321a6d..54827da 100644 (file)
@@ -60,7 +60,7 @@ _xDbgDBusClinetMsgFilter (DBusConnection *conn, DBusMessage *msg, void *data)
      * connection isn't valid at this point, so throw it out immediately. */
     if (dbus_message_is_signal (msg, DBUS_INTERFACE_LOCAL, "Disconnected"))
     {
-        fprintf (stderr, "[CLIENT:%s] disconnected by signal\n", info->client);
+        XDBG_LOG ("[CLIENT:%s] disconnected by signal\n", info->client);
         info->conn = NULL;
 
         return DBUS_HANDLER_RESULT_HANDLED;
@@ -81,12 +81,12 @@ _xDbgDBusClinetInit (XDbgDBusClientInfo *info)
     info->conn = dbus_bus_get (DBUS_BUS_SYSTEM, &err);
     if (dbus_error_is_set (&err))
     {
-        fprintf (stderr, "[CLIENT:%s] failed: connection (%s)\n", info->client, err.message);
+        XDBG_LOG ("[CLIENT:%s] failed: connection (%s)\n", info->client, err.message);
         goto err_get;
     }
     if (!info->conn)
     {
-        fprintf (stderr, "[CLIENT:%s] failed: connection NULL\n", info->client);
+        XDBG_LOG ("[CLIENT:%s] failed: connection NULL\n", info->client);
         goto err_get;
     }
 
@@ -94,7 +94,7 @@ _xDbgDBusClinetInit (XDbgDBusClientInfo *info)
 
     if (!dbus_connection_add_filter (info->conn, _xDbgDBusClinetMsgFilter, info, NULL))
     {
-        fprintf (stderr, "[CLIENT:%s] failed: add filter (%s)\n", info->client, err.message);
+        XDBG_LOG ("[CLIENT:%s] failed: add filter (%s)\n", info->client, err.message);
         goto err_get;
     }
 
@@ -102,18 +102,18 @@ _xDbgDBusClinetInit (XDbgDBusClientInfo *info)
                                  DBUS_NAME_FLAG_REPLACE_EXISTING , &err);
     if (dbus_error_is_set (&err))
     {
-        fprintf (stderr, "[CLIENT:%s] failed: request name (%s)\n", info->client, err.message);
+        XDBG_LOG ("[CLIENT:%s] failed: request name (%s)\n", info->client, err.message);
         goto err_request;
     }
     if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
     {
-        fprintf (stderr, "[CLIENT:%s] failed: Not Primary Owner (%d)\n", info->client, ret);
+        XDBG_LOG ("[CLIENT:%s] failed: Not Primary Owner (%d)\n", info->client, ret);
         goto err_request;
     }
 
     dbus_error_free (&err);
 
-//    fprintf (stderr, "[CLIENT:%s] connected\n", info->client);
+//    XDBG_LOG ("[CLIENT:%s] connected\n", info->client);
 
     return TRUE;
 
@@ -144,14 +144,14 @@ _xDbgDBusClinetDeinit (XDbgDBusClientInfo *info)
     dbus_error_init (&err);
     dbus_bus_release_name (info->conn, info->reqname, &err);
     if (dbus_error_is_set (&err))
-        fprintf (stderr, "[CLIENT:%s] failed: release name (%s)\n", info->client, err.message);
+        XDBG_LOG ("[CLIENT:%s] failed: release name (%s)\n", info->client, err.message);
     dbus_error_free (&err);
 
     dbus_connection_remove_filter (info->conn, _xDbgDBusClinetMsgFilter, info);
     dbus_connection_unref (info->conn);
     info->conn = NULL;
 
-//    fprintf (stderr, "[CLIENT:%s] disconnected\n", info->client);
+//    XDBG_LOG ("[CLIENT:%s] disconnected\n", info->client);
 }
 
 XDbgDBusClientInfo*
@@ -213,7 +213,7 @@ xDbugDBusClientSendMessage (XDbgDBusClientInfo *info, int argc, char **argv)
     for (i = 0; i < argc; i++)
         if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &argv[i]))
         {
-            fprintf (stderr, "[CLIENT:%s] failed: append\n", info->client);
+            XDBG_LOG ("[CLIENT:%s] failed: append\n", info->client);
             goto err_send;
         }
 
@@ -221,14 +221,14 @@ xDbugDBusClientSendMessage (XDbgDBusClientInfo *info, int argc, char **argv)
                                                            REPLY_TIME, &err);
     if (dbus_error_is_set (&err))
     {
-        fprintf (stderr, "[CLIENT:%s] failed: send (%s)\n", info->client, err.message);
+        XDBG_LOG ("[CLIENT:%s] failed: send (%s)\n", info->client, err.message);
         goto err_send;
     }
     GOTO_IF_FAIL (reply_msg != NULL, err_send);
 
     if (!dbus_message_iter_init (reply_msg, &iter))
     {
-        fprintf (stderr, "[CLIENT:%s] Message has no arguments\n", info->client);
+        XDBG_LOG ("[CLIENT:%s] Message has no arguments\n", info->client);
         goto err_send;
     }
 
@@ -238,18 +238,18 @@ xDbugDBusClientSendMessage (XDbgDBusClientInfo *info, int argc, char **argv)
 
         if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING)
         {
-            fprintf (stderr, "[CLIENT:%s] Argument is not string!\n", info->client);
+            XDBG_LOG ("[CLIENT:%s] Argument is not string!\n", info->client);
             goto err_send;
         }
 
         dbus_message_iter_get_basic (&iter, &arg);
         if (!arg)
         {
-            fprintf (stderr, "[CLIENT:%s] arg is NULL\n", info->client);
+            XDBG_LOG ("[CLIENT:%s] arg is NULL\n", info->client);
             goto err_send;
         }
         else
-            fprintf (stderr, "%s\n", arg);
+            XDBG_LOG ("%s\n", arg);
     } while (dbus_message_iter_has_next (&iter) &&
            dbus_message_iter_next (&iter));
 
index 70125a8..6a581ba 100644 (file)
@@ -207,7 +207,7 @@ xDbgEvlogRuleValidate (EvlogInfo *evinfo)
 
     if (!rc)
     {
-        fprintf (stderr, "failed: create rulechecker\n");
+        XDBG_LOG ("failed: create rulechecker\n");
         return FALSE;
     }
 
@@ -298,7 +298,7 @@ _EvlogGetExtentionEntry (int *return_extensions_size)
     dpy = XOpenDisplay (NULL);
     if (!dpy)
     {
-        fprintf (stderr, "failed: open display\n");
+        XDBG_LOG ("failed: open display\n");
         exit (-1);
     }
 #endif
index d2fc8b1..1cb364b 100644 (file)
@@ -148,7 +148,7 @@ xDbgEvlogCompositeGetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, COMPOSITE_NAME, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no Composite extension. \n");
+        XDBG_LOG ("no Composite extension. \n");
         return;
     }
     extinfo->req_func = _EvlogRequestComposite;
index 9c779de..53dcd58 100644 (file)
@@ -555,7 +555,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
     case ButtonRelease:
     case MotionNotify:
         {
-               REPLY (": Root(0x%lx %d,%d) Event(0x%lx %d,%d) Child(0x%lx)",
+            REPLY (": Root(0x%lx %d,%d) Event(0x%lx %d,%d) Child(0x%lx)",
                 evt->u.keyButtonPointer.root,
                 evt->u.keyButtonPointer.rootX,
                 evt->u.keyButtonPointer.rootY,
@@ -676,7 +676,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case MapRequest:
         {
-               REPLY (": Window(0x%lx) Parent(0x%lx)",
+            REPLY (": Window(0x%lx) Parent(0x%lx)",
                 evt->u.mapRequest.window,
                 evt->u.mapRequest.parent);
 
@@ -685,7 +685,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case ReparentNotify:
         {
-               REPLY (": Window(0x%lx) Event(0x%lx) parent(0x%lx) coord(%d,%d)",
+            REPLY (": Window(0x%lx) Event(0x%lx) parent(0x%lx) coord(%d,%d)",
                 evt->u.reparent.window,
                 evt->u.reparent.event,
                 evt->u.reparent.parent,
@@ -697,7 +697,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case ConfigureNotify:
         {
-               REPLY (": Window(0x%lx) Event(0x%lx) aboveSibling(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
+            REPLY (": Window(0x%lx) Event(0x%lx) aboveSibling(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
                 evt->u.configureNotify.window,
                 evt->u.configureNotify.event,
                 evt->u.configureNotify.aboveSibling,
@@ -712,7 +712,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case ConfigureRequest:
         {
-               REPLY (": Window(0x%lx) Parent(0x%lx) Sibling(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
+            REPLY (": Window(0x%lx) Parent(0x%lx) Sibling(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
                 evt->u.configureRequest.window,
                 evt->u.configureRequest.parent,
                 evt->u.configureRequest.sibling,
@@ -727,7 +727,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case GravityNotify:
         {
-               REPLY (": Window(0x%lx) Event(0x%lx) coord(%d,%d)",
+            REPLY (": Window(0x%lx) Event(0x%lx) coord(%d,%d)",
                 evt->u.gravity.window,
                 evt->u.gravity.event,
                 evt->u.gravity.x,
@@ -738,7 +738,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case ResizeRequest:
         {
-               REPLY (": Window(0x%lx) size(%dx%d)",
+            REPLY (": Window(0x%lx) size(%dx%d)",
                 evt->u.resizeRequest.window,
                 evt->u.resizeRequest.width,
                 evt->u.resizeRequest.height);
@@ -749,7 +749,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
     case CirculateNotify:
     case CirculateRequest:
         {
-               REPLY (": Window(0x%lx) Event(0x%lx) parent(0x%lx)",
+            REPLY (": Window(0x%lx) Event(0x%lx) parent(0x%lx)",
                 evt->u.circulate.window,
                 evt->u.circulate.event,
                 evt->u.circulate.parent);
@@ -759,7 +759,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case PropertyNotify:
         {
-               REPLY (": Window(0x%lx) atom(0x%lx)",
+            REPLY (": Window(0x%lx) atom(0x%lx)",
                 evt->u.property.window,
                 evt->u.property.atom);
 
@@ -768,7 +768,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case SelectionClear:
         {
-               REPLY (": Window(0x%lx) atom(0x%lx)",
+            REPLY (": Window(0x%lx) atom(0x%lx)",
                 evt->u.selectionClear.window,
                 evt->u.selectionClear.atom);
 
@@ -777,7 +777,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case SelectionRequest:
         {
-               REPLY (": Owner(0x%lx) Requestor(0x%lx) Selcection(0x%lx) Target(0x%lx) Property(0x%lx)",
+            REPLY (": Owner(0x%lx) Requestor(0x%lx) Selcection(0x%lx) Target(0x%lx) Property(0x%lx)",
                 evt->u.selectionRequest.owner,
                 evt->u.selectionRequest.requestor,
                 evt->u.selectionRequest.selection,
@@ -789,7 +789,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case SelectionNotify:
         {
-               REPLY (": Requestor(0x%lx) Selcection(0x%lx) Target(0x%lx) Property(0x%lx)",
+            REPLY (": Requestor(0x%lx) Selcection(0x%lx) Target(0x%lx) Property(0x%lx)",
                 evt->u.selectionNotify.requestor,
                 evt->u.selectionNotify.selection,
                 evt->u.selectionNotify.target,
@@ -800,7 +800,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case ColormapNotify:
         {
-               REPLY (": XID(0x%lx) Colormap(0x%lx)",
+            REPLY (": XID(0x%lx) Colormap(0x%lx)",
                 evt->u.colormap.window,
                 evt->u.colormap.colormap);
 
@@ -809,7 +809,7 @@ char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
 
     case ClientMessage:
         {
-               REPLY (": XID(0x%lx) Atom(0x%lx)",
+            REPLY (": XID(0x%lx) Atom(0x%lx)",
                 evt->u.clientMessage.window,
                 evt->u.clientMessage.u.b.type);
 
index 1c879e5..3f4b53c 100644 (file)
@@ -135,7 +135,7 @@ xDbgEvlogDamageGetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, DAMAGE_NAME, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no Damage extension. \n");
+        XDBG_LOG ("no Damage extension. \n");
         return;
     }
 
index 69a4dfa..1ced3b2 100644 (file)
@@ -210,7 +210,7 @@ xDbgEvlogDri2GetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, DRI2_NAME, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no DRI2 extension. \n");
+        XDBG_LOG ("no DRI2 extension. \n");
         return;
     }
     extinfo->req_func = _EvlogRequestDri2;
index b26c11d..8e5710e 100644 (file)
@@ -227,7 +227,7 @@ xDbgEvlogGestureGetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, GESTURE_EXT_NAME, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no Gesture extension. \n");
+        XDBG_LOG ("no Gesture extension. \n");
         return;
     }
     extinfo->req_func = _EvlogRequestGesture;
index 84ec58f..38ffe99 100644 (file)
@@ -328,7 +328,7 @@ xDbgEvlogRandrGetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, RANDR_NAME, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no Randr extension. \n");
+        XDBG_LOG ("no Randr extension. \n");
         return;
     }
     extinfo->req_func = _EvlogRequestRandr;
index a95660e..e89530b 100644 (file)
@@ -434,7 +434,7 @@ xDbgEvlogXextDpmsGetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, DPMSExtensionName, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no Xext_DPMS extension. \n");
+        XDBG_LOG ("no Xext_DPMS extension. \n");
         return;
     }
     extinfo->req_func = _EvlogRequestXextDpms;
@@ -463,7 +463,7 @@ xDbgEvlogXextShmGetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, SHMNAME, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no XShm extension. \n");
+        XDBG_LOG ("no XShm extension. \n");
         return;
     }
     extinfo->req_func = _EvlogRequestXextShm;
@@ -492,7 +492,7 @@ xDbgEvlogXextSyncGetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, SYNC_NAME, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no Sync extension. \n");
+        XDBG_LOG ("no Sync extension. \n");
         return;
     }
 
@@ -523,7 +523,7 @@ xDbgEvlogXextXtestExt1GetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, XTestEXTENSION_NAME, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no XTestExt1 extension. \n");
+        XDBG_LOG ("no XTestExt1 extension. \n");
         return;
     }
     extinfo->req_func = _EvlogRequestXextXtestExt1;
@@ -553,7 +553,7 @@ xDbgEvlogXextXtestGetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, XTestExtensionName, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no Xext_Xtest extension. \n");
+        XDBG_LOG ("no Xext_Xtest extension. \n");
         return;
     }
     extinfo->req_func = _EvlogRequestXextXtest;
index 7fc5479..e1db0cd 100644 (file)
@@ -647,7 +647,7 @@ xDbgEvlogXinputGetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, INAME, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no Xinput extension. \n");
+        XDBG_LOG ("no Xinput extension. \n");
         return;
     }
     extinfo->req_func = _EvlogRequestXinput;
index e807030..6d63ba9 100644 (file)
@@ -239,7 +239,7 @@ xDbgEvlogXvGetBase (void *dpy, ExtensionInfo *extinfo)
 
     if (!XQueryExtension(d, XvName, &extinfo->opcode, &extinfo->evt_base, &extinfo->err_base))
     {
-        fprintf (stderr, "[UTILX] no Xv extension. \n");
+        XDBG_LOG ("no Xv extension. \n");
         return;
     }
     extinfo->req_func = _EvlogRequestXv;
index 784b7ef..d2298e5 100644 (file)
@@ -54,6 +54,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define GOTO_IF_ERRNO(cond, dst, errno) \
     {if (!(cond)) { fprintf (stderr, "[%s] '%s' failed. (err=%s(%d))\n", __FUNCTION__, #cond, strerror(errno), errno); goto dst; }}
 
+#define XDBG_LOG(fmt, ARG...)   { fprintf (stderr, fmt, ##ARG); }
+
 #define REPLY(fmt, ARG...)  \
     do { \
         if (reply && len && *len > 0) \