ctypes-commit Mailing List for ctypes (Page 99)
Brought to you by:
theller
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(90) |
Jun
(143) |
Jul
(106) |
Aug
(94) |
Sep
(84) |
Oct
(163) |
Nov
(60) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(128) |
Feb
(79) |
Mar
(227) |
Apr
(192) |
May
(179) |
Jun
(41) |
Jul
(53) |
Aug
(103) |
Sep
(28) |
Oct
(38) |
Nov
(81) |
Dec
(17) |
2006 |
Jan
(184) |
Feb
(111) |
Mar
(188) |
Apr
(67) |
May
(58) |
Jun
(123) |
Jul
(73) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Thomas H. <th...@us...> - 2004-07-23 15:14:10
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27027 Modified Files: ChangeLog Log Message: *** empty log message *** Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** ChangeLog 7 May 2004 17:46:32 -0000 1.43 --- ChangeLog 23 Jul 2004 15:14:01 -0000 1.44 *************** *** 1,5 **** 2004-05-07 Thomas Heller <th...@py...> ! * (Message): Tag the HEAD with before_libffi_2004_05_07 * ctypes\source\callbacks.c: Callback functions can now return --- 1,24 ---- + 2004-07-23 Thomas Heller <th...@py...> + + * (Message): c_int, c_uint and other integer variants now use the + masked functions when converting Python integers/longs to C + integers. This has the effect that the value of the integer is + never checked, it is silently truncated. + + * (Message): ctypes now requires Python 2.3 or better. + + * (Message): Add some 'hacks' which make ctypes work on big-endian + platforms. On platforms with strict alignment rules, there are + still some crashes (solaris sparc). + + 2004-xx-xx Thomas Heller <th...@py...> + + * (Message): Conversion to libffi is now complete. libffi is now + used on all platforms. unittests pass, at least on x86 + architectures. Tested on Linux, FreeBSD. + 2004-05-07 Thomas Heller <th...@py...> ! * (Message): Tag the HEAD with before_libffi_2004_05_07 * ctypes\source\callbacks.c: Callback functions can now return |
From: Thomas H. <th...@us...> - 2004-07-23 14:52:39
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24198 Modified Files: setup.py Log Message: Require Python 2.3 (and check this early). Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** setup.py 23 Jul 2004 12:45:41 -0000 1.98 --- setup.py 23 Jul 2004 14:52:25 -0000 1.99 *************** *** 14,21 **** --- 14,26 ---- LIBFFI_SOURCES='source/gcc/libffi' + __version__ = "0.9.0" + ################################################################ import os, sys + if sys.version_info < (2, 3): + raise Exception, "ctypes %s requires Python 2.3 or better" % __version__ + from distutils.core import setup, Extension, Command import distutils.core *************** *** 317,356 **** ################################################################ - try: - walk = os.walk - except AttributeError: - def walk(top): - # Python 2.3's os.walk generator, without the large docstring ;-) - # And without the topdown and onerror arguments. - from os.path import join, isdir, islink - - # We may not have read permission for top, in which case we can't - # get a list of the files the directory contains. os.path.walk - # always suppressed the exception then, rather than blow up for a - # minor reason when (say) a thousand readable directories are still - # left to visit. That logic is copied here. - try: - names = os.listdir(top) - except OSError, err: - return - - dirs, nondirs = [], [] - for name in names: - if isdir(join(top, name)): - dirs.append(name) - else: - nondirs.append(name) - - yield top, dirs, nondirs - for name in dirs: - path = join(top, name) - if not islink(path): - for x in walk(path): - yield x - def find_file_in_subdir(dirname, filename): # if <filename> is in <dirname> or any subdirectory thereof, # return the directory name, else None ! for d, _, names in walk(dirname): if filename in names: return d --- 322,329 ---- ################################################################ def find_file_in_subdir(dirname, filename): # if <filename> is in <dirname> or any subdirectory thereof, # return the directory name, else None ! for d, _, names in os.walk(dirname): if filename in names: return d *************** *** 451,455 **** data_files = data_files, ! version="0.9.0", description="create and manipulate C data types in Python", long_description = __doc__, --- 424,428 ---- data_files = data_files, ! version=__version__, description="create and manipulate C data types in Python", long_description = __doc__, |
From: Thomas H. <th...@us...> - 2004-07-23 14:36:06
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21931 Modified Files: cfield.c Log Message: Give up Python 2.2 compatibility, and use the mask Python int/long -> C conversion functions everywhere. Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** cfield.c 23 Jul 2004 14:23:37 -0000 1.37 --- cfield.c 23 Jul 2004 14:35:54 -0000 1.38 *************** *** 198,219 **** get_long(PyObject *v, long *p) { - #if (PYTHON_API_VERSION < 1012) - long x; - if (!PyInt_Check(v) && !PyLong_Check(v)) { - PyErr_Format(PyExc_TypeError, - "int expected instead of %s instance", - v->ob_type->tp_name); - return -1; - } - x = PyInt_AsLong(v); - if (x == -1 && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) - PyErr_SetString(PyExc_ValueError, - "Value out of range"); - return -1; - } - *p = x; - return 0; - #else long x; if (!PyInt_Check(v) && !PyLong_Check(v)) { --- 198,201 ---- *************** *** 228,232 **** *p = x; return 0; - #endif } --- 210,213 ---- *************** *** 236,266 **** get_ulong(PyObject *v, unsigned long *p) { - #if (PYTHON_API_VERSION < 1012) - if (PyLong_Check(v)) { - unsigned long x = PyLong_AsUnsignedLong(v); - if (x == (unsigned long)(-1) && PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) - PyErr_SetString(PyExc_ValueError, - "Value out of range"); - return -1; - } - *p = x; - return 0; - } else if (PyInt_Check(v)) { - long x = PyInt_AsLong(v); - if (x < 0) { - PyErr_SetString(PyExc_ValueError, - "Value out of range"); - return -1; - } - *p = x; - return 0; - } else { - PyErr_Format(PyExc_TypeError, - "int expected instead of %s instance", - v->ob_type->tp_name); - return -1; - } - #else unsigned long x; if (!PyInt_Check(v) && !PyLong_Check(v)) { --- 217,220 ---- *************** *** 275,279 **** *p = x; return 0; - #endif } --- 229,232 ---- *************** *** 286,305 **** { PY_LONG_LONG x; ! ! if (PyLong_Check(v)) { ! x = PyLong_AsLongLong(v); ! if (x == (PY_LONG_LONG)-1 && PyErr_Occurred()) { ! if (PyErr_ExceptionMatches(PyExc_OverflowError)) ! PyErr_SetString(PyExc_ValueError, ! "Value out of range"); ! return -1; ! } ! *p = x; ! return 0; ! } else if (PyInt_Check(v)) { ! x = (PY_LONG_LONG)PyInt_AS_LONG(v); ! *p = x; ! return 0; ! } else { PyErr_Format(PyExc_TypeError, "int expected instead of %s instance", --- 239,243 ---- { PY_LONG_LONG x; ! if (!PyInt_Check(v) && !PyLong_Check(v)) { PyErr_Format(PyExc_TypeError, "int expected instead of %s instance", *************** *** 307,310 **** --- 245,253 ---- return -1; } + x = PyInt_AsUnsignedLongLongMask(v); + if (x == -1 && PyErr_Occurred()) + return -1; + *p = x; + return 0; } *************** *** 314,345 **** get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p) { ! if (PyLong_Check(v)) { ! unsigned PY_LONG_LONG x; ! x = PyLong_AsUnsignedLongLong(v); ! if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred()) { ! /* The type is OK (has been checked before), ! so we convert OverflowError and ! 'TypeError: can't convert negative long to unsigned' ! into ValueError ! */ ! if (PyErr_ExceptionMatches(PyExc_OverflowError) ! || PyErr_ExceptionMatches(PyExc_TypeError)) ! PyErr_SetString(PyExc_ValueError, ! "Value out of range"); ! return -1; ! } ! *p = x; ! return 0; ! } else if (PyInt_Check(v)) { ! long l; ! l = PyInt_AS_LONG(v); ! if (l < 0) { ! PyErr_SetString(PyExc_ValueError, ! "Value out of range"); ! return -1; ! } ! *p = (unsigned PY_LONG_LONG)l; ! return 0; ! } else { PyErr_Format(PyExc_TypeError, "int expected instead of %s instance", --- 257,262 ---- get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p) { ! unsigned PY_LONG_LONG x; ! if (!PyInt_Check(v) && !PyLong_Check(v)) { PyErr_Format(PyExc_TypeError, "int expected instead of %s instance", *************** *** 347,350 **** --- 264,272 ---- return -1; } + x = PyInt_AsUnsignedLongLongMask(v); + if (x == -1 && PyErr_Occurred()) + return -1; + *p = x; + return 0; } *************** *** 513,521 **** if (get_long(value, &val) < 0) return NULL; - if ((long)(short)val != val) { - PyErr_SetString(PyExc_ValueError, - "Value out of range"); - return NULL; - } *(short *)ptr = (short)val; Py_INCREF(Py_None); --- 435,438 ---- *************** *** 536,544 **** if (get_ulong(value, &val) < 0) return NULL; - if (val > 0xFFFF) { - PyErr_SetString(PyExc_ValueError, - "Value out of range"); - return NULL; - } *(unsigned short *)ptr = (unsigned short)val; Py_INCREF(Py_None); --- 453,456 ---- *************** *** 559,567 **** if (get_long(value, &val) < 0) return NULL; - if ((long)(char)val != val) { - PyErr_SetString(PyExc_ValueError, - "Value out of range"); - return NULL; - } *(char *)ptr = (char)val; Py_INCREF(Py_None); --- 471,474 ---- *************** *** 582,590 **** if (get_ulong(value, &val) < 0) return NULL; - if ((unsigned long)(unsigned char)val != val) { - PyErr_SetString(PyExc_ValueError, - "Value out of range"); - return NULL; - } *(unsigned char *)ptr = (unsigned char)val; Py_INCREF(Py_None); --- 489,492 ---- |
From: Thomas H. <th...@us...> - 2004-07-23 14:25:07
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20048 Modified Files: test_numbers.py Log Message: c_int and friends no longer check for valid ranges since they use the masked conversion functions, in Python 2.3 and up. Index: test_numbers.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_numbers.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** test_numbers.py 22 Jul 2004 10:45:13 -0000 1.19 --- test_numbers.py 23 Jul 2004 14:24:50 -0000 1.20 *************** *** 68,77 **** self.assertRaises(TypeError, t, None) ! def test_valid_ranges(self): ! # invalid values of the correct type ! # raise ValueError (not OverflowError) ! for t, (l, h) in zip(unsigned_types, unsigned_ranges): ! self.assertRaises(ValueError, t, l-1) ! self.assertRaises(ValueError, t, h+1) def test_from_param(self): --- 68,77 ---- self.assertRaises(TypeError, t, None) ! ## def test_valid_ranges(self): ! ## # invalid values of the correct type ! ## # raise ValueError (not OverflowError) ! ## for t, (l, h) in zip(unsigned_types, unsigned_ranges): ! ## self.assertRaises(ValueError, t, l-1) ! ## self.assertRaises(ValueError, t, h+1) def test_from_param(self): |
From: Thomas H. <th...@us...> - 2004-07-23 14:23:47
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19679 Modified Files: cfield.c Log Message: Use the masked conversion functions, when available. Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** cfield.c 22 Jul 2004 12:40:20 -0000 1.36 --- cfield.c 23 Jul 2004 14:23:37 -0000 1.37 *************** *** 198,201 **** --- 198,202 ---- get_long(PyObject *v, long *p) { + #if (PYTHON_API_VERSION < 1012) long x; if (!PyInt_Check(v) && !PyLong_Check(v)) { *************** *** 214,217 **** --- 215,232 ---- *p = x; return 0; + #else + long x; + if (!PyInt_Check(v) && !PyLong_Check(v)) { + PyErr_Format(PyExc_TypeError, + "int expected instead of %s instance", + v->ob_type->tp_name); + return -1; + } + x = PyInt_AsUnsignedLongMask(v); + if (x == -1 && PyErr_Occurred()) + return -1; + *p = x; + return 0; + #endif } *************** *** 221,224 **** --- 236,240 ---- get_ulong(PyObject *v, unsigned long *p) { + #if (PYTHON_API_VERSION < 1012) if (PyLong_Check(v)) { unsigned long x = PyLong_AsUnsignedLong(v); *************** *** 246,249 **** --- 262,279 ---- return -1; } + #else + unsigned long x; + if (!PyInt_Check(v) && !PyLong_Check(v)) { + PyErr_Format(PyExc_TypeError, + "int expected instead of %s instance", + v->ob_type->tp_name); + return -1; + } + x = PyInt_AsUnsignedLongMask(v); + if (x == -1 && PyErr_Occurred()) + return -1; + *p = x; + return 0; + #endif } |
From: Thomas H. <th...@us...> - 2004-07-23 14:23:37
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19521 Modified Files: test_win32.py Log Message: Python 2.2.0 doesn't have True. Index: test_win32.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_win32.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_win32.py 22 Jun 2004 08:59:50 -0000 1.7 --- test_win32.py 23 Jul 2004 14:23:02 -0000 1.8 *************** *** 58,62 **** pt = POINT(10, 10) rect = RECT(0, 0, 20, 20) ! self.failUnlessEqual(True, dll.PointInRect(byref(rect), pt)) if __name__ == '__main__': --- 58,62 ---- pt = POINT(10, 10) rect = RECT(0, 0, 20, 20) ! self.failUnlessEqual(1, dll.PointInRect(byref(rect), pt)) if __name__ == '__main__': |
From: Thomas H. <th...@us...> - 2004-07-23 13:50:56
|
Update of /cvsroot/ctypes/ctypes/win32/com/samples/server/control In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13025 Modified Files: test.html Log Message: Remove silly stuff. Index: test.html =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/samples/server/control/test.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test.html 21 Apr 2004 18:07:59 -0000 1.4 --- test.html 23 Jul 2004 13:50:47 -0000 1.5 *************** *** 12,15 **** --- 12,18 ---- <br> In the former case, try to register it with <tt>python stoplite.py -regserver</tt>. + <br> + Or you are not using Internet Explorer as your default browser, + in that case you should reopen this file with IE. <param name=digits value=50> </OBJECT> *************** *** 17,26 **** <param name=digits value=100> </OBJECT> - <hr> - <address><a href="mailto:th...@py...">Thomas Heller</a></address> - <!-- Created: Tue Jul 01 10:34:19 Westeuropäische Sommerzeit 2003 --> - <!-- hhmts start --> - Last modified: Wed Apr 21 10:17:56 Westeuropäische Sommerzeit 2004 - <!-- hhmts end --> </body> </html> --- 20,23 ---- |
From: Thomas H. <th...@us...> - 2004-07-23 13:43:11
|
Update of /cvsroot/ctypes/ctypes/win32/com/samples/server/IExplorer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11656 Modified Files: toolband.py Log Message: Avoid pulling in win32con for just three constants. Index: toolband.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/samples/server/IExplorer/toolband.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** toolband.py 20 Jul 2004 15:31:48 -0000 1.3 --- toolband.py 23 Jul 2004 13:43:02 -0000 1.4 *************** *** 200,206 **** self.hwndParent = hwndParent.value # Register and create window ! import win32con self.m_hwnd = windll.user32.CreateWindowExA(0, "button", "button", ! win32con.WS_CHILD, 0, 0, 0, 0, hwndParent, --- 200,206 ---- self.hwndParent = hwndParent.value # Register and create window ! WS_CHILD = 0x40000000 self.m_hwnd = windll.user32.CreateWindowExA(0, "button", "button", ! WS_CHILD, 0, 0, 0, 0, hwndParent, *************** *** 234,242 **** def IDockingWindow_ShowDW(self, this, bShow): if self.m_hwnd: ! import win32con if bShow: ! windll.user32.ShowWindow(self.m_hwnd, win32con.SW_SHOW) else: ! windll.user32.ShowWindow(self.m_hwnd, win32con.SW_HIDE) return S_OK --- 234,243 ---- def IDockingWindow_ShowDW(self, this, bShow): if self.m_hwnd: ! SW_SHOW = 5 ! SW_HIDE = 0 if bShow: ! windll.user32.ShowWindow(self.m_hwnd, SW_SHOW) else: ! windll.user32.ShowWindow(self.m_hwnd, SW_HIDE) return S_OK |
From: Thomas H. <th...@us...> - 2004-07-23 13:39:31
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10985 Modified Files: MANIFEST.windows.in Log Message: Add the html test page. Index: MANIFEST.windows.in =================================================================== RCS file: /cvsroot/ctypes/ctypes/MANIFEST.windows.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MANIFEST.windows.in 23 Jul 2004 13:22:26 -0000 1.2 --- MANIFEST.windows.in 23 Jul 2004 13:39:17 -0000 1.3 *************** *** 10,11 **** --- 10,13 ---- include samples/rt recursive-include samples *.py + + include win32/com/samples/server/control/test.html |
From: Thomas H. <th...@us...> - 2004-07-23 13:22:50
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7376 Modified Files: MANIFEST.windows.in Log Message: Add run_remote_test.py. Index: MANIFEST.windows.in =================================================================== RCS file: /cvsroot/ctypes/ctypes/MANIFEST.windows.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MANIFEST.windows.in 22 Jul 2004 14:02:22 -0000 1.1 --- MANIFEST.windows.in 23 Jul 2004 13:22:26 -0000 1.2 *************** *** 1,3 **** --- 1,4 ---- include MANIFEST MANIFEST.windows.in LICENSE.txt NEWS.txt README* + include run_remote_test.py include ctypes/.CTYPES_DEVEL |
From: Thomas H. <th...@us...> - 2004-07-23 13:19:13
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6559 Modified Files: MANIFEST.other.in Log Message: more files Index: MANIFEST.other.in =================================================================== RCS file: /cvsroot/ctypes/ctypes/MANIFEST.other.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MANIFEST.other.in 22 Jul 2004 14:02:22 -0000 1.1 --- MANIFEST.other.in 23 Jul 2004 13:19:03 -0000 1.2 *************** *** 1,3 **** ! include MANIFEST MANIFES.other.in LICENSE.txt NEWS.txt README* include source/*.c source/*.h include source/darwin/*.c source/darwin/*.h --- 1,4 ---- ! include MANIFEST.other.in LICENSE.txt NEWS.txt README* ! include run_remote_test.py include source/*.c source/*.h include source/darwin/*.c source/darwin/*.h *************** *** 5,9 **** recursive-include source/gcc * ! include unittests *.py include docs/*.html include docs/*.css --- 6,10 ---- recursive-include source/gcc * ! include unittests/*.py include docs/*.html include docs/*.css |
From: Thomas H. <th...@us...> - 2004-07-23 12:45:50
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv697 Modified Files: setup.py Log Message: data_files only needed on Windows. Add FreeBSD to the platforms list. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** setup.py 23 Jul 2004 11:02:31 -0000 1.97 --- setup.py 23 Jul 2004 12:45:41 -0000 1.98 *************** *** 425,430 **** --- 425,435 ---- if sys.platform == 'win32': options["sdist"] = {"template": "MANIFEST.windows.in", "force_manifest": 1} + data_files = [("ctypes/com/samples/server/control", + ["win32/com/samples/server/control/test.html"]) + ], + else: options["sdist"] = {"template": "MANIFEST.other.in", "force_manifest": 1} + data_files = [] class my_install_data(install_data.install_data): *************** *** 444,447 **** --- 449,453 ---- package_dir = package_dir, packages = packages, + data_files = data_files, version="0.9.0", *************** *** 452,461 **** license="MIT License", url="http://starship.python.net/crew/theller/ctypes.html", ! platforms=["windows", "Linux", "MacOS X", "Solaris"], ! ! data_files = [("ctypes/com/samples/server/control", ! ["win32/com/samples/server/control/test.html"]) ! ], ! cmdclass = {'test': test, 'build_py': my_build_py, 'build_ext': my_build_ext, 'clean': my_clean, 'install_data': my_install_data}, --- 458,463 ---- license="MIT License", url="http://starship.python.net/crew/theller/ctypes.html", ! platforms=["windows", "Linux", "MacOS X", "Solaris", "FreeBSD"], ! cmdclass = {'test': test, 'build_py': my_build_py, 'build_ext': my_build_ext, 'clean': my_clean, 'install_data': my_install_data}, |
From: Thomas H. <th...@us...> - 2004-07-23 12:40:39
|
Update of /cvsroot/ctypes/ctypes/win32/com/samples/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32287 Removed Files: setup.py Log Message: --- setup.py DELETED --- |
From: Thomas H. <th...@us...> - 2004-07-23 12:18:17
|
Update of /cvsroot/ctypes/ctypes/win32/com/samples/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29215 Modified Files: setup_sum.py Log Message: Update for py2exe 0.5. Index: setup_sum.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/samples/server/setup_sum.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** setup_sum.py 8 May 2003 19:40:04 -0000 1.1 --- setup_sum.py 23 Jul 2004 12:18:05 -0000 1.2 *************** *** 4,6 **** import py2exe ! setup(name='sum', scripts=['sum.py'], version='0') --- 4,6 ---- import py2exe ! setup(windows=['sum.py']) |
From: Thomas H. <th...@us...> - 2004-07-23 12:17:22
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29105 Modified Files: callbacks.c Log Message: Use ffi_arg instead of int. Index: callbacks.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callbacks.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** callbacks.c 23 Jul 2004 10:25:39 -0000 1.57 --- callbacks.c 23 Jul 2004 12:17:14 -0000 1.58 *************** *** 184,201 **** case 1: keep = setfunc(&r, result, 0); ! *(int *)mem = r.c; break; case SIZEOF_SHORT: keep = setfunc(&r, result, 0); ! *(int *)mem = r.s; break; case SIZEOF_INT: keep = setfunc(&r, result, 0); ! *(int *)mem = r.i; break; #if (SIZEOF_LONG != SIZEOF_INT) case SIZEOF_LONG: keep = setfunc(&r, result, 0); ! *(long *)mem = r.l; break; #endif --- 184,201 ---- case 1: keep = setfunc(&r, result, 0); ! *(ffi_arg *)mem = r.c; break; case SIZEOF_SHORT: keep = setfunc(&r, result, 0); ! *(ffi_arg *)mem = r.s; break; case SIZEOF_INT: keep = setfunc(&r, result, 0); ! *(ffi_arg *)mem = r.i; break; #if (SIZEOF_LONG != SIZEOF_INT) case SIZEOF_LONG: keep = setfunc(&r, result, 0); ! *(ffi_arg *)mem = r.l; break; #endif |
From: Thomas H. <th...@us...> - 2004-07-23 12:16:43
|
Update of /cvsroot/ctypes/ctypes/build/lib.win32-2.4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29001 Removed Files: _ctypes_test.pyd _ctypes.pyd Log Message: Remove the binaries from cvs. --- _ctypes_test.pyd DELETED --- --- _ctypes.pyd DELETED --- |
From: Thomas H. <th...@us...> - 2004-07-23 12:13:27
|
Update of /cvsroot/ctypes/ctypes/build/lib.win32-2.4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28485 Removed Files: .cvsignore Log Message: Remove the binaries from cvs. --- .cvsignore DELETED --- |
From: Thomas H. <th...@us...> - 2004-07-23 12:12:40
|
Update of /cvsroot/ctypes/ctypes/build/lib.win32-2.3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28284 Removed Files: _ctypes_test.pyd _ctypes.pyd .cvsignore Log Message: Remove the binaries from cvs. --- .cvsignore DELETED --- --- _ctypes_test.pyd DELETED --- --- _ctypes.pyd DELETED --- |
From: Thomas H. <th...@us...> - 2004-07-23 12:12:23
|
Update of /cvsroot/ctypes/ctypes/build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28240 Removed Files: .cvsignore Log Message: Remove the binaries from cvs. --- .cvsignore DELETED --- |
From: Thomas H. <th...@us...> - 2004-07-23 11:02:40
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17460 Modified Files: setup.py Log Message: Add a custom install_data command. Print a message (if -V2) before running a test file. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** setup.py 22 Jul 2004 15:22:19 -0000 1.96 --- setup.py 23 Jul 2004 11:02:31 -0000 1.97 *************** *** 22,25 **** --- 22,26 ---- from distutils.errors import DistutilsOptionError from distutils.command import build_py, build_ext, clean + from distutils.command import install_data from distutils.dir_util import mkpath from distutils.util import get_platform *************** *** 246,249 **** --- 247,252 ---- # tracebacks instance vars. # A sequence of testcase names together with their outcome is returned. + if self.verbosity > 1: + print "Running '%s run_remote_test.py %s'" % (sys.executable, path) os.system("%s run_remote_test.py %s" % (sys.executable, path)) cases = [] *************** *** 425,428 **** --- 428,442 ---- options["sdist"] = {"template": "MANIFEST.other.in", "force_manifest": 1} + class my_install_data(install_data.install_data): + """A custom install_data command, which will install it's files + into the standard directories (normally lib/site-packages). + """ + def finalize_options(self): + if self.install_dir is None: + installobj = self.distribution.get_command_obj('install') + self.install_dir = installobj.install_lib + print 'Installing data files to %s' % self.install_dir + install_data.install_data.finalize_options(self) + if __name__ == '__main__': setup(name="ctypes", *************** *** 440,444 **** platforms=["windows", "Linux", "MacOS X", "Solaris"], ! cmdclass = {'test': test, 'build_py': my_build_py, 'build_ext': my_build_ext, 'clean': my_clean}, options = options ) --- 454,463 ---- platforms=["windows", "Linux", "MacOS X", "Solaris"], ! data_files = [("ctypes/com/samples/server/control", ! ["win32/com/samples/server/control/test.html"]) ! ], ! ! cmdclass = {'test': test, 'build_py': my_build_py, 'build_ext': my_build_ext, ! 'clean': my_clean, 'install_data': my_install_data}, options = options ) |
From: Thomas H. <th...@us...> - 2004-07-23 10:25:56
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13280 Modified Files: callbacks.c Log Message: Fix some bugs in the hack. Index: callbacks.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callbacks.c,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** callbacks.c 23 Jul 2004 10:06:46 -0000 1.56 --- callbacks.c 23 Jul 2004 10:25:39 -0000 1.57 *************** *** 174,178 **** } else if (result != Py_None) { /* another big endian hack */ ! struct { char c; short s; --- 174,178 ---- } else if (result != Py_None) { /* another big endian hack */ ! union { char c; short s; *************** *** 279,283 **** if (dict) { p->setfunc = dict->setfunc; ! p->restype = &dict->restype; } else { p->setfunc = getentry("i")->setfunc; --- 279,283 ---- if (dict) { p->setfunc = dict->setfunc; ! p->restype = &dict->ffi_type; } else { p->setfunc = getentry("i")->setfunc; |
From: Thomas H. <th...@us...> - 2004-07-23 10:06:55
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10805 Modified Files: callbacks.c Log Message: Another big endian hack. Index: callbacks.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callbacks.c,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** callbacks.c 20 Jul 2004 15:07:03 -0000 1.55 --- callbacks.c 23 Jul 2004 10:06:46 -0000 1.56 *************** *** 88,91 **** --- 88,92 ---- */ static void _CallPythonObject(void *mem, + ffi_type *restype, SETFUNC setfunc, PyObject *callable, *************** *** 172,176 **** PyErr_Print(); } else if (result != Py_None) { ! PyObject *keep = setfunc(mem, result, 0); if (keep == NULL) { Extend_Error_Info("(callback return type) "); --- 173,207 ---- PyErr_Print(); } else if (result != Py_None) { ! /* another big endian hack */ ! struct { ! char c; ! short s; ! int i; ! long l; ! } r; ! PyObject *keep; ! switch (restype->size) { ! case 1: ! keep = setfunc(&r, result, 0); ! *(int *)mem = r.c; ! break; ! case SIZEOF_SHORT: ! keep = setfunc(&r, result, 0); ! *(int *)mem = r.s; ! break; ! case SIZEOF_INT: ! keep = setfunc(&r, result, 0); ! *(int *)mem = r.i; ! break; ! #if (SIZEOF_LONG != SIZEOF_INT) ! case SIZEOF_LONG: ! keep = setfunc(&r, result, 0); ! *(long *)mem = r.l; ! break; ! #endif ! default: ! keep = setfunc(mem, result, 0); ! break; ! } if (keep == NULL) { Extend_Error_Info("(callback return type) "); *************** *** 200,203 **** --- 231,235 ---- PyObject *callable; SETFUNC setfunc; + ffi_type *restype; ffi_type *atypes[0]; } ffi_info; *************** *** 211,214 **** --- 243,247 ---- _CallPythonObject(resp, + p->restype, p->setfunc, p->callable, *************** *** 244,251 **** { StgDictObject *dict = PyType_stgdict(restype); ! if (dict) p->setfunc = dict->setfunc; ! else p->setfunc = getentry("i")->setfunc; } --- 277,287 ---- { StgDictObject *dict = PyType_stgdict(restype); ! if (dict) { p->setfunc = dict->setfunc; ! p->restype = &dict->restype; ! } else { p->setfunc = getentry("i")->setfunc; + p->restype = &ffi_type_sint; + } } |
From: Thomas H. <th...@us...> - 2004-07-23 09:09:17
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3018 Modified Files: callproc.c Log Message: Revert last checkin, BYTEORDER doesn't exist. Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** callproc.c 23 Jul 2004 08:59:39 -0000 1.89 --- callproc.c 23 Jul 2004 09:09:06 -0000 1.90 *************** *** 728,734 **** dict = PyType_stgdict(restype); if (dict && dict->getfunc) { - /* ffi.h defines the endianness: - 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ - #if (BYTEORDER == 4321) /* This hack is needed for big endian machines. Is there another way? --- 728,731 ---- *************** *** 754,758 **** #endif } - #endif return dict->getfunc(&result->value, dict->size); } --- 751,754 ---- |
From: Thomas H. <th...@us...> - 2004-07-23 08:59:54
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1668 Modified Files: callproc.c Log Message: Use the endianness that ffi.h detected to protect the little hack. Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** callproc.c 22 Jul 2004 20:12:49 -0000 1.88 --- callproc.c 23 Jul 2004 08:59:39 -0000 1.89 *************** *** 728,731 **** --- 728,734 ---- dict = PyType_stgdict(restype); if (dict && dict->getfunc) { + /* ffi.h defines the endianness: + 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ + #if (BYTEORDER == 4321) /* This hack is needed for big endian machines. Is there another way? *************** *** 751,754 **** --- 754,758 ---- #endif } + #endif return dict->getfunc(&result->value, dict->size); } |
From: Thomas H. <th...@us...> - 2004-07-22 20:12:57
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21647 Modified Files: callproc.c Log Message: Hack to make functions work on big endian machines. Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** callproc.c 23 Jun 2004 16:26:13 -0000 1.87 --- callproc.c 22 Jul 2004 20:12:49 -0000 1.88 *************** *** 727,735 **** dict = PyType_stgdict(restype); ! if (dict && dict->getfunc) ! /* We don't do size-checking, we assume PrepareResult ! has already done it. */ return dict->getfunc(&result->value, dict->size); ! if (PyCallable_Check(restype)) return PyObject_CallFunction(restype, "i", --- 727,756 ---- dict = PyType_stgdict(restype); ! if (dict && dict->getfunc) { ! /* This hack is needed for big endian machines. ! Is there another way? ! */ ! char c; ! short s; ! int i; ! long l; ! switch (dict->size) { ! case 1: ! c = (char)result->value.l; ! return dict->getfunc(&c, dict->size); ! case SIZEOF_SHORT: ! s = (short)result->value.l; ! return dict->getfunc(&s, dict->size); ! case SIZEOF_INT: ! i = (int)result->value.l; ! return dict->getfunc(&i, dict->size); ! #if (SIZEOF_LONG != SIZEOF_INT) ! case SIZEOF_LONG: ! l = (long)result->value.l; ! return dict->getfunc(&l, dict->size); ! #endif ! } return dict->getfunc(&result->value, dict->size); ! } if (PyCallable_Check(restype)) return PyObject_CallFunction(restype, "i", |