From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Subject: [PATCH] fix xenstore check to properly compile with x86-64 Date: Wed, 21 Sep 2005 13:57:12 -0500 Message-ID: <1127329032.9013.9.camel@thinkpad> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org 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 =E2=80=98init_perms=E2=80=99: xs_random.c:253: warning: field precision should have type =E2=80=98int=E2= =80=99, but argument 3 has type =E2=80=98long int=E2=80=99 xs_random.c: In function =E2=80=98parent_filename=E2=80=99: xs_random.c:311: warning: field precision should have type =E2=80=98int=E2= =80=99, but argument 3 has type =E2=80=98long int=E2=80=99) Signed-off-by: Jerone Young --- 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 =3D talloc_asprintf(filename, "%.*s", - strrchr(filename, '/') - filename, + (int)(strrchr(filename, '/') - filename), filename); if (lstat(dirname, &st) =3D=3D 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 =3D 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 =3D 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 =3D 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) !=3D 0) @@ -1334,13 +1334,13 @@ static unsigned int try_diff(const bool file =3D 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 =3D 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); --=20 Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157)