WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
69988
[EFL] Change efl style local variables with WebKit coding Style.
https://bugs.webkit.org/show_bug.cgi?id=69988
Summary
[EFL] Change efl style local variables with WebKit coding Style.
Gyuyoung Kim
Reported
2011-10-12 18:55:45 PDT
Parameter variables name was changed with WebKit coding style in
Bug 69073
. So, we need to change local variables name according to WebKit coding style.
Attachments
Prototype
(334.19 KB, patch)
2011-10-14 01:27 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Patch
(360.01 KB, patch)
2011-10-18 04:23 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Patch
(360.01 KB, patch)
2011-10-18 04:28 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Patch
(359.15 KB, patch)
2011-10-18 05:06 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Patch
(359.24 KB, patch)
2011-10-18 18:25 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Patch
(359.39 KB, patch)
2011-10-20 00:48 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Patch
(358.55 KB, patch)
2011-10-20 00:55 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Patch
(358.21 KB, patch)
2011-10-21 09:20 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Patch
(12.71 KB, patch)
2011-10-21 21:16 PDT
,
Gyuyoung Kim
no flags
Details
Formatted Diff
Diff
Show Obsolete
(8)
View All
Add attachment
proposed patch, testcase, etc.
Gyuyoung Kim
Comment 1
2011-10-14 01:27:41 PDT
Created
attachment 110975
[details]
Prototype I make a prototype for this bug. Though I know well this patch is also very giant, I think it is better to change coding style as soon as possible. Major changes are as below, - Use ewkFrame instead of o parameter in ewk_frame.cpp. - Use ewkView instead of o parameter in ewk_view.cpp. - Use ewkTile instead of o parameter in ewk_tile_xxx.cpp. - Use smartData instead of sd parameter for Ewk_XXXX_Smart_Data struct. - Use width, height instead of w, h parameter. - Use scrollX, scrollY, scrollWidth, scrollHeight, centerX, centerY, deltaX, deltaY instead of sx, xy, sw, sh, cx, cy, dx, dy. - Use red, green, blue and alpha instead of r,g,b,a. - Remove "_" from parameter variable. However, backing store's variables is almost encrypt. Backing Store guys should review this patch. Because, this patch is initial prototype, I will modify this patch according to efl guys's comments.
Gyuyoung Kim
Comment 2
2011-10-14 01:30:48 PDT
CC'ing Ryuan, Kwang, Grzegorz, Lukasz, antognolli and Antonio.
Gyuyoung Kim
Comment 3
2011-10-14 01:49:23 PDT
Oops, there were wrong comments in #1. So, I list major changes up again. - Use *menu* instead of *o* in comment of ewk_contextmenu.cpp. - Use *list* instead of *l* local variable - Use *ewkPolicy* instead of *ewk_policy* in ewk_cookies.cpp - Use *smartData* instead of *sd* local variable for Ewk_XXXX_Smart_Data struct. - Use *width*, *height* instead of *w*, *h* local variables. - Use scrollX, scrollY, scrollWidth, scrollHeight, centerX, centerY, deltaX, deltaY, baseX, baseY instead of sx, xy, sw, sh, cx, cy, dx, dy, bx, by. - Use red, green, blue, alpha, contentRed, contentGreen, contentBlue and contentAlpha instead of r,g,b,a, cr, cg, cb, ca. - Use *object* instead of *obj* - Use *length* instead of *len* - Use *coreFrame* instead of *cf* - Use *buffer* instead of *buf* - Use *item* instead of *i* - Remove "_" in local variable. - And so on.
Raphael Kubo da Costa (:rakuco)
Comment 4
2011-10-14 04:57:05 PDT
It's impossible to review this patch, so informal rs+ from my side.
Gyuyoung Kim
Comment 5
2011-10-18 04:23:27 PDT
Created
attachment 111422
[details]
Patch
Gyuyoung Kim
Comment 6
2011-10-18 04:28:35 PDT
Created
attachment 111423
[details]
Patch
Gyuyoung Kim
Comment 7
2011-10-18 04:32:35 PDT
I update patch with below changes. Though I know very well it is difficult to review this patch, I hope to help to review this patch. - Use *menu* instead of *o* in comment of ewk_contextmenu.cpp. - Use *list* instead of *l* local variable - Use *ewkPolicy* instead of *ewk_policy* in ewk_cookies.cpp - Use *smartData* instead of *sd* local variable for Ewk_XXXX_Smart_Data struct. - Use *width*, *height* instead of *w*, *h* local variables. - Use *scrollX*, *scrollY*, *scrollWidth*, *scrollHeight*, *centerX*, *centerY*, *deltaX*, *deltaY*, *baseX*, *baseY* instead of *sx*, *sy*, *sw*, *sh*, *cx*, *cy*, *dx*, *dy*, *bx*, *by*. - Use *red*, *green*, *blue*, *alpha*, *contentRed*, *contentGreen*, *contentBlue* and *contentAlpha* instead of *r*,*g*,*b*,*a*,*cr*,*cg*,*cb*,*ca*. - Use *tilePositionX*, *tilePositionY* instead of *ox*,*oy* in tiled backingstore files. - Use *object* instead of *obj* - Use *length* instead of *len* - Use *coreFrame* instead of *cf* - Use *buffer* instead of *buf* - Use *item* instead of *i* - Remove "_" in local variable. - And so on.
Gyuyoung Kim
Comment 8
2011-10-18 05:06:34 PDT
Created
attachment 111425
[details]
Patch
Gyuyoung Kim
Comment 9
2011-10-18 05:11:32 PDT
patch is re-based with latest trunk.
Kenneth Rohde Christiansen
Comment 10
2011-10-18 06:07:02 PDT
Comment on
attachment 111425
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=111425&action=review
> Source/WebKit/efl/ewk/ewk_auth_soup.cpp:82 > + Ewk_Auth_Data* authData = static_cast<Ewk_Auth_Data*>(data);
authenticationData ?
> Source/WebKit/efl/ewk/ewk_auth_soup.cpp:92 > + const char* realMessage;
what is a real message?
> Source/WebKit/efl/ewk/ewk_cookies.cpp:93 > + Ewk_Cookie* ewkCookie = static_cast<Ewk_Cookie*>(malloc(sizeof(*ewkCookie)));
Why don't you do something like #define e_new(struct_type) (static_cast<struct_type*>(malloc(sizeof(struct_type))) similar to glib. then Ewk_Cookie* ewkCookie = cnew(Ewk_Cookie). Using templates it might be able to do something like cnew<Ewk_Cookie>(4) as well. template <typename struct_type> struct_type* cnew(size_t amount = 1) { return static_cast<struct_type*>malloc(amount * sizeof(struct_type)); } Ewk_Cookie* cookies = cnew<Ewk_Cookie>(10);
Gyuyoung Kim
Comment 11
2011-10-18 18:25:09 PDT
Created
attachment 111546
[details]
Patch
Gyuyoung Kim
Comment 12
2011-10-18 18:30:19 PDT
(In reply to
comment #10
)
> (From update of
attachment 111425
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=111425&action=review
> > > Source/WebKit/efl/ewk/ewk_auth_soup.cpp:82 > > + Ewk_Auth_Data* authData = static_cast<Ewk_Auth_Data*>(data); > > authenticationData ?
Fixed.
> > Source/WebKit/efl/ewk/ewk_auth_soup.cpp:92 > > + const char* realMessage; > > what is a real message?
Oops, I knew realm is abbreviation for realMessage. This is fixed.
> > Source/WebKit/efl/ewk/ewk_cookies.cpp:93 > > + Ewk_Cookie* ewkCookie = static_cast<Ewk_Cookie*>(malloc(sizeof(*ewkCookie))); > > Why don't you do something like > > #define e_new(struct_type) (static_cast<struct_type*>(malloc(sizeof(struct_type))) > > similar to glib. > > then Ewk_Cookie* ewkCookie = cnew(Ewk_Cookie). > > Using templates it might be able to do something like cnew<Ewk_Cookie>(4) as well. > > template <typename struct_type> > struct_type* cnew(size_t amount = 1) { > return static_cast<struct_type*>malloc(amount * sizeof(struct_type)); > } > > Ewk_Cookie* cookies = cnew<Ewk_Cookie>(10);
Looks good for me this template for memory allocation until using smart pointer. However, other ewk files also need to be adjusted. So, I would like to adjust this template into all ewk files after fixing this bug. If you agree with my opinion, I will file a new bug as soon as this bug is closed.
Kenneth Rohde Christiansen
Comment 13
2011-10-19 01:58:34 PDT
> > template <typename struct_type> > > struct_type* cnew(size_t amount = 1) { > > return static_cast<struct_type*>malloc(amount * sizeof(struct_type)); > > } > > > > Ewk_Cookie* cookies = cnew<Ewk_Cookie>(10); > > Looks good for me this template for memory allocation until using smart pointer. However, other ewk files also need to be adjusted. So, I would like to adjust this template into all ewk files after fixing this bug. If you agree with my opinion, I will file a new bug as soon as this bug is closed.
You could add it for the EFL port in Platform.h or similar, I guess.
Gyuyoung Kim
Comment 14
2011-10-19 02:45:38 PDT
(In reply to
comment #13
)
> You could add it for the EFL port in Platform.h or similar, I guess.
Do you mean it is better to add your suggestion to this patch together ?
Kenneth Rohde Christiansen
Comment 15
2011-10-19 02:59:12 PDT
separate is better
Gyuyoung Kim
Comment 16
2011-10-20 00:48:57 PDT
Created
attachment 111737
[details]
Patch
Gyuyoung Kim
Comment 17
2011-10-20 00:50:32 PDT
There are local variables looks like member variables. So, I fix it with currentColumn and currentRow thanks to Kwang. static inline Eina_Bool _ewk_tiled_backing_store_item_fill(Ewk_Tiled_Backing_Store_Data* priv, Ewk_Tiled_Backing_Store_Item* item, unsigned long column, unsigned long row) { unsigned long m_col = priv->model.base.column + column; unsigned long m_row = priv->model.base.row + row;
Gyuyoung Kim
Comment 18
2011-10-20 00:55:27 PDT
Created
attachment 111738
[details]
Patch
Gyuyoung Kim
Comment 19
2011-10-20 01:01:58 PDT
Patch is re-based. This patch should be re-based whenever modified because of too giant.
Antonio Gomes
Comment 20
2011-10-20 06:45:01 PDT
Comment on
attachment 111738
[details]
Patch feel free to land it when it is agreed it is in good shape by others.
Gyuyoung Kim
Comment 21
2011-10-20 18:45:56 PDT
(In reply to
comment #20
)
> (From update of
attachment 111738
[details]
) > feel free to land it when it is agreed it is in good shape by others.
Antonio, Thank you. Hello CC'ing guys, could you please review this patch?
Raphael Kubo da Costa (:rakuco)
Comment 22
2011-10-21 07:15:30 PDT
I can't review the patch, but I guess the changes are OK. Go ahead and cq+ it.
Gyuyoung Kim
Comment 23
2011-10-21 08:38:56 PDT
Comment on
attachment 111738
[details]
Patch Ok, let's go ahead. If there are problems, let's reopen this bug or file a new bug.
WebKit Review Bot
Comment 24
2011-10-21 08:42:06 PDT
Comment on
attachment 111738
[details]
Patch Rejecting
attachment 111738
[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: patching file Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp patching file Source/WebKit/efl/ewk/ewk_tiled_model.cpp patching file Source/WebKit/efl/ewk/ewk_view.cpp Hunk #96 FAILED at 3789. Hunk #97 succeeded at 3815 (offset -5 lines). Hunk #98 succeeded at 3828 (offset -5 lines). 1 out of 98 hunks FAILED -- saving rejects to file Source/WebKit/efl/ewk/ewk_view.cpp.rej Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--reviewer', u'Antonio Gomes', u'--fo..." exit_code: 1 Full output:
http://queues.webkit.org/results/10183936
Gyuyoung Kim
Comment 25
2011-10-21 09:20:04 PDT
Created
attachment 111975
[details]
Patch
WebKit Review Bot
Comment 26
2011-10-21 10:31:51 PDT
Comment on
attachment 111975
[details]
Patch Clearing flags on attachment: 111975 Committed
r98109
: <
http://trac.webkit.org/changeset/98109
>
WebKit Review Bot
Comment 27
2011-10-21 10:32:00 PDT
All reviewed patches have been landed. Closing bug.
Gyuyoung Kim
Comment 28
2011-10-21 21:16:16 PDT
Created
attachment 112069
[details]
Patch
Gyuyoung Kim
Comment 29
2011-10-21 21:17:09 PDT
Comment on
attachment 112069
[details]
Patch *sd* variables were changed by this bug. So, I fix them.
Gyuyoung Kim
Comment 30
2011-10-21 21:26:11 PDT
As mentioned
Comment #29
, this patch need to be re-opened.
WebKit Review Bot
Comment 31
2011-10-21 22:31:21 PDT
Comment on
attachment 112069
[details]
Patch Clearing flags on attachment: 112069 Committed
r98190
: <
http://trac.webkit.org/changeset/98190
>
WebKit Review Bot
Comment 32
2011-10-21 22:31:31 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.
Top of Page
Format For Printing
XML
Clone This Bug