v03i051: a colorful kaleidoscopic display, version 3, Patch4

Mike Wexler mikew at wyse.wyse.com
Wed Mar 15 04:57:22 AEST 1989


Submitted-by: nathanm at hp-pcd.hp.com (Nathan Meyers)
Posting-number: Volume 3, Issue 51
Archive-name: kaleid3/patch4

diff -cr kaleid.old/README kaleid/README

*** kaleid.old/README	Fri Mar 10 11:41:44 1989
--- kaleid/README	Tue Mar 14 09:24:17 1989
***************
*** 11,17 ****
  
  To make on systems of SYSV descent (such as hp-ux):
  
! 	make SYSV
  
  ---------------------
  Nathan Meyers
--- 11,17 ----
  
  To make on systems of SYSV descent (such as hp-ux):
  
! 	make "CDEBUGFLAGS=-O -DSYSV"
  
  ---------------------
  Nathan Meyers
diff -cr kaleid.old/kaleid.c kaleid/kaleid.c
*** kaleid.old/kaleid.c	Fri Mar 10 11:41:45 1989
--- kaleid/kaleid.c	Tue Mar 14 09:24:29 1989
***************
*** 19,26 ****
  
  char *progname;
  
- char *strchr();
- char *calloc();
  
  /* Approximation of CGA/EGA/VGA colors -- (out of standard order) */
  unsigned long colors[][3] = { { 0x0000, 0x0000, 0x0000 },    /* black */
--- 19,24 ----
***************
*** 42,48 ****
  
  #define NCOLORS 16
  
! static char *what = "@(#)kaleid.c $Revision: 1.98 $";
  
  Display *display;
  int screen;
--- 40,46 ----
  
  #define NCOLORS 16
  
! static char *what = "@(#)kaleid.c $Revision: 1.101 $";
  
  Display *display;
  int screen;
***************
*** 107,118 ****
    int iconic=0, bstore=0;
    long delayvalue = -1L, icondelay=100L;
    char *clipcoords = NULL;
    int monochrome=0;
    int o_argc = argc;
    char **o_argv = argv;
    int i,j;
    long time();
!   char *basename;
    long atol();
  
    progname = argv[0];
--- 105,117 ----
    int iconic=0, bstore=0;
    long delayvalue = -1L, icondelay=100L;
    char *clipcoords = NULL;
+   char *strchr();
    int monochrome=0;
    int o_argc = argc;
    char **o_argv = argv;
    int i,j;
    long time();
!   char *basename, *strrchr();
    long atol();
  
    progname = argv[0];
***************
*** 239,250 ****
      char *calloc();
      double strtod();
      int commacount = 0;
-     int len;
      while (*temp != '\0') commacount += (*(temp++) == ',') ? 1 : 0;
      if ((commacount & 0x3) != 3) usage();
      nclips = (commacount >> 2) + 1;
!     clips = (struct fclip *)calloc(nclips, sizeof(struct fclip));
!     cliplist = (XRectangle *)calloc(nclips, sizeof(XRectangle));
      if (clips == NULL || cliplist == NULL) {
        fprintf(stderr,"%s: calloc() failed\n",progname);
        exit(1);
--- 238,248 ----
      char *calloc();
      double strtod();
      int commacount = 0;
      while (*temp != '\0') commacount += (*(temp++) == ',') ? 1 : 0;
      if ((commacount & 0x3) != 3) usage();
      nclips = (commacount >> 2) + 1;
!     clips = (struct fclip *)calloc((unsigned)nclips, sizeof(struct fclip));
!     cliplist = (XRectangle *)calloc((unsigned)nclips, sizeof(XRectangle));
      if (clips == NULL || cliplist == NULL) {
        fprintf(stderr,"%s: calloc() failed\n",progname);
        exit(1);
***************
*** 281,286 ****
--- 279,285 ----
        int thiscolor;
        numcolors = 0;
        for (thiscolor=0; thiscolor<NCOLORS; thiscolor++) {
+ 
  	char *comma=strchr(ucolors,',');
  
  	if (comma != NULL) *comma='\0';
***************
*** 348,354 ****
  
    if (doroot) {
      nwindows=rootx*rooty;
!     if (!allocate_arrays(nwindows)) {
        (void)fprintf(stderr,"%s: malloc() failure\n",progname);
        exit(1);
      }
--- 347,353 ----
  
    if (doroot) {
      nwindows=rootx*rooty;
!     if (!allocate_arrays((unsigned)nwindows)) {
        (void)fprintf(stderr,"%s: malloc() failure\n",progname);
        exit(1);
      }
***************
*** 730,736 ****
            CY[i] = event->xconfigure.height;
  	}
  	else {
- 	  int dorandom=0;
            if (CX[i] != event->xconfigure.width/2 ||
                CY[i] != event->xconfigure.height/2) {
  	    XClearWindow(display,event->xconfigure.window);
--- 729,734 ----
***************
*** 861,867 ****
      "[-bg <background>]",
      "[-bstore]",
      "[-bw <borderwidth>]",
!     "[-clip x,y,w,h[,x,y,w,h[,x,y,w,h]]]",
      "[-colors <color1>[,<color2>[,...]]]",
      "[-delay <msec>]",
      "[-display <displayname>]",
--- 859,865 ----
      "[-bg <background>]",
      "[-bstore]",
      "[-bw <borderwidth>]",
!     "[-clip x,y,w,h[,x,y,w,h[,...]]]",
      "[-colors <color1>[,<color2>[,...]]]",
      "[-delay <msec>]",
      "[-display <displayname>]",
***************
*** 906,912 ****
  long maxval;
  int element;
  {
!   long lrand48();
    int sr1=15, sr2=16;
    long mv=maxval;
    while (mv > 0x8000L) {
--- 904,910 ----
  long maxval;
  int element;
  {
!   long nrand48(), lrand48();
    int sr1=15, sr2=16;
    long mv=maxval;
    while (mv > 0x8000L) {
***************
*** 921,926 ****
--- 919,925 ----
  allocate_arrays(nwin)
  unsigned nwin;
  {
+   char *calloc();
    int i;
    if ((window=(Window *)calloc(nwin,sizeof(Window))) == NULL) return 0;
    if ((window_gcs=(GC *)calloc(nwin,sizeof(GC))) == NULL) return 0;
***************
*** 1019,1025 ****
    /* Set next alarm to current time + interval.  If more than one window
       is visible, introduce a random variance so update is staggered.  */
    interval = intervals[nextalarm-schedule];
!   if (nvisible > 1) interval += rndm(interval/5L,-1) - interval/10L;
    nextalarm->tv_sec = currtime.tv_sec + interval/1000;
    nextalarm->tv_usec = currtime.tv_usec + (interval%1000)*1000;
    if (nextalarm->tv_usec >= 1000000) {
--- 1018,1024 ----
    /* Set next alarm to current time + interval.  If more than one window
       is visible, introduce a random variance so update is staggered.  */
    interval = intervals[nextalarm-schedule];
!   if (nvisible > 1) interval += rndm((long)(interval/5L),-1) - interval/10L;
    nextalarm->tv_sec = currtime.tv_sec + interval/1000;
    nextalarm->tv_usec = currtime.tv_usec + (interval%1000)*1000;
    if (nextalarm->tv_usec >= 1000000) {
diff -cr kaleid.old/patchlevel.h kaleid/patchlevel.h
*** kaleid.old/patchlevel.h	Fri Mar 10 11:41:46 1989
--- kaleid/patchlevel.h	Tue Mar 14 09:24:30 1989
***************
*** 1 ****
! #define PATCHLEVEL 3
--- 1 ----
! #define PATCHLEVEL 4
-- 
Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
Moderator of comp.sources.x



More information about the Comp.sources.x mailing list