Bug 39972 - Fix style errors of dtoa
Summary: Fix style errors of dtoa
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P4 Trivial
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-31 16:13 PDT by Kent Tamura
Modified: 2010-06-01 01:57 PDT (History)
2 users (show)

See Also:


Attachments
Patch (23.13 KB, patch)
2010-05-31 16:15 PDT, Kent Tamura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2010-05-31 16:13:35 PDT
Fix style errors of dtoa
Comment 1 Kent Tamura 2010-05-31 16:15:46 PDT
Created attachment 57498 [details]
Patch
Comment 2 Shinichiro Hamaji 2010-05-31 22:48:10 PDT
Comment on attachment 57498 [details]
Patch

JavaScriptCore/wtf/dtoa.cpp:210
 +  static ALWAYS_INLINE uint32_t* storeInc(uint32_t* p, uint16_t high, uint16_t low)
I think this is a refactoring rather than a style fix. I guess we can remove the style error just by adding spaces after commas?
Comment 3 Kent Tamura 2010-05-31 22:53:13 PDT
Thank you for looking at the patch.

(In reply to comment #2)
> (From update of attachment 57498 [details])
> JavaScriptCore/wtf/dtoa.cpp:210
>  +  static ALWAYS_INLINE uint32_t* storeInc(uint32_t* p, uint16_t high, uint16_t low)
> I think this is a refactoring rather than a style fix. I guess we can remove the style error just by adding spaces after commas?

It's also a style fix though check-webkit-style doesn't complain it.

http://webkit.org/coding/coding-style.html
> 11. Prefer const to #define. Prefer inline functions to macros.
Comment 4 Shinichiro Hamaji 2010-06-01 01:09:56 PDT
> It's also a style fix though check-webkit-style doesn't complain it.
> 
> http://webkit.org/coding/coding-style.html
> > 11. Prefer const to #define. Prefer inline functions to macros.

I see. So, we should fix rounded_product and rounded_quotient as well?

I guess we can use reference if there are no performance regression (I'm guessing the compiler is clever enough)?

static ALWAYS_INLINE void storeInc(uint32_t*& p, uint16_t high, uint16_t low)
{
  // ...
  p++;
}
Comment 5 Kent Tamura 2010-06-01 01:24:29 PDT
(In reply to comment #4)
> I see. So, we should fix rounded_product and rounded_quotient as well?

Yes, we should.  But I didn't change them because I thought they could be member functions of type U.

> I guess we can use reference if there are no performance regression (I'm guessing the compiler is clever enough)?
> 
> static ALWAYS_INLINE void storeInc(uint32_t*& p, uint16_t high, uint16_t low)
> {
>   // ...
>   p++;
> }

I don't like to change to the reference unless you have a strong objection.  I believe returning updated pointer has better code readability.
Comment 6 Shinichiro Hamaji 2010-06-01 01:30:02 PDT
Comment on attachment 57498 [details]
Patch

> I don't like to change to the reference unless you have a strong objection.  I believe returning updated pointer has better code readability.

Hmm I slightly prefer the reference so that we won't forget to assign the return value, but it's not a strong objection. Please feel free to land this patch as is.
Comment 7 WebKit Commit Bot 2010-06-01 01:57:51 PDT
Comment on attachment 57498 [details]
Patch

Clearing flags on attachment: 57498

Committed r60468: <http://trac.webkit.org/changeset/60468>
Comment 8 WebKit Commit Bot 2010-06-01 01:57:57 PDT
All reviewed patches have been landed.  Closing bug.