TST: mark gen_alignment_data private

it not very useful outside numpy and there might be changes required in
future e.g. to add min_size.
Merge pull request #3791 from juliantaylor/simd-gen-private

TST: mark gen_alignment_data private
BUG: Fix failed import of mlab.

Fix imports in the numpy/oldnumeric/mlab.py module.  The problem was
that the module used imports of the form

from . import compat

which do not work as '.' is apparently undefined when the module import
is attempted. The fix is ugly, but it works and the oldnumeric module is
going away in 1.9.

Closes #3803.
Merge pull request #3805 from charris/fix-mlab-import

Fix mlab import
BUG: do a boolean check on casting bool to other types

avoids some issues of booleans coming from external buffers that may not
only contain 0 or 1.
closes #3801.
BUG: INCREF before DECREF when copying object arrays.

Only the change in dtype_transfer actually seems to be
related to the simple np.copyto(a, a) bug, when a is a scalar
object array.
It seemed however safer to me, to generally turn around the
logic, even if it may not be necessary and in one place
requires an extra temporary variable.

Closes gh-3787
BUG: fix hashing of long integers under python3

python3 long_hash is more complex than int_hash so instead of copying
into numpy call it via the Python capi.
Same for long long for wich the numpy hash function is not correct with
python 2.7 on i386.
Will be slower but doesn't need adapting each timy python changes.
closes #3793
Merge pull request #3811 from charris/backport-1.8-3802

Backport 1.8 3802
Merge pull request #3809 from charris/backport-1.8-3800

Backport 1.8 3800
[fix] Check for errors in PyArray_CanCastTypeto DEPRECATE

If a user had set warnings to raise errors, then this DEPRECATE would
leave us with an unpropagated exception and cause havoc downstream.

Unfortunately there is no way to propagate an exception from here, so
we just have to throw it away :-(. But this is still better than the
alternative...
[fix] If we fail to raise an error, at least dump something to the console
Merge pull request #3814 from charris/backport-1.8-3806

Backport 1.8 3806
Merge pull request #3810 from charris/backport-1.8-3788

Backport 1.8 3788