diff mercurial/dirs.c @ 30159:fb5504d7b2c9

dirs: document Py_SIZE weirdness Assigning to what looks like a function is clown shoes. Document that it is a macro referring to a struct member.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 08 Oct 2016 17:07:43 +0200
parents 27e00e6352ce
children 1e5ff5ae1d2b
line wrap: on
line diff
--- a/mercurial/dirs.c	Wed Oct 12 12:22:54 2016 +0200
+++ b/mercurial/dirs.c	Sat Oct 08 17:07:43 2016 +0200
@@ -76,6 +76,8 @@
 			if (key == NULL)
 				goto bail;
 		}
+		/* Py_SIZE(o) refers to the ob_size member of the struct. Yes,
+		* assigning to what looks like a function seems wrong. */
 		Py_SIZE(key) = pos;
 		((PyBytesObject *)key)->ob_sval[pos] = '\0';