History log of /external/python/cpython2/Objects/longobject.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
445844993b68f102241a600636b0d69394db1c7b 03-Dec-2016 Benjamin Peterson <benjamin@python.org> fix refleak in the shift-by-zero case (#27870)
/external/python/cpython2/Objects/longobject.c
6507657dddebc629e49f3dc683d89a96a481fb86 07-Sep-2016 Martin Panter <vadmium+py@gmail.com> Issue #27895: Spelling fixes (Contributed by Ville Skyttä).
/external/python/cpython2/Objects/longobject.c
02c0c0b6e7e87320a4f11d80295b9a2d6085f621 29-Aug-2016 Mark Dickinson <dickinsm@gmail.com> Issue #27870: A left shift of zero by a large integer no longer attempts to allocate large amounts of memory.
/external/python/cpython2/Objects/longobject.c
89446b2c91b664a851874b43a295859c8383343d 21-Aug-2016 Mark Dickinson <dickinsm@gmail.com> Issue #25604: Fix bug in integer true division that could have resulted in off-by-one-ulp results in unusual cases.
/external/python/cpython2/Objects/longobject.c
a850ef698e55d07173051747e96207496c6f1bdb 28-Jul-2016 Martin Panter <vadmium+py@gmail.com> Issue #27626: Spelling fixes in docs, comments and internal names

Based on patch by Ville Skyttä.
/external/python/cpython2/Objects/longobject.c
8d30ad7c8ad5df59be8a65c8f8dab0d13be00dab 25-Nov-2015 Serhiy Storchaka <storchaka@gmail.com> Issue #24731: Fixed crash on converting objects with special methods
__str__, __trunc__, and __float__ returning instances of subclasses of
str, long, and float to subclasses of str, long, and float correspondingly.
/external/python/cpython2/Objects/longobject.c
61e9ffa191aa3a3270c5efcd3f1d05810419b63f 05-Oct-2013 Tim Peters <tim@python.org> Issue #19171: speed some cases of 3-argument long pow().

Reduce the base by the modulus when the base is larger than
the modulus. This can unboundedly speed the "startup costs"
of doing modular exponentiation, particularly in cases where
the base is much larger than the modulus. Original patch
by Armin Rigo, inspired by https://github.com/pyca/ed25519.
(grafted from f34c59494420765b013136ca93f63b716d9f1d30)
/external/python/cpython2/Objects/longobject.c
74f49ab28b91d3c23524356230feb2724ee9b23f 18-Jan-2013 Serhiy Storchaka <storchaka@gmail.com> Issue #15989: Fix several occurrences of integer overflow
when result of PyInt_AsLong() or PyLong_AsLong() narrowed
to int without checks.

This is a backport of changesets 13e2e44db99d and 525407d89277.
/external/python/cpython2/Objects/longobject.c
cf095f8e0f0ed1111995a5b8a8a5ebdb189683f2 28-Dec-2012 Serhiy Storchaka <storchaka@gmail.com> Issue #16761: Raise TypeError when int() or long() called with base argument only.
/external/python/cpython2/Objects/longobject.c
ad4b0001794e47368b0997183b30b1171eab2790 08-Oct-2012 Chris Jerdonek <chris.jerdonek@gmail.com> Issue #14783: Backport changes from 3.2.
/external/python/cpython2/Objects/longobject.c
c2077b0d9b5bf99768c6f396bf7ae6c41b682465 15-Mar-2011 Ezio Melotti <ezio.melotti@gmail.com> #11565: Fix several typos. Patch by Piotr Kasprzyk.
/external/python/cpython2/Objects/longobject.c
24b07bcba350bb86c4d6ca446e1564647a199868 15-Mar-2011 Ezio Melotti <ezio.melotti@gmail.com> #11515: fix several typos. Patch by Piotr Kasprzyk.
/external/python/cpython2/Objects/longobject.c
43ca377e457a5eaf3674f58bf1a9bdd3bd06af76 09-May-2010 Mark Dickinson <dickinsm@gmail.com> Wrap multiline macros in a 'do {} while(0)', for safety.
/external/python/cpython2/Objects/longobject.c
fda8d114ea302704dc66e565305824b935f4191a 09-May-2010 Mark Dickinson <dickinsm@gmail.com> Post-detabification cleanup: whitespace fixes and long line rewraps only.
/external/python/cpython2/Objects/longobject.c
c83ea137d7e717f764e2f31fc2544f522de7d857 09-May-2010 Antoine Pitrou <solipsis@pitrou.net> Untabify C files. Will watch buildbots.
/external/python/cpython2/Objects/longobject.c
22ff664ff7850032118c712023a4882ab23d471b 08-May-2010 Mark Dickinson <dickinsm@gmail.com> Issue #8659: Remove redundant ABS calls. Thanks Daniel Stutzbach.
/external/python/cpython2/Objects/longobject.c
ef7590e943df2e2bc11d422c1f995929c019385c 07-Apr-2010 Stefan Krah <stefan@bytereef.org> Issue #8328: Silence Visual Studio warnings.
/external/python/cpython2/Objects/longobject.c
ea7e5510aa6d42bd8f7fcc2f22fea972f2b5c8c7 06-Apr-2010 Mark Dickinson <dickinsm@gmail.com> Silence a 'comparison between signed and unsigned integer expressions' gcc warning.
/external/python/cpython2/Objects/longobject.c
3ec9b942b5536e3fc597a065851750e01025b6f1 06-Apr-2010 Mark Dickinson <dickinsm@gmail.com> Issue #8259: Get rid of 'outrageous left shift count' error when
left-shifting an integer by more than 2**31 on a 64-bit machine. Also
convert shift counts to a Py_ssize_t instead of a C long.
/external/python/cpython2/Objects/longobject.c
a36507c64cd8d299749c758503b0951070e202f8 30-Jan-2010 Mark Dickinson <dickinsm@gmail.com> Issue #7767: Add new C-API function PyLong_AsLongLongAndOverflow, a
long long variant of PyLong_AsLongAndOverflow. Patch by Case Van
Horsen.
/external/python/cpython2/Objects/longobject.c
d3e323215c6d9f303bf42875f98e365e2ff1734f 02-Jan-2010 Mark Dickinson <dickinsm@gmail.com> Refactor some longobject internals: PyLong_AsDouble and _PyLong_AsScaledDouble
(the latter renamed to _PyLong_Frexp) now use the same core code. The
exponent produced by _PyLong_Frexp now has type Py_ssize_t instead of the
previously used int, and no longer needs scaling by PyLong_SHIFT. This
frees the math module from having to know anything about the PyLong
implementation. This closes issue #5576.
/external/python/cpython2/Objects/longobject.c
465728364749e903fb4293b2f7a266b58de6bde4 27-Dec-2009 Mark Dickinson <dickinsm@gmail.com> Issue #1811: Improve accuracy and consistency of true division for integers.
/external/python/cpython2/Objects/longobject.c
e31d300664f54029ce35ccb78475333b968fdd6b 21-Dec-2009 Mark Dickinson <dickinsm@gmail.com> Issue #7528: Backport PyLong_AsLongAndOverflow from py3k to trunk.
Thanks Case Van Horsen for the patch.
/external/python/cpython2/Objects/longobject.c
8d87dc0c2995a4e1eb5bb889372bc7efe218c3a4 25-Oct-2009 Mark Dickinson <dickinsm@gmail.com> Issue #1087418: Small performance boost for bitwise operations on longs.
Initial patch by Gregory Smith; some tweaks added.
/external/python/cpython2/Objects/longobject.c
71adc9328d593449a7d8d3bff45b09bf87afa59e 28-Sep-2009 Mark Dickinson <dickinsm@gmail.com> Style/consistency/nano-optimization nit: replace occurrences of
(high_bits << PyLong_SHIFT) + low_bits with
(high_bits << PyLong_SHIFT) | low_bits
in Objects/longobject.c. Motivation:
- shouldn't unnecessarily mix bit ops with arithmetic ops (style)
- this pattern should be spelt the same way thoughout (consistency)
- it's very very very slightly faster: no need to worry about
carries to the high digit (nano-optimization).
/external/python/cpython2/Objects/longobject.c
40ee861c0acea30e27f06f088b0713b617a4291c 21-Sep-2009 Mark Dickinson <dickinsm@gmail.com> Silence MSVC compiler warnings.
/external/python/cpython2/Objects/longobject.c
aa2adc828a0583ee472d42a3b6a8964c822c7ee2 17-Sep-2009 Mark Dickinson <dickinsm@gmail.com> Issue #6713: Improve performance of str(n) and repr(n) for integers n
(up to 3.1 times faster in tests), by special-casing base 10 in
_PyLong_Format. (Backport of r74851 from py3k.)
/external/python/cpython2/Objects/longobject.c
1f4fc097f600cf0c0408afd88a9d0a9bff9d9212 13-Sep-2009 Mark Dickinson <dickinsm@gmail.com> Fix potential signed-overflow bug in _PyLong_Format; also fix
a couple of whitespace issues.
/external/python/cpython2/Objects/longobject.c
752a2daf323572cbeaa6dec42a807fc421d577c3 06-Sep-2009 Mark Dickinson <dickinsm@gmail.com> Remove redundant assignment
/external/python/cpython2/Objects/longobject.c
d4b5c98fa66c8e80bcb719d0fa11222495b646ac 02-May-2009 Mark Dickinson <dickinsm@gmail.com> Remove unnecessary use of context for long getters.
(Related to issue #5880).
/external/python/cpython2/Objects/longobject.c
6736cf8d20b67b74e8e959622132963285156242 20-Apr-2009 Mark Dickinson <dickinsm@gmail.com> Issue #3166: Make long -> float (and int -> float) conversions
correctly rounded, using round-half-to-even. This ensures that the
value of float(n) doesn't depend on whether we're using 15-bit digits
or 30-bit digits for Python longs.
/external/python/cpython2/Objects/longobject.c
48e3fd240fc6338fbcbbc9c1c8a7d118faca924a 02-Apr-2009 Mark Dickinson <dickinsm@gmail.com> sys.long_info attributes should be ints, not longs
/external/python/cpython2/Objects/longobject.c
0b666bfdf94b04af370d28806f16a9977d6f5792 23-Mar-2009 Mark Dickinson <dickinsm@gmail.com> Issue #5512: speed up the long division algorithm for Python longs.
The basic algorithm remains the same; the most significant speedups
come from the following three changes:

(1) normalize by shifting instead of multiplying and dividing
(2) the old algorithm usually did an unnecessary extra iteration of
the outer loop; remove this. As a special case, this means that
long divisions with a single-digit result run twice as fast as
before.
(3) make inner loop much tighter.

Various benchmarks show speedups of between 50% and 150% for long
integer divisions and modulo operations.
/external/python/cpython2/Objects/longobject.c
efc82f7e8eff19d8e844a3dc268a88de7fbcb173 20-Mar-2009 Mark Dickinson <dickinsm@gmail.com> Issue #4258: Use 30-bit digits for Python longs, on 64-bit platforms.
Backport of r70459.
/external/python/cpython2/Objects/longobject.c
b6464876876d6cb2ce53c40ae33daa5a00d522a4 25-Feb-2009 Mark Dickinson <dickinsm@gmail.com> Replace long with twodigits, to avoid depending
on sizeof(digit) < sizeof(long)
/external/python/cpython2/Objects/longobject.c
bcf6b18eb721ac291599a26fba36cec4229cadce 15-Feb-2009 Mark Dickinson <dickinsm@gmail.com> A few more minor fixes in longobject.c
/external/python/cpython2/Objects/longobject.c
2ffb26fb83b4c559d1f4cd3a26cda6d7234e809d 15-Feb-2009 Mark Dickinson <dickinsm@gmail.com> Issue #5260: Various portability and standards compliance fixes, optimizations
and cleanups in Objects/longobject.c. The most significant change is that
longs now use less memory: average savings are 2 bytes per long on 32-bit
systems and 6 bytes per long on 64-bit systems. (This memory saving already
exists in py3k.)
/external/python/cpython2/Objects/longobject.c
4015f62e39452db0aa651edcd54b00f4e80e6bb5 10-Feb-2009 Mark Dickinson <dickinsm@gmail.com> Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for
negative arguments. Previously, it raised TypeError.

Thanks Lisandro Dalcin.
/external/python/cpython2/Objects/longobject.c
a0eae0398c0b10ff3000e279e93e6eef83485ad0 26-Jan-2009 Mark Dickinson <dickinsm@gmail.com> Fix comment.
/external/python/cpython2/Objects/longobject.c
6ffa4a2a7d6c1e1149783d68bba5c05f835c2d61 26-Jan-2009 Mark Dickinson <dickinsm@gmail.com> Fix undefined behaviour (left shift of negative value) in long_hash. Also,
rewrap a line of length > 79, and update comments.
/external/python/cpython2/Objects/longobject.c
1afe6ddd07c892cadc38b2a6100265ce0fea7365 25-Jan-2009 Mark Dickinson <dickinsm@gmail.com> No need for carry to be type twodigits in _PyLong_AsByteArray; digit is large enough.
This change should silence a compiler warning on Windows.
/external/python/cpython2/Objects/longobject.c
ff84aa87b43ca0688d2bcd8003b28e0b75c15a90 24-Jan-2009 Mark Dickinson <dickinsm@gmail.com> Issue #4393: fix 3 classes of potential portability problems in longobject.c:
- fix some places where counters into ob_digit were declared as
int instead of Py_ssize_t
- add (twodigit) casts where necessary
- fix code in _PyLong_AsByteArray that uses << on negative values
/external/python/cpython2/Objects/longobject.c
1a707981c8b57e5ca7c5b8aa38d3e5e6ca235dbf 17-Dec-2008 Mark Dickinson <dickinsm@gmail.com> Issue #3439: add bit_length method to int and long.
Thanks Fredrik Johansson and Victor Stinner for code,
Raymond Hettinger for review.
/external/python/cpython2/Objects/longobject.c
b646757e01d51c242eef2f9802f1ca6836a5804a 04-Aug-2008 Mark Dickinson <dickinsm@gmail.com> Issue #1481296: (again!) Make conversion of a float NaN to an int or
long raise ValueError instead of returning 0. Also, change the error
message for conversion of an infinity to an integer, replacing 'long' by
'integer', so that it's appropriate for both long(float('inf')) and
int(float('inf')).
/external/python/cpython2/Objects/longobject.c
e7d8be80ba634fa15ece6f503c33592e0d333361 31-Jul-2008 Neal Norwitz <nnorwitz@gmail.com> Security patches from Apple: prevent int overflow when allocating memory
/external/python/cpython2/Objects/longobject.c
9be2ec109bcec499c1a6971fb4c40d9a8e7886fe 10-Jul-2008 Robert Schuppenies <okkotonushi@googlemail.com> Added additional __sizeof__ implementations and addressed comments made in
Issue3122.
/external/python/cpython2/Objects/longobject.c
9c437af4ebd832d913b85bfb2e666d55565c3665 25-Jun-2008 Raymond Hettinger <python@rcn.com> Revert 64424, 64438, and 64439.
/external/python/cpython2/Objects/longobject.c
e3ae655edfea3dd8ed32fcca63cb3eae861a58b7 20-Jun-2008 Raymond Hettinger <python@rcn.com> Make bin() implementation parallel oct() and hex() so that int/long subclasses can override or so that other classes can support.
/external/python/cpython2/Objects/longobject.c
dd96db63f689e2f0d8ae5a1436b3b3395eec7de5 09-Jun-2008 Gregory P. Smith <greg@mad-scientist.com> This reverts r63675 based on the discussion in this thread:

http://mail.python.org/pipermail/python-dev/2008-June/079988.html

Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
/external/python/cpython2/Objects/longobject.c
7a6de8b0f465037ed75104d8f17ca3de99a4da52 01-Jun-2008 Georg Brandl <georg@python.org> Some style nits. Also clarify in the docstrings what __sizeof__ does.
/external/python/cpython2/Objects/longobject.c
51df0647672bc758da6d58eecfe45da9dc5913df 01-Jun-2008 Robert Schuppenies <okkotonushi@googlemail.com> Issue #2898: Added sys.getsizeof() to retrieve size of objects in bytes.
/external/python/cpython2/Objects/longobject.c
dc13b79a384691ed966f760a58d73a1b835e7d6b 30-May-2008 Eric Smith <eric@trueblade.com> Refactor and clean up str.format() code (and helpers) in advance of optimizations.
/external/python/cpython2/Objects/longobject.c
593daf545bd9b7e7bcb27b498ecc6f36db9ae395 26-May-2008 Christian Heimes <christian@cheimes.de> Renamed PyString to PyBytes
/external/python/cpython2/Objects/longobject.c
6f34109384f3a78d5f4f8bdd418a89caca19631e 19-Apr-2008 Christian Heimes <christian@cheimes.de> I finally got the time to update and merge Mark's and my trunk-math branch. The patch is collaborated work of Mark Dickinson and me. It was mostly done a few months ago. The patch fixes a lot of loose ends and edge cases related to operations with NaN, INF, very small values and complex math.

The patch also adds acosh, asinh, atanh, log1p and copysign to all platforms. Finally it fixes differences between platforms like different results or exceptions for edge cases. Have fun :)
/external/python/cpython2/Objects/longobject.c
27a632510e7520466e620a16628433d85655ccb3 15-Apr-2008 Mark Dickinson <dickinsm@gmail.com> Fix for possible signed overflow: the behaviour of -LONG_MIN is
undefined in ANSI C.
/external/python/cpython2/Objects/longobject.c
d183bdd6fb77ae562714c655f0689beacdc00da1 28-Mar-2008 Neal Norwitz <nnorwitz@gmail.com> Revert r61969 which added casts to Py_CHARMASK to avoid compiler warnings.
Rather than sprinkle casts throughout the code, change Py_CHARMASK to
always cast it's result to an unsigned char. This should ensure we
do the right thing when accessing an array with the result.
/external/python/cpython2/Objects/longobject.c
231346e23f3bcb5102199712b998ca7f2354dfdd 27-Mar-2008 Neal Norwitz <nnorwitz@gmail.com> Fix warnings about using char as an array subscript. This is not portable
since char is signed on some platforms and unsigned on others.
/external/python/cpython2/Objects/longobject.c
5de250e823f03e45cee3558b699f9e8b4404c347 18-Mar-2008 Jeffrey Yasskin <jyasskin@gmail.com> Fix build on platforms that don't have intptr_t. Patch by Joseph Armbruster.
/external/python/cpython2/Objects/longobject.c
9ff19b54346d39d15cdcf75e9d66ab46ea6064d6 17-Mar-2008 Eric Smith <eric@trueblade.com> Finished backporting PEP 3127, Integer Literal Support and Syntax.

Added 0b and 0o literals to tokenizer.
Modified PyOS_strtoul to support 0b and 0o inputs.
Modified PyLong_FromString to support guessing 0b and 0o inputs.
Renamed test_hexoct.py to test_int_literal.py and added binary tests.
Added upper and lower case 0b, 0O, and 0X tests to test_int_literal.py
/external/python/cpython2/Objects/longobject.c
a9f7d6248032c9572b4d2024a1be8bd2823af09f 17-Feb-2008 Eric Smith <eric@trueblade.com> Backport of PEP 3101, Advanced String Formatting, from py3k.

Highlights:
- Adding PyObject_Format.
- Adding string.Format class.
- Adding __format__ for str, unicode, int, long, float, datetime.
- Adding builtin format.
- Adding ''.format and u''.format.
- str/unicode fixups for formatters.

The files in Objects/stringlib that implement PEP 3101 (stringdefs.h,
unicodedefs.h, formatter.h, string_format.h) are identical in trunk
and py3k. Any changes from here on should be made to trunk, and
changes will propogate to py3k).
/external/python/cpython2/Objects/longobject.c
5e527ebee1580f052fc53aacabe3906ffcdd4805 10-Feb-2008 Eric Smith <eric@trueblade.com> Added PyNumber_ToBase and supporting routines _PyInt_Format and
_PyLong_Format. In longobject.c, changed long_format to
_PyLong_Format. In intobject.c, changed uses of PyOS_snprintf to
_PyInt_Format instead.

_PyLong_Format is similar to py3k's routine of the same name, except
it has 2 additional parameters: addL and newstyle. addL was existing
in long_format, and controls adding the trailing "L". This is
unneeded in py3k. newstyle is used to control whether octal prepends
"0" (the pre-2.6 style), or "0o" (the 3.0 sytle).

PyNumber_ToBase is needed for PEP 3127 (Integer Literal Support and
Syntax) and PEP 3101 (Advanced String Formatting).

This changeset does not need merging into py3k.
/external/python/cpython2/Objects/longobject.c
7f39c9fcbba0cc59293d80a7bbcbb8bca62790ee 25-Jan-2008 Christian Heimes <christian@cheimes.de> Backport of several functions from Python 3.0 to 2.6 including PyUnicode_FromString, PyUnicode_Format and PyLong_From/AsSsize_t. The functions are partly required for the backport of the bytearray type and _fileio module. They should also make it easier to port C to 3.0.
First chapter of the Python 3.0 io framework back port: _fileio
The next step depends on a working bytearray type which itself depends on a backport of the nwe buffer API.
/external/python/cpython2/Objects/longobject.c
4956d2b88981fd5a6481cd048d7efd514594b6e9 18-Jan-2008 Christian Heimes <christian@cheimes.de> Silence Coverity false alerts with CIDs #172, #183, #184
/external/python/cpython2/Objects/longobject.c
9871d8fe22566acf68bf336d04d3a1dbd51f3269 05-Jan-2008 Jeffrey Yasskin <jyasskin@gmail.com> Continue rolling back pep-3141 changes that changed behavior from 2.5. This
round included:
* Revert round to its 2.6 behavior (half away from 0).
* Because round, floor, and ceil always return float again, it's no
longer necessary to have them delegate to __xxx___, so I've ripped
that out of their implementations and the Real ABC. This also helps
in implementing types that work in both 2.6 and 3.0: you return int
from the __xxx__ methods, and let it get enabled by the version
upgrade.
* Make pow(-1, .5) raise a ValueError again.
/external/python/cpython2/Objects/longobject.c
737c73f96ff52cda4b433d25f887525442b7b430 04-Jan-2008 Jeffrey Yasskin <jyasskin@gmail.com> Make math.{floor,ceil}({int,long}) return float again for backwards
compatibility after r59671 made them return integral types.
/external/python/cpython2/Objects/longobject.c
8267d1dfe5f73007812dcb35f865fd4763e94471 04-Jan-2008 Christian Heimes <christian@cheimes.de> Bug #1481296: Fixed long(float('nan'))!=0L.
/external/python/cpython2/Objects/longobject.c
2f3c16be73a8562d357b9b13bbb8088e275840a7 03-Jan-2008 Jeffrey Yasskin <jyasskin@gmail.com> Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (just
the complex_pow part), r56649, r56652, r56715, r57296, r57302, r57359, r57361,
r57372, r57738, r57739, r58017, r58039, r58040, and r59390, and new
documentation. The only significant difference is that round(x) returns a float
to preserve backward-compatibility. See http://bugs.python.org/issue1689.
/external/python/cpython2/Objects/longobject.c
e93237dfcc4ee4feee62adafb4e7899487ca864b 19-Dec-2007 Christian Heimes <christian@cheimes.de> #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available.
/external/python/cpython2/Objects/longobject.c
d544df7ddd0f4910e2eae33a596fae8cb7a5d6cb 19-Sep-2007 Facundo Batista <facundobatista@gmail.com> Issue #1772851. Alters long.__hash__ from being *almost* completely
predictable to being completely predictable. The value of hash(n)
is unchanged for any n that's small enough to be representable as an
int, and also unchanged for the vast majority of long integers n of
reasonable size.
/external/python/cpython2/Objects/longobject.c
6819210b9e4e5719a6f7f9c1725f8fa70a8936f6 21-Jul-2007 Martin v. Löwis <martin@v.loewis.de> PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
/external/python/cpython2/Objects/longobject.c
f030394de333ed645e7f1139e2e42f43444efb73 03-May-2007 Kristján Valur Jónsson <kristjan@ccpgames.com> Fix problems in x64 build that were discovered by the testsuite:
- Reenable modules on x64 that had been disabled aeons ago for Itanium.
- Cleared up confusion about compilers for 64 bit windows. There is only Itanium and x64. Added macros MS_WINI64 and MS_WINX64 for those rare cases where it matters, such as the disabling of modules above.
- Set target platform (_WIN32_WINNT and WINVER) to 0x0501 (XP) for x64, and 0x0400 (NT 4.0) otherwise, which are the targeted minimum platforms.
- Fixed thread_nt.h. The emulated InterlockedCompareExchange function didn´t work on x64, probaby due to the lack of a "volatile" specifier. Anyway, win95 is no longer a target platform.
- Itertools module used wrong constant to check for overflow in count()
- PyInt_AsSsize_t couldn't deal with attribute error when accessing the __long__ member.
- PyLong_FromSsize_t() incorrectly specified that the operand were unsigned.

With these changes, the x64 passes the testsuite, for those modules present.
/external/python/cpython2/Objects/longobject.c
c02e13122ba94b05dc03fd56de393b9129f3ed25 11-Apr-2007 Georg Brandl <georg@python.org> Add some missing NULL checks which trigger crashes on low-memory conditions.
Found by Victor Stinner. Will backport when 2.5 branch is unfrozen.
/external/python/cpython2/Objects/longobject.c
00cd818dea72177dd79a3d86562d52f1433f9f49 06-Mar-2007 Georg Brandl <georg@python.org> Patch #1638879: don't accept strings with embedded NUL bytes in long().
/external/python/cpython2/Objects/longobject.c
ee3a1b5244e60566c5d5c8f6a1ea4b381de99f1c 25-Feb-2007 Neal Norwitz <nnorwitz@gmail.com> Variation of patch # 1624059 to speed up checking if an object is a subclass
of some of the common builtin types.

Use a bit in tp_flags for each common builtin type. Check the bit
to determine if any instance is a subclass of these common types.
The check avoids a function call and O(n) search of the base classes.
The check is done in the various Py*_Check macros rather than calling
PyType_IsSubtype().

All the bits are set in tp_flags when the type is declared
in the Objects/*object.c files because PyType_Ready() is not called
for all the types. Should PyType_Ready() be called for all types?
If so and the change is made, the changes to the Objects/*object.c files
can be reverted (remove setting the tp_flags). Objects/typeobject.c
would also have to be modified to add conditions
for Py*_CheckExact() in addition to each the PyType_IsSubtype check.
/external/python/cpython2/Objects/longobject.c
7ccbca93a27e22f0b06316b0d9760fbf7b19cbda 04-Oct-2006 Armin Rigo <arigo@tunes.org> Forward-port of r52136,52138: a review of overflow-detecting code.

* unified the way intobject, longobject and mystrtoul handle
values around -sys.maxint-1.

* in general, trying to entierely avoid overflows in any computation
involving signed ints or longs is extremely involved. Fixed a few
simple cases where a compiler might be too clever (but that's all
guesswork).

* more overflow checks against bad data in marshal.c.

* 2.5 specific: fixed a number of places that were still confusing int
and Py_ssize_t. Some of them could potentially have caused
"real-world" breakage.

* list.pop(x): fixing overflow issues on x was messy. I just reverted
to PyArg_ParseTuple("n"), which does the right thing. (An obscure
test was trying to give a Decimal to list.pop()... doesn't make
sense any more IMHO)

* trying to write a few tests...
/external/python/cpython2/Objects/longobject.c
8a87f5d37e6aab91ddc4c6491877b6cbd48a12cf 12-Aug-2006 Neal Norwitz <nnorwitz@gmail.com> Patch #1538606, Patch to fix __index__() clipping.

I modified this patch some by fixing style, some error checking, and adding
XXX comments. This patch requires review and some changes are to be expected.
I'm checking in now to get the greatest possible review and establish a
baseline for moving forward. I don't want this to hold up release if possible.
/external/python/cpython2/Objects/longobject.c
c09efa844419b801ba9d9db9e04ccfb2af59d7f3 23-Jul-2006 Neal Norwitz <nnorwitz@gmail.com> Move the initialization of size_a down below the check for a being NULL.

Reported by Klocwork #106
/external/python/cpython2/Objects/longobject.c
ef02b9e1445b7c7ae60c790a68ed1e0e75dfe435 16-Jul-2006 Neal Norwitz <nnorwitz@gmail.com> a & b were dereffed above, so they are known to be valid pointers.
z is known to be NULL, nothing to DECREF.

Reported by Klockwork, #107.
/external/python/cpython2/Objects/longobject.c
9faa3eda6b767ddfae8ff2627d50edd6ad072490 30-May-2006 Tim Peters <tim.peters@gmail.com> PyLong_FromString(): Continued fraction analysis (explained in
a new comment) suggests there are almost certainly large input
integers in all non-binary input bases for which one Python digit
too few is initally allocated to hold the final result. Instead
of assert-failing when that happens, allocate more space. Alas,
I estimate it would take a few days to find a specific such case,
so this isn't backed up by a new test (not to mention that such
a case may take hours to run, since conversion time is quadratic
in the number of digits, and preliminary attempts suggested that
the smallest such inputs contain at least a million digits).
/external/python/cpython2/Objects/longobject.c
d89fc22dc6300ef3f1a8447a34f9ad2d15c722d5 26-May-2006 Tim Peters <tim.peters@gmail.com> Patch #1494387: SVN longobject.c compiler warnings

The SIGCHECK macro defined here has always been bizarre, but
it apparently causes compiler warnings on "Sun Studio 11".
I believe the warnings are bogus, but it doesn't hurt to make
the macro definition saner.

Bugfix candidate (but I'm not going to bother).
/external/python/cpython2/Objects/longobject.c
a85bf202ac57e4d8013a12b13928cccb8fbc5fa4 25-May-2006 Bob Ippolito <bob@redivi.com> Faster path for PyLong_FromLongLong, using PyLong_FromLong algorithm
/external/python/cpython2/Objects/longobject.c
da53afa1b09218c0fb7ce8803cd783a43ee9d319 25-May-2006 Tim Peters <tim.peters@gmail.com> A new table to help string->integer conversion was added yesterday to
both mystrtoul.c and longobject.c. Share the table instead. Also
cut its size by 64 entries (they had been used for an inscrutable
trick originally, but the code no longer tries to use that trick).
/external/python/cpython2/Objects/longobject.c
696cf43b58cf1ddb7a3ab3c5bee6709e3b3653d9 24-May-2006 Tim Peters <tim.peters@gmail.com> Heavily fiddled variant of patch #1442927: PyLong_FromString optimization.

``long(str, base)`` is now up to 6x faster for non-power-of-2 bases. The
largest speedup is for inputs with about 1000 decimal digits. Conversion
from non-power-of-2 bases remains quadratic-time in the number of input
digits (it was and remains linear-time for bases 2, 4, 8, 16 and 32).

Speedups at various lengths for decimal inputs, comparing 2.4.3 with
current trunk. Note that it's actually a bit slower for 1-digit strings:

len speedup
---- -------
1 -4.5%
2 4.6%
3 8.3%
4 12.7%
5 16.9%
6 28.6%
7 35.5%
8 44.3%
9 46.6%
10 55.3%
11 65.7%
12 77.7%
13 73.4%
14 75.3%
15 85.2%
16 103.0%
17 95.1%
18 112.8%
19 117.9%
20 128.3%
30 174.5%
40 209.3%
50 236.3%
60 254.3%
70 262.9%
80 295.8%
90 297.3%
100 324.5%
200 374.6%
300 403.1%
400 391.1%
500 388.7%
600 440.6%
700 468.7%
800 498.0%
900 507.2%
1000 501.2%
2000 450.2%
3000 463.2%
4000 452.5%
5000 440.6%
6000 439.6%
7000 424.8%
8000 418.1%
9000 417.7%
/external/python/cpython2/Objects/longobject.c
c6a989ac3a2ce1f52f48acfb73d04b604ba173b1 10-May-2006 Neal Norwitz <nnorwitz@gmail.com> Fix problems found by Coverity.

longobject.c: also fix an ssize_t problem
<a> could have been NULL, so hoist the size calc to not use <a>.

_ssl.c: under fail: self is DECREF'd, but it would have been NULL.

_elementtree.c: delete self if there was an error.

_csv.c: I'm not sure if lineterminator could have been anything other than
a string. However, other string method calls are checked, so check this
one too.
/external/python/cpython2/Objects/longobject.c
429433b30bbfb957c38b1bc0b699cda2fb30db1c 18-Apr-2006 Skip Montanaro <skip@pobox.com> C++ compiler cleanup: bunch-o-casts, plus use of unsigned loop index var in a couple places
/external/python/cpython2/Objects/longobject.c
9cb28bea04066b6b47f84662e1db130eda137b09 12-Apr-2006 Thomas Wouters <thomas@python.org> Fix int() and long() to repr() their argument when formatting the exception,
to avoid confusing situations like:

>>> int("")
ValueError: invalid literal for int():
>>> int("2\n\n2")
ValueError: invalid literal for int(): 2

2

Also report the base used, to avoid:

ValueError: invalid literal for int(): 2

They now report:

>>> int("")
ValueError: invalid literal for int() with base 10: ''
>>> int("2\n\n2")
ValueError: invalid literal for int() with base 10: '2\n\n2'
>>> int("2", 2)
ValueError: invalid literal for int() with base 2: '2'

(Reporting the base could be avoided when base is 10, which is the default,
but hrm.) Another effect of these changes is that the errormessage can be
longer; before, it was cut off at about 250 characters. Now, it can be up to
four times as long, as the unrepr'ed string is cut off at 200 characters,
instead.

No tests were added or changed, since testing for exact errormsgs is (pardon
the pun) somewhat errorprone, and I consider not testing the exact text
preferable. The actually changed code is tested frequent enough in the
test_builtin test as it is (120 runs for each of ints and longs.)
/external/python/cpython2/Objects/longobject.c
377be11ee1fab015f4cc77975374f86cf436536e 11-Apr-2006 Anthony Baxter <anthonybaxter@gmail.com> More C++-compliance. Note especially listobject.c - to get C++ to accept the
PyTypeObject structures, I had to make prototypes for the functions, and
move the structure definition ahead of the functions. I'd dearly like a better
way to do this - to change this would make for a massive set of changes to
the codebase.

There's still some warnings - this is purely to get rid of errors first.
/external/python/cpython2/Objects/longobject.c
0bc2ab9a20745e3cc7a2ca4cc01a3708e273e2dc 10-Apr-2006 Martin v. Löwis <martin@v.loewis.de> Patch #837242: id() for large ptr should return a long.
/external/python/cpython2/Objects/longobject.c
c48c8db110fd5e3b1f8574e8e52f85d11d4c4fd4 05-Apr-2006 Martin v. Löwis <martin@v.loewis.de> Add PY_SSIZE_T_MIN, as suggested by Ralf W. Grosse-Kunstleve.
/external/python/cpython2/Objects/longobject.c
347b30042b68e80b245a03b23cb616024ecb1f1e 30-Mar-2006 Georg Brandl <georg@python.org> Remove unnecessary casts in type object initializers.
/external/python/cpython2/Objects/longobject.c
12bec1b9851b821d3350a20f3a49e2a0cb7d22e5 28-Mar-2006 Armin Rigo <arigo@tunes.org> fix a comment.
/external/python/cpython2/Objects/longobject.c
38fff8c4e4276e4e57660a78f305e68bfa87874b 07-Mar-2006 Guido van Rossum <guido@python.org> Checking in the code for PEP 357.
This was mostly written by Travis Oliphant.
I've inspected it all; Neal Norwitz and MvL have also looked at it
(in an earlier incarnation).
/external/python/cpython2/Objects/longobject.c
4af5c8cee4885df70884a58e2e74c48984bbe7c2 07-Mar-2006 Hye-Shik Chang <hyeshik@gmail.com> SF #1444030: Fix several potential defects found by Coverity.
(reviewed by Neal Norwitz)
/external/python/cpython2/Objects/longobject.c
15e62742fad688b026ba80bf17d1345c4cbd423b 27-Feb-2006 Martin v. Löwis <martin@v.loewis.de> Revert backwards-incompatible const changes.
/external/python/cpython2/Objects/longobject.c
18e165558b24d29e7e0ca501842b9236589b012a 15-Feb-2006 Martin v. Löwis <martin@v.loewis.de> Merge ssize_t branch.
/external/python/cpython2/Objects/longobject.c
553489ab1db7990998aae3bffc0a1e20f5dc51af 01-Feb-2006 Thomas Wouters <thomas@python.org> As discussed on python-dev, silence three gcc-4.0.x warnings, using assert()
to protect against actual uninitialized usage.

Objects/longobject.c: In function ‘PyLong_AsDouble’:
Objects/longobject.c:655: warning: ‘e’ may be used uninitialized in this function

Objects/longobject.c: In function ‘long_true_divide’:
Objects/longobject.c:2263: warning: ‘aexp’ may be used uninitialized in this function
Objects/longobject.c:2263: warning: ‘bexp’ may be used uninitialized in this function
/external/python/cpython2/Objects/longobject.c
af68c874a6803b4e90b616077a602c0593719a1d 10-Dec-2005 Jeremy Hylton <jeremy@alum.mit.edu> Add const to several API functions that take char *.

In C++, it's an error to pass a string literal to a char* function
without a const_cast(). Rather than require every C++ extension
module to put a cast around string literals, fix the API to state the
const-ness.

I focused on parts of the API where people usually pass literals:
PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type
slots, etc. Predictably, there were a large set of functions that
needed to be fixed as a result of these changes. The most pervasive
change was to make the keyword args list passed to
PyArg_ParseTupleAndKewords() to be a const char *kwlist[].

One cast was required as a result of the changes: A type object
mallocs the memory for its tp_doc slot and later frees it.
PyTypeObject says that tp_doc is const char *; but if the type was
created by type_new(), we know it is safe to cast to char *.
/external/python/cpython2/Objects/longobject.c
de7990b8af50e7f2ebf6776b948fdb48408ccb02 18-Jul-2005 Tim Peters <tim.peters@gmail.com> SF bug #1238681: freed pointer is used in longobject.c:long_pow().

In addition, long_pow() skipped a necessary (albeit extremely unlikely
to trigger) error check when converting an int modulus to long.

Alas, I was unable to write a test case that crashed due to either
cause.

Bugfix candidate.
/external/python/cpython2/Objects/longobject.c
3296e696db4e46f63f7a5348ac977b2b0a32ecbc 30-Jun-2005 Raymond Hettinger <python@rcn.com> SF bug #1224347: int/long unification and hex()

Hex longs now print with lowercase letters like their int counterparts.
/external/python/cpython2/Objects/longobject.c
c3647ac93e2a38762de8a23b1d94a6380e9ad468 26-Apr-2005 Brett Cannon <bcannon@gmail.com> Make subclasses of int, long, complex, float, and unicode perform type
conversion using the proper magic slot (e.g., __int__()). Also move conversion
code out of PyNumber_*() functions in the C API into the nb_* function.

Applied patch #1109424. Thanks Walter Doewald.
/external/python/cpython2/Objects/longobject.c
6ce7ed23d0449daa70f396486fae3c1014d93191 03-Mar-2005 Martin v. Löwis <martin@v.loewis.de> Revert previous checkin on getargs 'L' code. Try to convert all
numbers in PyLong_AsLongLong, and update test suite accordingly.
Backported to 2.4.
/external/python/cpython2/Objects/longobject.c
729d47db091f33ab366be2e43d7bee17f06d10d7 20-Sep-2004 Martin v. Löwis <martin@v.loewis.de> Patch #1024670: Support int objects in PyLong_AsUnsignedLong[Mask].
/external/python/cpython2/Objects/longobject.c
cd97da3b1d61be00bb06f3264a60418dbdb83bd8 30-Aug-2004 Tim Peters <tim.peters@gmail.com> long_pow(): Fix more instances of leaks in error cases.

Bugfix candidate -- although long_pow() is so different now I doubt a
patch would apply to 2.3.
/external/python/cpython2/Objects/longobject.c
47e52ee0c5c8868db903d476b49c3368fce4d79a 30-Aug-2004 Tim Peters <tim.peters@gmail.com> SF patch 936813: fast modular exponentiation

This checkin is adapted from part 2 (of 3) of Trevor Perrin's patch set.

BACKWARD INCOMPATIBILITY: SHIFT must now be divisible by 5. AFAIK,
nobody will care. long_pow() could be complicated to worm around that,
if necessary.

long_pow():
- BUGFIX: This leaked the base and power when the power was negative
(and so the computation delegated to float pow).
- Instead of doing right-to-left exponentiation, do left-to-right. This
is more efficient for small bases, which is the common case.
- In addition, if the exponent is large (more than FIVEARY_CUTOFF
digits), precompute [a**i % c for i in range(32)], and go left to
right 5 bits at a time.
l_divmod():
- The signature changed so that callers who don't want the quotient,
or don't want the remainder, can pass NULL in the slot they don't
want. This saves them from having to declare a vrbl for unwanted
stuff, and remembering to decref it.
long_mod(), long_div(), long_classic_div():
- Adjust to new l_divmod() signature, and simplified as a result.
/external/python/cpython2/Objects/longobject.c
0973b99e1cfe13b3d197e1b6c449a2d75b55d17a 30-Aug-2004 Tim Peters <tim.peters@gmail.com> SF patch 936813: fast modular exponentiation

This checkin is adapted from part 1 (of 3) of Trevor Perrin's patch set.

x_mul()
- sped a little by optimizing the C
- sped a lot (~2X) if it's doing a square; note that long_pow() squares
often
k_mul()
- more cache-friendly now if it's doing a square
KARATSUBA_CUTOFF
- boosted; gradeschool mult is quicker now, and it may have been too low
for many platforms anyway
KARATSUBA_SQUARE_CUTOFF
- new
- since x_mul is a lot faster at squaring now, the point at which
Karatsuba pays for squaring is much higher than for general mult
/external/python/cpython2/Objects/longobject.c
f466793fcc6e2234f4843bd6a04625f1fac96132 28-Jun-2003 Raymond Hettinger <python@rcn.com> SF patch 703666: Several objects don't decref tmp on failure in subtype_new
Submitted By: Christopher A. Craig

Fillin some missing decrefs.
/external/python/cpython2/Objects/longobject.c
c7bc0b98e7cd2190a03da1a5269cdaaea711429e 05-May-2003 Tim Peters <tim.peters@gmail.com> SF patch 730594: assert from longobject.c, line 1215.
Some version of gcc in the "RTEMS port running on the Coldfire (m5200)
processor" generates bad code for a loop in long_from_binary_base(),
comparing the wrong half of an int to a short. The patch changes the
decl of the short temp to be an int temp instead. This "simplifies"
the code enough that gcc no longer blows it.
/external/python/cpython2/Objects/longobject.c
fc61f9a36e937221f0bbee02afd419055a7cdb6f 01-May-2003 Jeremy Hylton <jeremy@alum.mit.edu> Silence compiler warnings in VC 7.
/external/python/cpython2/Objects/longobject.c
a4ea603b055533e71920a088acb1c106e4895dbd 17-Apr-2003 Thomas Heller <theller@ctypes.org> SF # 595026: support for masks in getargs.c.

New functions:
unsigned long PyInt_AsUnsignedLongMask(PyObject *);
unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);
unsigned long PyLong_AsUnsignedLongMask(PyObject *);
unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);

New and changed format codes:

b unsigned char 0..UCHAR_MAX
B unsigned char none **
h unsigned short 0..USHRT_MAX
H unsigned short none **
i int INT_MIN..INT_MAX
I * unsigned int 0..UINT_MAX
l long LONG_MIN..LONG_MAX
k * unsigned long none
L long long LLONG_MIN..LLONG_MAX
K * unsigned long long none

Notes:

* New format codes.

** Changed from previous "range-and-a-half" to "none"; the
range-and-a-half checking wasn't particularly useful.

New test test_getargs2.py, to verify all this.
/external/python/cpython2/Objects/longobject.c
b9a0f9121876cbc728cbef88f16bb32b92712d2d 29-Mar-2003 Martin v. Löwis <martin@v.loewis.de> Rename LONG_LONG to PY_LONG_LONG. Fixes #710285.
/external/python/cpython2/Objects/longobject.c
d5a65a77cfdd81ad6945195c88e367fcd9f709c2 24-Feb-2003 Neal Norwitz <nnorwitz@gmail.com> Fix SF bug #689659, 64-bit int and long hash keys incompatible

On a 64-bit machine, a dictionary could contain duplicate int/long keys
if the value was > 2**32.
/external/python/cpython2/Objects/longobject.c
004a65c9b10718c9f0089125f3cbbfac2a754804 03-Feb-2003 Guido van Rossum <guido@python.org> _PyLong_Sign(): remove an assert that needed a variable ndigits that
wasn't used outside the assert (and hence caused a compiler warning
about an unused variable in NDEBUG mode). The assert wasn't very
useful any more.

_PyLong_NumBits(): moved the calculation of ndigits after asserting
that v != NULL.
/external/python/cpython2/Objects/longobject.c
1a3b19a6e9ac3e65fd2b648f5f2e04312afe8674 02-Feb-2003 Tim Peters <tim.peters@gmail.com> long_from_binary_base(): Sped this a little by computing the # of bits
needed outside the first loop.
/external/python/cpython2/Objects/longobject.c
efb9625b81c87330742e49b1df9595634583f7a8 02-Feb-2003 Tim Peters <tim.peters@gmail.com> Tightened a too-generous assert.
/external/python/cpython2/Objects/longobject.c
bf2674be0e95787cdeb154091b7377e30b2827bf 02-Feb-2003 Tim Peters <tim.peters@gmail.com> long(string, base) now takes time linear in len(string) when base is a
power of 2. Enabled the tail end of test_long() in pickletester.py
because it no longer takes forever when run from test_pickle.py.
/external/python/cpython2/Objects/longobject.c
ee1a53cbb1302971a65ce6eba9b5e538a3595df0 02-Feb-2003 Tim Peters <tim.peters@gmail.com> cPickle.c: Full support for the new LONG1 and LONG4. Added comments.
Assorted code cleanups; e.g., sizeof(char) is 1 by definition, so there's
no need to do things like multiply by sizeof(char) in hairy malloc
arguments. Fixed an undetected-overflow bug in readline_file().

longobject.c: Fixed a really stupid bug in the new _PyLong_NumBits.

pickle.py: Fixed stupid bug in save_long(): When proto is 2, it
wrote LONG1 or LONG4, but forgot to return then -- it went on to
append the proto 1 LONG opcode too.
Fixed equally stupid cancelling bugs in load_long1() and
load_long4(): they *returned* the unpickled long instead of pushing
it on the stack. The return values were ignored. Tests passed
before only because save_long() pickled the long twice.

Fixed bugs in encode_long().

Noted that decode_long() is quadratic-time despite our hopes,
because long(string, 16) is still quadratic-time in len(string).
It's hex() that's linear-time. I don't know a way to make decode_long()
linear-time in Python, short of maybe transforming the 256's-complement
bytes into marshal's funky internal format, and letting marshal decode
that. It would be more valuable to make long(string, 16) linear time.

pickletester.py: Added a global "protocols" vector so tests can try
all the protocols in a sane way. Changed test_ints() and test_unicode()
to do so. Added a new test_long(), but the tail end of it is disabled
because it "takes forever" under pickle.py (but runs very quickly under
cPickle: cPickle proto 2 for longs is linear-time).
/external/python/cpython2/Objects/longobject.c
08a1d9cafc5e713957d7ddd2b29ea75c3d073d96 31-Jan-2003 Tim Peters <tim.peters@gmail.com> Squash compiler wng about signed/unsigned comparison mismatch.
/external/python/cpython2/Objects/longobject.c
5b8132ffa34244cc24b603d8462e6e733e014e71 31-Jan-2003 Tim Peters <tim.peters@gmail.com> _PyLong_NumBits(): The definition of this was too specific to the quirky
needs of pickling longs. Backed off to a definition that's much easier
to understand. The pickler will have to work a little harder, but other
uses are more likely to be correct <0.5 wink>.

_PyLong_Sign(): New teensy function to characterize a long, as to <0, ==0,
or >0.
/external/python/cpython2/Objects/longobject.c
5d9113d8be81596bc93f2b1a37f57e5110d39a77 29-Jan-2003 Guido van Rossum <guido@python.org> Implement appropriate __getnewargs__ for all immutable subclassable builtin
types. The special handling for these can now be removed from save_newobj().
Add some testing for this.

Also add support for setting the 'fast' flag on the Python Pickler class,
which suppresses use of the memo.
/external/python/cpython2/Objects/longobject.c
baefd9e552723c6489c69cf5df93f82b473550a2 28-Jan-2003 Tim Peters <tim.peters@gmail.com> Added new private API function _PyLong_NumBits. This will be used at the
start for the C implemention of new pickle LONG1 and LONG4 opcodes (the
linear-time way to pickle a long is to call _PyLong_AsByteArray, but
the caller has no idea how big an array to allocate, and correct
calculation is a bit subtle).
/external/python/cpython2/Objects/longobject.c
0df295889c79ab93743a502d36402a549559c1f1 30-Dec-2002 Neil Schemenauer <nascheme@enme.ucalgary.ca> Consolidate the int and long sequence repeat code. Before the change,
integers checked for integer overflow but longs did not.
/external/python/cpython2/Objects/longobject.c
f171540ab8d816a996c34db3f6aa4bf9cf147fba 19-Nov-2002 Walter Dörwald <walter@livinglogic.de> Change int() so that passing a string, unicode, float or long argument
that is outside the integer range no longer raises OverflowError, but
returns a long object instead.

This fixes SF bug http://www.python.org/sf/635115
/external/python/cpython2/Objects/longobject.c
07e147667cf02cbcb05c84fe03fee31ef61a21c4 06-Nov-2002 Walter Dörwald <walter@livinglogic.de> Make int("...") return a long if an int would overflow.

Also remove the 512 character limitation for int(u"...") and long(u"...").

This closes SF bug #629989.
/external/python/cpython2/Objects/longobject.c
d581d7792bc31e6249ee6ed20bc2a71f53f0d3bb 03-Sep-2002 Skip Montanaro <skip@pobox.com> replace thread state objects' ticker and checkinterval fields with two
globals, _Py_Ticker and _Py_CheckInterval. This also implements Jeremy's
shortcut in Py_AddPendingCall that zeroes out _Py_Ticker. This allows the
test in the main loop to only test a single value.

The gory details are at

http://python.org/sf/602191
/external/python/cpython2/Objects/longobject.c
0d2d87d202c62182983c9d7edce978a0c9c9aad1 20-Aug-2002 Tim Peters <tim.peters@gmail.com> long_format(), long_lshift(): Someone on c.l.py is trying to boost
SHIFT and MASK, and widen digit. One problem is that code of the form

digit << small_integer

implicitly assumes that the result fits in an int or unsigned int
(platform-dependent, but "int sized" in any case), since digit is
promoted "just" to int or unsigned via the usual integer promotions.
But if digit is typedef'ed as unsigned int, this loses information.
The cure for this is just to cast digit to twodigits first.
/external/python/cpython2/Objects/longobject.c
e417de0e5697a5242f7530292da13c25eddcf439 15-Aug-2002 Tim Peters <tim.peters@gmail.com> Illustrating by example one good reason not to trust a proof <wink>.
/external/python/cpython2/Objects/longobject.c
ab86c2be2415050c71a254ad4e47fb4bdcf3a69f 15-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul() comments: In honor of Dijkstra, made the proof that "t3 fits"
rigorous instead of hoping for testing not to turn up counterexamples.
Call me heretical, but despite that I'm wholly confident in the proof,
and have done it two different ways now, I still put more faith in
testing ...
/external/python/cpython2/Objects/longobject.c
9973d74b2d63ebd6a49d239b49f01fe823705b97 15-Aug-2002 Tim Peters <tim.peters@gmail.com> long_mul(): Simplified exit code. In particular, k_mul() returns a
normalized result, so no point to normalizing it again. The number
of test+branches was also excessive.
/external/python/cpython2/Objects/longobject.c
48d52c0fccb23c213402476992c42664f07cdca1 14-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul() comments: Simplified the simplified explanation of why ah*bh and
al*bl "always fit": it's actually trivial given what came before.
/external/python/cpython2/Objects/longobject.c
8e966ee49aed03c8cd0a5ff86d3f82d7a2423f15 14-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul() comments: Explained why there's always enough room to subtract
ah*bh and al*bl. This is much easier than explaining why that's true
for (ah+al)*(bh+bl), and follows directly from the simple part of the
(ah+al)*(bh+bl) explanation.
/external/python/cpython2/Objects/longobject.c
cba6e969290ece55c3380b5244b5f8d1ac591643 13-Aug-2002 Tim Peters <tim.peters@gmail.com> Fixed error in new comment.
/external/python/cpython2/Objects/longobject.c
d6974a54ab5ab929ac84047691bdc94f95bef27c 13-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul(): The fix for (ah+al)*(bh+bl) spilling 1 bit beyond the allocated
space is no longer needed, so removed the code. It was only possible when
a degenerate (ah->ob_size == 0) split happened, but after that fix went
in I added k_lopsided_mul(), which saves the body of k_mul() from seeing
a degenerate split. So this removes code, and adds a honking long comment
block explaining why spilling out of bounds isn't possible anymore. Note:
ff we end up spilling out of bounds anyway <wink>, an assert in v_iadd()
is certain to trigger.
/external/python/cpython2/Objects/longobject.c
d8c8048f5e9660a877e6894393198a63cb99c89c 13-Aug-2002 Guido van Rossum <guido@python.org> Fix comment for PyLong_AsUnsignedLong() to say that the return value
is an *unsigned* long.
/external/python/cpython2/Objects/longobject.c
120340374383e4f246fe71e7013a7711104bb8a9 13-Aug-2002 Tim Peters <tim.peters@gmail.com> k_lopsided_mul(): This allocated more space for bslice than necessary.
/external/python/cpython2/Objects/longobject.c
6000464d08b94114baeef0a464896654fb0faa62 13-Aug-2002 Tim Peters <tim.peters@gmail.com> Added new function k_lopsided_mul(), which is much more efficient than
k_mul() when inputs have vastly different sizes, and a little more
efficient when they're close to a factor of 2 out of whack.

I consider this done now, although I'll set up some more correctness
tests to run overnight.
/external/python/cpython2/Objects/longobject.c
547607c4bf97ece7ad5cc50f103cbf651560ac86 12-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul(): Moved an assert down. In a debug build, interrupting a
multiply via Ctrl+C could cause a NULL-pointer dereference due to
the assert.
/external/python/cpython2/Objects/longobject.c
70b041bbe737e6b0d87183a63cbcd3d72edb90e8 12-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul(): Heh -- I checked in two fixes for the last problem. Only keep
the good one <wink>. Also checked in a test-aid by mistake.
/external/python/cpython2/Objects/longobject.c
d8b2173ef97edecadcc171dc5fce95ee13ee9d3d 12-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul(): White-box testing turned up that (ah+al)*(bh+bl) can, in rare
cases, overflow the allocated result object by 1 bit. In such cases,
it would have been brought back into range if we subtracted al*bl and
ah*bh from it first, but I don't want to do that because it hurts cache
behavior. Instead we just ignore the excess bit when it appears -- in
effect, this is forcing unsigned mod BASE**(asize + bsize) arithmetic
in a case where that doesn't happen all by itself.
/external/python/cpython2/Objects/longobject.c
115c888b97125e31851fc64cc0292c4fc3b122dd 12-Aug-2002 Tim Peters <tim.peters@gmail.com> x_mul(): Made life easier for C optimizers in the "grade school"
algorithm. MSVC 6 wasn't impressed <wink>.

Something odd: the x_mul algorithm appears to get substantially worse
than quadratic time as the inputs grow larger:

bits in each input x_mul time k_mul time
------------------ ---------- ----------
15360 0.01 0.00
30720 0.04 0.01
61440 0.16 0.04
122880 0.64 0.14
245760 2.56 0.40
491520 10.76 1.23
983040 71.28 3.69
1966080 459.31 11.07

That is, x_mul is perfectly quadratic-time until a little burp at
2.56->10.76, and after that goes to hell in a hurry. Under Karatsuba,
doubling the input size "should take" 3 times longer instead of 4, and
that remains the case throughout this range. I conclude that my "be nice
to the cache" reworkings of k_mul() are paying.
/external/python/cpython2/Objects/longobject.c
d64c1def7ca69e346bade11f2a99651eb8e2ff35 12-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul() and long_mul(): I'm confident that the Karatsuba algorithm is
correct now, so added some final comments, did some cleanup, and enabled
it for all long-int multiplies. The KARAT envar no longer matters,
although I left some #if 0'ed code in there for my own use (temporary).
k_mul() is still much slower than x_mul() if the inputs have very
differenent sizes, and that still needs to be addressed.
/external/python/cpython2/Objects/longobject.c
738eda742cd17739d65594b557fba442f65ff18a 12-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul: Rearranged computation for better cache use. Ignored overflow
(it's possible, but should be harmless -- this requires more thought,
and allocating enough space in advance to prevent it requires exactly
as much thought, to know exactly how much that is -- the end result
certainly fits in the allocated space -- hmm, but that's really all
the thought it needs! borrows/carries out of the high digits really
are harmless).
/external/python/cpython2/Objects/longobject.c
44121a6bc9828c993932b87e442440dc4f260f3c 12-Aug-2002 Tim Peters <tim.peters@gmail.com> x_mul(): This failed to normalize its result.

k_mul(): This didn't allocate enough result space when one input had
more than twice as many bits as the other. This was partly hidden by
that x_mul() didn't normalize its result.

The Karatsuba recurrence is pretty much hosed if the inputs aren't
roughly the same size. If one has at least twice as many bits as the
other, we get a degenerate case where the "high half" of the smaller
input is 0. Added a special case for that, for speed, but despite that
it helped, this can still be much slower than the "grade school" method.
It seems to take a really wild imbalance to trigger that; e.g., a
2**22-bit input times a 1000-bit input on my box runs about twice as slow
under k_mul than under x_mul. This still needs to be addressed.

I'm also not sure that allocating a->ob_size + b->ob_size digits is
enough, given that this is computing k = (ah+al)*(bh+bl) instead of
k = (ah-al)*(bl-bh); i.e., it's certainly enough for the final result,
but it's vaguely possible that adding in the "artificially" large k may
overflow that temporarily. If so, an assert will trigger in the debug
build, but we'll probably compute the right result anyway(!).
/external/python/cpython2/Objects/longobject.c
877a2126786bd2a8e5086fbddb05a593c40cbc51 12-Aug-2002 Tim Peters <tim.peters@gmail.com> Introduced helper functions v_iadd and v_isub, for in-place digit-vector
addition and subtraction. Reworked the tail end of k_mul() to use them.
This saves oodles of one-shot longobject allocations (this is a triply-
recursive routine, so saving one allocation in the body saves 3**n
allocations at depth n; we actually save 2 allocations in the body).
/external/python/cpython2/Objects/longobject.c
fc07e5684411a92580d92384e684c2e28c4f5885 12-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul(): Repaired another typo in another comment.
/external/python/cpython2/Objects/longobject.c
18c15b9bbdbe336a5ac542dfd555c87f0cf9328b 12-Aug-2002 Tim Peters <tim.peters@gmail.com> k_mul(): Repaired typo in comment.
/external/python/cpython2/Objects/longobject.c
5af4e6c739c50c4452182b0d9ce57b606a31199f 12-Aug-2002 Tim Peters <tim.peters@gmail.com> Cautious introduction of a patch that started from
SF 560379: Karatsuba multiplication.
Lots of things were changed from that. This needs a lot more testing,
for correctness and speed, the latter especially when bit lengths are
unbalanced. For now, the Karatsuba code gets invoked if and only if
envar KARAT exists.
/external/python/cpython2/Objects/longobject.c
938ace69a0e112424a2f426a4881d1fd1fc922d2 17-Jul-2002 Jeremy Hylton <jeremy@alum.mit.edu> staticforward bites the dust.

The staticforward define was needed to support certain broken C
compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the
static keyword when it was used with a forward declaration of a static
initialized structure. Standard C allows the forward declaration with
static, and we've decided to stop catering to broken C compilers. (In
fact, we expect that the compilers are all fixed eight years later.)

I'm leaving staticforward and statichere defined in object.h as
static. This is only for backwards compatibility with C extensions
that might still use it.

XXX I haven't updated the documentation.
/external/python/cpython2/Objects/longobject.c
b6d29b7856d25e382a024139d6599962c02b404b 13-Jul-2002 Guido van Rossum <guido@python.org> Undef MIN and MAX before defining them, to avoid warnings on certain
platforms.
/external/python/cpython2/Objects/longobject.c
14f8b4cfcb98de74b9c6e9316539be9e2a5cd31f 13-Jun-2002 Martin v. Löwis <martin@v.loewis.de> Patch #568124: Add doc string macros.
/external/python/cpython2/Objects/longobject.c
c4ad0bcbe5891f0e0df297b28d211696aad5d1ba 23-Apr-2002 Jeremy Hylton <jeremy@alum.mit.edu> Clarify return value of PyLong_AsLongLong().

The function is documented to return -1 on error. If res was < 0, it
returned res. It wasn't clear that the invariant was res < 0 iff res
== -1.
/external/python/cpython2/Objects/longobject.c
aa769ae468c7b857226ebe5b073b4c787a60445a 12-Apr-2002 Neil Schemenauer <nascheme@enme.ucalgary.ca> PyObject_Del can now be used as a function designator.
/external/python/cpython2/Objects/longobject.c
c8bb9eba31bb9352b1fdf19da490b3238fe8cb3e 09-Mar-2002 Martin v. Löwis <martin@v.loewis.de> Patch #494047: removes 64-bit ?: to cope on plan9.
/external/python/cpython2/Objects/longobject.c
5329cdb3cea9f76a8b758aa61058455a5bfb4506 02-Mar-2002 Tim Peters <tim.peters@gmail.com> _PyLong_Copy(): was creating a copy of the absolute value, but should
copy the sign too. Added a test to test_descr to ensure that it does.

Bugfix candidate.
/external/python/cpython2/Objects/longobject.c
a5854c24a2319a599e57e40cd759b421f781fccd 17-Feb-2002 Martin v. Löwis <martin@v.loewis.de> Patch #508038: Do not use a type as a variable name.
/external/python/cpython2/Objects/longobject.c
6f97e493e1626d101c53472c239e28e3fae3b42a 05-Nov-2001 Tim Peters <tim.peters@gmail.com> long_true_divide(): decref its converted arguments. test_long_future.py
run in an infinite loop no longer grows. Thanks to Neal Norwitz for
determining that test leaked!
/external/python/cpython2/Objects/longobject.c
9475a2310d9cdec4b4c36dee8bf30c72605ae928 05-Oct-2001 Guido van Rossum <guido@python.org> Enable GC for new-style instances. This touches lots of files, since
many types were subclassable but had a xxx_dealloc function that
called PyObject_DEL(self) directly instead of deferring to
self->ob_type->tp_free(self). It is permissible to set tp_free in the
type object directly to _PyObject_Del, for non-GC types, or to
_PyObject_GC_Del, for GC types. Still, PyObject_DEL was a tad faster,
so I'm fearing that our pystone rating is going down again. I'm not
sure if doing something like

void xxx_dealloc(PyObject *self)
{
if (PyXxxCheckExact(self))
PyObject_DEL(self);
else
self->ob_type->tp_free(self);
}

is any faster than always calling the else branch, so I haven't
attempted that -- however those types whose own dealloc is fancier
(int, float, unicode) do use this pattern.
/external/python/cpython2/Objects/longobject.c
d38b1c74f3f28a3f9a73c142d9be83425adaa6e1 30-Sep-2001 Tim Peters <tim.peters@gmail.com> SF [#466125] PyLong_AsLongLong works for any integer.
Generalize PyLong_AsLongLong to accept int arguments too. The real point
is so that PyArg_ParseTuple's 'L' code does too. That code was
undocumented (AFAICT), so documented it.
/external/python/cpython2/Objects/longobject.c
1952e388ca63b8eaa090bef966dd538f78ece208 19-Sep-2001 Guido van Rossum <guido@python.org> Add additional coercion support for "self subtypes" to int, long,
float (compare the recent checkin to complex). Added tests for these.
/external/python/cpython2/Objects/longobject.c
7e35d57c0cd94b136d613129cb22a2b4252aa008 15-Sep-2001 Guido van Rossum <guido@python.org> A fix for SF bug #461546 (bug in long_mul).

Both int and long multiplication are changed to be more careful in
their assumptions about when one of the arguments is a sequence: the
assumption that at least one of the arguments must be an int (or long,
respectively) is still held, but the assumption that these don't smell
like sequences is no longer true: a subtype of int or long may well
have a sequence-repeat thingie!
/external/python/cpython2/Objects/longobject.c
bafedecc06176e431c3050ba8bcf1d4039e605af 13-Sep-2001 Skip Montanaro <skip@pobox.com> based upon a suggestion in c.l.py, this slight expansion of the
OverflowError message seems reasonable.
/external/python/cpython2/Objects/longobject.c
40c397dd560b8394b1b97b30ab2c9946b2a32584 12-Sep-2001 Tim Peters <tim.peters@gmail.com> long_invert(): tiny speed and space optimization.
/external/python/cpython2/Objects/longobject.c
69c2de3ad69219d60c53827670856deee6f4241c 12-Sep-2001 Tim Peters <tim.peters@gmail.com> More bug 460020. Disable a number of long optimizations for long subclasses.
/external/python/cpython2/Objects/longobject.c
64b5ce3a69569b203a39f74c5c03348ba0a67583 10-Sep-2001 Tim Peters <tim.peters@gmail.com> SF bug #460020: bug or feature: unicode() and subclasses.
Given an immutable type M, and an instance I of a subclass of M, the
constructor call M(I) was just returning I as-is; but it should return a
new instance of M. This fixes it for M in {int, long}. Strings, floats
and tuples remain to be done.
Added new macros PyInt_CheckExact and PyLong_CheckExact, to more easily
distinguish between "is" and "is a" (i.e., only an int passes
PyInt_CheckExact, while any sublass of int passes PyInt_Check).
Added private API function _PyLong_Copy.
/external/python/cpython2/Objects/longobject.c
e56ed9ba1513b3719ce0fe8b85da6b3367d7da64 06-Sep-2001 Tim Peters <tim.peters@gmail.com> long_true_divide: reliably force underflow to 0 when the denominator
has more bits than the numerator than can be counted in a C int (yes,
that's unlikely, and no, I'm not adding a test case with a 2 gigabit
long).
/external/python/cpython2/Objects/longobject.c
4c483c4d8eac8603ff299adbd373e4f14da61ff9 05-Sep-2001 Tim Peters <tim.peters@gmail.com> Make the error msgs in our pow() implementations consistent.
/external/python/cpython2/Objects/longobject.c
57f282a2a06c01417abec74926e770fb12f95610 05-Sep-2001 Tim Peters <tim.peters@gmail.com> Try to recover from that glibc's ldexp apparently doesn't set errno on
overflow. Needs testing on Linux (test_long.py and test_long_future.py
especially).
/external/python/cpython2/Objects/longobject.c
e2a600099d3b61327aba5be94d30d40773faa2c9 04-Sep-2001 Tim Peters <tim.peters@gmail.com> Change long/long true division to return as many good bits as it can;
e.g., (1L << 40000)/(1L << 40001) returns 0.5, not Inf or NaN or whatever.
/external/python/cpython2/Objects/longobject.c
20dab9f168745bdc7099f4daf33edc34fda2448b 04-Sep-2001 Tim Peters <tim.peters@gmail.com> Move long_true_divide next to the other division routines (for clarity!).
/external/python/cpython2/Objects/longobject.c
9fffa3eea3a7e99b0179988e7a016a45bf63ab96 04-Sep-2001 Tim Peters <tim.peters@gmail.com> Raise OverflowError when appropriate on long->float conversion. Most of
the fiddling is simply due to that no caller of PyLong_AsDouble ever
checked for failure (so that's fixing old bugs). PyLong_AsDouble is much
faster for big inputs now too, but that's more of a happy consequence
than a design goal.
/external/python/cpython2/Objects/longobject.c
a1c1b0f46865bddd9a84dfae6c146a0e010a4496 04-Sep-2001 Tim Peters <tim.peters@gmail.com> Introduce new private API function _PyLong_AsScaledDouble. Not used yet,
but will be the foundation for Good Things:
+ Speed PyLong_AsDouble.
+ Give PyLong_AsDouble the ability to detect overflow.
+ Make true division of long/long nearly as accurate as possible (no
spurious infinities or NaNs).
+ Return non-insane results from math.log and math.log10 when passing a
long that can't be approximated by a double better than HUGE_VAL.
/external/python/cpython2/Objects/longobject.c
32f453eaa476c78376cd721d29ba8ab726e400bb 03-Sep-2001 Tim Peters <tim.peters@gmail.com> New restriction on pow(x, y, z): If z is not None, x and y must be of
integer types, and y must be >= 0. See discussion at
http://sf.net/tracker/index.php?func=detail&aid=457066&group_id=5470&atid=105470
/external/python/cpython2/Objects/longobject.c
393661d15fa76ec46e9f7b71e97bf2ed38470620 31-Aug-2001 Guido van Rossum <guido@python.org> Add warning mode for classic division, almost exactly as specified in
PEP 238. Changes:

- add a new flag variable Py_DivisionWarningFlag, declared in
pydebug.h, defined in object.c, set in main.c, and used in
{int,long,float,complex}object.c. When this flag is set, the
classic division operator issues a DeprecationWarning message.

- add a new API PyRun_SimpleStringFlags() to match
PyRun_SimpleString(). The main() function calls this so that
commands run with -c can also benefit from -Dnew.

- While I was at it, I changed the usage message in main() somewhat:
alphabetized the options, split it in *four* parts to fit in under
512 bytes (not that I still believe this is necessary -- doc strings
elsewhere are much longer), and perhaps most visibly, don't display
the full list of options on each command line error. Instead, the
full list is only displayed when -h is used, and otherwise a brief
reminder of -h is displayed. When -h is used, write to stdout so
that you can do `python -h | more'.

Notes:

- I don't want to use the -W option to control whether the classic
division warning is issued or not, because the machinery to decide
whether to display the warning or not is very expensive (it involves
calling into the warnings.py module). You can use -Werror to turn
the warnings into exceptions though.

- The -Dnew option doesn't select future division for all of the
program -- only for the __main__ module. I don't know if I'll ever
change this -- it would require changes to the .pyc file magic
number to do it right, and a more global notion of compiler flags.

- You can usefully combine -Dwarn and -Dnew: this gives the __main__
module new division, and warns about classic division everywhere
else.
/external/python/cpython2/Objects/longobject.c
13228a6f099cbf4855fa0dc0ee921f174bc967ff 30-Aug-2001 Guido van Rossum <guido@python.org> Ah, the joy of writing test cases...

long_subtype_new(): fix a typo (type->ob_size instead of
tmp->ob_size).
/external/python/cpython2/Objects/longobject.c
bef1417f9f31fdf0f7b7bdb458c1c1f17c5cfada 29-Aug-2001 Guido van Rossum <guido@python.org> Make int, long and float subclassable.
This uses a slightly wimpy and wasteful approach, but it works. :-)
/external/python/cpython2/Objects/longobject.c
339d0f720e86dc34837547c90d3003a4a68d7d46 17-Aug-2001 Martin v. Löwis <martin@v.loewis.de> Patch #445762: Support --disable-unicode
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
- check for Py_USING_UNICODE in all places that use Unicode functions
- disables unicode literals, and the builtin functions
- add the types.StringTypes list
- remove Unicode literals from most tests.
/external/python/cpython2/Objects/longobject.c
4668b000a1d9113394941ad39875c827634feb49 08-Aug-2001 Guido van Rossum <guido@python.org> Implement PEP 238 in its (almost) full glory.

This introduces:

- A new operator // that means floor division (the kind of division
where 1/2 is 0).

- The "future division" statement ("from __future__ import division)
which changes the meaning of the / operator to implement "true
division" (where 1/2 is 0.5).

- New overloadable operators __truediv__ and __floordiv__.

- New slots in the PyNumberMethods struct for true and floor division,
new abstract APIs for them, new opcodes, and so on.

I emphasize that without the future division statement, the semantics
of / will remain unchanged until Python 3.0.

Not yet implemented are warnings (default off) when / is used with int
or long arguments.

This has been on display since 7/31 as SF patch #443474.

Flames to /dev/null.
/external/python/cpython2/Objects/longobject.c
6d6c1a35e08b95a83dbe47dbd9e6474daff00354 02-Aug-2001 Tim Peters <tim.peters@gmail.com> Merge of descr-branch back into trunk.
/external/python/cpython2/Objects/longobject.c
0d5dd68692e8e7a4ebe16cf0902de6a778ea5200 15-Jul-2001 Tim Peters <tim.peters@gmail.com> Python.h: Don't attempt to redefine NDEBUG if it's already defined.
Others: Remove redundant includes of assert.h.
/external/python/cpython2/Objects/longobject.c
586b2e3f3df6134064af4231215c13d221087f3a 15-Jul-2001 Tim Peters <tim.peters@gmail.com> long_format: Simplify the overly elaborate base-is-a-power-of-2 code.
/external/python/cpython2/Objects/longobject.c
212e614f604af14465bde8a8d5a7419b0924be7f 14-Jul-2001 Tim Peters <tim.peters@gmail.com> divrem1 & long_format: found a clean way to factor divrem1 so that
long_format can reuse a scratch area for its repeated divisions (instead
of malloc/free for every digit produced); speeds str(long)/repr(long).
/external/python/cpython2/Objects/longobject.c
c8a6b9b6d67c4bf343f3771fcae0002160066fe3 14-Jul-2001 Tim Peters <tim.peters@gmail.com> long_format(): Simplify new code a bit.
/external/python/cpython2/Objects/longobject.c
fad225f1ba5df5f22328ea5648d1e3d2aa919479 13-Jul-2001 Tim Peters <tim.peters@gmail.com> long_format(): Easy speedup for output bases that aren't a power of 2 (in
particular, str(long) and repr(long) use base 10, and that gets a factor
of 4 speedup). Another factor of 2 can be gotten by refactoring divrem1 to
support in-place division, but that started getting messy so I'm leaving
that out.
/external/python/cpython2/Objects/longobject.c
0ec9abaa2b5f85837feae5c6cbc1491f2f34f16f 12-Jul-2001 Guido van Rossum <guido@python.org> On long to the negative long power, let float handle it instead of
raising an error. This was one of the two issues that the VPython
folks were particularly problematic for their students. (The other
one was integer division...) This implements (my) SF patch #440487.
/external/python/cpython2/Objects/longobject.c
70128a1ba693d399177714e657e13c08a2056b45 16-Jun-2001 Tim Peters <tim.peters@gmail.com> PyLong_{As, From}VoidPtr: cleanup, replacing assumptions in comments with
#if/#error constructs.
/external/python/cpython2/Objects/longobject.c
cf37dfc3dba1040b982ca4b39a5728c9d26e7cf7 14-Jun-2001 Tim Peters <tim.peters@gmail.com> Change IS_LITTLE_ENDIAN macro -- a little faster now.
/external/python/cpython2/Objects/longobject.c
ede0509111a7cd2789e92191da12bed7318dba4b 14-Jun-2001 Tim Peters <tim.peters@gmail.com> _PyLong_AsByteArray: simplify the logic for dealing with the most-
significant digits sign bits. Again no change in semantics.
/external/python/cpython2/Objects/longobject.c
ce9de2f79a8676d6838e446cc72a9ab0a7b6cded 14-Jun-2001 Tim Peters <tim.peters@gmail.com> PyLong_From{Unsigned,}Long: count the # of digits first, so no more space
is allocated than needed (used to allocate 80 bytes of digit space no
matter how small the long input). This also runs faster, at least on 32-
bit boxes.
/external/python/cpython2/Objects/longobject.c
f251d06a66dcadd4d64c6b4d2b3608f33c8a1868 13-Jun-2001 Tim Peters <tim.peters@gmail.com> _PyLong_FromByteArray: changed decl of "carry" to match "thisbyte". No
semantic change, but a bit clearer and may help a really stupid compiler
avoid pointless runtime length conversions.
/external/python/cpython2/Objects/longobject.c
05607ad4fdf7942bf178e1b6289901cd95dc7d8e 13-Jun-2001 Tim Peters <tim.peters@gmail.com> _PyLong_AsByteArray: Don't do the "delicate overflow" check unless it's
truly needed; usually saves a little time, but no change in semantics.
/external/python/cpython2/Objects/longobject.c
898cf85c25de57a0c40bd9bedc00519674d09457 13-Jun-2001 Tim Peters <tim.peters@gmail.com> _PyLong_AsByteArray: added assert that the input is normalized. This is
outside the function's control, but is crucial to correct operation.
/external/python/cpython2/Objects/longobject.c
9cb0c38fff05776f598ebfb67a60abc3bff629e2 13-Jun-2001 Tim Peters <tim.peters@gmail.com> PyLong_As{Unsigned,}LongLong: fiddled final result casting.
/external/python/cpython2/Objects/longobject.c
d1a7da6c0d377d2296b79c4203d267ffe1664bfb 13-Jun-2001 Tim Peters <tim.peters@gmail.com> longobject.c:
Replaced PyLong_{As,From}{Unsigned,}LongLong guts with calls
to _PyLong_{As,From}ByteArray.
_testcapimodule.c:
Added strong tests of PyLong_{As,From}{Unsigned,}LongLong.

Fixes SF bug #432552 PyLong_AsLongLong() problems.
Possible bugfix candidate, but the fix relies on code added to longobject
to support the new q/Q structmodule format codes.
/external/python/cpython2/Objects/longobject.c
8bc84b4391583b1bac5eb05556f20ead8a428e88 12-Jun-2001 Tim Peters <tim.peters@gmail.com> _PyLong_{As,From}ByteArray: Minor code rearrangement aimed at improving
clarity. Should have no effect visible to callers.
/external/python/cpython2/Objects/longobject.c
7a3bfc3a472dafc42d20845389eb79db8af0b046 12-Jun-2001 Tim Peters <tim.peters@gmail.com> Added q/Q standard (x-platform 8-byte ints) mode in struct module.
This completes the q/Q project.

longobject.c _PyLong_AsByteArray: The original code had a gross bug:
the most-significant Python digit doesn't necessarily have SHIFT
significant bits, and you really need to count how many copies of the sign
bit it has else spurious overflow errors result.

test_struct.py: This now does exhaustive std q/Q testing at, and on both
sides of, all relevant power-of-2 boundaries, both positive and negative.

NEWS: Added brief dict news while I was at it.
/external/python/cpython2/Objects/longobject.c
2a9b36738504672e6c3cc42018669853b9c62566 11-Jun-2001 Tim Peters <tim.peters@gmail.com> Two new private longobject API functions,
_PyLong_FromByteArray
_PyLong_AsByteArray
Untested and probably buggy -- they compile OK, but nothing calls them
yet. Will soon be called by the struct module, to implement x-platform
'q' and 'Q'.
If other people have uses for them, we could move them into the public API.
See longobject.h for usage details.
/external/python/cpython2/Objects/longobject.c
6fd867b04d78766700af1ca4cfc9cba1782a1519 17-Jan-2001 Guido van Rossum <guido@python.org> Rich comparisons fall-out:

- Get rid of long_cmp().

- Renamed Py_TPFLAGS_NEWSTYLENUMBER to Py_TPFLAGS_CHECKTYPES.
/external/python/cpython2/Objects/longobject.c
ba872e25349599168fb352b40792522358d36e7f 04-Jan-2001 Neil Schemenauer <nascheme@enme.ucalgary.ca> Make long a new style number type. Sequence repeat is now done here
now as well.
/external/python/cpython2/Objects/longobject.c
661ea26b3d8621ad0acc0ed2f2036ab29355f8ff 24-Oct-2000 Fred Drake <fdrake@acm.org> Ka-Ping Yee <ping@lfw.org>:
Changes to error messages to increase consistency & clarity.

This (mostly) closes SourceForge patch #101839.
/external/python/cpython2/Objects/longobject.c
c54d19043a595679f253a55e46fda2910f513c52 06-Oct-2000 Tim Peters <tim.peters@gmail.com> SF bug 115831 and Ping's SF patch 101751, 0.0**-2.0 returns inf rather than
raise ValueError. Checked in the patch as far as it went, but also changed
all of ints, longs and floats to raise ZeroDivisionError instead when raising
0 to a negative number. This is what 754-inspired stds require, as the "true
result" is an infinity obtained from finite operands, i.e. it's a singularity.
Also changed float pow to not be so timid about using its square-and-multiply
algorithm. Note that what math.pow does is unrelated to what builtin pow
does, and will still vary by platform.
/external/python/cpython2/Objects/longobject.c
8586991099e4ace18ee94163a96b8ea1bed77ebe 02-Sep-2000 Guido van Rossum <guido@python.org> REMOVED all CWI, CNRI and BeOpen copyright markings.
This should match the situation in the 1.6b1 tree.
/external/python/cpython2/Objects/longobject.c
39dce29365d287dc6b353b2a527dc11fe58dcfa6 15-Aug-2000 Tim Peters <tim.peters@gmail.com> Fix for http://sourceforge.net/bugs/?func=detailbug&bug_id=111866&group_id=5470.
This was a misleading bug -- the true "bug" was that hash(x) gave an error
return when x is an infinity. Fixed that. Added new Py_IS_INFINITY macro to
pyport.h. Rearranged code to reduce growing duplication in hashing of float and
complex numbers, pushing Trent's earlier stab at that to a logical conclusion.
Fixed exceedingly rare bug where hashing of floats could return -1 even if there
wasn't an error (didn't waste time trying to construct a test case, it was simply
obvious from the code that it *could* happen). Improved complex hash so that
hash(complex(x, y)) doesn't systematically equal hash(complex(y, x)) anymore.
/external/python/cpython2/Objects/longobject.c
7e018909862a3fe6c571bbb7143f4ffb18ae834c 31-Jul-2000 Peter Schneider-Kamp <nowonder@nowonder.de> merge Include/my*.h into Include/pyport.h

marked my*.h as obsolete
/external/python/cpython2/Objects/longobject.c
7d3a511a40a8c90eac66d3d59edbbe3c3d4559b1 08-Jul-2000 Tim Peters <tim.peters@gmail.com> Cray J90 fixes for long ints.
This was a convenient excuse to create the pyport.h file recently
discussed!
Please use new Py_ARITHMETIC_RIGHT_SHIFT when right-shifting a
signed int and you *need* sign-extension. This is #define'd in
pyport.h, keying off new config symbol SIGNED_RIGHT_SHIFT_ZERO_FILLS.
If you're running on a platform that needs that symbol #define'd,
the std tests never would have worked for you (in particular,
at least test_long would have failed).
The autoconfig stuff got added to Python after my Unix days, so
I don't know how that works. Would someone please look into doing
& testing an auto-config of the SIGNED_RIGHT_SHIFT_ZERO_FILLS
symbol? It needs to be defined if & only if, e.g., (-1) >> 3 is
not -1.
/external/python/cpython2/Objects/longobject.c
43f04a36cf4e809a8baa3a895268b527bfd6254c 08-Jul-2000 Tim Peters <tim.peters@gmail.com> The tail end of x_sub implicitly assumed that an unsigned short
contains 16 bits. Not true on Cray J90.
/external/python/cpython2/Objects/longobject.c
9ace6bc7efcca54f85cd638adef7b76468253505 08-Jul-2000 Tim Peters <tim.peters@gmail.com> Got RID of redundant coercions in longobject.c (as spotted by Greg
Stein -- thanks!). Incidentally removed all the Py_PROTO macros
from object.h, as they prevented my editor from magically finding
the definitions of the "coercion", "cmpfunc" and "reprfunc"
typedefs that were being redundantly applied in longobject.c.
/external/python/cpython2/Objects/longobject.c
9f688bf9d21547bf7bd6e931c0272abb189c7d8c 07-Jul-2000 Tim Peters <tim.peters@gmail.com> Some cleanup of longs in prepartion for Cray J90 fixes: got
rid of Py_PROTO, switched to ANSI function decls, and did some
minor fiddling.
/external/python/cpython2/Objects/longobject.c
ffcc3813d82e6b96db79f518f4e67b940a13ce64 01-Jul-2000 Guido van Rossum <guido@python.org> Change copyright notice - 2nd try.
/external/python/cpython2/Objects/longobject.c
fd71b9e9d496caa510dec56a9b69966558d6ba5d 01-Jul-2000 Guido van Rossum <guido@python.org> Change copyright notice.
/external/python/cpython2/Objects/longobject.c
4c7fdfc35bb7c3123260bca00fe13bd0a1899faf 01-Jun-2000 Fred Drake <fdrake@acm.org> Trent Mick <trentm@ActiveState.com>:
This patch correct bounds checking in PyLong_FromLongLong. Currently, it does
not check properly for negative values when checking to see if the incoming
value fits in a long or unsigned long. This results in possible silent
truncation of the value for very large negative values.
/external/python/cpython2/Objects/longobject.c
b18618dab7b6b85bb05b084693706e59211fa180 04-May-2000 Guido van Rossum <guido@python.org> Vladimir Marangozov's long-awaited malloc restructuring.
For more comments, read the patches@python.org archives.
For documentation read the comments in mymalloc.h and objimpl.h.

(This is not exactly what Vladimir posted to the patches list; I've
made a few changes, and Vladimir sent me a fix in private email for a
problem that only occurs in debug mode. I'm also holding back on his
change to main.c, which seems unnecessary to me.)
/external/python/cpython2/Objects/longobject.c
ba71a247acc7cac07a75d79ff087b29b56ee0b55 10-Apr-2000 Guido van Rossum <guido@python.org> Simple optimization by Christian Tismer, who gives credit to Lenny
Kneler for reporting this issue: long_mult() is faster when the
smaller argument is on the left. Swap the arguments accordingly.
/external/python/cpython2/Objects/longobject.c
9e896b37c7a554250d7d832566cc4fe7d30d034c 05-Apr-2000 Guido van Rossum <guido@python.org> Marc-Andre's third try at this bulk patch seems to work (except that
his copy of test_contains.py seems to be broken -- the lines he
deleted were already absent). Checkin messages:


New Unicode support for int(), float(), complex() and long().

- new APIs PyInt_FromUnicode() and PyLong_FromUnicode()
- added support for Unicode to PyFloat_FromString()
- new encoding API PyUnicode_EncodeDecimal() which converts
Unicode to a decimal char* string (used in the above new
APIs)
- shortcuts for calls like int(<int object>) and float(<float obj>)
- tests for all of the above

Unicode compares and contains checks:
- comparing Unicode and non-string types now works; TypeErrors
are masked, all other errors such as ValueError during
Unicode coercion are passed through (note that PyUnicode_Compare
does not implement the masking -- PyObject_Compare does this)
- contains now works for non-string types too; TypeErrors are
masked and 0 returned; all other errors are passed through

Better testing support for the standard codecs.

Misc minor enhancements, such as an alias dbcs for the mbcs codec.

Changes:
- PyLong_FromString() now applies the same error checks as
does PyInt_FromString(): trailing garbage is reported
as error and not longer silently ignored. The only characters
which may be trailing the digits are 'L' and 'l' -- these
are still silently ignored.
- string.ato?() now directly interface to int(), long() and
float(). The error strings are now a little different, but
the type still remains the same. These functions are now
ready to get declared obsolete ;-)
- PyNumber_Int() now also does a check for embedded NULL chars
in the input string; PyNumber_Long() already did this (and
still does)

Followed by:

Looks like I've gone a step too far there... (and test_contains.py
seem to have a bug too).

I've changed back to reporting all errors in PyUnicode_Contains()
and added a few more test cases to test_contains.py (plus corrected
the join() NameError).
/external/python/cpython2/Objects/longobject.c
121ee2722e510834bda99f8a48ccadc55d832e2a 23-Dec-1999 Fred Drake <fdrake@acm.org> long_format(): Now takes a third parameter, addL; iff true, a
trailing 'L' is appended to the representation,
otherwise not.

All existing call sites are modified to pass true for
addL.

Remove incorrect statement about external use of this
function from elsewhere; it's static!

long_str(): Handler for the tp_str slot in the type object.
Identical to long_repr(), but passes false as the addL
parameter of long_format().
/external/python/cpython2/Objects/longobject.c
2c7b8fe618600ed8ee73e48a70b1da05fa8fde49 12-Oct-1999 Guido van Rossum <guido@python.org> Fix PR#66. Solution: add error checking around l_divmod() calls in
long_pow().
/external/python/cpython2/Objects/longobject.c
1a23c2484ece91d06f75d9ebdaf2ada951c87c82 27-Sep-1999 Guido van Rossum <guido@python.org> Patch by Tim Peters fixing PR#89:

long(+/- infinity) returns nonsense.
/external/python/cpython2/Objects/longobject.c
b5cebfe164fbf6c862e8aa9fb91628d1b8cf76be 27-Jan-1999 Barry Warsaw <barry@python.org> PyLong_FromString(): Nailed a small memory leak. In the str==start
test, we forgot that z is still pointing to a real live object.
DECREF() it before returning.
/external/python/cpython2/Objects/longobject.c
cdd9ae00ba9346c3f8e2c6c5ba28eb25f4ab86f4 06-Jan-1999 Guido van Rossum <guido@python.org> Changes for long file support by Steve Clift.
(Really: moved a bunch of defs to longobject.h.)
/external/python/cpython2/Objects/longobject.c
3886026beda0ffb87bbf0bf20a96efb8e520e45d 09-Oct-1998 Guido van Rossum <guido@python.org> Remove unreachable code. (Sjoerd)
/external/python/cpython2/Objects/longobject.c
78694d970fbdc70cfbda5b21a556f6e11f684fb0 18-Sep-1998 Guido van Rossum <guido@python.org> Patches from Greg Stein to support 'P' format in struct module's
native format, as void* (translated to Python int or long).
Also adds PyLong_FromVoidPtr and PyLong_AsVoidPtr to longobject.c.
/external/python/cpython2/Objects/longobject.c
065ce5a4b7c2ff6f177fd6b40fac592bef7fc22f 13-Sep-1998 Guido van Rossum <guido@python.org> Undo victim of careless global substitute ("long long_hash" was
changed to "LONG_LONG_hash" in the list of forward decls). Discovered
by Jason Harper.
/external/python/cpython2/Objects/longobject.c
3293b07df58a875afaf3fc82c1e499af59bc99e4 25-Aug-1998 Guido van Rossum <guido@python.org> Patch by Mark Hammond to support 64-bit ints on MS platforms.
The MS compiler doesn't call it 'long long', it uses __int64,
so a new #define, LONG_LONG, has been added and all occurrences
of 'long long' are replaced with it.
/external/python/cpython2/Objects/longobject.c
bd3a527f93ef7a97b9eb828456955b84eda023d3 11-Aug-1998 Guido van Rossum <guido@python.org> Two patches by Jason Harper:

- Faster conversion to string for binary bases: linear instead of quadratic!

- Allocate smaller result for certain masking ops, e.g. (1L<<30000) & 1.
/external/python/cpython2/Objects/longobject.c
1a8791e0b875df8e9428c2d9969f64e5967ac0b4 05-Aug-1998 Guido van Rossum <guido@python.org> Changes for BeOS, QNX and long long, by Chris Herborth.
/external/python/cpython2/Objects/longobject.c
ac6a37ae55b0f165dee662d65976c2d3ab9d2325 04-Aug-1998 Guido van Rossum <guido@python.org> Fix a potential problem in PyLong_FromString(): could fall through the
for loop with z==NULL but continue to reference z later.
/external/python/cpython2/Objects/longobject.c
e67629774fd0b921d886f4f81f83c0368143efdd 22-Jun-1998 Guido van Rossum <guido@python.org> Add check in long-to-int conversion for at least one digit.
/external/python/cpython2/Objects/longobject.c
f753181272d9f69ec9cea4330cfd0af1fcabc935 26-May-1998 Guido van Rossum <guido@python.org> Subject: Buglet in PyLong_AsLong
From: "Tim Peters" <tim_one@email.msn.com>
To: "Guido van Rossum" <guido@CNRI.Reston.VA.US>
Date: Sat, 23 May 1998 21:45:53 -0400

Guido, the overflow checking in PyLong_AsLong is off a little:

1) If the C in use sign-extends right shifts on signed longs, there's a
spurious overflow error when converting the most-negative int:

Python 1.5.1 (#0, Apr 13 1998, 20:22:04) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> x = -1L << 31
>>> x
-2147483648L
>>> int(x)
Traceback (innermost last):
File "<stdin>", line 1, in ?
OverflowError: long int too long to convert
>>>

2) If C does not sign-extend, some genuine overflows won't be caught.

The attached should repair both, and, because I installed a new disk and a C
compiler today, it's even been compiled this time <wink>.

Python 1.5.1 (#0, May 23 1998, 20:24:58) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> x = -1L << 31
>>> x
-2147483648L
>>> int(x)
-2147483648
>>> int(-x)
Traceback (innermost last):
File "<stdin>", line 1, in ?
OverflowError: long int too long to convert
>>> int(-x-1)
2147483647
>>> int(x-1)
Traceback (innermost last):
File "<stdin>", line 1, in ?
OverflowError: long int too long to convert
>>>

end-casing-ly y'rs - tim
/external/python/cpython2/Objects/longobject.c
1109fbca76d08bb2f11f2899580d2ab7dbe796fa 11-Apr-1998 Guido van Rossum <guido@python.org> Make new gcc -Wall happy
/external/python/cpython2/Objects/longobject.c
c0b618a2ccfb0fc39e07ee96dc09da77fbcce1b1 02-May-1997 Guido van Rossum <guido@python.org> Quickly renamed the last directory.
/external/python/cpython2/Objects/longobject.c
2095d24842e34f7f85d5025767134badbf9dd44f 09-Apr-1997 Guido van Rossum <guido@python.org> Tweaks to keep the Microsoft compiler quiet.
/external/python/cpython2/Objects/longobject.c
f2e499b1d760076f519b618105c112495d6f7911 16-Mar-1997 Guido van Rossum <guido@python.org> New long_lshift, without restriction on size of shift count, by Tim Peters.
This makes it possible to write 1L<<1000000, memory permitting.
/external/python/cpython2/Objects/longobject.c
45b83915f8d5974045d374c981531d9b98570df1 14-Mar-1997 Guido van Rossum <guido@python.org> New form of PyFPE_END_PROTECT macro.
/external/python/cpython2/Objects/longobject.c
09e6ad0c1e1c7b3c6132ab2d5dd85c5cc376721d 14-Feb-1997 Guido van Rossum <guido@python.org> Changes for Lee Busby's SIGFPE patch set.
Surround various f.p. operations with PyFPE_{START,END}_PROTECT macros.
/external/python/cpython2/Objects/longobject.c
53756b1097805e6a7910a1788d6eb7cb190864ba 03-Jan-1997 Guido van Rossum <guido@python.org> Added PyLong_FromUnsignedLong() and PyLong_AsUnsignedLong().
/external/python/cpython2/Objects/longobject.c
472c04f18f54327433c13601b25c7ea2c7071e6b 05-Dec-1996 Guido van Rossum <guido@python.org> Fix newlongobject so it will work for 64-bit as well as 32-bit hardware
(although for 32-bit hardware it's a bit slower than it was).

Make gcc -Wall happy.
/external/python/cpython2/Objects/longobject.c
d266eb460e20ded087d01a29da0a230e235afc40 25-Oct-1996 Guido van Rossum <guido@python.org> New permission notice, includes CNRI.
/external/python/cpython2/Objects/longobject.c
687ec1892b60c4e57575f823cf0c6e49ae21afaf 04-Mar-1995 Guido van Rossum <guido@python.org> changes for MPW
/external/python/cpython2/Objects/longobject.c
9fa2c116139a22d647fc736cf36dfd815c6de944 10-Feb-1995 Guido van Rossum <guido@python.org> use Py_CHARMASK; and don't check for neg. float to the float power here
/external/python/cpython2/Objects/longobject.c
3535f6e0a1ca5fb7a7a9f2c4b5a1cf1a125248b8 17-Jan-1995 Guido van Rossum <guido@python.org> long_scan is no longer used
/external/python/cpython2/Objects/longobject.c
c206c766dd743c635397d5e6be9adfdfc8fb921c 10-Jan-1995 Guido van Rossum <guido@python.org> fix memory leak and null pointer dereference
/external/python/cpython2/Objects/longobject.c
6610ad9d6bfe484a026f1fd34ebdcdf9924f9114 04-Jan-1995 Guido van Rossum <guido@python.org> Added 1995 to copyright message.
floatobject.c: fix hash().
methodobject.c: support METH_FREENAME flag bit.
/external/python/cpython2/Objects/longobject.c
d7047b395e392ce9e46f9a83480ade8b37f6d5b0 02-Jan-1995 Guido van Rossum <guido@python.org> Lots of minor changes. Note for mappingobject.c: the hash table pointer
can now be NULL.
/external/python/cpython2/Objects/longobject.c
03093a248d4ef3af23a5906dea276c01e0c1ae2c 28-Sep-1994 Guido van Rossum <guido@python.org> * Include/classobject.h, Objects/classobject.c, Python/ceval.c:
entirely redone operator overloading. The rules for class
instances are now much more relaxed than for other built-in types
(whose coerce must still return two objects of the same type)

* Objects/floatobject.c: add overflow check when converting float
to int and implement truncation towards zero using ceil/float

* Objects/longobject.c: change ValueError to OverflowError when
converting to int

* Objects/rangeobject.c: modernized

* Objects/stringobject.c: use HAVE_LIMITS instead of __STDC__

* Objects/xxobject.c: changed to use new style (not finished?)
/external/python/cpython2/Objects/longobject.c
eb1fafcec14725f71aadf3874df6507a5fe577a1 29-Aug-1994 Guido van Rossum <guido@python.org> New patches by Andrew to fix various problems
Add cast for Lance
/external/python/cpython2/Objects/longobject.c
b73cc04e625511f41c63b880b418338af70dc8bd 01-Nov-1993 Guido van Rossum <guido@python.org> * ceval.c, longobject.c, methodobject.c, listnode.c, arraymodule.c,
pythonrun.c: added static forward declarations
* pythonrun.h, ceval.h, longobject.h, node.h: removed declarations of
static routines
/external/python/cpython2/Objects/longobject.c
234f942aefb779efa6cfb7225e21d16a3f7e80f7 17-Jun-1993 Guido van Rossum <guido@python.org> * Added gmtime/localtime/mktime and SYSV timezone globals to timemodule.c.
Added $(SYSDEF) to its build rule in Makefile.
* cgensupport.[ch], modsupport.[ch]: removed some old stuff. Also
changed files that still used it... And made several things static
that weren't but should have been... And other minor cleanups...
* listobject.[ch]: add external interfaces {set,get}listslice
* socketmodule.c: fix bugs in new send() argument parsing.
* sunaudiodevmodule.c: added flush() and close().
/external/python/cpython2/Objects/longobject.c
9bfef44d97d1ae24e03717e3d59024b44626a9de 29-Mar-1993 Guido van Rossum <guido@python.org> * Changed all copyright messages to include 1993.
* Stubs for faster implementation of local variables (not yet finished)
* Added function name to code object. Print it for code and function
objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version
number has changed accordingly)
* Print address of self for built-in methods
* New internal functions getattro and setattro (getattr/setattr with
string object arg)
* Replaced "dictobject" with more powerful "mappingobject"
* New per-type functio tp_hash to implement arbitrary object hashing,
and hashobject() to interface to it
* Added built-in functions hash(v) and hasattr(v, 'name')
* classobject: made some functions static that accidentally weren't;
added __hash__ special instance method to implement hash()
* Added proper comparison for built-in methods and functions
/external/python/cpython2/Objects/longobject.c
e537240c252ff678d49451ee6f80fa934653a724 16-Mar-1993 Guido van Rossum <guido@python.org> * Changed many files to use mkvalue() instead of newtupleobject().
* Fixcprt.py: added [-y file] option, do only files younger than file.
* modsupport.[ch]: added vmkvalue().
* intobject.c: use mkvalue().
* stringobject.c: added "formatstring"; renamed string* to string_*;
ceval.c: call formatstring for string % value.
* longobject.c: close memory leak in divmod.
* parsetok.c: set result node to NULL when returning an error.
/external/python/cpython2/Objects/longobject.c
34679b7661873ec65e5157ddd1ea2be8269632d0 26-Jan-1993 Guido van Rossum <guido@python.org> * Added Fixcprt.py: script to fix copyright message.
* various modules: added 1993 to copyright.
* thread.c: added copyright notice.
* ceval.c: minor change to error message for "+"
* stdwinmodule.c: check for error from wfetchcolor
* config.c: MS-DOS fixes (define PYTHONPATH, use DELIM, use osdefs.h)
* Add declaration of inittab to import.h
* sysmodule.c: added sys.builtin_module_names
* xxmodule.c, xxobject.c: fix minor errors
/external/python/cpython2/Objects/longobject.c
0b0db8e3a07c92786fde60bf53bd1d5aa32e0aae 21-Jan-1993 Guido van Rossum <guido@python.org> Added separate main program for the Mac: macmain.c
stdwinmodule.c: wsetfont can now return an error
Makefile: add CL_USE and CL_LIB*S; config.c: move CL part around
New things in imgfile; also in Makefile.
longobject.c: fix comparison of negative long ints... [REAL BUG!]
marshal.c: add dumps() and loads() to read/write strings
timemodule.c: make sure there's always a floatsleep()
posixmodule.c: rationalize struct returned by times()
Makefile: add test target, disable imgfile by default
thread.c: Improved coexistance with dl module (sjoerd)
stdwinmodule.c: Change include stdwin.h if macintosh
rotormodule.c: added missing last argument to RTR_?_region calls
confic.c: merged with configmac.c, added 1993 to copyright message
fileobject.c: int compared to NULL in writestring(); change fopenRF ifdef
timemodule.c: simplify times() using mkvalue; include myselect.h
earlier (for sequent).
posixmodule: for sequent, include unistd.h instead of explicit
extern definitions and don't define rename()
Makefile: change misleading/wrong MD5 comments
/external/python/cpython2/Objects/longobject.c
7066dd75c5ee8385135541d03fb8edd8939ad740 17-Sep-1992 Guido van Rossum <guido@python.org> * Makefile: added IMGFILE; moved some stuff around.
* flmodule.c: added some missing functions; changed readonly flags of
some data members based upon FORMS documentation.
* listobject.c: fixed int/long arg lint bug (bites PC compilers).
* several: removed redundant print methods (repr is good enough).
* posixmodule.c: added (still experimental) process group functions.
/external/python/cpython2/Objects/longobject.c
1899c2e0550fa025080e35bb3ec25aeff0118dc7 12-Sep-1992 Guido van Rossum <guido@python.org> Made builtins int(), long(), float(), oct() and hex() more generic.
/external/python/cpython2/Objects/longobject.c
2c475427c26f013cf2050ed281637820abeedc10 14-Aug-1992 Guido van Rossum <guido@python.org> oct(0) should return '0', not '00'
/external/python/cpython2/Objects/longobject.c
e6eefc22313e7f2da5918ecd608fbb0b7a7a1610 14-Aug-1992 Guido van Rossum <guido@python.org> * classobject.[ch], {float,long,int}object.c, bltinmodule.c:
coercion is now completely generic.
* ceval.c: for instances, don't coerce for + and *; * reverses
arguments if left one is non-instance numeric and right one sequence.
/external/python/cpython2/Objects/longobject.c
bab9d0385585fcddf6ee96a4ca38dd18e3517f54 05-Apr-1992 Guido van Rossum <guido@python.org> Copyright for 1992 added
/external/python/cpython2/Objects/longobject.c
8b27d929a606b9723efb6cf3045a5a4b5418acb3 27-Mar-1992 Guido van Rossum <guido@python.org> Lint stuff (involves casts, yuck!)
/external/python/cpython2/Objects/longobject.c
e32e014c7edf368c35a6228915775b7709a51ad7 19-Jan-1992 Guido van Rossum <guido@python.org> Add prototypes.
Change / and % to match divmod.
/external/python/cpython2/Objects/longobject.c
4c260ff2a53b094cbaae3033ca50fb24a1717d0a 14-Jan-1992 Guido van Rossum <guido@python.org> Changed to 2's complement bitwise ops. Got rid of ZABS etc.
/external/python/cpython2/Objects/longobject.c
afbb8db8e6647de7aaf20078c2259efbbfc086d0 31-Dec-1991 Guido van Rossum <guido@python.org> Fixed bug in long masking ops.
/external/python/cpython2/Objects/longobject.c
87e7ea72a6ef9232be9db06038943044c747971b 10-Dec-1991 Guido van Rossum <guido@python.org> Use new exceptions.
/external/python/cpython2/Objects/longobject.c
c6913e7da286f5a307661399e4c3306a5cce2c29 19-Nov-1991 Guido van Rossum <guido@python.org> Made the sign use one's complement; implemented shifting and masking operators.
/external/python/cpython2/Objects/longobject.c
3d3037d51a541ac1480e60dc469efc51607542f5 24-Oct-1991 Guido van Rossum <guido@python.org> Changed convert to add '0' or '0x' prefix for oct/hex.
Added NULL function pointers for shift and mask ops.
/external/python/cpython2/Objects/longobject.c
909336104b70cae29c0c4fde4477d508e1d709ac 07-Jun-1991 Guido van Rossum <guido@python.org> printobject now returns an error code
/external/python/cpython2/Objects/longobject.c
149e9ea24c34e47c3a66ee7aa0cf19f50da947b9 03-Jun-1991 Guido van Rossum <guido@python.org> Added dnewlongobject(), function to convert double to long int.
/external/python/cpython2/Objects/longobject.c
c7ec9c98e21b2b0da29e14975683f73a09321c18 28-May-1991 Guido van Rossum <guido@python.org> Fix off-by-one error in long_repr.
Implement long_pow.
/external/python/cpython2/Objects/longobject.c
23d6f0e8e7725bcec50f5052709c8e241bc64eda 14-May-1991 Guido van Rossum <guido@python.org> Many small changes
/external/python/cpython2/Objects/longobject.c
edcc38aac5cf1a07eb287624b917116ec114ed61 05-May-1991 Guido van Rossum <guido@python.org> Initial revision
/external/python/cpython2/Objects/longobject.c