fix: xorg-x11-drv-exynos build-break
authorBoram Park <boram1288.park@samsung.com>
Tue, 16 Apr 2013 10:22:40 +0000 (19:22 +0900)
committerBoram Park <boram1288.park@samsung.com>
Mon, 17 Jun 2013 08:44:34 +0000 (17:44 +0900)
Change-Id: Idab429fb8bcced50b1d74f7376e00836aa02395e

common/xdbg_evlog.c
common/xdbg_evlog_event.c
common/xdbg_evlog_request.c
common/xdbg_types.h
lib/xdbg_log.h

index b80dec5..eaae2d6 100644 (file)
@@ -114,7 +114,7 @@ xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len)
 
         if (argc < 3)
         {
-            XDBG_REPLY ("Error : Too few arguments.\n");
+            REPLY ("Error : Too few arguments.\n");
             return FALSE;
         }
 
@@ -124,7 +124,7 @@ xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len)
             policy_type = DENY;
         else
         {
-            XDBG_REPLY ("Error : Unknown policy : [%s].\n          Policy should be ALLOW or DENY.\n", policy);
+            REPLY ("Error : Unknown policy : [%s].\n          Policy should be ALLOW or DENY.\n", policy);
             return FALSE;
         }
 
@@ -133,16 +133,16 @@ xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len)
         result = rulechecker_add_rule (rc, policy_type, rule);
         if (result == RC_ERR_TOO_MANY_RULES)
         {
-            XDBG_REPLY ("Error : Too many rules were added.\n");
+            REPLY ("Error : Too many rules were added.\n");
             return FALSE;
         }
         else if (result == RC_ERR_PARSE_ERROR)
         {
-            XDBG_REPLY ("Error : An error occured during parsing the rule [%s]\n", rule);
+            REPLY ("Error : An error occured during parsing the rule [%s]\n", rule);
             return FALSE;
         }
 
-        XDBG_REPLY ("The rule was successfully added.\n\n");
+        REPLY ("The rule was successfully added.\n\n");
         rulechecker_print_rule (rc, reply);
         return TRUE;
     }
@@ -153,7 +153,7 @@ xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len)
 
         if (argc < 2)
         {
-            XDBG_REPLY ("Error : Too few arguments.\n");
+            REPLY ("Error : Too few arguments.\n");
             return FALSE;
         }
 
@@ -165,15 +165,15 @@ xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len)
             {
                 rulechecker_destroy (rc);
                 rc = rulechecker_init();
-                XDBG_REPLY ("Every rules were successfully removed.\n");
+                REPLY ("Every rules were successfully removed.\n");
             }
             else
             {
                 int index = atoi (remove_idx);
                 if (isdigit (*remove_idx) && rulechecker_remove_rule (rc, index) == 0)
-                    XDBG_REPLY ("The rule [%d] was successfully removed.\n", index);
+                    REPLY ("The rule [%d] was successfully removed.\n", index);
                 else
-                    XDBG_REPLY ("Rule remove fail : No such rule [%s].\n", remove_idx);
+                    REPLY ("Rule remove fail : No such rule [%s].\n", remove_idx);
             }
         }
         rulechecker_print_rule (rc, reply);
@@ -186,11 +186,11 @@ xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len)
     }
     else if (!_strcasecmp (command, "help"))
     {
-        XDBG_REPLY ("%s", rulechecker_print_usage());
+        REPLY ("%s", rulechecker_print_usage());
         return TRUE;
     }
 
-    XDBG_REPLY ("%s\nUnknown command : [%s].\n\n", rulechecker_print_usage(), command);
+    REPLY ("%s\nUnknown command : [%s].\n\n", rulechecker_print_usage(), command);
 
     return TRUE;
 }
@@ -233,7 +233,7 @@ xDbgEvlogFillLog (EvlogInfo *evinfo, char *reply, int *len)
     RETURN_IF_FAIL (evinfo->type >= 0 && (sizeof (evt_dir) / sizeof (char*)));
     RETURN_IF_FAIL (evinfo->type >= 0 && (sizeof (evt_type) / sizeof (char*)));
 
