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
0138c4ce
Commit
0138c4ce
authored
Aug 27, 2019
by
Raymond Hettinger
Committed by
GitHub
Aug 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unused variable and signed/unsigned warnings (GH-15537)
parent
8bf5fef8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
Objects/unicodeobject.c
Objects/unicodeobject.c
+6
-0
Python/peephole.c
Python/peephole.c
+2
-2
Python/pystrhex.c
Python/pystrhex.c
+1
-1
No files found.
Objects/unicodeobject.c
View file @
0138c4ce
...
@@ -500,10 +500,14 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content)
...
@@ -500,10 +500,14 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content)
}
}
else
{
else
{
PyCompactUnicodeObject
*
compact
=
(
PyCompactUnicodeObject
*
)
op
;
PyCompactUnicodeObject
*
compact
=
(
PyCompactUnicodeObject
*
)
op
;
#ifndef NDEBUG
void
*
data
;
void
*
data
;
#endif
if
(
ascii
->
state
.
compact
==
1
)
{
if
(
ascii
->
state
.
compact
==
1
)
{
#ifndef NDEBUG
data
=
compact
+
1
;
data
=
compact
+
1
;
#endif
_PyObject_ASSERT
(
op
,
kind
==
PyUnicode_1BYTE_KIND
_PyObject_ASSERT
(
op
,
kind
==
PyUnicode_1BYTE_KIND
||
kind
==
PyUnicode_2BYTE_KIND
||
kind
==
PyUnicode_2BYTE_KIND
||
kind
==
PyUnicode_4BYTE_KIND
);
||
kind
==
PyUnicode_4BYTE_KIND
);
...
@@ -512,9 +516,11 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content)
...
@@ -512,9 +516,11 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content)
_PyObject_ASSERT
(
op
,
compact
->
utf8
!=
data
);
_PyObject_ASSERT
(
op
,
compact
->
utf8
!=
data
);
}
}
else
{
else
{
#ifndef NDEBUG
PyUnicodeObject
*
unicode
=
(
PyUnicodeObject
*
)
op
;
PyUnicodeObject
*
unicode
=
(
PyUnicodeObject
*
)
op
;
data
=
unicode
->
data
.
any
;
data
=
unicode
->
data
.
any
;
#endif
if
(
kind
==
PyUnicode_WCHAR_KIND
)
{
if
(
kind
==
PyUnicode_WCHAR_KIND
)
{
_PyObject_ASSERT
(
op
,
ascii
->
length
==
0
);
_PyObject_ASSERT
(
op
,
ascii
->
length
==
0
);
_PyObject_ASSERT
(
op
,
ascii
->
hash
==
-
1
);
_PyObject_ASSERT
(
op
,
ascii
->
hash
==
-
1
);
...
...
Python/peephole.c
View file @
0138c4ce
...
@@ -255,8 +255,8 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
...
@@ -255,8 +255,8 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
than +255 (encoded as multiple bytes), just to keep the peephole optimizer
than +255 (encoded as multiple bytes), just to keep the peephole optimizer
simple. The optimizer leaves line number deltas unchanged. */
simple. The optimizer leaves line number deltas unchanged. */
for
(
j
=
0
;
j
<
tabsiz
;
j
+=
2
)
{
for
(
i
=
0
;
i
<
tabsiz
;
i
+=
2
)
{
if
(
lnotab
[
j
]
==
255
)
{
if
(
lnotab
[
i
]
==
255
)
{
goto
exitUnchanged
;
goto
exitUnchanged
;
}
}
}
}
...
...
Python/pystrhex.c
View file @
0138c4ce
...
@@ -57,7 +57,7 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen,
...
@@ -57,7 +57,7 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen,
}
}
resultlen
+=
arglen
*
2
;
resultlen
+=
arglen
*
2
;
if
(
abs_bytes_per_sep
>=
arglen
)
{
if
(
(
size_t
)
abs_bytes_per_sep
>=
(
size_t
)
arglen
)
{
bytes_per_sep_group
=
0
;
bytes_per_sep_group
=
0
;
abs_bytes_per_sep
=
0
;
abs_bytes_per_sep
=
0
;
}
}
...
...
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