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-devel

[Xen-devel] [PATCH] fix xenstore check to properly compile with x86-64

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] fix xenstore check to properly compile with x86-64
From: Jerone Young <jyoung5@xxxxxxxxxx>
Date: Wed, 21 Sep 2005 13:57:12 -0500
Delivery-date: Wed, 21 Sep 2005 18:57:30 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This fixes the "make check" feature of xenstore to properly compile with
x86-64. When compiling you would get the following error since on x86-64
it was passing a long , when you are expecting an int:

(snippet)
cc1: warnings being treated as errors
xs_random.c: In function ‘init_perms’:
xs_random.c:253: warning: field precision should have type ‘int’, but
argument 3 has type ‘long int’
xs_random.c: In function ‘parent_filename’:
xs_random.c:311: warning: field precision should have type ‘int’, but
argument 3 has type ‘long int’)

Signed-off-by: Jerone Young <jyoung5@xxxxxxxxxx>

--- tools/xenstore/xs_random.c.bak      2005-09-21 13:56:04.000000000
-0400
+++ tools/xenstore/xs_random.c  2005-09-21 13:52:31.000000000 -0400
@@ -75,7 +75,7 @@ static void maybe_convert_to_directory(c
 {
        struct stat st;
        char *dirname = talloc_asprintf(filename, "%.*s",
-                                       strrchr(filename, '/') -
filename,
+                                       (int)(strrchr(filename, '/') -
filename),
                                        filename);
        if (lstat(dirname, &st) == 0 && S_ISREG(st.st_mode))
                convert_to_dir(dirname);
@@ -249,7 +249,7 @@ static void init_perms(const char *filen

        /* Copy permissions from parent */
        command = talloc_asprintf(filename, "cp %.*s/.perms %s",
-                                 strrchr(filename, '/') - filename,
+                                 (int)(strrchr(filename, '/') -
filename),
                                  filename, permfile);
        do_command(command);
 }
@@ -308,7 +308,7 @@ static char *parent_filename(const char
        char *slash = strrchr(name + 1, '/');
        if (!slash)
                return talloc_strdup(name, "/");
-       return talloc_asprintf(name, "%.*s", slash-name, name);
+       return talloc_asprintf(name, "%.*s", (int)(slash-name), name);
 }

 static void make_dirs(const char *filename)
@@ -1063,7 +1063,7 @@ static unsigned int try_simple(const boo

                ret = do_next_op(data->ops, h, i + data->seed, verbose);
                if (verbose)
-                       printf("-> %.*s\n", strchr(ret, '\n') - ret,
ret);
+                       printf("-> %.*s\n", (int)(strchr(ret, '\n') -
ret), ret);
                if (streq(ret, "FAILED:Bad file descriptor"))
                        goto out;
                if (kill(daemon_pid, 0) != 0)
@@ -1334,13 +1334,13 @@ static unsigned int try_diff(const bool

                file = do_next_op(&file_ops, fileh, i+data->seed,
verbose);
                if (verbose)
-                       printf("-> %.*s\n", strchr(file, '/') - file,
file);
+                       printf("-> %.*s\n", (int)(strchr(file, '/') -
file), file);

                if (verbose)
                        printf("XS: ");
                xs = do_next_op(&xs_ops, xsh, i+data->seed, verbose);
                if (verbose)
-                       printf("-> %.*s\n", strchr(xs, '/') - xs, xs);
+                       printf("-> %.*s\n", (int)(strchr(xs, '/') - xs),
xs);

                if (!streq(file, xs))
                        goto out;
@@ -1508,7 +1508,7 @@ static unsigned int try_fail(const bool
                        aborted++;

                if (verbose)
-                       printf("-> %.*s\n", strchr(ret, '\n') - ret,
ret);
+                       printf("-> %.*s\n", (int)(strchr(ret, '\n') -
ret), ret);

                talloc_free(ret);



-- 
Jerone Young
IBM Linux Technology Center
jyoung5@xxxxxxxxxx
512-838-1157 (T/L: 678-1157)


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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] fix xenstore check to properly compile with x86-64, Jerone Young <=