-    XDBG_REPLY ("[%10.3f][%5ld] %22s(%2d:%5d) %s %s",
+    REPLY ("[%10.3f][%5ld] %22s(%2d:%5d) %s %s",
                 evinfo->time / 1000.0,
                 evinfo->time - prev,
                 xDbgEvlogGetCmd (evinfo->client.command),
@@ -244,15 +244,15 @@ xDbgEvlogFillLog (EvlogInfo *evinfo, char *reply, int *len)
 
     if (evinfo->type == REQUEST)
     {
-        XDBG_REPLY ("(");
+        REPLY ("(");
         reply = xDbgEvlogReqeust (evinfo, reply, len);
-        XDBG_REPLY (")");
+        REPLY (")");
     }
     else if (evinfo->type == EVENT)
     {
-        XDBG_REPLY ("(");
+        REPLY ("(");
         reply = xDbgEvlogEvent (evinfo, reply, len);
-        XDBG_REPLY (")");
+        REPLY (")");
     }
     else
     {
@@ -261,10 +261,10 @@ xDbgEvlogFillLog (EvlogInfo *evinfo, char *reply, int *len)
             evlog_name = evinfo->req.name;
         else if (evinfo->type == EVENT)
             evlog_name = evinfo->evt.name;
-        XDBG_REPLY ("(%s)", evlog_name);
+        REPLY ("(%s)", evlog_name);
     }
 
-    XDBG_REPLY ("\n");
+    REPLY ("\n");
 
     prev = evinfo->time;
 }
index 899c351..cbe87f2 100644 (file)
@@ -134,7 +134,7 @@ xDbgEvlogEvent (EvlogInfo *evinfo, char *reply, int *len)
     if (!_EvlogEventGetExtentionEntry ())
         return reply;
 
-    XDBG_REPLY ("%s", ev.name);
+    REPLY ("%s", ev.name);
 
 #ifdef XDBG_CLIENT
     if (xEvt->u.u.type == damage_base + XDamageNotify)
@@ -143,7 +143,7 @@ xDbgEvlogEvent (EvlogInfo *evinfo, char *reply, int *len)
 #endif
     {
         xDamageNotifyEvent *damage_e = (xDamageNotifyEvent*)xEvt;
-        XDBG_REPLY (": XID(%lx) area(%d,%d %dx%d) geo(%d,%d %dx%d)",
+        REPLY (": XID(%lx) area(%d,%d %dx%d) geo(%d,%d %dx%d)",
             damage_e->drawable,
             damage_e->area.x,
             damage_e->area.y,
index d6c14cc..3a4797d 100644 (file)
@@ -127,7 +127,7 @@ _EvlogRequestCore (xReq *req, char *reply, int *len)
     case X_PutImage:
         {
             xPutImageReq *stuff = (xPutImageReq *)req;
-            XDBG_REPLY (": XID(%lx) size(%dx%d) dst(%d,%d)",
+            REPLY (": XID(%lx) size(%dx%d) dst(%d,%d)",
                 stuff->drawable,
                 stuff->width,
                 stuff->height,
@@ -152,7 +152,7 @@ _EvlogRequestShm (xReq *req, char *reply, int *len)
     case X_ShmPutImage:
         {
             xShmPutImageReq *stuff = (xShmPutImageReq *)req;
-            XDBG_REPLY (": XID(%lx) size(%dx%d) src(%d,%d %dx%d) dst(%d,%d)",
+            REPLY (": XID(%lx) size(%dx%d) src(%d,%d %dx%d) dst(%d,%d)",
                 stuff->drawable,
                 stuff->totalWidth,
                 stuff->totalHeight,
@@ -186,7 +186,7 @@ xDbgEvlogReqeust (EvlogInfo *evinfo, char *reply, int *len)
     if (!_EvlogRequestGetExtentionEntry ())
         return reply;
 
-    XDBG_REPLY ("%s", req.name);
+    REPLY ("%s", req.name);
 
     if (xReq->reqType < EXTENSION_BASE)
     {
index 8a19c77..c8fe9c0 100644 (file)
@@ -54,7 +54,7 @@ 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_REPLY(fmt, ARG...)  \
+#define REPLY(fmt, ARG...)  \
     do { \
         if (reply && len && *len > 0) \
         { \
index 78e8a38..554b0be 100644 (file)
@@ -103,6 +103,16 @@ void* xDbgLog            (unsigned int module, int logoption, const char *file,
 #define XDBG_GOTO_IF_FAIL(cond, dst)       {if (!(cond)) { ErrorF ("[%s] '%s' failed.\n", __FUNCTION__, #cond); goto dst; }}
 #define XDBG_GOTO_IF_ERRNO(cond, dst, errno)       {if (!(cond)) { ErrorF ("[%s] '%s' failed. (err=%s(%d))\n", __FUNCTION__, #cond, strerror(errno), errno); goto dst; }}
 
+#define XDBG_REPLY(fmt, ARG...)  \
+    do { \
+        if (reply && len && *len > 0) \
+        { \
+            int s = snprintf (reply, *len, fmt, ##ARG); \
+            reply += s; \
+            *len -= s; \
+        } \
+    } while (0)
+
 unsigned int xDbgLogGetModule (char *name);
 
 #define _C(b,s)             (((b) >> (s)) & 0xFF)