All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerone Young <jyoung5@us.ibm.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] fix xenstore check to properly compile with x86-64
Date: Wed, 21 Sep 2005 13:57:12 -0500	[thread overview]
Message-ID: <1127329032.9013.9.camel@thinkpad> (raw)

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@us.ibm.com>

--- 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@us.ibm.com
512-838-1157 (T/L: 678-1157)

                 reply	other threads:[~2005-09-21 18:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1127329032.9013.9.camel@thinkpad \
    --to=jyoung5@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.