swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SWARM Boids


From: Marcus G. Daniels
Subject: Re: SWARM Boids
Date: 02 Jun 1999 12:18:44 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.3.10

>>>>> "EW" == Eric Werk <address@hidden> writes:

EW> http://www.daimi.au.dk/~werk/swarm/boid/boid.tar.gz

Cool!  Here are few tweaks to avoid NULL pointer conditions,
and a buffer overrun:

diff -c -r boid/Polygon.m boid-new/Polygon.m
*** boid/Polygon.m      Wed Jun  2 11:47:49 1999
--- boid-new/Polygon.m  Wed Jun  2 13:12:25 1999
***************
*** 11,22 ****
    return [super createEnd];
  }
  
  - createItem
  {
    id <Index> index;
    id <Vector> vector;
    if ([vectorList getCount]>0) {
!     char eval[20 + [vectorList getCount]*5];
      
      index = [vectorList begin: [self getZone]];
      
--- 11,27 ----
    return [super createEnd];
  }
  
+ - createBindings
+ {
+    return self;
+ }
+ 
  - createItem
  {
    id <Index> index;
    id <Vector> vector;
    if ([vectorList getCount]>0) {
!     char eval[20 + [vectorList getCount]*(2 * (1 + 3)) + 1];
      
      index = [vectorList begin: [self getZone]];
      
***************
*** 33,39 ****
  
  - erase
  {
!   [globalTkInterp eval: "%s delete %s", [canvas getWidgetName], item];  
    return self;
  }
   
--- 38,45 ----
  
  - erase
  {
!   if (item)
!     [globalTkInterp eval: "%s delete %s", [canvas getWidgetName], item];  
    return self;
  }
   

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]