[haiku-development] Re: I want to involve

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 06 Mar 2008 14:00:10 +0100

Hi Lukas,

thank your for your work!

Lukas Durfina wrote:
> > 2) I think your somewhat aggressive use of static_cast makes things a
> > bit unreadable, as in:
> > -                kDefaultShellCommand[1], NULL);
> > +                kDefaultShellCommand[1], static_cast<char *>(NULL));
> 
>    ok, if I want to remove warning, because function expects char*,
> so it is better to use (char *) or do anything and ignore warning?
> 
> > 3) if you need to break a line into two, the second line is only
> > indented a single tab, so the following (as you did) is wrong:
> > -    return CurPos(p.x / fFontWidth, p.y / fFontHeight);
> > +    return CurPos(static_cast<int32>(p.x / fFontWidth),
> > +                    static_cast<int32>(p.y / fFontHeight));
> >
> > (this is also a good example of not using static_cast IMO)
> 
> 
> also, use (int32) or ingore it?

It is prefered to fix any warnings. Personally I don't know if there is any 
compelling pro argument for the new style casts. I just find "(int32)" or 
"(char*)" much better readable, so I always use those.

Best regards,
-Stephan

Other related posts: