swarm-support
[Top][All Lists]
Advanced

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

Re: Errors from includes & casts


From: Darren Schreiber
Subject: Re: Errors from includes & casts
Date: Mon, 13 Sep 1999 16:57:43 -0700

>>>>>> "DS" == DARREN MATTHEW SCHREIBER <address@hidden> writes:
>
>DS> First, a simple question.  Do I need to both remove the emptySpace
>DS> from the emptySpacesList and drop it? (this object will never
>DS> exist again)
>
>Removing an object from a Collection removes the reference to the
>object, but doesn't deallocate the object itself; you should drop it
>if you never want it again and nothing else could possibly reference it.
>

Ok, now the reverse question... if I drop an object is that sufficient to
also remove it from the lists it may be a member of?  Or, do I need to
remove it everywhere and then drop it?

>DS> SchellingWorld.m:64: warning: return type for `getRandomIntMin:Max:'
>
>What is the definition of this method? (I guess you have a good reason
>for not using uniformIntRand, directly?)

No, I didn't have a good reason, so I have now directly linked to the
uniformInteger object now.

But, I still am wondering why I get the

 SchellingWorld.m: In function `_i_SchellingWorld__findEmptyLocation_':
 SchellingWorld.m:64: warning: cannot find method.
 SchellingWorld.m:64: warning: return type for `getRandomIntMin:Max:'
 defaults to id
 SchellingWorld.m:64: warning: assignment makes integer from pointer
 without a cast

type of errors when I am calling a method from modelSwarm?  My guess (as I
said) is because I setModelSwarm when I am creating the schellingWorld
object, but I am wondering if there is a more swarm savy way that will keep
me from getting the compile time errors.


>DS> *** event raised for error: OffsetOutOfRange
>
>Is the number you get from your random number method what you'd expect?
>I doubt there is a casting or declaration problem at the bottom of this
>since the default type would be `id' which is the same size, typically
>as `int'.  Of course, you should get the declarations right, anyway.

This error was stupid on my part since I set the max of the random number
generator as the getCount from the list, when it should have been
1-getCount so as to include the first member who is number zero.

>DS> Neighborhood.h:12: parse error before `SchellingWorld'
>
>You can probably make this go away by changing the type of this variable
>to `id'; probably referencing a symbol that isn't defined yet.

This points to question I have.  It is my impression that lots of code I've
looked at uses this "SchellingWorld * myWorld;" construction.  Should I be
declaring this pointer myWorld as type id first?


Thanks,

        Darren



_____________________________________________

                 Darren Schreiber
                  Attorney at Law
                 Graduate Student
             Political Science, UCLA
                address@hidden

                  ==================================
   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]