[Mono-dev] FW: RealTimeSignal patch

tim.jenks at realtimeworlds.com tim.jenks at realtimeworlds.com
Wed Dec 17 06:19:23 EST 2008


Thanks Jon,

Attached is another pass at this. Just one point below that I couldn't address as suggested:

> > +#if NET_2_0
> > +                : IEquatable <RealTimeSignum>
> > +#endif
> > +       {
> > +               private int rt_offset;
> > +               public static readonly RealTimeSignum MinValue = new
> RealTimeSignum(0);
> > +               public static readonly RealTimeSignum MaxValue = new
> RealTimeSignum(UnixSignal.GetSIGRTMAX() - UnixSignal.GetSIGRTMIN() -
> 1);
> > +
> > +               public RealTimeSignum(int offset)
> > +               {
> > +                       if (offset < 0)
> > +                               throw new
> ArgumentOutOfRangeException("Offset cannot be negative");
> > +                       if (offset > (UnixSignal.GetSIGRTMAX()-
> UnixSignal.GetSIGRTMIN()-1))
> 
> There's no need to call UnixSignal.GetSIGRTMAX() here, as the MaxValue
> field has already computed this.  Just do:
> 
> 	if (offset > MaxValue.Offset)
> 		throw new ArgumentOutOfRangeException(...);

Problem here is that MaxValue is dependent on this cstor. When constructing the MaxValue field, MaxValue.Offset will be 0 in the case above. For now, I've refactored the logic to a private static readonly int MaxOffset, I hope this is sufficient and removes the duplication in question.

Cheers
-Tim

____________________________________________________________________
DISCLAIMER

This message and any attachments contain privileged and confidential information intended for the use of the addressee named above. If you are not the intended recipient of this message, you are hereby notified that any use, dissemination, distribution or reproduction of this message is prohibited. Please note that we cannot guarantee that this message or any attachment is virus free or that it has not been intercepted and amended. The views of the author may not necessarily reflect those of Realtime Worlds Ltd.

 

Realtime Worlds Ltd is registered in Scotland, number 225628. Registered Office: 152 West Marketgait, Dundee, DD1 1NJ.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcs.diff
Type: application/octet-stream
Size: 14013 bytes
Desc: mcs.diff
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20081217/3c1e02b9/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mono.diff
Type: application/octet-stream
Size: 793 bytes
Desc: mono.diff
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20081217/3c1e02b9/attachment-0003.obj 


More information about the Mono-devel-list mailing list