cpython/Objects
Jeremy Hylton af68c874a6 Add const to several API functions that take char *.
In C++, it's an error to pass a string literal to a char* function
without a const_cast().  Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.

I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc.  Predictably, there were a large set of functions that
needed to be fixed as a result of these changes.  The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].

One cast was required as a result of the changes:  A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
2005-12-10 18:50:16 +00:00
..
abstract.c Convert iterator __len__() methods to a private API. 2005-09-24 21:23:05 +00:00
boolobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
bufferobject.c Disallow keyword arguments for type constructors that don't use them. 2005-08-26 06:42:30 +00:00
cellobject.c Use new GC API. 2001-08-29 23:54:21 +00:00
classobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
cobject.c Make CObjects mutable. Fixes #477441. 2003-10-19 18:30:01 +00:00
codeobject.c Merge ast-branch to head 2005-10-20 19:59:25 +00:00
complexobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
descrobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
dictnotes.txt Fix typos and add some elaborations 2004-03-15 15:52:22 +00:00
dictobject.c Convert iterator __len__() methods to a private API. 2005-09-24 21:23:05 +00:00
enumobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
fileobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
floatobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
frameobject.c Fix a bunch of imports to use code.h instead of compile.h. 2005-10-21 14:58:06 +00:00
funcobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
genobject.c Fix a too-aggressive assert (see SF#1257960). Previously, gen_iternext 2005-08-13 03:29:00 +00:00
intobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
iterobject.c Convert iterator __len__() methods to a private API. 2005-09-24 21:23:05 +00:00
listobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
listsort.txt The key to the various sort columns got lost. Pulled from 2005-09-23 17:14:22 +00:00
longobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
methodobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
moduleobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
object.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
obmalloc.c Do a better job of not inlining Py_ADDRESS_IN_RANGE() for newer gcc's. 2005-11-13 18:55:39 +00:00
rangeobject.c Convert iterator __len__() methods to a private API. 2005-09-24 21:23:05 +00:00
setobject.c Prevent name pollution by making lots of internal functions static. 2005-11-13 18:41:28 +00:00
sliceobject.c Disallow keyword arguments for type constructors that don't use them. 2005-08-26 06:42:30 +00:00
stringobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
structseq.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
tupleobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
typeobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
unicodectype.c Enhance the performance of two important Unicode character 2005-10-20 19:06:35 +00:00
unicodeobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00
unicodetype_db.h SF #989185: Drop unicode.iswide() and unicode.width() and add 2004-08-04 07:38:35 +00:00
weakrefobject.c Add const to several API functions that take char *. 2005-12-10 18:50:16 +00:00