Bug 150396

Summary: check-webkit-style complains about missing operator whitespace inside character literal
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: Tools / TestsAssignee: Frédéric Wang (:fredw) <fred.wang>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, glenn, lforschler, ossy
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 150394, 150451    
Attachments:
Description Flags
Patch darin: review+

Description Frédéric Wang (:fredw) 2015-10-21 10:09:57 PDT
Bug 150394, contains a patch that loads the OS/2 table as follows:

  CFDataRef os2Table = CGFontCopyTableForTag(m_platformData.cgFont(), 'OS/2')

Here 'OS/2' is a character literal (32 bit integer) used as a tag representing the TrueType table. The slash is not used as an operator, however check-webkit-style complains with the following message:

  ERROR: Source/WebCore/platform/graphics/cocoa/FontCocoa.mm:179:  Missing spaces around /  [whitespace/operators] [3]
Comment 1 Frédéric Wang (:fredw) 2015-10-24 08:52:58 PDT
Created attachment 263979 [details]
Patch
Comment 2 Frédéric Wang (:fredw) 2015-10-24 08:56:24 PDT
Note that the 'OS/2' case is already in the source code:

https://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm#L284
Comment 3 Csaba Osztrogonác 2015-10-24 12:21:04 PDT
Comment on attachment 263979 [details]
Patch

Could you please add a new unittest covers this change?
Comment 4 Csaba Osztrogonác 2015-10-24 12:22:03 PDT
(In reply to comment #3)
> Comment on attachment 263979 [details]
> Patch
> 
> Could you please add a new unittest covers this change?

Sorry, please ignore this comment.
Comment 5 Frédéric Wang (:fredw) 2015-10-24 16:37:07 PDT
Committed r191538: <http://trac.webkit.org/changeset/191538>