From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: [PATCH] Use PRIu64 instead of %lu in monitor.c Date: Mon, 12 Feb 2007 22:09:08 -0600 Message-ID: <45D139E4.1090606@codemonkey.ws> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080202010204060206060802" To: kvm-devel Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------080202010204060206060802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Howdy, %lu only works on 64 bit hosts for uint64_t's. The most portable thing to do is use PRIu64. This is what is done in the rest of QEMU. Regards, Anthony Liguori --------------080202010204060206060802 Content-Type: text/x-patch; name="monitor-uint64.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="monitor-uint64.diff" diff -r f2e188be2c43 qemu/monitor.c --- a/qemu/monitor.c Mon Feb 12 22:04:38 2007 -0600 +++ b/qemu/monitor.c Mon Feb 12 22:06:28 2007 -0600 @@ -379,13 +379,15 @@ static void do_io_statistics(const char case 'a': term_printf("---------- hda io statistics ----------\n"); io[0] = vmdk_io_statistics(bs_table[0]); - term_printf("read: %lu \nwrite: %lu \n", io[0].read_byte_counter, io[0].write_byte_counter); + term_printf("read: %" PRIu64 " \nwrite: %" PRIu64 " \n", + io[0].read_byte_counter, io[0].write_byte_counter); break; case 'b': term_printf("---------- hdb io statistics ----------\n"); if (bs_table[1]) { io[1] = vmdk_io_statistics(bs_table[1]); - term_printf("read: %lu \nwrite: %lu \n", io[1].read_byte_counter, io[1].write_byte_counter); + term_printf("read: %" PRIu64 " \nwrite: %" PRIu64 " \n", + io[1].read_byte_counter, io[1].write_byte_counter); }else { term_printf("hdb not exist\n"); } @@ -394,7 +396,8 @@ static void do_io_statistics(const char term_printf("---------- hdc io statistics ----------\n"); if (bs_table[2]) { io[2] = vmdk_io_statistics(bs_table[2]); - term_printf("read: %lu \nwrite: %lu \n", io[2].read_byte_counter, io[2].write_byte_counter); + term_printf("read: %" PRIu64 " \nwrite: %" PRIu64 " \n", + io[2].read_byte_counter, io[2].write_byte_counter); }else { term_printf("hdc not exist\n"); } @@ -403,7 +406,8 @@ static void do_io_statistics(const char term_printf("---------- hdd io statistics ----------\n"); if (bs_table[3]) { io[3] = vmdk_io_statistics(bs_table[1]); - term_printf("read: %lu \nwrite: %lu \n", io[3].read_byte_counter, io[3].write_byte_counter); + term_printf("read: %" PRIu64 " \nwrite: %" PRIu64 " \n", + io[3].read_byte_counter, io[3].write_byte_counter); }else { term_printf("hdd not exist\n"); } --------------080202010204060206060802 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 --------------080202010204060206060802 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------080202010204060206060802--