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
bcf6b18e
Commit
bcf6b18e
authored
Feb 15, 2009
by
Mark Dickinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few more minor fixes in longobject.c
parent
2ffb26fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Include/longintrepr.h
Include/longintrepr.h
+1
-0
Objects/longobject.c
Objects/longobject.c
+4
-5
No files found.
Include/longintrepr.h
View file @
bcf6b18e
...
...
@@ -19,6 +19,7 @@ extern "C" {
long_pow() requires that SHIFT be divisible by 5. */
typedef
unsigned
short
digit
;
typedef
short
sdigit
;
/* signed variant of digit */
#define BASE_TWODIGITS_TYPE long
typedef
unsigned
BASE_TWODIGITS_TYPE
twodigits
;
typedef
BASE_TWODIGITS_TYPE
stwodigits
;
/* signed variant of twodigits */
...
...
Objects/longobject.c
View file @
bcf6b18e
...
...
@@ -63,7 +63,7 @@ long_normalize(register PyLongObject *v)
PyLongObject
*
_PyLong_New
(
Py_ssize_t
size
)
{
if
(
size
>
MAX_LONG_DIGITS
)
{
if
(
size
>
(
Py_ssize_t
)
MAX_LONG_DIGITS
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"too many digits in integer"
);
return
NULL
;
...
...
@@ -1945,7 +1945,7 @@ long_compare(PyLongObject *a, PyLongObject *b)
if
(
i
<
0
)
sign
=
0
;
else
{
sign
=
(
int
)
a
->
ob_digit
[
i
]
-
(
in
t
)
b
->
ob_digit
[
i
];
sign
=
(
sdigit
)
a
->
ob_digit
[
i
]
-
(
sdigi
t
)
b
->
ob_digit
[
i
];
if
(
Py_SIZE
(
a
)
<
0
)
sign
=
-
sign
;
}
...
...
@@ -2865,7 +2865,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
for
(
i
=
Py_SIZE
(
b
)
-
1
;
i
>=
0
;
--
i
)
{
digit
bi
=
b
->
ob_digit
[
i
];
for
(
j
=
1
<<
(
PyLong_SHIFT
-
1
);
j
!=
0
;
j
>>=
1
)
{
for
(
j
=
(
digit
)
1
<<
(
PyLong_SHIFT
-
1
);
j
!=
0
;
j
>>=
1
)
{
MULT
(
z
,
z
,
z
)
if
(
bi
&
j
)
MULT
(
z
,
a
,
z
)
...
...
@@ -3099,9 +3099,8 @@ long_bitwise(PyLongObject *a,
{
digit
maska
,
maskb
;
/* 0 or PyLong_MASK */
int
negz
;
Py_ssize_t
size_a
,
size_b
,
size_z
;
Py_ssize_t
size_a
,
size_b
,
size_z
,
i
;
PyLongObject
*
z
;
int
i
;
digit
diga
,
digb
;
PyObject
*
v
;
...
...
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