Thanks, I fixed this and several other instances in base where
NSNotFound was read from or stored in an unsigned or int variable.

(I didn't change the "c" variable here to NSUInteger because I don't
think it's strictly necessary - a lot of NSConnection code uses
"unsigned" - but it could be a good idea)

Eric

On Mon, Mar 5, 2012 at 8:57 AM, Philippe Roussel <p.o.rous...@free.fr> wrote:
> Hi,
>
> Lucas Schnorr ran into the following problem (I can reproduce it too) :
>
> 2012-03-05 10:08:26.409 tobjc[6709] Problem posting notification:
> <NSException: 0x7f22d8005658> NAME:NSRangeException REASON:Index -1 is
> out of range 1 (in 'objectAtIndex:') INFO:{Array = ("<NSRunLoop:
> 0x1cfe998>"); Count = 1; Index = 4294967295; }
>
> NSConnection was probably forgotten when NSArray was moved to NSUInteger. I
> think the following patch is needed :
>
> Index: Source/NSConnection.m
> ===================================================================
> --- Source/NSConnection.m       (révision 34875)
> +++ Source/NSConnection.m       (copie de travail)
> @@ -1583,11 +1583,11 @@
>   GS_M_LOCK(IrefGate);
>   if (IrunLoops != nil)
>     {
> -      unsigned pos = [IrunLoops indexOfObjectIdenticalTo: loop];
> +      NSUInteger pos = [IrunLoops indexOfObjectIdenticalTo: loop];
>
>       if (pos != NSNotFound)
>        {
> -         unsigned      c = [IrequestModes count];
> +         NSUInteger c = [IrequestModes count];
>
>          while (c-- > 0)
>            {
>
> Philippe
>
> _______________________________________________
> Gnustep-dev mailing list
> Gnustep-dev@gnu.org
> https://lists.gnu.org/mailman/listinfo/gnustep-dev

_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to