Mercurial > cpython-lru_cache-weakref
diff Modules/structmodule.c @ 2061:172ba04a5191 legacy-trunk
Added 1995 to copyright message.
Setup.in: clarified Tk comments somewhat.
structmodule.c: use memcpy() instead of double precision assignment.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 04 Jan 1995 19:10:35 +0000 |
| parents | 1940892d2fe3 |
| children | 65644766158a |
line wrap: on
line diff
--- a/Modules/structmodule.c Wed Jan 04 19:08:09 1995 +0000 +++ b/Modules/structmodule.c Wed Jan 04 19:10:35 1995 +0000 @@ -1,6 +1,6 @@ /*********************************************************** -Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, -Amsterdam, The Netherlands. +Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, +The Netherlands. All Rights Reserved @@ -290,7 +290,7 @@ res += sizeof(float); break; case 'd': - *(double*)res = fval; + memcpy(res, (char*)&fval, sizeof fval); res += sizeof(double); break; } @@ -415,9 +415,13 @@ break; case 'd': - v = newfloatobject(*(double*)str); + { + double d; + memcpy((char *)&d, str, sizeof d); + v = newfloatobject(d); str += sizeof(double); break; + } default: err_setstr(StructError, "bad char in fmt");
