-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
_imaging module cleanup #8389
base: main
Are you sure you want to change the base?
_imaging module cleanup #8389
Conversation
@@ -34,9 +34,6 @@ | |||
|
|||
#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
MAX
andMIN
toImagingUtils.h
517f16bImPlatform.h
is renamed toImagingPlatform.h
d73e8c2#undef *INT*
moved toJpeg.h
8909052#define *INT*
by requiringstdint.h
(C99) 92bf691#include <Python.h>
once inImaging.h
84f0261#include <math.h>
inImagingPlatform.h
fbd4c98<*.h>
instead of"*.h"
108602badd-imaging-libs
option (is not documented, not sure why we need it) c3172e8PyImaging_CheckBuffer
andPyImaging_GetBuffer
e972962Py_RETURN_NONE
macro when possible f58cd7dHAVE_LIBMPEG
ffa0230new_block
method to_imaging
and fix some functions arguments type e7bce42core.convert
function e7bce42Imaging_Type
checking in_convert
b89f791PyErr_Format
instead ofsprintf
, use nativePyErr_Clear
function, remove extraPyExc_TypeError
afterPySequence_Fast
, remove unusedExcept.c
file 05a67d1