Commit Graph

16 Commits

Author SHA1 Message Date
wiredfool
4b4ef5f1e2 Malloc check, realloc, #1715 2016-06-08 06:21:38 -07:00
wiredfool
c589ae6bcf Change return type of PyPath_Flatten to Py_ssize_t to match PyObject_Length 2016-06-08 06:21:38 -07:00
wiredfool
b1a190ad78 mixed 8c tabs+spaces -> spaces 2016-06-08 06:21:38 -07:00
wiredfool
c6ec3be0d6 Fix for integer overflow in path.c 2016-03-15 19:56:40 +00:00
Alex Clark
bb1b3a532c Cleanup WS, courtesy of @Arfrever
find * -type f "-(" -name "*.bdf" -o -name "*.c" -o -name "*.h" -o -name "*.py" -o -name "*.rst" -o -name "*.txt" "-)" -exec sed -e "s/[[:space:]]*$//" -i {} \;
2013-06-30 18:42:19 -04:00
wiredfool
3662e34ff1 changed PY_VERSION_HEX, fixes https://github.com/python-imaging/Pillow/issues/166 2013-04-12 15:34:15 -07:00
Alex Clark ☺
88b712f79c Merge pull request #81 from cgohlke/patch-2
64 bit proof alloc_array
2013-03-08 12:59:47 -08:00
Christoph Gohlke
e5a7b63151 Use correct PyArg_ParseTuple format for Py_ssize_t 2013-03-08 12:13:10 -08:00
Christoph Gohlke
2e70b054a9 64 bit proof path_getattr_id 2013-03-08 10:13:50 -08:00
Christoph Gohlke
1c189b3f2c 64 bit proof alloc_array 2013-03-08 09:51:22 -08:00
Brian Crowell
a8599e8bb2 py3k: Remove ancient Python hacks 2013-01-10 08:46:57 -06:00
Christoph Gohlke
be560f00f5 py3k: Allow slicing for paths
This is Gohlke's fix for two issues: negative indexes on paths were not
resolved to the correct index, and path slicing didn't work.

His fix for slicing is related to the one found at:

  http://renesd.blogspot.com/2009/07/python3-c-api-simple-slicing-sqslice.html

With this commit, all 79 tests (82 minus the three skipped ones) run
successfully on Python 2.6.8, Python 2.7.3rc2, and Python 3.2.3.
2013-01-10 08:46:57 -06:00
Brian Crowell
af5228896a py3k: Add module initialization and unicode/bytes int/long thunks
This commit:

* Adds Python 3 module initialization functions. I split out the main init
  of each module into a static setup_module function.
* Adds a py3.h which unifies int/long in Python 3 and unicode/bytes in
  Python 2. _imagingft.c unfortunately looks a little kludgy after this
  because it was already using PyUnicode functions, and I had to mix and
  match there manually.

With this commit, the modules all build successfully under Python 3.

What this commit does NOT do is patch all of the uses of PyArg_ParseTuple
and Py_BuildValue, which all need to be checked for proper use of bytes
and unicode codes. It also does not let selftest.py run yet, because there
are probably hundreds of issues to fix in the Python code itself.
2013-01-10 08:46:37 -06:00
Brian Crowell
804095ecb3 py3k: Use new buffer protocol
Other ports have taken advantage of the fact that Python 3 has wrappers for
the old buffer protocol, but there's a significant disadvantage: you can't
let the buffered object know when you're done with it.

Since Python 2.6 supports the new protocol, we just go ahead and move to
it.
2013-01-10 08:46:35 -06:00
Brian Crowell
9519013466 py3k: Modernize type declarations
This updates several Python type definitions and uses to bring us closer
to Python 3 compatibility. This includes:

* Replacing staticforward and statichere with static. These were a hack for
  old compilers and are not supported/needed anymore.
* Using Py_TYPE() instead of ob_type; ob_type is hidden in Py3.
* Replacing getattr with getters/setters. getattr is sort-of supported in
  Py3, but Py_FindMethod is not. So we just use the newer
  methods/getsetters mechanisms and start using PyType_Ready everywhere.
* Use PyVarObject_HEAD_INIT for types, since types are PyVarObject.
* Use PyMODINIT_FUNC for module initialization functions.

There are some tab/space issues in this commit. I'm set for spaces; the
source is a little schizo.
2013-01-10 08:46:34 -06:00
Alex Clark
9a640e3157 Forking PIL 2010-07-30 22:52:47 -04:00