Patchwork D1169: cext: add /* header */ comment to all PyVarObject_HEAD_INIT() calls

login
register
mail settings
Submitter phabricator
Date Oct. 17, 2017, 9:45 p.m.
Message ID <differential-rev-PHID-DREV-ozqdbrceidr23fqlgsdl-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25149/
State Superseded
Headers show

Comments

phabricator - Oct. 17, 2017, 9:45 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This gives clang-format the right notion about formatting these struct
  initializers, therefore allowing us to automatically format several
  additional files.
  
  1. skip-blame because this is just a content-free comment addition

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1169

AFFECTED FILES
  mercurial/cext/manifest.c
  mercurial/cext/osutil.c
  mercurial/cext/parsers.c
  mercurial/cext/revlog.c

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 18, 2017, 3:48 p.m.
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  Oh, I was wondering how to do this. AFAICT this feature is not documented at https://clang.llvm.org/docs/ClangFormat.html or https://clang.llvm.org/docs/ClangFormatStyleOptions.html. Boo.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1169

To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
phabricator - Oct. 18, 2017, 3:53 p.m.
durin42 added a comment.


  I figured this out by finding a bug at Google on this topic, and then djasper showed me a workaround and said he'd look again at fixing the other case we're stuck on.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1169

To: durin42, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -1991,7 +1991,7 @@ 
 };
 
 static PyTypeObject indexType = {
-	PyVarObject_HEAD_INIT(NULL, 0)
+	PyVarObject_HEAD_INIT(NULL, 0) /* header */
 	"parsers.index",           /* tp_name */
 	sizeof(indexObject),       /* tp_basicsize */
 	0,                         /* tp_itemsize */
diff --git a/mercurial/cext/parsers.c b/mercurial/cext/parsers.c
--- a/mercurial/cext/parsers.c
+++ b/mercurial/cext/parsers.c
@@ -195,7 +195,7 @@ 
 };
 
 PyTypeObject dirstateTupleType = {
-	PyVarObject_HEAD_INIT(NULL, 0)
+	PyVarObject_HEAD_INIT(NULL, 0) /* header */
 	"dirstate_tuple",          /* tp_name */
 	sizeof(dirstateTupleObject),/* tp_basicsize */
 	0,                         /* tp_itemsize */
diff --git a/mercurial/cext/osutil.c b/mercurial/cext/osutil.c
--- a/mercurial/cext/osutil.c
+++ b/mercurial/cext/osutil.c
@@ -121,7 +121,7 @@ 
 }
 
 static PyTypeObject listdir_stat_type = {
-	PyVarObject_HEAD_INIT(NULL, 0)
+	PyVarObject_HEAD_INIT(NULL, 0) /* header */
 	"osutil.stat",             /*tp_name*/
 	sizeof(struct listdir_stat), /*tp_basicsize*/
 	0,                         /*tp_itemsize*/
diff --git a/mercurial/cext/manifest.c b/mercurial/cext/manifest.c
--- a/mercurial/cext/manifest.c
+++ b/mercurial/cext/manifest.c
@@ -262,7 +262,7 @@ 
 #endif
 
 static PyTypeObject lazymanifestEntriesIterator = {
-	PyVarObject_HEAD_INIT(NULL, 0)
+	PyVarObject_HEAD_INIT(NULL, 0) /* header */
 	"parsers.lazymanifest.entriesiterator", /*tp_name */
 	sizeof(lmIter),                  /*tp_basicsize */
 	0,                               /*tp_itemsize */
@@ -310,7 +310,7 @@ 
 #endif
 
 static PyTypeObject lazymanifestKeysIterator = {
-	PyVarObject_HEAD_INIT(NULL, 0)
+	PyVarObject_HEAD_INIT(NULL, 0) /* header */
 	"parsers.lazymanifest.keysiterator", /*tp_name */
 	sizeof(lmIter),                  /*tp_basicsize */
 	0,                               /*tp_itemsize */
@@ -890,7 +890,7 @@ 
 #endif
 
 static PyTypeObject lazymanifestType = {
-	PyVarObject_HEAD_INIT(NULL, 0)
+	PyVarObject_HEAD_INIT(NULL, 0) /* header */
 	"parsers.lazymanifest",                           /* tp_name */
 	sizeof(lazymanifest),                             /* tp_basicsize */
 	0,                                                /* tp_itemsize */