Alexander Malmberg wrote:
> However, in the original patch, the wrap-around is just ugly; it isn't
> really a problem since the wrap-around behavior of unsigned ints is
> defined by the c standard.

It may not please the educated eye, but it works :-)
Also, the patch doesn't need a cast which would limit the possible length of strings.
In fact, I think it is a clean way to solve the problem, as it simply checks  
if layout_char is in the legal range. This is absolutely safe, straigth forward  
and easy to understand.


> I've committed a slightly different patch that's both pretty and safe,
>
>  if (layout_char > r.location)
>    {
>      if (layout_char >= r.location + r.length)
>        layout_char += lengthChange;
>      else
>        layout_char = r.location;
>    }

Well, it doesn't work.
That's all I can say, as I have not much knowledge of the internals here.
Here are the involved variables of the method for my test case:

layout_char  =  26
r.location   =   0
r.length     =   1
lengthChange = -29

Georg


_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to