summaryrefslogtreecommitdiffstats
path: root/Parser/tokenizer.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-12-11 14:04:59 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-12-11 14:04:59 (GMT)
commit95292d6caa3af3196c5b9f5f95dae209815c09e5 (patch)
tree193e6e6a45f1e1319e4bb4ba07a3fee838a2ca5d /Parser/tokenizer.c
parent0e88c9f65d163c0c8551d0f079a19b71a8a9e3ca (diff)
downloadcpython-95292d6caa3af3196c5b9f5f95dae209815c09e5.zip
cpython-95292d6caa3af3196c5b9f5f95dae209815c09e5.tar.gz
cpython-95292d6caa3af3196c5b9f5f95dae209815c09e5.tar.bz2
Constify filenames and scripts. Fixes #651362.
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r--Parser/tokenizer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 800a166..d7a223a 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -386,7 +386,8 @@ fp_setreadl(struct tok_state *tok, const char* enc)
{
PyObject *reader, *stream, *readline;
- stream = PyFile_FromFile(tok->fp, tok->filename, "rb", NULL);
+ /* XXX: constify filename argument. */
+ stream = PyFile_FromFile(tok->fp, (char*)tok->filename, "rb", NULL);
if (stream == NULL)
return 0;
@@ -591,7 +592,7 @@ decode_str(const char *str, struct tok_state *tok)
/* Set up tokenizer for string */
struct tok_state *
-PyTokenizer_FromString(char *str)
+PyTokenizer_FromString(const char *str)
{
struct tok_state *tok = tok_new();
if (tok == NULL)
@@ -599,7 +600,8 @@ PyTokenizer_FromString(char *str)
str = (char *)decode_str(str, tok);
if (str == NULL)
return NULL;
- tok->buf = tok->cur = tok->end = tok->inp = str;
+ /* XXX: constify members. */
+ tok->buf = tok->cur = tok->end = tok->inp = (char*)str;
return tok;
}