[Python-checkins] python/dist/src/Objects floatobject.c,2.120,2.121

Andrew MacIntyre andymac@bullseye.apana.org.au
Sat, 22 Mar 2003 09:28:47 +1000 (est)


On Thu, 20 Mar 2003 tim_one@users.sourceforge.net wrote:

> Update of /cvsroot/python/python/dist/src/Objects
> In directory sc8-pr-cvs1:/tmp/cvs-serv6732/python/Objects
>
> Modified Files:
> 	floatobject.c
> Log Message:
> New private API functions _PyFloat_{Pack,Unpack}(4,8}.  This is a
> refactoring to get all the duplicates of this delicate code out of the
> cPickle and struct modules.
>
>
> Index: floatobject.c
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v
> retrieving revision 2.120
> retrieving revision 2.121
> diff -C2 -d -r2.120 -r2.121
> *** floatobject.c	29 Jan 2003 17:58:45 -0000	2.120
> --- floatobject.c	20 Mar 2003 20:53:32 -0000	2.121
> ***************
> *** 905,906 ****
> --- 905,1219 ----
>   	}
>   }
> +
> + /*----------------------------------------------------------------------------
> +  * _PyFloat_{Pack,Unpack}{4,8}.  See floatobject.h.
> +  *
> +  * TODO:  On platforms that use the standard IEEE-754 single and double
> +  * formats natively, these routines could simply copy the bytes.
> +  */
> + int
> + _PyFloat_Pack4(double x, unsigned char *p, int le)
> + {

For those platforms that build cStringIO and struct as DL extensions,
shouldn't these be declared with the PyAPI_FUNC() macro?

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac@bullseye.apana.org.au  | Snail: PO Box 370
        andymac@pcug.org.au            |        Belconnen  ACT  2616
Web:    http://www.andymac.org/        |        Australia