summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Make it possible to find the use of tp_as_buffer here with a global search.Tim Peters2001-06-051-1/+1
| | | | (Just a change to a comment)
* Correct one-line typo, reported by yole @ SF, bug 130077.Guido van Rossum2001-01-251-1/+1
|
* The array type was missing the Py_TPFLAGS_DEFAULT initializer for theGuido van Rossum2001-01-241-1/+1
| | | | | tp_flags. This will become important when I introduce Py_TPFLAGS_HAVE_RICHCOMPARE (as I should have!).
* Same treatment as listobject.c:Guido van Rossum2001-01-181-67/+156
| | | | | | | | | | | | - In count(), remove(), index(): call RichCompare(Py_EQ). - Get rid of array_compare(), in favor of new array_richcompare() (a near clone of list_compare()). - Aligned items in array_methods initializer and comments for type struct initializer. - Folded a few long lines.
* Fix for SF bug 117402, crashes on str(array) and repr(array). This was anTim Peters2000-11-101-3/+5
| | | | | unfortunate consequence of somebody switching from PyArg_Parse to PyArg_ParseTuple but without changing the argument from a NULL to a tuple.
* Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake2000-09-261-3/+0
| | | | | | | | Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.
* arraymodule: Fix SF bug 113960.Tim Peters2000-09-161-18/+23
| | | | | | | | | | | | | | reverse() didn't work at all due to bad arg check. Fixed that. Added Brad Chapman to ACKS file, as the proud new owner of two implicitly copyrighted lines of Python source code <wink>. Repaired buffer_info's total lack of arg-checking. Replaced memmove by memcpy in reverse() guts, as memmove is often slower and the memory areas are guaranteed disjoint. Replaced poke-and-hope unchecked decl of tmp buffer size by assert-checked larger tmp buffer. Got rid of inconsistent spaces before open paren in docstrings. Added reverse() sanity tests to test_array.py.
* General cleanup in preparation for a bugfix: removed unused code, uselessTim Peters2000-09-101-65/+27
| | | | | | | | declarations, added some comments where I had to think too hard to understand what was happening, and changed the primary internal get/set functions to assert they're passed objects of the correct type instead of doing runtime tests for that (it's an internal error that "should never happen", so it's good enough to check it only in the debug build).
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* Peter Schneider-Kamp <nowonder@nowonder.de>:Fred Drake2000-08-311-3/+1
| | | | | | Remove some of GCC's warning in -Wstrict-prototypes mode. This closes SourceForge patch #101342.
* Use safer comparisons (only matters when sizeof(int) != sizeof(size_t)). freadTrent Mick2000-08-121-2/+2
| | | | | and fwrite return size_t, so it is safer to cast up to the largest type for the comparison. I believe the cast is required at all to remove compiler warnings.
* Removed decl of unreferenced vrbl.Tim Peters2000-08-011-1/+0
|
* replaced PyArgs_Parse by PyArgs_ParseTuplePeter Schneider-Kamp2000-07-311-34/+39
| | | | changed error messages for extend method from "append" to "extend"
* added count, extend, index, pop and remove to arraymodulePeter Schneider-Kamp2000-07-311-72/+168
|
* Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters2000-07-211-1/+1
| | | | | | | | | | | | | | | | | | and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
* ANSI-fication (got lost in the deep seas of source forge <wink>)Peter Schneider-Kamp2000-07-131-195/+60
|
* Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters2000-07-091-8/+8
|
* Jack Jansen, Mac patch:Guido van Rossum2000-07-011-0/+3
| | | | Include limits.h if we have it.
* In b_setitem(), instead of the platform dependent CHAR_MIN andGuido van Rossum2000-07-011-2/+2
| | | | | | | | | | | | | CHAR_MAX, use hardcoded -128 and 127. This may seem strange, unless you realize that we're talking about signed bytes here! Bytes are always 8 bits and 2's complement. CHAR_MIN and CHAR_MAX are properties of the char data type, which is guaranteed to hold at least 8 bits anyway. Otherwise you'd get failing tests on platforms where unsigned char is the default (e.g. AIX). Thanks, Vladimir Marangozov, for finding this nit!
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|
* Change copyright notice.Guido van Rossum2000-06-301-22/+7
|
* Trent Mick: use size_t instead of int where appropriate (inGuido van Rossum2000-06-281-2/+2
| | | | fromfile(), to hold fread() result.)
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-281-10/+95
| | | | | | | | | | | | | | | | | | | | | | | | | The cause: Relatively recent (last month) patches to getargs.c added overflow checking to the PyArg_Parse*() integral formatters thereby restricting 'b' to unsigned char value and 'h','i', and 'l' to signed integral values (i.e. if the incoming value is outside of the specified bounds you get an OverflowError, previous it silently overflowed). The problem: This broke the array module (as Fredrik pointed out) because *its* formatters relied on the loose allowance of signed and unsigned ranges being able to pass through PyArg_Parse*()'s formatters. The fix: This patch fixes the array module to work with the more strict bounds checking now in PyArg_Parse*(). How: If the type signature of a formatter in the arraymodule exactly matches one in PyArg_Parse*(), then use that directly. If there is no equivalent type signature in PyArg_Parse*() (e.g. there is no unsigned int formatter in PyArg_Parse*()), then use the next one up and do some extra bounds checking in the array module. This partially closes SourceForge patch #100506.
* Michael Hudson <mwh21@cam.ac.uk>:Fred Drake2000-06-011-3/+8
| | | | | Removed PyErr_BadArgument() calls and replaced them with more useful error messages.
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-031-6/+3
| | | | | | | | | | 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.)
* Patch from Paul Sokolovsky <Paul.Sokolovsky@technologist.com>:Fred Drake2000-02-041-1/+3
| | | | | Attached is patch (against 1.5.2 release) to allow some modules to be buildable as pyd's (usual &PyType_Type stuff).
* The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum2000-01-201-1/+1
| | | | compilation on NT Alpha. Mostly added casts etc.
* Correct the docstring for byteswap(); error noted by Bernhard ReiterFred Drake1999-12-031-4/+9
| | | | | | | <bernhard@uwm.edu>. Added a check that no parameters were passed to byteswap(); previously allowed any parameters you happened to pass.
* Tiny patch by Mark Hammond to avoid sys/types.h if we don't have itGuido van Rossum1999-08-271-2/+4
| | | | (for Windows/CE).
* Use an unsigned cast to avoid a warning in VC++.Guido van Rossum1999-03-191-1/+2
|
* Carefully check for overflow when allocating the memory for fromfileGuido van Rossum1999-02-231-1/+8
| | | | | -- someone tried to pass in sys.maxint and got bitten by the bogus calculations.
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
| | | | on BeOS or Windows.
* No need to issue a fatal error if the PyDict_SetItemString fails; theGuido van Rossum1998-10-141-3/+2
| | | | caller (in import.c) will test for errors and take appropriate action.
* ACK! There was still an unescaped newline in a docstring.Guido van Rossum1998-10-141-1/+1
|
* Doc strings by Chris Petrilli.Guido van Rossum1998-10-131-42/+177
|
* Added buffer_info() method that returns address and length in bytes ofGuido van Rossum1997-08-121-0/+10
| | | | the buffer used to hold the array -- for dangerous low-level I/O.
* array_type -> ArrayTypeGuido van Rossum1997-06-021-2/+2
|
* PyObject_Compare can raise an exception now.Guido van Rossum1997-05-231-4/+4
|
* Defined array.array_type, the type object.Guido van Rossum1997-05-221-1/+6
|
* Address the following problem on DOS and Win 3.1, reported by JimGuido van Rossum1997-05-161-12/+12
| | | | | | | | | Ahlstrom: Arraymodule.c has static functions H_getitem and h_getitem, and a few others which differ only in case. These are a problem on Windows 3.1, since a case-sensitive link causes Winsock to fail (hey, it's not my fault). Please convert H_etc to HH_etc etc.
* Checkin of Jack's buffer mods.Guido van Rossum1997-05-051-0/+53
| | | | Not really checked, but didn't fail any tests either...
* Keep Microsoft VC happy.Guido van Rossum1997-04-111-2/+2
|
* Add new formats B, H, I, L for unsigned data types (analogous to theGuido van Rossum1997-01-031-1/+85
| | | | recent changes in the struct module).
* Removed some unneeded header files and reedited with a fixed-width fontRoger E. Masse1996-12-091-14/+19
| | | | from emacs as per recomendation from GvR
* Renamed Grandly (I think).Roger E. Masse1996-12-091-265/+270
|
* Keep gcc -Wall happy.Guido van Rossum1996-12-051-0/+8
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* changes for MPWGuido van Rossum1995-03-091-1/+1
|
* make routines staticGuido van Rossum1995-01-221-5/+5
|
* Made some more things static, and other cleanup for new naming schemeGuido van Rossum1995-01-171-5/+5
|