<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>68209</bug_id>
          
          <creation_ts>2011-09-15 19:16:05 -0700</creation_ts>
          <short_desc>[EFL] Change WebKit EFL coding style</short_desc>
          <delta_ts>2011-12-29 19:36:03 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit EFL</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>68231</dependson>
    
    <dependson>68321</dependson>
    
    <dependson>68867</dependson>
    
    <dependson>69073</dependson>
    
    <dependson>69988</dependson>
    
    <dependson>70883</dependson>
    
    <dependson>71433</dependson>
    
    <dependson>74474</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gyuyoung Kim">gyuyoung.kim</reporter>
          <assigned_to name="Gyuyoung Kim">gyuyoung.kim</assigned_to>
          <cc>donggwan.kim</cc>
    
    <cc>enmi.lee</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>kenneth</cc>
    
    <cc>leandro</cc>
    
    <cc>lucas.de.marchi</cc>
    
    <cc>rakuco</cc>
    
    <cc>sangseok.lim</cc>
    
    <cc>s.choi</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>468242</commentid>
    <comment_count>0</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2011-09-15 19:16:05 -0700</bug_when>
    <thetext>WebKit EFL port has used EFL coding style. However, EFL port has used C-coding style despite files are C++. In addition, this style disturbed reviewers to review EFL patches. So, we discussed this issues by means of webkit-efl mailing list.  https://lists.webkit.org/pipermail/webkit-efl/2011-September/000049.html 

I list current issues up as below. And, this bug is a meta bug to track this issues.

1. pointer operator coding style based on efl coding style.
   : pointer(&apos;*&apos;) operator coding style follows efl coding style. It looks we need to adhere webkit coding style.

2. Should we use EINA_TRUE and EINA_FALSE?
   : It can be replace with true / false.  

3. Internal functions are using &apos;(void)&apos; parameter.
   : As we already discussed, internal function needs to use C++ coding style.

4. Manual memory management.
   : ewk_xxx files are using malloc, calloc and realloc instead of smart pointer.
      For example, GOwnPtr.

5. C style casting operator.
   : Though file format is .cpp, some codes are still using c type casting operator.
	
6. Meaningless parameter name.
   : We have used coding style of efl parameter so far. However, that is not webkit coding style.
      I heard that port implementation tends to be platform coding style. So, I added a parameter coding style exception to 
      style checker for efl port. But, now I&apos;m not sure whether we&apos;re able to use it continually.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>469075</commentid>
    <comment_count>1</comment_count>
    <who name="Lucas De Marchi">lucas.de.marchi</who>
    <bug_when>2011-09-17 09:08:50 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; WebKit EFL port has used EFL coding style. However, EFL port has used C-coding style despite files are C++. In addition, this style disturbed reviewers to review EFL patches. So, we discussed this issues by means of webkit-efl mailing list.  https://lists.webkit.org/pipermail/webkit-efl/2011-September/000049.html 
&gt; 
&gt; I list current issues up as below. And, this bug is a meta bug to track this issues.
&gt; 
&gt; 1. pointer operator coding style based on efl coding style.
&gt;    : pointer(&apos;*&apos;) operator coding style follows efl coding style. It looks we need to adhere webkit coding style.

Ok, on bug 68231 I sent an initial configuration for uncrustify to fix this.

&gt; 
&gt; 2. Should we use EINA_TRUE and EINA_FALSE?
&gt;    : It can be replace with true / false.

The problem here is that in public functions we must use Eina_Bool type. It&apos;s somewhat automatic then in those functions to use EINA_TRUE/EINA_FALSE.

Internal functions should be fine using bool and thus true/false. For public functions, I&apos;m not sure what approach we should take.

&gt; 3. Internal functions are using &apos;(void)&apos; parameter.
&gt;    : As we already discussed, internal function needs to use C++ coding style.

Agreed.

&gt; 4. Manual memory management.
&gt;    : ewk_xxx files are using malloc, calloc and realloc instead of smart pointer.
&gt;       For example, GOwnPtr.

These are more difficult to handle. Recently Raphael Kubo converted some of them.


&gt; 5. C style casting operator.
&gt;    : Though file format is .cpp, some codes are still using c type casting operator.

This is another easy one. Since most of the time we are converting C structs or native types, almost all of them will be converted to static_cast&lt;&gt;. We could even automatically convert all of them to static_cast&lt;&gt; and going back if we need another type of cast.


&gt; 6. Meaningless parameter name.
&gt;    : We have used coding style of efl parameter so far. However, that is not webkit coding style.
&gt;       I heard that port implementation tends to be platform coding style. So, I added a parameter coding style exception to 
&gt;       style checker for efl port. But, now I&apos;m not sure whether we&apos;re able to use it continually.

Some of them are common language to EFL committers/users. I don&apos;t think changing it is a good idea, but if it&apos;s required we can use sed/coccinelle for this task.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>469079</commentid>
    <comment_count>2</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2011-09-17 10:41:08 -0700</bug_when>
    <thetext>
&gt; &gt; 2. Should we use EINA_TRUE and EINA_FALSE?
&gt; &gt;    : It can be replace with true / false.
&gt; 
&gt; The problem here is that in public functions we must use Eina_Bool type. It&apos;s somewhat automatic then in those functions to use EINA_TRUE/EINA_FALSE.

For return values this should be fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>469081</commentid>
    <comment_count>3</comment_count>
    <who name="Raphael Kubo da Costa (:rakuco)">rakuco</who>
    <bug_when>2011-09-17 12:11:27 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; &gt; &gt; 2. Should we use EINA_TRUE and EINA_FALSE?
&gt; &gt; &gt;    : It can be replace with true / false.
&gt; &gt; 
&gt; &gt; The problem here is that in public functions we must use Eina_Bool type. It&apos;s somewhat automatic then in those functions to use EINA_TRUE/EINA_FALSE.
&gt; 
&gt; For return values this should be fine.

Eina_Bool Foo::bar()
{
    // ...
    return true;
}

should work just fine too, there&apos;s just an implicit bool -&gt; unsigned char conversion involved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>469229</commentid>
    <comment_count>4</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2011-09-18 21:12:32 -0700</bug_when>
    <thetext>(In reply to comment #3)

&gt; Eina_Bool Foo::bar()
&gt; {
&gt;     // ...
&gt;     return true;
&gt; }
&gt; 

Can this conversion to reduce readability or make confusion to ewk contributor ? I think it is better to use only EINA_BOOL in public functions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>512702</commentid>
    <comment_count>5</comment_count>
    <who name="Raphael Kubo da Costa (:rakuco)">rakuco</who>
    <bug_when>2011-12-01 05:13:41 -0800</bug_when>
    <thetext>All the bugs this report depends on have been closed, can we close this one too?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>520638</commentid>
    <comment_count>6</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2011-12-13 20:32:15 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; All the bugs this report depends on have been closed, can we close this one too?

I&apos;d like to close this bug after Bug 74474 is landed. Because, that bug is also similar bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>521676</commentid>
    <comment_count>7</comment_count>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2011-12-14 22:40:01 -0800</bug_when>
    <thetext>All coding style issues mentioned by this bug are closed. So, I close this bug.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>