summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-12-11 13:21:12 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-12-11 13:21:12 (GMT)
commit32b4a1ba62abe01684cbd1486274c7a40f81d78c (patch)
tree7c927e3180677f9e3217031507025f9a0f0511f1
parentb023381466b5dad8545191bb8ab0c37eb1a24c22 (diff)
downloadcpython-32b4a1ba62abe01684cbd1486274c7a40f81d78c.zip
cpython-32b4a1ba62abe01684cbd1486274c7a40f81d78c.tar.gz
cpython-32b4a1ba62abe01684cbd1486274c7a40f81d78c.tar.bz2
Constify char* API. Fixes #651363. 2.2 candidate.
-rw-r--r--Include/dictobject.h6
-rw-r--r--Objects/dictobject.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/Include/dictobject.h b/Include/dictobject.h
index 36053e8..d3a0fc5 100644
--- a/Include/dictobject.h
+++ b/Include/dictobject.h
@@ -116,9 +116,9 @@ PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d,
PyObject *seq2,
int override);
-PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, char *key);
-PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, char *key, PyObject *item);
-PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, char *key);
+PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key);
+PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);
+PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);
#ifdef __cplusplus
}
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 712ec2c..5e39dfa 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1919,7 +1919,7 @@ PyTypeObject PyDict_Type = {
/* For backward compatibility with old dictionary interface */
PyObject *
-PyDict_GetItemString(PyObject *v, char *key)
+PyDict_GetItemString(PyObject *v, const char *key)
{
PyObject *kv, *rv;
kv = PyString_FromString(key);
@@ -1931,7 +1931,7 @@ PyDict_GetItemString(PyObject *v, char *key)
}
int
-PyDict_SetItemString(PyObject *v, char *key, PyObject *item)
+PyDict_SetItemString(PyObject *v, const char *key, PyObject *item)
{
PyObject *kv;
int err;
@@ -1945,7 +1945,7 @@ PyDict_SetItemString(PyObject *v, char *key, PyObject *item)
}
int
-PyDict_DelItemString(PyObject *v, char *key)
+PyDict_DelItemString(PyObject *v, const char *key)
{
PyObject *kv;
int err;