Bug 83477 - [Texmap] Improve TextureMapperGL readability
Summary: [Texmap] Improve TextureMapperGL readability
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Noam Rosenthal
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-09 09:25 PDT by Noam Rosenthal
Modified: 2012-04-09 22:47 PDT (History)
2 users (show)

See Also:


Attachments
Patch (18.55 KB, patch)
2012-04-09 09:38 PDT, Noam Rosenthal
no flags Details | Formatted Diff | Diff
Patch for landing (18.42 KB, patch)
2012-04-09 20:03 PDT, Noam Rosenthal
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Noam Rosenthal 2012-04-09 09:25:17 PDT
[Texmap] Improve TextureMapperGL readability
Comment 1 Noam Rosenthal 2012-04-09 09:38:33 PDT
Created attachment 136240 [details]
Patch
Comment 2 Martin Robinson 2012-04-09 09:47:54 PDT
Comment on attachment 136240 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=136240&action=review

> Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp:53
> +#define GL_CMD(...) do { __VA_ARGS__; ASSERT_ARG(__VA_ARGS__, !glGetError()); } while (0)

Is the do-while loop here necessary to allow the semicolon? Having two semicolons in a row and a semicolon following an orphan block is fine in C/C++.

For instance this compiles just fine for me:


int main(int argc, const char* argv[])
{
    {
        printf("hey\n");
        return 0;
    };
}
Comment 3 Noam Rosenthal 2012-04-09 09:52:18 PDT
(In reply to comment #2)
> (From update of attachment 136240 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=136240&action=review
> 
> > Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp:53
> > +#define GL_CMD(...) do { __VA_ARGS__; ASSERT_ARG(__VA_ARGS__, !glGetError()); } while (0)
> 
> Is the do-while loop here necessary to allow the semicolon? Having two semicolons in a row and a semicolon following an orphan block is fine in C/C++.
> 
> For instance this compiles just fine for me:
> 
> 
> int main(int argc, const char* argv[])
> {
>     {
>         printf("hey\n");
>         return 0;
>     };
> }

I copied that trick from Assertions.h :)
Orphan semi-colons might break if statements without a brace-block.
Comment 4 Noam Rosenthal 2012-04-09 20:03:32 PDT
Created attachment 136384 [details]
Patch for landing
Comment 5 WebKit Review Bot 2012-04-09 21:49:26 PDT
Comment on attachment 136384 [details]
Patch for landing

Rejecting attachment 136384 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:

Hunk #13 FAILED at 445.
Hunk #14 succeeded at 500 (offset -7 lines).
Hunk #15 succeeded at 534 (offset -7 lines).
Hunk #16 succeeded at 564 (offset -7 lines).
Hunk #17 succeeded at 609 (offset -7 lines).
Hunk #18 succeeded at 637 (offset -7 lines).
3 out of 18 hunks FAILED -- saving rejects to file Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp.rej

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/12371639
Comment 6 WebKit Review Bot 2012-04-09 22:47:51 PDT
Comment on attachment 136384 [details]
Patch for landing

Clearing flags on attachment: 136384

Committed r113684: <http://trac.webkit.org/changeset/113684>
Comment 7 WebKit Review Bot 2012-04-09 22:47:56 PDT
All reviewed patches have been landed.  Closing bug.