Re: [webkit-dev] Type cast by using toFoo()

2014-01-20 Thread Ravi Kasibhatla
I am the original author of style checker patch reported in previous mail by Gyuyoung. My logic for checking the error is simple: - In the patch, I check for any line which contains regex static_castFoo*. - If line does contain it, I pick the regex part Foo and search for Foo.h in the codebase. -

[webkit-dev] Type cast by using toFoo()

2013-09-30 Thread Gyuyoung Kim
Hello WebKittens, I have focused on using toFoo() for SVG and CSS instead of using static_cast. Because I think there are some advantages when we use it. - Bad type cast can be detected by using ASSERTION in toFoo(). The toFoo() function has an ASSERTION to check if source value is a proper

Re: [webkit-dev] Type cast by using toFoo()

2013-09-30 Thread Sam Weinig
On Sep 30, 2013, at 3:39 AM, Gyuyoung Kim gyuyoung@webkit.org wrote: Hello WebKittens, I have focused on using toFoo() for SVG and CSS instead of using static_cast. Because I think there are some advantages when we use it. - Bad type cast can be detected by using ASSERTION in

Re: [webkit-dev] Type cast by using toFoo()

2013-09-30 Thread Yong Li
I think it can be done by checking the vtable pointer if the classes are virtual. From: Sam Weinig Sent: ‎Monday‎, ‎September‎ ‎30‎, ‎2013 ‎12‎:‎53‎ ‎PM To: Gyuyoung Kim Cc: Webkit Development List On Sep 30, 2013, at 3:39 AM, Gyuyoung Kim gyuyoung@webkit.org wrote: Hello WebKittens,

Re: [webkit-dev] Type cast by using toFoo()

2013-09-30 Thread Darin Adler
On Sep 30, 2013, at 9:54 AM, Yong Li yong.li.web...@outlook.com wrote: Finally I plan to add this toFoo() policy to the WebKit style checker. Can you explain more about this? How are you going to determine static_casts that are acceptable from ones that aren’t. I think it can be done

Re: [webkit-dev] Type cast by using toFoo()

2013-09-30 Thread Yong Li
Developmentmailto:webkit-dev@lists.webkit.org Subject: Re: [webkit-dev] Type cast by using toFoo() On Sep 30, 2013, at 9:54 AM, Yong Li yong.li.web...@outlook.com wrote: Finally I plan to add this toFoo() policy to the WebKit style checker. Can you explain more about this? How are you going to determine

Re: [webkit-dev] Type cast by using toFoo()

2013-09-30 Thread Ryosuke Niwa
On Mon, Sep 30, 2013 at 10:52 AM, Yong Li yong.li.web...@outlook.comwrote: Bottom line is turning on RTTI in debug build? Style checker analyzes the code statically. It's nothing to do with runtime assertions. If that wasn't clear enough, style check happens before WebKit is ever built. -

Re: [webkit-dev] Type cast by using toFoo()

2013-09-30 Thread Gyuyoung Kim
My plan is to show style error when submitted patch doesn't use toFoo() though toFoo exists. This idea was originated from blink commit. However, it was reverted because of some regression. http://src.chromium.org/viewvc/blink?view=revisionrevision=158059 If my understanding is correct, the