Commit Graph

4873 Commits

Author SHA1 Message Date
Roger E. Masse 5b0eba3ced Reindented. 1997-01-03 18:51:01 +00:00
Barry Warsaw 752300bbdf Check of return values and proper error handling. 1997-01-03 17:18:10 +00:00
Guido van Rossum 53756b1097 Added PyLong_FromUnsignedLong() and PyLong_AsUnsignedLong(). 1997-01-03 17:14:46 +00:00
Barry Warsaw 461a1c172f Output for signal module test 1997-01-03 16:01:20 +00:00
Guido van Rossum 042a05172f Add $(srcdir) in front of the test program's name (else it won't work
when $(srcdir) isn't '.', i.e. when using VPATH).
1997-01-03 15:54:36 +00:00
Guido van Rossum b9d338cbfb Fill pad bytes with zeros (fixing a bug dating from the very first version!). 1997-01-03 15:40:33 +00:00
Guido van Rossum dbadd558b5 Describe standard float/double support.
Rewrite example to be an interactive session
1997-01-03 04:20:09 +00:00
Barry Warsaw b9a781e177 Scratch the ears of gcc -Wall. 1997-01-03 00:26:28 +00:00
Barry Warsaw f3f41a9e57 Added declaration for PyErr_SetInterrupt. 1997-01-03 00:15:03 +00:00
Barry Warsaw 929711765e Several changes:
- Conform to standard Python C coding styles.

- All static symbols were renamed and shorted.

- Eyeballed all return values and memory references.

- Fixed a bug in signal.pause() so that exceptions raised in signal
  handlers are now properly caught after pause() returns.

- Removed SIGCPU and SIGFSZ.  We surmise that these were typos for the
  previously missing SIGXCPU and SIGXFSZ.
1997-01-03 00:14:25 +00:00
Guido van Rossum 420c11c6aa Added f/d tests for specific byte orders. 1997-01-03 00:09:46 +00:00
Guido van Rossum 4ccc531f34 Ok, ok, I've fixed gradual underflow on packing too.
Still don't know what to do with Inf/NaN, so I raise an exception on
pack(), and something random decided by ldexp() will happen on
unpack().
1997-01-02 23:23:20 +00:00
Guido van Rossum 6083f0e9ce Use the new struct module's ability to pack and unpack standardized
data formats.  The _xdr module is no longer used, since struct
supports the required IEEE floats and doubles.

(I have one doubt about not using _xdr.  The struct module doesn't
handle Inf, NaN and gradual underflow correctly.  If the _xdr module
does these things better, it may still have a (small) competitive
advantage.  On the other hand, since not all platforms support IEEE
floating point, it's not clear that it would be a good idea to ever
transfer Inf or NaNs.  Gradual underflow can be fixed in the struct
module.
1997-01-02 22:52:15 +00:00
Guido van Rossum 07ef655222 Oops -- unpack float/double didn't do the right thing if e==0. 1997-01-02 22:31:07 +00:00
Guido van Rossum 74679b455f Support float and double in non-native formats.
These use the ANSI/IEEE standard, which is also used by XDR;
so the _xdr module may become obsolete.
1997-01-02 22:21:36 +00:00
Barry Warsaw 9e3fceb5b3 rotorobj_setkey(): A single string argument is now required (i.e. no
long optional with nearly-no-op missing).
1997-01-02 20:36:36 +00:00
Barry Warsaw 5afafad82d <rotorobj>.setkey() now requires exactly one argument 1997-01-02 20:02:44 +00:00
Barry Warsaw 9121ab9433 Switched over to use the new testregr.py test harness. 1997-01-02 20:01:44 +00:00
Barry Warsaw 6717030dc9 setkey method's argument is no longer optional (it used to be a no-op
when missing).
1997-01-02 19:48:00 +00:00
Guido van Rossum b02092a9b2 Added characteristics of shttp, https, and snews. 1997-01-02 18:18:27 +00:00
Guido van Rossum 6757748641 Properly parenthesize a long Boolean combination. Formerly, you could
pass invalid seed values.
1997-01-02 18:13:35 +00:00
Guido van Rossum 3c83bb49d0 The usual... 1996-12-31 22:35:16 +00:00
Guido van Rossum 8c4ed9ae5d Rewritten the readline test, hopefully it's okay now. 1996-12-31 22:34:17 +00:00
Fred Drake 591bbb1572 (libformatter.tex): Document the flush() method on the writer. 1996-12-31 20:51:42 +00:00
Fred Drake 2823168c46 (formatter.py): Add a flush() method to the writer interface. This really
needs to be a standard part of the interface, so we'll have it in
	for the next release.
1996-12-31 20:50:51 +00:00
Guido van Rossum 2a37850273 Exercise the new feature set somewhat.
Use TestFailed exception and verbose flag from test_support module.
1996-12-31 17:25:47 +00:00
Guido van Rossum 60c50614e1 Added better handling of unsigned longs -- a Python long returned by
unpack('L', ...) is now acceptable to pack('L', ...).
1996-12-31 16:29:52 +00:00
Guido van Rossum 36bb181cdf Rewrote _{read,write}_{short,long} to use the newly revamped struct
module.  (Small problem: struct.pack() won't deal with the Python long
ints returned by struct.unpack() for the 'L' format.  Worked around
that for now.)
1996-12-31 05:57:34 +00:00
Guido van Rossum 3dd68d3364 Added libstat.tex 1996-12-31 02:24:54 +00:00
Guido van Rossum 125434665b Document the new extensions. 1996-12-31 02:22:14 +00:00
Guido van Rossum 3aa27fd315 Fix the first bugs... treatment of 0 count was wrong, and memchr()
should be memset().
1996-12-31 02:10:45 +00:00
Guido van Rossum f7e6b4b388 Pretty much rewritten to fulfull several long-standing wishes:
-- The whole implementation is now more table-driven.

-- Unsigned integers.  Format characters 'B', 'H', 'I' and 'L'
mean unsigned byte, short, int and long.  For 'I' and 'L', the return
value is a Python long integer if a Python plain integer can't
represent the required range (note: this is dependent on the size of
the relevant C types only, not of the sign of the actual value).

-- A new format character 's' packs/unpacks a string.  When given a
count prefix, this is the size of the string, not a repeat count like
for the other format characters; e.g. '10s' means a single 10-byte
string, while '10c' means 10 characters.  For packing, the string is
truncated or padded with null bytes as appropriate to make it fit.
For unpacking, the resulting string always has exactly the specified
number of bytes.  As a special case, '0s' means a single, empty
string (while '0c' means 0 characters).

-- Various byte order options.  The first character of the format
string determines the byte order, size and alignment, as follows:

First character		Byte order		size and alignment

	'@'		native			native
	'='		native			standard
	'<'		little-endian		standard
	'>'		big-endian		standard
	'!'		network (= big-endian)	standard

If the first character is not one of these, '@' is assumed.

Native byte order is big-endian or little-endian, depending on the
host system (e.g. Motorola and Sun are big-endian; Intel and DEC are
little-endian).

Native size and alignment are determined using the C compiler's sizeof
expression.  This is always combined with native byte order.

Standard size and alignment are as follows: no alignment is required
for any type (so you have to use pad bytes); short is 2 bytes; int and
long are 4 bytes.  In this mode, there is no support for float and
double.

Note the difference between '@' and '=': both use native byte order,
but the size and alignment of the latter is standardized.

The form '!' is available for those poor souls who can't remember
whether network byte order is big-endian or little-endian.

There is no way to indicate non-native byte order (i.e. force
byte-swapping); use the appropriate choice of '<' or '>'.
1996-12-31 01:41:25 +00:00
Guido van Rossum b5846d7600 A different winning animation. 1996-12-30 16:45:14 +00:00
Guido van Rossum 408027ea46 Rename DEBUG macro to Py_DEBUG 1996-12-30 16:17:54 +00:00
Guido van Rossum a0dc1c4a61 Actually, *this* fixes the last bug. 1996-12-30 02:37:07 +00:00
Guido van Rossum 1b2b53a25d Considerably restructured. This fixes the one remaining bug. 1996-12-30 02:20:29 +00:00
Guido van Rossum 8de9f894e1 Solitaire game, like the one that comes with Windows. 1996-12-29 20:15:32 +00:00
Guido van Rossum c17a268398 Added support for RFC 850 style dates, as used by some HTTP servers
(such as Netscape-Commerce and CERN).

An example of a RFC 850 date: 'Wednesday, 18-Dec-96 21:00:00 GMT'

From: Chris Lawrence <quango@themall.net>
1996-12-27 15:42:35 +00:00
Guido van Rossum 178ff353e8 Fix bogus implementation of Group.bind().
Added unbind() to CanvasItem and Group classes.
1996-12-27 15:40:31 +00:00
Guido van Rossum 8371013f9a Added config(ure) method to Image class.
(Fred Drake)
1996-12-27 15:33:17 +00:00
Guido van Rossum 0b96b945b8 Change the default values for IntVar and DoubleVar to numbers (they
were strings, accidentally).
1996-12-27 15:30:20 +00:00
Guido van Rossum 671dc20efc Crude but effective hack to clear the parser cache every so often.
(Fred Drake.)
1996-12-27 15:26:15 +00:00
Guido van Rossum babab6869f Removed all traces of accessobject.c. 1996-12-25 19:22:49 +00:00
Roger E. Masse fbd1d74286 Renamed.
However: "cgensupport.h" is still present... otherwise I get
	maaaany type errors... not sure if this needs more attention.
1996-12-24 19:39:23 +00:00
Roger E. Masse cf284cc5db Test output for the gl C extension module. 1996-12-24 19:36:33 +00:00
Roger E. Masse 6da2953f1e gl is a *huge* module. This is a very simple test that insures that
all the modules attributes are present and creates a small criss-cross
window for 5 seconds (example from the documentation :-)  A more
comprehensive test would probably be useful... but maybe overkill.
1996-12-24 19:36:07 +00:00
Barry Warsaw fb817cd4a2 Output files
test_rotor.py: New test of the rotor module.

test_*: converted to the new test harness.  GvR note!  test_signal.py
works interatively (i.e. when verbose=1) but does not work inside the
test harness.  It must be a timing issue, but I haven't figured it out
yet.
1996-12-23 23:40:11 +00:00
Barry Warsaw 5e056bbb76 test_rotor.py: New test of the rotor module.
test_*: converted to the new test harness.  GvR note!  test_signal.py
works interatively (i.e. when verbose=1) but does not work inside the
test harness.  It must be a timing issue, but I haven't figured it out
yet.
1996-12-23 23:39:42 +00:00
Barry Warsaw aeb207c6b6 Reworked to check for memory problems (one potential found),
non-checked error return values, and where appropriate,
PyArg_ParseTuple() style argument parsing.

I also changed some function names and converted all malloc/free calls
to PyMem_NEW/PyMem_DEL.

Some stylistic changes and formatting standardization.
1996-12-23 23:36:24 +00:00
Barry Warsaw f308c0f1fc From reading the source, it turns out that the setkey() method can
take an optional string key, but if key is not given, the method does
nothing!  In the rewrite (see upcoming check-in), I left things this
way, but here I document that this is the case.
1996-12-23 23:34:17 +00:00