Skip to content

BUG: ticket #1805, replace type char by signed char for tables. #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

charris
Copy link
Member

@charris charris commented Apr 22, 2011

The char type can be either signed or unsigned, the tables used for the type promotions need signed characters.

@charris
Copy link
Member Author

charris commented Apr 22, 2011

There are other uses of char that cause problems when it is unsigned, so this patch is incomplete. However, it does allow numpy to run so that it can be tested.

@mwiebe
Copy link
Member

mwiebe commented Apr 22, 2011

I expect the issue with the nditer perm should be a straightforward substitution of 'char' with 'signed char' or 'npy_int8' (maybe more clear) in the right places. Do you want to do that, or would you prefer I jump in?

@charris
Copy link
Member Author

charris commented Apr 22, 2011

I've had the same thought of using 'npy_int8' for clarity, it seems more numeric. Last night I made a quick substitution in nditer and the macros just to see what happened and ended up with a lot of cast warnings, so that will take a bit of work but should be straightforward. The warnings should help get everything right. I think you would have an easier time there since you know which char variables you used for numeric purposes as opposed to simple buffering, flags, etc.

@charris
Copy link
Member Author

charris commented Apr 23, 2011

This isn't as trivial as it looks at first, there are a lot of block level variables and explicit casts to (char) that the compiler doesn't flag, so making sure all instances are fixed isn't a sure thing. The iterator tests pass with the update, but the einsum tests are still failing.

@mwiebe
Copy link
Member

mwiebe commented Apr 23, 2011

I pushed your changes together with a fix for the einsum fix (bug was in the label parsing). Do you want to add your newest commit which I didn't notice, validate my changes, and close up the bug?

@charris
Copy link
Member Author

charris commented Apr 23, 2011

I added the last little commit and pushed it upstream. All the tests pass here but I'll make another check of the source tomorrow to see if I missed anything obvious. But I think this pull request can be closed.

@charris charris closed this Apr 23, 2011
fangerer pushed a commit to hpyproject/numpy-hpy that referenced this pull request Dec 12, 2022
Merge in ~STEPAN.SINDELAR_ORACLE.COM/numpy-hpy from mq/GR-40304 to labs-hpy-port

* commit 'f5a2c9c3ef2b8b13a7615410283a933df28eb3f7':
  doc update
  Revert "'HPyArrayDescr_Type' cannot be used in shared libraries"
  generate sources for _HPyArrayScalar_BoolValues
  clean up warnings
  Generate a multiarray HPy API
luyahan pushed a commit to plctlab/numpy that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants