summaryrefslogtreecommitdiff
path: root/Modules/arraymodule.c
AgeCommit message (Collapse)AuthorLines
2001-12-08Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum-1/+1
type.__module__ behavior. This adds the module name and a dot in front of the type name in every type object initializer, except for built-in types (and those that already had this). Note that it touches lots of Mac modules -- I have no way to test these but the changes look right. Apologies if they're not. This also touches the weakref docs, which contains a sample type object initializer. It also touches the mmap test output, because the mmap type's repr is included in that output. It touches object.h to put the correct description in a comment.
2001-11-28sprintf -> PyOS_snprintf in some "obviously safe" cases.Tim Peters-3/+4
Also changed <>-style #includes to ""-style in some places where the former didn't make sense.
2001-07-27Fix buffer_info() docstring to match reality. See SF bug #444842.Guido van Rossum-1/+3
2001-06-05Make it possible to find the use of tp_as_buffer here with a global search.Tim Peters-1/+1
(Just a change to a comment)
2001-01-25Correct one-line typo, reported by yole @ SF, bug 130077.Guido van Rossum-1/+1
2001-01-24The array type was missing the Py_TPFLAGS_DEFAULT initializer for theGuido van Rossum-1/+1
tp_flags. This will become important when I introduce Py_TPFLAGS_HAVE_RICHCOMPARE (as I should have!).
2001-01-18Same treatment as listobject.c:Guido van Rossum-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.
2000-11-10Fix for SF bug 117402, crashes on str(array) and repr(array). This was anTim Peters-3/+5
unfortunate consequence of somebody switching from PyArg_Parse to PyArg_ParseTuple but without changing the argument from a NULL to a tuple.
2000-09-26Rationalize use of limits.h, moving the inclusion to Python.h.Fred Drake-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.
2000-09-16arraymodule: Fix SF bug 113960.Tim Peters-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.
2000-09-10General cleanup in preparation for a bugfix: removed unused code, uselessTim Peters-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).
2000-09-01REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum-9/+0
This should match the situation in the 1.6b1 tree.
2000-08-31Peter Schneider-Kamp <nowonder@nowonder.de>:Fred Drake-3/+1
Remove some of GCC's warning in -Wstrict-prototypes mode. This closes SourceForge patch #101342.
2000-08-12Use safer comparisons (only matters when sizeof(int) != sizeof(size_t)). freadTrent Mick-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.
2000-08-01Removed decl of unreferenced vrbl.Tim Peters-1/+0
2000-07-31replaced PyArgs_Parse by PyArgs_ParseTuplePeter Schneider-Kamp-34/+39
changed error messages for extend method from "append" to "extend"
2000-07-31added count, extend, index, pop and remove to arraymodulePeter Schneider-Kamp-72/+168
2000-07-21Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters-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 ;)
2000-07-13ANSI-fication (got lost in the deep seas of source forge <wink>)Peter Schneider-Kamp-195/+60
2000-07-09Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters-8/+8
2000-07-01Jack Jansen, Mac patch:Guido van Rossum-0/+3
Include limits.h if we have it.
2000-07-01In b_setitem(), instead of the platform dependent CHAR_MIN andGuido van Rossum-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!
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
2000-06-28Trent Mick: use size_t instead of int where appropriate (inGuido van Rossum-2/+2
fromfile(), to hold fread() result.)
2000-06-28Trent Mick <trentm@activestate.com>:Fred Drake-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.
2000-06-01Michael Hudson <mwh21@cam.ac.uk>:Fred Drake-3/+8
Removed PyErr_BadArgument() calls and replaced them with more useful error messages.
2000-05-03Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum-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.)
2000-02-04Patch from Paul Sokolovsky <Paul.Sokolovsky@technologist.com>:Fred Drake-1/+3
Attached is patch (against 1.5.2 release) to allow some modules to be buildable as pyd's (usual &PyType_Type stuff).
2000-01-20The rest of the changes by Trent Mick and Dale Nagata for warning-freeGuido van Rossum-1/+1
compilation on NT Alpha. Mostly added casts etc.
1999-12-03Correct the docstring for byteswap(); error noted by Bernhard ReiterFred Drake-4/+9
<bernhard@uwm.edu>. Added a check that no parameters were passed to byteswap(); previously allowed any parameters you happened to pass.
1999-08-27Tiny patch by Mark Hammond to avoid sys/types.h if we don't have itGuido van Rossum-2/+4
(for Windows/CE).
1999-03-19Use an unsigned cast to avoid a warning in VC++.Guido van Rossum-1/+2
1999-02-23Carefully check for overflow when allocating the memory for fromfileGuido van Rossum-1/+8
-- someone tried to pass in sys.maxint and got bitten by the bogus calculations.
1998-12-04Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum-1/+1
on BeOS or Windows.
1998-10-14No need to issue a fatal error if the PyDict_SetItemString fails; theGuido van Rossum-3/+2
caller (in import.c) will test for errors and take appropriate action.
1998-10-14ACK! There was still an unescaped newline in a docstring.Guido van Rossum-1/+1
1998-10-13Doc strings by Chris Petrilli.Guido van Rossum-42/+177
1997-08-12Added buffer_info() method that returns address and length in bytes ofGuido van Rossum-0/+10
the buffer used to hold the array -- for dangerous low-level I/O.
1997-06-02array_type -> ArrayTypeGuido van Rossum-2/+2
1997-05-23PyObject_Compare can raise an exception now.Guido van Rossum-4/+4
1997-05-22Defined array.array_type, the type object.Guido van Rossum-1/+6
1997-05-16Address the following problem on DOS and Win 3.1, reported by JimGuido van Rossum-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.
1997-05-05Checkin of Jack's buffer mods.Guido van Rossum-0/+53
Not really checked, but didn't fail any tests either...
1997-04-11Keep Microsoft VC happy.Guido van Rossum-2/+2
1997-01-03Add new formats B, H, I, L for unsigned data types (analogous to theGuido van Rossum-1/+85
recent changes in the struct module).
1996-12-09Removed some unneeded header files and reedited with a fixed-width fontRoger E. Masse-14/+19
from emacs as per recomendation from GvR
1996-12-09Renamed Grandly (I think).Roger E. Masse-265/+270
1996-12-05Keep gcc -Wall happy.Guido van Rossum-0/+8
1996-10-25New permission notice, includes CNRI.Guido van Rossum-12/+19