Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
20b39b27
Commit
20b39b27
authored
Sep 28, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed redundant casts to `char *`.
Corresponding functions now accept `const char *` (issue #1772673).
parent
131caba0
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
17 additions
and
18 deletions
+17
-18
Modules/_cursesmodule.c
Modules/_cursesmodule.c
+1
-1
Modules/_decimal/_decimal.c
Modules/_decimal/_decimal.c
+2
-2
Modules/cjkcodecs/cjkcodecs.h
Modules/cjkcodecs/cjkcodecs.h
+1
-1
Modules/cjkcodecs/multibytecodec.c
Modules/cjkcodecs/multibytecodec.c
+2
-2
Modules/pyexpat.c
Modules/pyexpat.c
+4
-5
Objects/bytesobject.c
Objects/bytesobject.c
+1
-1
Objects/floatobject.c
Objects/floatobject.c
+2
-2
Objects/longobject.c
Objects/longobject.c
+1
-1
Objects/unicodeobject.c
Objects/unicodeobject.c
+2
-2
Python/import.c
Python/import.c
+1
-1
No files found.
Modules/_cursesmodule.c
View file @
20b39b27
...
...
@@ -2675,7 +2675,7 @@ PyCurses_KeyName(PyObject *self, PyObject *args)
}
knp
=
keyname
(
ch
);
return
PyBytes_FromString
((
knp
==
NULL
)
?
""
:
(
char
*
)
knp
);
return
PyBytes_FromString
((
knp
==
NULL
)
?
""
:
knp
);
}
#endif
...
...
Modules/_decimal/_decimal.c
View file @
20b39b27
...
...
@@ -5640,7 +5640,7 @@ PyInit__decimal(void)
goto
error
;
/* GCOV_NOT_REACHED */
}
ASSIGN_PTR
(
cm
->
ex
,
PyErr_NewException
(
(
char
*
)
cm
->
fqname
,
base
,
NULL
));
ASSIGN_PTR
(
cm
->
ex
,
PyErr_NewException
(
cm
->
fqname
,
base
,
NULL
));
Py_DECREF
(
base
);
/* add to module */
...
...
@@ -5672,7 +5672,7 @@ PyInit__decimal(void)
goto
error
;
/* GCOV_NOT_REACHED */
}
ASSIGN_PTR
(
cm
->
ex
,
PyErr_NewException
(
(
char
*
)
cm
->
fqname
,
base
,
NULL
));
ASSIGN_PTR
(
cm
->
ex
,
PyErr_NewException
(
cm
->
fqname
,
base
,
NULL
));
Py_DECREF
(
base
);
Py_INCREF
(
cm
->
ex
);
...
...
Modules/cjkcodecs/cjkcodecs.h
View file @
20b39b27
...
...
@@ -362,7 +362,7 @@ importmap(const char *modname, const char *symbol,
if
(
mod
==
NULL
)
return
-
1
;
o
=
PyObject_GetAttrString
(
mod
,
(
char
*
)
symbol
);
o
=
PyObject_GetAttrString
(
mod
,
symbol
);
if
(
o
==
NULL
)
goto
errorexit
;
else
if
(
!
PyCapsule_IsValid
(
o
,
PyMultibyteCodec_CAPSULE_NAME
))
{
...
...
Modules/cjkcodecs/multibytecodec.c
View file @
20b39b27
...
...
@@ -1269,10 +1269,10 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self,
if
(
sizehint
<
0
)
cres
=
PyObject_CallMethod
(
self
->
stream
,
(
char
*
)
method
,
NULL
);
method
,
NULL
);
else
cres
=
PyObject_CallMethod
(
self
->
stream
,
(
char
*
)
method
,
"i"
,
sizehint
);
method
,
"i"
,
sizehint
);
if
(
cres
==
NULL
)
goto
errorexit
;
...
...
Modules/pyexpat.c
View file @
20b39b27
...
...
@@ -1478,7 +1478,7 @@ PyUnknownEncodingHandler(void *encodingHandlerData,
static
PyObject
*
newxmlparseobject
(
c
har
*
encoding
,
char
*
namespace_separator
,
PyObject
*
intern
)
newxmlparseobject
(
c
onst
char
*
encoding
,
const
char
*
namespace_separator
,
PyObject
*
intern
)
{
int
i
;
xmlparseobject
*
self
;
...
...
@@ -1932,8 +1932,7 @@ pyexpat_ParserCreate_impl(PyModuleDef *module, const char *encoding, const char
return
NULL
;
}
result
=
newxmlparseobject
((
char
*
)
encoding
,
(
char
*
)
namespace_separator
,
intern
);
result
=
newxmlparseobject
(
encoding
,
namespace_separator
,
intern
);
if
(
intern_decref
)
{
Py_DECREF
(
intern
);
}
...
...
@@ -2074,7 +2073,7 @@ MODULE_INITFUNC(void)
PyModule_AddObject
(
m
,
"XMLParserType"
,
(
PyObject
*
)
&
Xmlparsetype
);
PyModule_AddStringConstant
(
m
,
"EXPAT_VERSION"
,
(
char
*
)
XML_ExpatVersion
());
XML_ExpatVersion
());
{
XML_Expat_Version
info
=
XML_ExpatVersionInfo
();
PyModule_AddObject
(
m
,
"version_info"
,
...
...
@@ -2154,7 +2153,7 @@ MODULE_INITFUNC(void)
#define MYCONST(name) \
if (PyModule_AddStringConstant(errors_module, #name, \
(char *)XML_ErrorString(name)) < 0)
\
XML_ErrorString(name)) < 0)
\
return NULL; \
tmpnum = PyLong_FromLong(name); \
if (tmpnum == NULL) return NULL; \
...
...
Objects/bytesobject.c
View file @
20b39b27
...
...
@@ -3403,7 +3403,7 @@ _PyBytes_Resize(PyObject **pv, Py_ssize_t newsize)
_Py_DEC_REFTOTAL
;
_Py_ForgetReference
(
v
);
*
pv
=
(
PyObject
*
)
PyObject_REALLOC
(
(
char
*
)
v
,
PyBytesObject_SIZE
+
newsize
);
PyObject_REALLOC
(
v
,
PyBytesObject_SIZE
+
newsize
);
if
(
*
pv
==
NULL
)
{
PyObject_Del
(
v
);
PyErr_NoMemory
();
...
...
Objects/floatobject.c
View file @
20b39b27
...
...
@@ -2026,7 +2026,7 @@ _PyFloat_Pack4(double x, unsigned char *p, int le)
}
else
{
float
y
=
(
float
)
x
;
const
char
*
s
=
(
char
*
)
&
y
;
const
unsigned
char
*
s
=
(
unsigned
char
*
)
&
y
;
int
i
,
incr
=
1
;
if
(
Py_IS_INFINITY
(
y
)
&&
!
Py_IS_INFINITY
(
x
))
...
...
@@ -2162,7 +2162,7 @@ _PyFloat_Pack8(double x, unsigned char *p, int le)
return
-
1
;
}
else
{
const
char
*
s
=
(
char
*
)
&
x
;
const
unsigned
char
*
s
=
(
unsigned
char
*
)
&
x
;
int
i
,
incr
=
1
;
if
((
double_format
==
ieee_little_endian_format
&&
!
le
)
...
...
Objects/longobject.c
View file @
20b39b27
...
...
@@ -2312,7 +2312,7 @@ _PyLong_FromBytes(const char *s, Py_ssize_t len, int base)
PyObject
*
result
,
*
strobj
;
char
*
end
=
NULL
;
result
=
PyLong_FromString
(
(
char
*
)
s
,
&
end
,
base
);
result
=
PyLong_FromString
(
s
,
&
end
,
base
);
if
(
end
==
NULL
||
(
result
!=
NULL
&&
end
==
s
+
len
))
return
result
;
Py_XDECREF
(
result
);
...
...
Objects/unicodeobject.c
View file @
20b39b27
...
...
@@ -727,7 +727,7 @@ resize_compact(PyObject *unicode, Py_ssize_t length)
_Py_DEC_REFTOTAL
;
_Py_ForgetReference
(
unicode
);
new_unicode
=
(
PyObject
*
)
PyObject_REALLOC
(
(
char
*
)
unicode
,
new_size
);
new_unicode
=
(
PyObject
*
)
PyObject_REALLOC
(
unicode
,
new_size
);
if
(
new_unicode
==
NULL
)
{
_Py_NewReference
(
unicode
);
PyErr_NoMemory
();
...
...
@@ -3483,7 +3483,7 @@ mbstowcs_errorpos(const char *str, size_t len)
memset
(
&
mbs
,
0
,
sizeof
mbs
);
while
(
len
)
{
converted
=
mbrtowc
(
&
ch
,
(
char
*
)
str
,
len
,
&
mbs
);
converted
=
mbrtowc
(
&
ch
,
str
,
len
,
&
mbs
);
if
(
converted
==
0
)
/* Reached end of string */
break
;
...
...
Python/import.c
View file @
20b39b27
...
...
@@ -2064,7 +2064,7 @@ PyImport_AppendInittab(const char *name, PyObject* (*initfunc)(void))
memset
(
newtab
,
'\0'
,
sizeof
newtab
);
newtab
[
0
].
name
=
(
char
*
)
name
;
newtab
[
0
].
name
=
name
;
newtab
[
0
].
initfunc
=
initfunc
;
return
PyImport_ExtendInittab
(
newtab
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment