[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Jerone Young <jyoung5@xxxxxxxxxx>
  • Date: Wed, 21 Sep 2005 13:57:12 -0500
  • Delivery-date: Wed, 21 Sep 2005 18:57:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.