From: "Charles Coffing" <ccoffing@novell.com>
To: xen-devel@lists.sf.net
Subject: [PATCH] trivial libxc portability patch
Date: Fri, 10 Dec 2004 14:34:26 -0700 [thread overview]
Message-ID: <s1b9b3fa.024@sinclair.provo.novell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 270 bytes --]
The installed Xen header files (/usr/include/xen/*) expect the U8, u16,
u32, etc types to already be defined. Currently, xc.h provides this in
a nonportable way. I've changed xc.h to use stdint.h, and fixed a few
printf-style format strings to match.
Thanks,
Charles
[-- Attachment #2: xc-types.patch --]
[-- Type: application/octet-stream, Size: 1980 bytes --]
--- a/tools/libxc/xc.h 2004-12-02 09:25:04.000000000 -0700
+++ b/tools/libxc/xc.h 2004-12-09 12:28:11.346154189 -0700
@@ -9,14 +9,15 @@
#ifndef __XC_H__
#define __XC_H__
-typedef unsigned char u8;
-typedef unsigned short u16;
-typedef unsigned long u32;
-typedef unsigned long long u64;
-typedef signed char s8;
-typedef signed short s16;
-typedef signed long s32;
-typedef signed long long s64;
+#include <stdint.h>
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+typedef int8_t s8;
+typedef int16_t s16;
+typedef int32_t s32;
+typedef int64_t s64;
#include <xen/xen.h>
#include <xen/dom0_ops.h>
--- a/tools/libxc/xc_linux_save.c 2004-12-09 12:49:14.163232557 -0700
+++ b/tools/libxc/xc_linux_save.c 2004-12-09 13:08:42.965728543 -0700
@@ -6,6 +6,7 @@
* Copyright (c) 2003, K A Fraser.
*/
+#include <inttypes.h>
#include <sys/time.h>
#include "xc_private.h"
#include <xen/linux/suspend.h>
@@ -243,7 +244,7 @@
if ( print )
printf("delta %lldms, dom0 %d%%, target %d%%, sent %dMb/s, "
- "dirtied %dMb/s %ld pages\n",
+ "dirtied %dMb/s %" PRId32 " pages\n",
wall_delta,
(int)((d0_cpu_delta*100)/wall_delta),
(int)((d1_cpu_delta*100)/wall_delta),
@@ -305,8 +306,8 @@
DOM0_SHADOW_CONTROL_OP_PEEK,
NULL, 0, &stats);
- printf("now= %lld faults= %ld dirty= %ld dirty_net= %ld "
- "dirty_block= %ld\n",
+ printf("now= %lld faults= %" PRId32 " dirty= %" PRId32
+ " dirty_net= %" PRId32 " dirty_block= %" PRId32"\n",
((now-start)+500)/1000,
stats.fault_count, stats.dirty_count,
stats.dirty_net_count, stats.dirty_block_count);
reply other threads:[~2004-12-10 21:34 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=s1b9b3fa.024@sinclair.provo.novell.com \
--to=ccoffing@novell.com \
--cc=xen-devel@lists.sf.net \
/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.