This gives clang-format the right notion about formatting these struct
initializers, therefore allowing us to automatically format several
additional files.
- skip-blame because this is just a content-free comment addition
indygreg |
hg-reviewers |
This gives clang-format the right notion about formatting these struct
initializers, therefore allowing us to automatically format several
additional files.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
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.
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.
Path | Packages | |||
---|---|---|---|---|
M | mercurial/cext/manifest.c (6 lines) | |||
M | mercurial/cext/osutil.c (2 lines) | |||
M | mercurial/cext/parsers.c (2 lines) | |||
M | mercurial/cext/revlog.c (2 lines) |
#ifdef IS_PY3K | #ifdef IS_PY3K | ||||
#define LAZYMANIFESTENTRIESITERATOR_TPFLAGS Py_TPFLAGS_DEFAULT | #define LAZYMANIFESTENTRIESITERATOR_TPFLAGS Py_TPFLAGS_DEFAULT | ||||
#else | #else | ||||
#define LAZYMANIFESTENTRIESITERATOR_TPFLAGS Py_TPFLAGS_DEFAULT \ | #define LAZYMANIFESTENTRIESITERATOR_TPFLAGS Py_TPFLAGS_DEFAULT \ | ||||
| Py_TPFLAGS_HAVE_ITER | | Py_TPFLAGS_HAVE_ITER | ||||
#endif | #endif | ||||
static PyTypeObject lazymanifestEntriesIterator = { | static PyTypeObject lazymanifestEntriesIterator = { | ||||
PyVarObject_HEAD_INIT(NULL, 0) | PyVarObject_HEAD_INIT(NULL, 0) /* header */ | ||||
"parsers.lazymanifest.entriesiterator", /*tp_name */ | "parsers.lazymanifest.entriesiterator", /*tp_name */ | ||||
sizeof(lmIter), /*tp_basicsize */ | sizeof(lmIter), /*tp_basicsize */ | ||||
0, /*tp_itemsize */ | 0, /*tp_itemsize */ | ||||
lmiter_dealloc, /*tp_dealloc */ | lmiter_dealloc, /*tp_dealloc */ | ||||
0, /*tp_print */ | 0, /*tp_print */ | ||||
0, /*tp_getattr */ | 0, /*tp_getattr */ | ||||
0, /*tp_setattr */ | 0, /*tp_setattr */ | ||||
0, /*tp_compare */ | 0, /*tp_compare */ | ||||
#ifdef IS_PY3K | #ifdef IS_PY3K | ||||
#define LAZYMANIFESTKEYSITERATOR_TPFLAGS Py_TPFLAGS_DEFAULT | #define LAZYMANIFESTKEYSITERATOR_TPFLAGS Py_TPFLAGS_DEFAULT | ||||
#else | #else | ||||
#define LAZYMANIFESTKEYSITERATOR_TPFLAGS Py_TPFLAGS_DEFAULT \ | #define LAZYMANIFESTKEYSITERATOR_TPFLAGS Py_TPFLAGS_DEFAULT \ | ||||
| Py_TPFLAGS_HAVE_ITER | | Py_TPFLAGS_HAVE_ITER | ||||
#endif | #endif | ||||
static PyTypeObject lazymanifestKeysIterator = { | static PyTypeObject lazymanifestKeysIterator = { | ||||
PyVarObject_HEAD_INIT(NULL, 0) | PyVarObject_HEAD_INIT(NULL, 0) /* header */ | ||||
"parsers.lazymanifest.keysiterator", /*tp_name */ | "parsers.lazymanifest.keysiterator", /*tp_name */ | ||||
sizeof(lmIter), /*tp_basicsize */ | sizeof(lmIter), /*tp_basicsize */ | ||||
0, /*tp_itemsize */ | 0, /*tp_itemsize */ | ||||
lmiter_dealloc, /*tp_dealloc */ | lmiter_dealloc, /*tp_dealloc */ | ||||
0, /*tp_print */ | 0, /*tp_print */ | ||||
0, /*tp_getattr */ | 0, /*tp_getattr */ | ||||
0, /*tp_setattr */ | 0, /*tp_setattr */ | ||||
0, /*tp_compare */ | 0, /*tp_compare */ | ||||
#ifdef IS_PY3K | #ifdef IS_PY3K | ||||
#define LAZYMANIFEST_TPFLAGS Py_TPFLAGS_DEFAULT | #define LAZYMANIFEST_TPFLAGS Py_TPFLAGS_DEFAULT | ||||
#else | #else | ||||
#define LAZYMANIFEST_TPFLAGS Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_SEQUENCE_IN | #define LAZYMANIFEST_TPFLAGS Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_SEQUENCE_IN | ||||
#endif | #endif | ||||
static PyTypeObject lazymanifestType = { | static PyTypeObject lazymanifestType = { | ||||
PyVarObject_HEAD_INIT(NULL, 0) | PyVarObject_HEAD_INIT(NULL, 0) /* header */ | ||||
"parsers.lazymanifest", /* tp_name */ | "parsers.lazymanifest", /* tp_name */ | ||||
sizeof(lazymanifest), /* tp_basicsize */ | sizeof(lazymanifest), /* tp_basicsize */ | ||||
0, /* tp_itemsize */ | 0, /* tp_itemsize */ | ||||
(destructor)lazymanifest_dealloc, /* tp_dealloc */ | (destructor)lazymanifest_dealloc, /* tp_dealloc */ | ||||
0, /* tp_print */ | 0, /* tp_print */ | ||||
0, /* tp_getattr */ | 0, /* tp_getattr */ | ||||
0, /* tp_setattr */ | 0, /* tp_setattr */ | ||||
0, /* tp_compare */ | 0, /* tp_compare */ |
} | } | ||||
static void listdir_stat_dealloc(PyObject *o) | static void listdir_stat_dealloc(PyObject *o) | ||||
{ | { | ||||
o->ob_type->tp_free(o); | o->ob_type->tp_free(o); | ||||
} | } | ||||
static PyTypeObject listdir_stat_type = { | static PyTypeObject listdir_stat_type = { | ||||
PyVarObject_HEAD_INIT(NULL, 0) | PyVarObject_HEAD_INIT(NULL, 0) /* header */ | ||||
"osutil.stat", /*tp_name*/ | "osutil.stat", /*tp_name*/ | ||||
sizeof(struct listdir_stat), /*tp_basicsize*/ | sizeof(struct listdir_stat), /*tp_basicsize*/ | ||||
0, /*tp_itemsize*/ | 0, /*tp_itemsize*/ | ||||
(destructor)listdir_stat_dealloc, /*tp_dealloc*/ | (destructor)listdir_stat_dealloc, /*tp_dealloc*/ | ||||
0, /*tp_print*/ | 0, /*tp_print*/ | ||||
0, /*tp_getattr*/ | 0, /*tp_getattr*/ | ||||
0, /*tp_setattr*/ | 0, /*tp_setattr*/ | ||||
0, /*tp_compare*/ | 0, /*tp_compare*/ |
dirstate_tuple_item, /* sq_item */ | dirstate_tuple_item, /* sq_item */ | ||||
0, /* sq_ass_item */ | 0, /* sq_ass_item */ | ||||
0, /* sq_contains */ | 0, /* sq_contains */ | ||||
0, /* sq_inplace_concat */ | 0, /* sq_inplace_concat */ | ||||
0 /* sq_inplace_repeat */ | 0 /* sq_inplace_repeat */ | ||||
}; | }; | ||||
PyTypeObject dirstateTupleType = { | PyTypeObject dirstateTupleType = { | ||||
PyVarObject_HEAD_INIT(NULL, 0) | PyVarObject_HEAD_INIT(NULL, 0) /* header */ | ||||
"dirstate_tuple", /* tp_name */ | "dirstate_tuple", /* tp_name */ | ||||
sizeof(dirstateTupleObject),/* tp_basicsize */ | sizeof(dirstateTupleObject),/* tp_basicsize */ | ||||
0, /* tp_itemsize */ | 0, /* tp_itemsize */ | ||||
(destructor)dirstate_tuple_dealloc, /* tp_dealloc */ | (destructor)dirstate_tuple_dealloc, /* tp_dealloc */ | ||||
0, /* tp_print */ | 0, /* tp_print */ | ||||
0, /* tp_getattr */ | 0, /* tp_getattr */ | ||||
0, /* tp_setattr */ | 0, /* tp_setattr */ | ||||
0, /* tp_compare */ | 0, /* tp_compare */ |
}; | }; | ||||
static PyGetSetDef index_getset[] = { | static PyGetSetDef index_getset[] = { | ||||
{"nodemap", (getter)index_nodemap, NULL, "nodemap", NULL}, | {"nodemap", (getter)index_nodemap, NULL, "nodemap", NULL}, | ||||
{NULL} /* Sentinel */ | {NULL} /* Sentinel */ | ||||
}; | }; | ||||
static PyTypeObject indexType = { | static PyTypeObject indexType = { | ||||
PyVarObject_HEAD_INIT(NULL, 0) | PyVarObject_HEAD_INIT(NULL, 0) /* header */ | ||||
"parsers.index", /* tp_name */ | "parsers.index", /* tp_name */ | ||||
sizeof(indexObject), /* tp_basicsize */ | sizeof(indexObject), /* tp_basicsize */ | ||||
0, /* tp_itemsize */ | 0, /* tp_itemsize */ | ||||
(destructor)index_dealloc, /* tp_dealloc */ | (destructor)index_dealloc, /* tp_dealloc */ | ||||
0, /* tp_print */ | 0, /* tp_print */ | ||||
0, /* tp_getattr */ | 0, /* tp_getattr */ | ||||
0, /* tp_setattr */ | 0, /* tp_setattr */ | ||||
0, /* tp_compare */ | 0, /* tp_compare */ |