-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
_imaging module cleanup #8389
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
base: main
Are you sure you want to change the base?
_imaging module cleanup #8389
Conversation
| #include "Imaging.h" | ||
|
|
||
| #include <math.h> | ||
| #include <stdint.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the reason I think we can rely on C99 is stdint.h was included here unconditionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default standard used by GCC on CentOS 7 was gnu90, which is not C99, but does support stdint.h. CentOS 7 is no longer supported though. The conclusion from this discussion (#6516) was essentially that if it compiles in all of the test environments, it's okay to use.
| #if defined(_MSC_VER) && !defined(__GNUC__) | ||
| #define inline __inline | ||
| #endif | ||
| #endif | ||
|
|
||
| #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will examine this and return if needed:
#5807
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not completely clear on your meaning - reconsidering this change is a to-do item for yourself before this PR is ready for merge?
# Conflicts: # setup.py
Move new_block method to _imaging remove _imaging.convert method
Remove unused module Remove ImagingError_Clear alias Do not set PyExc_TypeError after PySequence_Fast Remove ImagingError_OSError alias Use PyErr_Format when possible
Co-authored-by: Andrew Murray <[email protected]>
Co-authored-by: Andrew Murray <[email protected]>
Includes some useful changers from #8340.
Improvements
MAXandMINtoImagingUtils.h517f16bImPlatform.his renamed toImagingPlatform.hd73e8c2#undef *INT*moved toJpeg.h8909052#define *INT*by requiringstdint.h(C99) 92bf691#include <Python.h>once inImaging.h84f0261#include <math.h>inImagingPlatform.hfbd4c98<*.h>instead of"*.h"108602badd-imaging-libsoption (is not documented, not sure why we need it) c3172e8PyImaging_CheckBufferandPyImaging_GetBuffere972962Py_RETURN_NONEmacro when possible f58cd7dHAVE_LIBMPEGffa0230new_blockmethod to_imagingand fix some functions arguments type e7bce42core.convertfunction e7bce42Imaging_Typechecking in_convertb89f791PyErr_Formatinstead ofsprintf, use nativePyErr_Clearfunction, remove extraPyExc_TypeErrorafterPySequence_Fast, remove unusedExcept.cfile 05a67d1