changeset 46875:651e6df2b0a4

clang-format: run the formatter on mercurial/cext/revlog.c This fix `test-check-clang-format.t` that has been complaining for a while. Differential Revision: https://phab.mercurial-scm.org/D10327
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 08 Apr 2021 20:05:59 +0200
parents 84a93fa7ecfd
children a8fa270a0e86
files mercurial/cext/revlog.c
diffstat 1 files changed, 17 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cext/revlog.c	Tue Apr 06 18:55:19 2021 +0200
+++ b/mercurial/cext/revlog.c	Thu Apr 08 20:05:59 2021 +0200
@@ -115,12 +115,10 @@
 
 #if LONG_MAX == 0x7fffffffL
 static const char *const v1_tuple_format = PY23("Kiiiiiis#", "Kiiiiiiy#");
-static const char *const v2_tuple_format =
-    PY23("Kiiiiiis#Ki", "Kiiiiiiy#Ki");
+static const char *const v2_tuple_format = PY23("Kiiiiiis#Ki", "Kiiiiiiy#Ki");
 #else
 static const char *const v1_tuple_format = PY23("kiiiiiis#", "kiiiiiiy#");
-static const char *const v2_tuple_format =
-    PY23("kiiiiiis#ki", "kiiiiiiy#ki");
+static const char *const v2_tuple_format = PY23("kiiiiiis#ki", "kiiiiiiy#ki");
 #endif
 
 /* A RevlogNG v1 index entry is 64 bytes long. */
@@ -407,10 +405,11 @@
 			return NULL;
 		}
 	} else {
-		if (!PyArg_ParseTuple(
-		        obj, v2_tuple_format, &offset_flags, &comp_len,
-		        &uncomp_len, &base_rev, &link_rev, &parent_1, &parent_2,
-		        &c_node_id, &c_node_id_len, &sidedata_offset, &sidedata_comp_len)) {
+		if (!PyArg_ParseTuple(obj, v2_tuple_format, &offset_flags,
+		                      &comp_len, &uncomp_len, &base_rev,
+		                      &link_rev, &parent_1, &parent_2,
+		                      &c_node_id, &c_node_id_len,
+		                      &sidedata_offset, &sidedata_comp_len)) {
 			PyErr_SetString(PyExc_TypeError, "10-tuple required");
 			return NULL;
 		}
@@ -467,11 +466,11 @@
 	int rev;
 	Py_ssize_t sidedata_comp_len;
 	char *data;
-  #if LONG_MAX == 0x7fffffffL
-	  const char *const sidedata_format = PY23("nKi", "nKi");
-	#else
-	  const char *const sidedata_format = PY23("nki", "nki");
-	#endif
+#if LONG_MAX == 0x7fffffffL
+	const char *const sidedata_format = PY23("nKi", "nKi");
+#else
+	const char *const sidedata_format = PY23("nki", "nki");
+#endif
 
 	if (self->hdrsize == v1_hdrsize || self->inlined) {
 		/*
@@ -499,12 +498,12 @@
 		return NULL;
 	}
 
-	/* Find the newly added node, offset from the "already on-disk" length */
+	/* Find the newly added node, offset from the "already on-disk" length
+	 */
 	data = self->added + self->hdrsize * (rev - self->length);
 	putbe64(sidedata_offset, data + 64);
 	putbe32(sidedata_comp_len, data + 72);
 
-
 	Py_RETURN_NONE;
 }
 
@@ -2724,9 +2723,9 @@
 		    Py_BuildValue(PY23("iiiiiiis#", "iiiiiiiy#"), 0, 0, 0, -1,
 		                  -1, -1, -1, nullid, self->nodelen);
 	} else {
-		self->nullentry = Py_BuildValue(
-		    PY23("iiiiiiis#ii", "iiiiiiiy#ii"), 0, 0, 0, -1, -1, -1,
-		    -1, nullid, self->nodelen, 0, 0);
+		self->nullentry =
+		    Py_BuildValue(PY23("iiiiiiis#ii", "iiiiiiiy#ii"), 0, 0, 0,
+		                  -1, -1, -1, -1, nullid, self->nodelen, 0, 0);
 	}
 
 	if (!self->nullentry)