Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(254)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 6427056: Fix trailing commas in enums

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by gw280
Modified:
13 years, 5 months ago
Reviewers:
bungeman, reed1, bsalomon, TomH
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlecode.com/svn/trunk
Visibility:
Public.
Fix trailing commas in enums R=reed1 BUG= TEST=

Patch Set 1 #

Patch Set 2 : Add -pedantic to CXXFLAGS and update all enums #

Total comments: 1
Created: 13 years, 5 months ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -111 lines) Patch
M bench/AAClipBench.cpp View 1 3 chunks +3 lines, -3 lines 0 comments Download
M bench/ChecksumBench.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M bench/GrMemoryPoolBench.cpp View 1 6 chunks +6 lines, -6 lines 0 comments Download
M bench/MathBench.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M bench/MatrixBench.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M bench/PictureRecordBench.cpp View 1 4 chunks +4 lines, -4 lines 0 comments Download
M bench/VertBench.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M bench/benchmain.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M experimental/Intersection/Simplify.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M gm/gmmain.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M gm/system_preferences_mac.mm View 1 1 chunk +1 line, -1 line 0 comments Download
M gyp/common_conditions.gypi View 1 1 chunk +2 lines, -1 line 1 comment Download
M include/core/SkAnnotation.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkDeviceProfile.h View 2 chunks +2 lines, -2 lines 0 comments Download
M include/core/SkFlattenable.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkPaint.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkScalerContext.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M include/gpu/GrClip.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/gpu/GrContext.h View 1 4 chunks +4 lines, -4 lines 0 comments Download
M include/gpu/GrContextFactory.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/gpu/GrPaint.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M include/gpu/GrProgramStageFactory.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M include/gpu/GrRenderTarget.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/gpu/GrTextContext.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/gpu/GrTexture.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/gpu/GrTypes.h View 1 3 chunks +3 lines, -3 lines 0 comments Download
M include/pdf/SkPDFDevice.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/pdf/SkPDFDocument.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/utils/SkJSON.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/views/SkOSWindow_Android.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/views/SkOSWindow_Mac.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/views/SkOSWindow_Unix.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/views/SkOSWindow_iOS.h View 1 1 chunk +1 line, -1 line 0 comments Download
M include/views/SkTouchGesture.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/animator/SkDisplayApply.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/animator/SkScript2.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkGlyphCache.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPaint.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPictureFlat.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPicturePlayback.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPictureRecord.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkLightingImageFilter.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkTableColorFilter.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/GrAAConvexPathRenderer.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/GrBufferAllocPool.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/GrClipMaskManager.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/GrDrawState.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/GrDrawTarget.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/GrGpu.h View 1 3 chunks +3 lines, -3 lines 0 comments Download
M src/gpu/GrInOrderDrawBuffer.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/GrMemoryPool.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/GrPathRendererChain.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/GrResourceCache.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/GrSWMaskHelper.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/GrStencil.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/GrTextContext.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/GrTexture.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/effects/Gr1DKernelEffect.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/effects/GrConvolutionEffect.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/gl/GrGLCaps.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/gl/GrGLProgram.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/gl/GrGLProgramStage.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/gl/GrGLSL.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/gl/GrGLShaderBuilder.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/gl/GrGLShaderVar.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/gpu/gl/GrGLTexture.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/gl/GrGpuGL.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pdf/SkPDFStream.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pdf/SkPDFUtils.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pipe/SkGPipePriv.h View 1 4 chunks +4 lines, -4 lines 0 comments Download
M src/pipe/SkGPipeWrite.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/ports/SkFontDescriptor.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/ports/SkFontHost_win.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/utils/ios/SkFontHost_iOS.mm View 1 2 chunks +2 lines, -2 lines 0 comments Download
M tests/WritePixelsTest.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
Total messages: 13
|
gw280
13 years, 5 months ago (2012年07月19日 22:04:47 UTC) #1
Sign in to reply to this message.
reed1
Committed revision 4686. Can you update the .gyp files so that we see this warning ...
13 years, 5 months ago (2012年07月20日 11:36:31 UTC) #2
Committed revision 4686.
Can you update the .gyp files so that we see this warning on our bots?
Sign in to reply to this message.
bungeman
On the one hand I understand this change, the trailing comma in enums is not ...
13 years, 5 months ago (2012年07月20日 14:29:46 UTC) #3
On the one hand I understand this change, the trailing comma in enums is not
allowed in C89 or C++98. However, it is supported in C99 and C++11, and all
current compilers support it (and have supported it as an extension for quite
some time). I would rather propose that this trailing comma in enum be the first
C++11 feature Skia declares supported, unless there is a good reason to be
pedantic.
Sign in to reply to this message.
TomH
We actually have external users still on compilers that don't permit it. (I can't remember ...
13 years, 5 months ago (2012年07月20日 14:55:20 UTC) #4
We actually have external users still on compilers that don't permit it. (I
can't remember if this was Android x86, or one of the Linux distros, or ???)
On Fri, Jul 20, 2012 at 10:29 AM, <bungeman@google.com> wrote:
> On the one hand I understand this change, the trailing comma in enums is
> not allowed in C89 or C++98. However, it is supported in C99 and C++11,
> and all current compilers support it (and have supported it as an
> extension for quite some time). I would rather propose that this
> trailing comma in enum be the first C++11 feature Skia declares
> supported, unless there is a good reason to be pedantic.
>
>
>
https://codereview.appspot.**com/6427056/<https://codereview.appspot.com/6427...
>
> --
> You received this message because you are subscribed to the Google Groups
> "skia-review" group.
> To post to this group, send email to skia-review@googlegroups.com.
> To unsubscribe from this group, send email to skia-review+unsubscribe@**
> googlegroups.com <skia-review%2Bunsubscribe@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
> group/skia-review?hl=en <http://groups.google.com/group/skia-review?hl=en>
> .
>
>
Sign in to reply to this message.
gw280
On 2012年07月20日 14:55:20, TomH wrote: > We actually have external users still on compilers that ...
13 years, 5 months ago (2012年07月20日 15:07:09 UTC) #5
On 2012年07月20日 14:55:20, TomH wrote:
> We actually have external users still on compilers that don't permit it. (I
> can't remember if this was Android x86, or one of the Linux distros, or ???)
> 
It seems to me that while there are no advantages to supporting this, there are
disadvantages in that it limits the number of compilers Skia would support
without warnings.
Sign in to reply to this message.
bungeman
If we really want this we would need to do all of them, add the ...
13 years, 5 months ago (2012年07月20日 15:57:30 UTC) #6
If we really want this we would need to do all of them, add the rule to the
style guide, and modify out gyps to ensure this warning is an error. Note that
we do this in a lot of places, run 
rgrep --exclude-dir "*.svn" --exclude-dir "out" -Pzo
"enum[^{]*{[^}]*,\s*(//[^\n]*)?[ \n]*}" .
from the top level of a Skia checkout to get the list. To see the list of files
run
rgrep --exclude-dir "*.svn" --exclude-dir "out" -Pzoc
"enum[^{]*{[^}]*,\s*(//[^\n]*)?[ \n]*}" . | grep -v :0
Also, src/sfnt/SkTypedEnum.h would need to be updated.
Sign in to reply to this message.
gw280
On 2012年07月20日 15:57:30, bungeman wrote: > If we really want this we would need to ...
13 years, 5 months ago (2012年07月20日 18:26:17 UTC) #7
On 2012年07月20日 15:57:30, bungeman wrote:
> If we really want this we would need to do all of them, add the rule to the
> style guide, and modify out gyps to ensure this warning is an error. Note that
> we do this in a lot of places, run 
> 
> rgrep --exclude-dir "*.svn" --exclude-dir "out" -Pzo
> "enum[^{]*{[^}]*,\s*(//[^\n]*)?[ \n]*}" .
> 
> from the top level of a Skia checkout to get the list. To see the list of
files
> run
> 
> rgrep --exclude-dir "*.svn" --exclude-dir "out" -Pzoc
> "enum[^{]*{[^}]*,\s*(//[^\n]*)?[ \n]*}" . | grep -v :0
> 
> Also, src/sfnt/SkTypedEnum.h would need to be updated.
So here's an updated patch that adds -pedantic to the CXXFLAGS and fixes all the
enums.
Sign in to reply to this message.
TomH
Over a discussion at lunch, multiple Skia devs objected to turning on -pedantic. We should ...
13 years, 5 months ago (2012年07月20日 18:27:45 UTC) #8
Over a discussion at lunch, multiple Skia devs objected to turning on -pedantic.
We should probably find a way to debate this more widely than a CL?
Sign in to reply to this message.
gw280
On 2012年07月20日 18:27:45, TomH wrote: > Over a discussion at lunch, multiple Skia devs objected ...
13 years, 5 months ago (2012年07月20日 18:33:16 UTC) #9
On 2012年07月20日 18:27:45, TomH wrote:
> Over a discussion at lunch, multiple Skia devs objected to turning on
-pedantic.
> We should probably find a way to debate this more widely than a CL?
skia-discuss?
Sign in to reply to this message.
bsalomon
On 2012年07月20日 18:33:16, gwright wrote: > On 2012年07月20日 18:27:45, TomH wrote: > > Over a ...
13 years, 5 months ago (2012年07月20日 18:50:49 UTC) #10
On 2012年07月20日 18:33:16, gwright wrote:
> On 2012年07月20日 18:27:45, TomH wrote:
> > Over a discussion at lunch, multiple Skia devs objected to turning on
> -pedantic.
> > We should probably find a way to debate this more widely than a CL?
> 
> skia-discuss?
skia-discuss is good. I'd like to know why this is necessary before seeing this
change committed.
Sign in to reply to this message.
bungeman
This CL (Patch Set 2) appears to be missing what would be a required change ...
13 years, 5 months ago (2012年07月20日 19:43:53 UTC) #11
This CL (Patch Set 2) appears to be missing what would be a required change (as
mentioned above) to src/sfnt/SkTypedEnum.h, though it may not have been used on
Linux as of yet.
https://codereview.appspot.com/6427056/diff/7001/gyp/common_conditions.gypi
File gyp/common_conditions.gypi (right):
https://codereview.appspot.com/6427056/diff/7001/gyp/common_conditions.gypi#n...
gyp/common_conditions.gypi:105: '-pedantic'
Just because this is an appropriate time to use the word 'ironic', this line
should end with a ','.
Sign in to reply to this message.
gw280
On 2012年07月20日 19:43:53, bungeman wrote: > This CL (Patch Set 2) appears to be missing ...
13 years, 5 months ago (2012年07月20日 20:15:04 UTC) #12
On 2012年07月20日 19:43:53, bungeman wrote:
> This CL (Patch Set 2) appears to be missing what would be a required change
(as
> mentioned above) to src/sfnt/SkTypedEnum.h, though it may not have been used
on
> Linux as of yet.
I will hold off on fixing this until we've reached a consensus on skia-dicuss as
to whether it's a good idea to fix the enums.
>
https://codereview.appspot.com/6427056/diff/7001/gyp/common_conditions.gypi#n...
> gyp/common_conditions.gypi:105: '-pedantic'
> Just because this is an appropriate time to use the word 'ironic', this line
> should end with a ','.
Haha :) I don't know gyp syntax and assumed that the trailing comma was not
allowed/necessary because previously there wasn't one.
Sign in to reply to this message.
reed1
my 2-cents: fixing trailing commas seems useful it we're breaking a compiler somewhere, independent (somewhat) ...
13 years, 5 months ago (2012年07月20日 20:32:13 UTC) #13
my 2-cents:
fixing trailing commas seems useful it we're breaking a compiler somewhere,
independent (somewhat) if we want to turn-on pedantic warnings. I know we can
regress if we don't have pedantic turned on, but fixing now is a start. Hell, we
could try running Ben's script as part of our Housekeeping pass, to detect
regression w/o using the compiler...
Sign in to reply to this message.
|
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /