RESOLVED FIXED 47063
Fix broken C++ in PODInterval and PODIntervalTree
https://bugs.webkit.org/show_bug.cgi?id=47063
Summary Fix broken C++ in PODInterval and PODIntervalTree
Nico Weber
Reported 2010-10-03 12:13:02 PDT
Fix broken C++ in PODInterval and PODIntervalTree
Attachments
Patch (6.73 KB, patch)
2010-10-03 12:50 PDT, Nico Weber
no flags
Patch (11.75 KB, patch)
2010-10-04 09:55 PDT, Nico Weber
no flags
Patch (12.01 KB, patch)
2010-10-04 12:16 PDT, Nico Weber
no flags
Patch (12.03 KB, patch)
2010-10-04 13:43 PDT, Nico Weber
no flags
Nico Weber
Comment 1 2010-10-03 12:50:37 PDT
Nico Weber
Comment 2 2010-10-03 12:52:28 PDT
kbr: Please review. evan, hans: fyi
WebKit Review Bot
Comment 3 2010-10-03 13:12:46 PDT
Nico Weber
Comment 4 2010-10-03 13:21:53 PDT
dglazkov: Which gcc version is cr-linux running? Builds fine for me locally with 4.0.1 and 4.2.1.
Nico Weber
Comment 5 2010-10-04 08:45:31 PDT
Turns out function templates can't be partially specialized. Please refrain from reviewing…
Nico Weber
Comment 6 2010-10-04 09:07:00 PDT
Thinking about this, the options seem to be: 1. Convert the function template into a class template, which can then use partial specialization like this: template <class T> struct ValueToString { static String value(const T& t); }; template <> struct<int> ValueToString { static String value(const int& t) { return intToStr(t); } }; etc. 2. Use argument-dependent lookup for the function. ADL only works for class types, so I'd need to declare the function for all basic types, and could then use ADL for the rest. 3. Just delete this code. It's only used for debugging and probably isn't worth all the complexity. I think we should go with 3. Comments?
Kenneth Russell
Comment 7 2010-10-04 09:09:29 PDT
(In reply to comment #6) > Thinking about this, the options seem to be: > > 1. Convert the function template into a class template, which can then use partial specialization like this: > template <class T> > struct ValueToString { > static String value(const T& t); > }; > template <> > struct<int> ValueToString { > static String value(const int& t) { return intToStr(t); } > }; > > etc. > > > 2. Use argument-dependent lookup for the function. ADL only works for class types, so I'd need to declare the function for all basic types, and could then use ADL for the rest. > > > 3. Just delete this code. It's only used for debugging and probably isn't worth all the complexity. > > > I think we should go with 3. Comments? I do not support simply deleting this code. It has occasionally proven essential for debugging purposes. The original code used iostreams and overloaded operator<< to provide printing functionality. Either option (1) or (2) sounds fine. I'm happy to make the change to (1) if you want.
Nico Weber
Comment 8 2010-10-04 09:55:27 PDT
Nico Weber
Comment 9 2010-10-04 09:56:07 PDT
Approach 1 it is.
WebKit Review Bot
Comment 10 2010-10-04 11:08:27 PDT
Nico Weber
Comment 11 2010-10-04 12:16:57 PDT
Kenneth Russell
Comment 12 2010-10-04 13:39:59 PDT
Comment on attachment 69664 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=69664&action=review Code changes look fine; please note minor documentation changes needed. > WebCore/platform/graphics/gpu/PODInterval.h:64 > +// String string(const T& t); This should be documented as being static, as is used in the code. > WebCore/platform/graphics/gpu/PODInterval.h:67 > +// String string(const UserData& t); static. > WebCore/platform/graphics/gpu/PODRedBlackTree.h:48 > +// String string(const T& t); static.
Nico Weber
Comment 13 2010-10-04 13:43:44 PDT
Kenneth Russell
Comment 14 2010-10-04 14:07:25 PDT
Comment on attachment 69677 [details] Patch Looks fine. I think you need to wait for the r+ before marking it cq+, though.
WebKit Commit Bot
Comment 15 2010-10-04 23:10:16 PDT
Comment on attachment 69677 [details] Patch Clearing flags on attachment: 69677 Committed r69081: <http://trac.webkit.org/changeset/69081>
WebKit Commit Bot
Comment 16 2010-10-04 23:10:23 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.