Bug 96638 - [EFL] Remove a lot of C'ism from Ewk_Tiled_Matrix
Summary: [EFL] Remove a lot of C'ism from Ewk_Tiled_Matrix
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-13 05:39 PDT by Chris Dumez
Modified: 2012-09-13 23:29 PDT (History)
6 users (show)

See Also:


Attachments
Patch (21.33 KB, patch)
2012-09-13 05:41 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (24.12 KB, patch)
2012-09-13 22:49 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2012-09-13 05:39:55 PDT
Ewk_Tiled_Matrix contains a lot of C'ism and does not always follow coding style. We should clean it up.
Comment 1 Chris Dumez 2012-09-13 05:41:57 PDT
Created attachment 163848 [details]
Patch
Comment 2 Chris Dumez 2012-09-13 09:19:35 PDT
Could someone please take a look at this one?
Comment 3 Ryuan Choi 2012-09-13 16:02:48 PDT
Comment on attachment 163848 [details]
Patch

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

Good to me.

I found some small things which you may like.

> Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp:252
>          if (iterator->zoom != zoom)
>              continue;
> -        entry = iterator;
> -        tileMatrix->matrices = eina_inlist_promote(tileMatrix->matrices, EINA_INLIST_GET(entry));
> -        tileMatrix->matrix = entry->matrix;
> +
> +        tileMatrix->matrices = eina_inlist_promote(tileMatrix->matrices, EINA_INLIST_GET(iterator));
> +        tileMatrix->matrix = iterator->matrix;
>          return true;

if (iterator->zoom == zoom) {
    ...
    return true;
}

Although it may not be related to C'sm, I think that you like this more.

> Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp:579
> +        unsigned long col = info->col;
> +        unsigned long row = info->row;
>  
>          Ewk_Tile* tile = static_cast<Ewk_Tile*>(eina_matrixsparse_data_idx_get(tileMatrix->matrix, row, col));

What do you think about passing them instead of making local variable?

> Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp:628
> +    bool last_empty = false;

lastEmpty looks correct for webkit style.
Comment 4 Chris Dumez 2012-09-13 22:01:34 PDT
(In reply to comment #3)
> (From update of attachment 163848 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=163848&action=review
> 
> Good to me.
> 
> I found some small things which you may like.
> 
> > Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp:252
> >          if (iterator->zoom != zoom)
> >              continue;
> > -        entry = iterator;
> > -        tileMatrix->matrices = eina_inlist_promote(tileMatrix->matrices, EINA_INLIST_GET(entry));
> > -        tileMatrix->matrix = entry->matrix;
> > +
> > +        tileMatrix->matrices = eina_inlist_promote(tileMatrix->matrices, EINA_INLIST_GET(iterator));
> > +        tileMatrix->matrix = iterator->matrix;
> >          return true;
> 
> if (iterator->zoom == zoom) {
>     ...
>     return true;
> }
> 
> Although it may not be related to C'sm, I think that you like this more.
> 
> > Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp:579
> > +        unsigned long col = info->col;
> > +        unsigned long row = info->row;
> >  
> >          Ewk_Tile* tile = static_cast<Ewk_Tile*>(eina_matrixsparse_data_idx_get(tileMatrix->matrix, row, col));
> 
> What do you think about passing them instead of making local variable?
> 
> > Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp:628
> > +    bool last_empty = false;
> 
> lastEmpty looks correct for webkit style.

Thanks for taking a look Ryuan. I'll improve the patch based on your comments.
Comment 5 Chris Dumez 2012-09-13 22:49:13 PDT
Created attachment 164051 [details]
Patch

Take Ryuan's feedback into consideration.
Comment 6 Ryuan Choi 2012-09-13 22:58:58 PDT
(In reply to comment #5)
> Created an attachment (id=164051) [details]
> Patch
> 
> Take Ryuan's feedback into consideration.

Looks good to me.
Thank you.
Comment 7 Gyuyoung Kim 2012-09-13 23:01:48 PDT
Comment on attachment 164051 [details]
Patch

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

Looks fine thanks.

> Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp:399
> +#ifndef NDEBUG

Don't you need to check this routine in normal mode ?
Comment 8 Chris Dumez 2012-09-13 23:04:29 PDT
(In reply to comment #7)
> (From update of attachment 164051 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=164051&action=review
> 
> Looks fine thanks.
> 
> > Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp:399
> > +#ifndef NDEBUG
> 
> Don't you need to check this routine in normal mode ?

If you look at the code, it does nothing besides doing extra checks and printing a warning. This is debug code IMO. In release mode, it would only slow us down.
Comment 9 Gyuyoung Kim 2012-09-13 23:11:39 PDT
(In reply to comment #8)

> If you look at the code, it does nothing besides doing extra checks and printing a warning. This is debug code IMO. In release mode, it would only slow us down.

I just wanna verify it. Thanks. :)
Comment 10 WebKit Review Bot 2012-09-13 23:28:59 PDT
Comment on attachment 164051 [details]
Patch

Clearing flags on attachment: 164051

Committed r128560: <http://trac.webkit.org/changeset/128560>
Comment 11 WebKit Review Bot 2012-09-13 23:29:03 PDT
All reviewed patches have been landed.  Closing bug.