The changes to xentop.c: - vwprintw(stdscr, (char *)fmt, args); + vwprintw(stdscr, (const char *)fmt, args); - addstr((char *)str); + addstr((const char *)str); Are both unneccessary on Linux (as they''re const char * already), and broken on Solaris, where we have rather unfortunate prototypes from pre-history that aren''t constified. I think these need to be reverted back to being the meaningful ''(char *)''. regards, john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon
2006-Dec-28 17:39 UTC
[Xen-devel] [PATCH] 13120:3e2d3d737624 breaks Solaris compile
On Fri, Dec 22, 2006 at 02:29:57PM +0000, John Levon wrote:> Are both unneccessary on Linux (as they''re const char * already), and > broken on Solaris, where we have rather unfortunate prototypes from > pre-history that aren''t constified. I think these need to be reverted > back to being the meaningful ''(char *)''.The below is still needed. regards john # HG changeset patch # User john.levon@sun.com # Date 1167321418 28800 # Node ID a00bf3c8f7bc8cb8537b153c61e6d09c9b494459 # Parent bce4fd687b7901de6f2e72ea37d92508eb3f5a77 Older curses implementations don''t have const-safe prototypes, so we must cast. Signed-off-by: John Levon <john.levon@sun.com> diff --git a/tools/xenstat/xentop/xentop.c b/tools/xenstat/xentop/xentop.c --- a/tools/xenstat/xentop/xentop.c +++ b/tools/xenstat/xentop/xentop.c @@ -271,7 +271,7 @@ static void print(const char *fmt, ...) if (!batch) { if((current_row() < lines()-1)) { va_start(args, fmt); - vwprintw(stdscr, fmt, args); + vwprintw(stdscr, (char *)fmt, args); va_end(args); } } else { @@ -285,7 +285,7 @@ static void attr_addstr(int attr, const static void attr_addstr(int attr, const char *str) { attron(attr); - addstr(str); + addstr((char *)str); attroff(attr); } _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel