X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fgdc.c;h=81de6c8d018e97473fe1049b4efce8e4c7275b13;hp=a2263245d95e9a781ee387914c28e6bf4a2c7da3;hb=32f9f5f12cd9159261f9db228461049e8c770404;hpb=683b593ffaeafaa191e701759b05cdba8086b6b1 diff --git a/test/gdc.c b/test/gdc.c index a2263245..81de6c8d 100644 --- a/test/gdc.c +++ b/test/gdc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,7 @@ * modified 10-18-89 for curses (jrl) * 10-18-89 added signal handling * - * $Id: gdc.c,v 1.40 2014/02/15 17:34:36 tom Exp $ + * $Id: gdc.c,v 1.44 2015/07/04 21:28:28 tom Exp $ */ #include @@ -89,7 +89,7 @@ drawbox(bool scrolling) int n; if (hascolor) - (void) attrset((attr_t) COLOR_PAIR(PAIR_FRAMES)); + (void) attrset(AttrArg(COLOR_PAIR(PAIR_FRAMES), 0)); MvAddCh(YBASE - 1, XBASE - 1, ACS_ULCORNER); hline(ACS_HLINE, XLENGTH); @@ -113,7 +113,7 @@ drawbox(bool scrolling) vline(ACS_VLINE, YDEPTH); if (hascolor) - (void) attrset((attr_t) COLOR_PAIR(PAIR_OTHERS)); + (void) attrset(AttrArg(COLOR_PAIR(PAIR_OTHERS), 0)); } static void @@ -121,13 +121,13 @@ standt(int on) { if (on) { if (hascolor) { - attron((attr_t) COLOR_PAIR(PAIR_DIGITS)); + attron(COLOR_PAIR(PAIR_DIGITS)); } else { attron(A_STANDOUT); } } else { if (hascolor) { - attron((attr_t) COLOR_PAIR(PAIR_OTHERS)); + attron(COLOR_PAIR(PAIR_OTHERS)); } else { attroff(A_STANDOUT); } @@ -274,7 +274,7 @@ main(int argc, char *argv[]) init_pair(PAIR_DIGITS, COLOR_BLACK, COLOR_RED); init_pair(PAIR_OTHERS, COLOR_RED, bg); init_pair(PAIR_FRAMES, COLOR_WHITE, bg); - (void) attrset((attr_t) COLOR_PAIR(PAIR_OTHERS)); + (void) attrset(AttrArg(COLOR_PAIR(PAIR_OTHERS), 0)); } restart: @@ -380,7 +380,11 @@ main(int argc, char *argv[]) /* this depends on the detailed format of ctime(3) */ (void) strncpy(buf, ctime(&now), (size_t) 30); - (void) strcpy(buf + 10, buf + 19); + { + char *d2 = buf + 10; + char *s2 = buf + 19; + while ((*d2++ = *s2++) != '\0') ; + } MvAddStr(16, 30, buf); move(6, 0);