Bug 13985 - WebCore/rendering/RenderTable.cpp fails to compile with gcc 4.2.x
Summary: WebCore/rendering/RenderTable.cpp fails to compile with gcc 4.2.x
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-04 07:58 PDT by Bernhard Rosenkraenzer
Modified: 2007-07-06 04:45 PDT (History)
2 users (show)

See Also:


Attachments
Fix (2.52 KB, patch)
2007-06-04 08:15 PDT, Bernhard Rosenkraenzer
ddkilzer: review-
Details | Formatted Diff | Diff
Fix adjusted to WebKit coding style (3.03 KB, patch)
2007-06-05 00:56 PDT, Bernhard Rosenkraenzer
no flags Details | Formatted Diff | Diff
Fix adjusted to WebKit coding style (3.00 KB, patch)
2007-06-05 00:57 PDT, Bernhard Rosenkraenzer
mrowe: review-
Details | Formatted Diff | Diff
Same patch, rediffed to not need patch -p1 (3.40 KB, patch)
2007-06-20 09:13 PDT, Bernhard Rosenkraenzer
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Rosenkraenzer 2007-06-04 07:58:31 PDT
../../../WebCore/rendering/RenderTable.cpp: In member function 'int WebCore::RenderTable::calcBorderLeft() const':
../../../WebCore/rendering/RenderTable.cpp:722: error: no matching function for call to 'max(unsigned int&, const short unsigned int:12&)'
../../../WebCore/rendering/RenderTable.cpp:735: error: no matching function for call to 'max(unsigned int&, const short unsigned int:12&)'
../../../WebCore/rendering/RenderTable.cpp:749: error: no matching function for call to 'max(unsigned int&, const short unsigned int:12&)'
../../../WebCore/rendering/RenderTable.cpp:751: error: no matching function for call to 'max(unsigned int&, const short unsigned int:12&)'
../../../WebCore/rendering/RenderTable.cpp: In member function 'int WebCore::RenderTable::calcBorderRight() const':
../../../WebCore/rendering/RenderTable.cpp:781: error: no matching function for call to 'max(unsigned int&, const short unsigned int:12&)'
../../../WebCore/rendering/RenderTable.cpp:794: error: no matching function for call to 'max(unsigned int&, const short unsigned int:12&)'
../../../WebCore/rendering/RenderTable.cpp:808: error: no matching function for call to 'max(unsigned int&, const short unsigned int:12&)'
../../../WebCore/rendering/RenderTable.cpp:810: error: no matching function for call to 'max(unsigned int&, const short unsigned int:12&)'
make[1]: *** [tmp/RenderTable.o] Error 1
Comment 1 Bernhard Rosenkraenzer 2007-06-04 08:15:48 PDT
Created attachment 14851 [details]
Fix

The problem is that "unsigned int" and "unsigned int:12" are no longer considered the same type.
Comment 2 David Kilzer (:ddkilzer) 2007-06-04 09:48:34 PDT
Comment on attachment 14851 [details]
Fix

Thanks for posting a patch to fix this, Bernhard!

In the future, please set the "review?" flag on patches so that they may be flagged for review, and please add a ChangeLog entry for the updates.  See this page for more details:  http://webkit.org/coding/contributing.html

>-                borderWidth = max(borderWidth, gb.width);
>+                borderWidth = max(borderWidth, (unsigned int)gb.width);

In all of these cases, we prefer to use the static_cast<>() syntax and "unsigned" instead of "unsigned int":

>+                borderWidth = max(borderWidth, static_cast<unsigned>(gb.width));

Please add a ChangeLog entry, update the patch and repost.  Thanks!
Comment 3 Bernhard Rosenkraenzer 2007-06-05 00:56:00 PDT
Created attachment 14859 [details]
Fix adjusted to WebKit coding style
Comment 4 Bernhard Rosenkraenzer 2007-06-05 00:57:32 PDT
Created attachment 14860 [details]
Fix adjusted to WebKit coding style

Forgot to do the unsigned int -> unsigned bit, updated patch
Comment 5 Sam Weinig 2007-06-06 11:45:22 PDT
Comment on attachment 14860 [details]
Fix adjusted to WebKit coding style

This looks fine.
Comment 6 Mark Rowe (bdash) 2007-06-18 10:03:30 PDT
Comment on attachment 14860 [details]
Fix adjusted to WebKit coding style

Your patch is in some weird format that svn-apply does not understand.  Can you please resubmit it in a format that we can actually apply?
Comment 7 Bernhard Rosenkraenzer 2007-06-20 09:13:50 PDT
Created attachment 15140 [details]
Same patch, rediffed to not need patch -p1

The patch was a standard unified diff, you just need to use patch -p1 to apply it because its path names include the name of the top level directory.
Rediffed to apply with patch -p0, which seems to be what svn-apply uses.
Comment 8 Mark Rowe (bdash) 2007-07-06 04:45:30 PDT
Landed in r24058.  Thanks for the patch!

I think the thing that threw svn-apply off was the lack of the "Index: path/to/file" headers in the patch.  Keep in mind that our style guideline requires spaces rather than tabs for indentation, even in the ChangeLog.