WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] Re: PATCH[3/3] take 2: xenitp tool

To: Tristan Gingold <tgingold@xxxxxxx>
Subject: [Xen-ia64-devel] Re: PATCH[3/3] take 2: xenitp tool
From: Alex Williamson <alex.williamson@xxxxxx>
Date: Mon, 24 Sep 2007 14:49:57 -0600
Cc: Xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 24 Sep 2007 13:50:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070922125111.GA2571@saphi>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: OSLO R&D
References: <20070919235604.GA2934@xxxxxxxxxxxxxxxxxxxxx> <1190400315.6358.8.camel@lappy> <20070922125111.GA2571@saphi>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Sat, 2007-09-22 at 14:51 +0200, Tristan Gingold wrote:
> 
> I have just added the header.

Hi Tristan,

   Thanks, applied.  It looks like a very handy tool.  I get a few
warnings building it, almost all having to do with sign differences for
char *.  The patch below removes them, but I thought I'd pass it by you
in case you want to make any structural changes to avoid them instead of
just cast'ing them away.  Thanks,

        Alex

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---

diff -r 42d4313b5fdd tools/debugger/xenitp/xenitp.c
--- a/tools/debugger/xenitp/xenitp.c    Mon Sep 24 14:21:02 2007 -0600
+++ b/tools/debugger/xenitp/xenitp.c    Mon Sep 24 14:26:18 2007 -0600
@@ -790,12 +790,12 @@ int parse_unary (unsigned char **buf, un
     case '0' ... '9':
         {
             char *e;
-            *res = strtoul (*buf, &e, 0);
+            *res = strtoul ((char *)*buf, &e, 0);
             if (e == (char *)*buf) {
                 printf ("bad literal\n");
                 return -1;
             }
-            *buf = e;
+            *buf = (unsigned char *)e;
         }
         break;
     case '+':
@@ -828,13 +828,13 @@ int parse_unary (unsigned char **buf, un
 
             c = b[len];
             b[len] = 0;
-            reg = get_reg_addr (b);
+            reg = get_reg_addr ((char *)b);
             b[len] = c;
 
             if (reg != NULL)
                 *res = *reg;
-            else if (strncmp (b, "d2p", len) == 0 ||
-                     strncmp (b, "i2p", len) == 0) {
+            else if (strncmp ((char *)b, "d2p", len) == 0 ||
+                     strncmp ((char *)b, "i2p", len) == 0) {
                 unsigned long vaddr;
 
                 *buf = e;
@@ -1205,31 +1205,31 @@ static int
 static int
 cmd_disp (unsigned char *arg)
 {
-    if (strcmp (arg, "br") == 0)
+    if (strcmp ((char *)arg, "br") == 0)
         print_br (cur_ctx);
-    else if (strcmp (arg, "regs") == 0)
+    else if (strcmp ((char *)arg, "regs") == 0)
         print_regs (cur_ctx);
-    else if (strcmp (arg, "cr") == 0)
+    else if (strcmp ((char *)arg, "cr") == 0)
         print_cr (cur_ctx);
-    else if (strcmp (arg, "ar") == 0)
+    else if (strcmp ((char *)arg, "ar") == 0)
         print_ar (cur_ctx);
-    else if (strcmp (arg, "tr") == 0)
+    else if (strcmp ((char *)arg, "tr") == 0)
         print_tr (cur_ctx);
-    else if (strcmp (arg, "rr") == 0)
+    else if (strcmp ((char *)arg, "rr") == 0)
         print_rr (cur_ctx);
-    else if (strcmp (arg, "db") == 0)
+    else if (strcmp ((char *)arg, "db") == 0)
         print_db (cur_ctx);
-    else if (strcmp (arg, "psr") == 0) {
+    else if (strcmp ((char *)arg, "psr") == 0) {
         printf ("psr:");
         print_bits (psr_bits, cur_ctx->regs.psr);
         printf ("\n");
     }
-    else if (strcmp (arg, "ipsr") == 0) {
+    else if (strcmp ((char *)arg, "ipsr") == 0) {
         printf ("ipsr:");
         print_bits (psr_bits, cur_ctx->regs.cr.ipsr);
         printf ("\n");
     }
-    else if (strcmp (arg, "break") == 0) {
+    else if (strcmp ((char *)arg, "break") == 0) {
         int i;
 
         for (i = 0; i < 4; i++)
@@ -1238,7 +1238,7 @@ cmd_disp (unsigned char *arg)
                         (cur_ctx->regs.ibr[2 * i + 1] & (1UL << 63)) ?
                         "enabled" : "disabled");
     }
-    else if (strcmp (arg, "domain") == 0) {
+    else if (strcmp ((char *)arg, "domain") == 0) {
         xc_dominfo_t dominfo;
 #ifdef HAVE_DEBUG_OP
         xen_ia64_debug_op_t debug_op;
@@ -1311,7 +1311,7 @@ cmd_bev (unsigned char *arg)
         return 0;
     }
     else {
-        char *p = strtok (arg, " ");
+        char *p = strtok ((char *)arg, " ");
 
         while (p != NULL) {
             unsigned int flag = 0;
@@ -1353,7 +1353,7 @@ cmd_set (unsigned char *line)
 
     reg = parse_arg (&line);
 
-    addr = get_reg_addr (reg);
+    addr = get_reg_addr ((char *)reg);
     if (addr == NULL) {
         printf ("unknown register %s\n", reg);
         return -1;
@@ -1499,10 +1499,10 @@ void xenitp (int vcpu)
 
         printf ("XenITP> ");
 
-        if (fgets (buf, sizeof (buf), stdin) == NULL)
+        if (fgets ((char *)buf, sizeof (buf), stdin) == NULL)
             break;
 
-        len = strlen (buf);
+        len = strlen ((char *)buf);
         if (len > 1 && buf[len - 1] == '\n')
             buf[len - 1] = 0;
 



_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel