Skip to content

Commit

Permalink
[release-0.5.5.3] FIX #75
Browse files Browse the repository at this point in the history
  • Loading branch information
marscher committed Aug 11, 2014
1 parent 6e217b2 commit a4fb25e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
14 changes: 7 additions & 7 deletions doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ Changelog

This changelog *only* contains changes from the *first* pypi release (0.5.4.3) onwards.

0.5.5.3 (to be released)
----------------------
* Optional support for NumPy arrays in handling of Java Arrays. Both set and get
0.5.5.3
-------
* Optional support for NumPy arrays in handling of Java arrays. Both set and get
slice operators are supported. Speed improvement of factor 10 for setting and
factor 6 for getting. The returned arrays are typed with the matching NumPy type.
* Fix: add missing wrapper type 'JShort'
* Fix: Conversion check for unsigned types did not work in array setters (tautological compare)

0.5.5.2
----------------------
-------
* Fix: array setter memory leak (ISSUE: #64)

0.5.5.1
----------------------
-------
* Fix: setup.py now runs under MacOSX with Python 2.6 (referred to missing subprocess function)

0.5.5
----------------------
0.5.5
-----

*Note* that this release is *not* compatible with Python 2.5 anymore!

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,13 @@ class my_build_ext(build_ext):
def initialize_options(self, *args):
from distutils.sysconfig import get_config_vars
(opt,) = get_config_vars('OPT')
os.environ['OPT'] = ' '.join(flag for flag in opt.split() if flag != '-Wstrict-prototypes')
os.environ['OPT'] = ' '.join(flag for flag in opt.split()
if flag and flag != '-Wstrict-prototypes')
build_ext.initialize_options(self)

setup(
name='JPype1',
version='0.5.5.2',
version='0.5.5.3',
description='A Python to Java bridge.',
long_description=(read_utf8('README.rst') + '\n\n' +
read_utf8('doc/CHANGELOG.rst') + '\n\n' +
Expand Down
7 changes: 3 additions & 4 deletions src/native/common/jp_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ void JPArray::setRange(int start, int stop, vector<HostRef*>& val)
void JPArray::setRange(int start, int stop, PyObject* sequence)
{
JPType* compType = m_Class->getComponentType();

unsigned int len = stop-start;
// check bounds of sequence which is to be assigned
HostRef* ptr = new HostRef(sequence);
unsigned int plength = JPEnv::getHost()->getSequenceLength(ptr);
delete ptr;
HostRef h(sequence);
unsigned int plength = JPEnv::getHost()->getSequenceLength(&h);

if (len != plength)
{
std::stringstream out;
Expand Down
5 changes: 3 additions & 2 deletions src/native/common/jp_primitivetypes_autogen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if(exe != NULL) \

template <typename jarraytype, typename jelementtype, typename setFnc>
inline bool
setViaBuffer(jarray array, int start, int length, PyObject* sequence, setFnc setter) {
setViaBuffer(jarray array, int start, uint length, PyObject* sequence, setFnc setter) {
//creates a PyMemoryView from sequence check for typeError,
// if no underlying py_buff exists.
if(! PyObject_CheckBuffer(sequence)) {
Expand All @@ -76,7 +76,8 @@ setViaBuffer(jarray array, int start, int length, PyObject* sequence, setFnc set
if ((py_buff->len / sizeof(jelementtype)) != length) {
std::stringstream ss;
ss << "Underlying buffer does not contain requested number of elements! Has "
<< py_buff->len << ", but " << length <<" are requested.";
<< py_buff->len << ", but " << length <<" are requested. Element size is "
<< sizeof(jelementtype);
RAISE(JPypeException, ss.str());
}

Expand Down

0 comments on commit a4fb25e

Please sign in to comment.