Skip to content

Commit

Permalink
Revert "Don't cast getter function pointers"
Browse files Browse the repository at this point in the history
This reverts commit a2f6548.
  • Loading branch information
Hood committed Nov 15, 2021
1 parent a2f6548 commit b083f13
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 62 deletions.
12 changes: 6 additions & 6 deletions src/_imaging.c
Expand Up @@ -3568,12 +3568,12 @@ _getattr_unsafe_ptrs(ImagingObject *self, void *closure) {
};

static struct PyGetSetDef getsetters[] = {
{"mode", _getattr_mode},
{"size", _getattr_size},
{"bands", _getattr_bands},
{"id", _getattr_id},
{"ptr", _getattr_ptr},
{"unsafe_ptrs", _getattr_unsafe_ptrs},
{"mode", (getter)_getattr_mode},
{"size", (getter)_getattr_size},
{"bands", (getter)_getattr_bands},
{"id", (getter)_getattr_id},
{"ptr", (getter)_getattr_ptr},
{"unsafe_ptrs", (getter)_getattr_unsafe_ptrs},
{NULL}};

/* basic sequence semantics */
Expand Down
88 changes: 44 additions & 44 deletions src/_imagingcms.c
Expand Up @@ -1370,52 +1370,52 @@ cms_profile_getattr_icc_viewing_condition(CmsProfileObject *self, void *closure)

static struct PyGetSetDef cms_profile_getsetters[] = {
/* New style interfaces. */
{"rendering_intent", cms_profile_getattr_rendering_intent},
{"creation_date", cms_profile_getattr_creation_date},
{"copyright", cms_profile_getattr_copyright},
{"target", cms_profile_getattr_target},
{"manufacturer", cms_profile_getattr_manufacturer},
{"model", cms_profile_getattr_model},
{"profile_description", cms_profile_getattr_profile_description},
{"screening_description", cms_profile_getattr_screening_description},
{"viewing_condition", cms_profile_getattr_viewing_condition},
{"version", cms_profile_getattr_version},
{"icc_version", cms_profile_getattr_icc_version},
{"attributes", cms_profile_getattr_attributes},
{"header_flags", cms_profile_getattr_header_flags},
{"header_manufacturer", cms_profile_getattr_header_manufacturer},
{"header_model", cms_profile_getattr_header_model},
{"device_class", cms_profile_getattr_device_class},
{"connection_space", cms_profile_getattr_connection_space},
{"xcolor_space", cms_profile_getattr_xcolor_space},
{"profile_id", cms_profile_getattr_profile_id},
{"is_matrix_shaper", cms_profile_getattr_is_matrix_shaper},
{"technology", cms_profile_getattr_technology},
{"colorimetric_intent", cms_profile_getattr_colorimetric_intent},
{"rendering_intent", (getter)cms_profile_getattr_rendering_intent},
{"creation_date", (getter)cms_profile_getattr_creation_date},
{"copyright", (getter)cms_profile_getattr_copyright},
{"target", (getter)cms_profile_getattr_target},
{"manufacturer", (getter)cms_profile_getattr_manufacturer},
{"model", (getter)cms_profile_getattr_model},
{"profile_description", (getter)cms_profile_getattr_profile_description},
{"screening_description", (getter)cms_profile_getattr_screening_description},
{"viewing_condition", (getter)cms_profile_getattr_viewing_condition},
{"version", (getter)cms_profile_getattr_version},
{"icc_version", (getter)cms_profile_getattr_icc_version},
{"attributes", (getter)cms_profile_getattr_attributes},
{"header_flags", (getter)cms_profile_getattr_header_flags},
{"header_manufacturer", (getter)cms_profile_getattr_header_manufacturer},
{"header_model", (getter)cms_profile_getattr_header_model},
{"device_class", (getter)cms_profile_getattr_device_class},
{"connection_space", (getter)cms_profile_getattr_connection_space},
{"xcolor_space", (getter)cms_profile_getattr_xcolor_space},
{"profile_id", (getter)cms_profile_getattr_profile_id},
{"is_matrix_shaper", (getter)cms_profile_getattr_is_matrix_shaper},
{"technology", (getter)cms_profile_getattr_technology},
{"colorimetric_intent", (getter)cms_profile_getattr_colorimetric_intent},
{"perceptual_rendering_intent_gamut",
cms_profile_getattr_perceptual_rendering_intent_gamut},
(getter)cms_profile_getattr_perceptual_rendering_intent_gamut},
{"saturation_rendering_intent_gamut",
cms_profile_getattr_saturation_rendering_intent_gamut},
{"red_colorant", cms_profile_getattr_red_colorant},
{"green_colorant", cms_profile_getattr_green_colorant},
{"blue_colorant", cms_profile_getattr_blue_colorant},
{"red_primary", cms_profile_getattr_red_primary},
{"green_primary", cms_profile_getattr_green_primary},
{"blue_primary", cms_profile_getattr_blue_primary},
(getter)cms_profile_getattr_saturation_rendering_intent_gamut},
{"red_colorant", (getter)cms_profile_getattr_red_colorant},
{"green_colorant", (getter)cms_profile_getattr_green_colorant},
{"blue_colorant", (getter)cms_profile_getattr_blue_colorant},
{"red_primary", (getter)cms_profile_getattr_red_primary},
{"green_primary", (getter)cms_profile_getattr_green_primary},
{"blue_primary", (getter)cms_profile_getattr_blue_primary},
{"media_white_point_temperature",
cms_profile_getattr_media_white_point_temperature},
{"media_white_point", cms_profile_getattr_media_white_point},
{"media_black_point", cms_profile_getattr_media_black_point},
{"luminance", cms_profile_getattr_luminance},
{"chromatic_adaptation", cms_profile_getattr_chromatic_adaptation},
{"chromaticity", cms_profile_getattr_chromaticity},
{"colorant_table", cms_profile_getattr_colorant_table},
{"colorant_table_out", cms_profile_getattr_colorant_table_out},
{"intent_supported", cms_profile_getattr_is_intent_supported},
{"clut", cms_profile_getattr_is_clut},
(getter)cms_profile_getattr_media_white_point_temperature},
{"media_white_point", (getter)cms_profile_getattr_media_white_point},
{"media_black_point", (getter)cms_profile_getattr_media_black_point},
{"luminance", (getter)cms_profile_getattr_luminance},
{"chromatic_adaptation", (getter)cms_profile_getattr_chromatic_adaptation},
{"chromaticity", (getter)cms_profile_getattr_chromaticity},
{"colorant_table", (getter)cms_profile_getattr_colorant_table},
{"colorant_table_out", (getter)cms_profile_getattr_colorant_table_out},
{"intent_supported", (getter)cms_profile_getattr_is_intent_supported},
{"clut", (getter)cms_profile_getattr_is_clut},
{"icc_measurement_condition",
cms_profile_getattr_icc_measurement_condition},
{"icc_viewing_condition", cms_profile_getattr_icc_viewing_condition},
(getter)cms_profile_getattr_icc_measurement_condition},
{"icc_viewing_condition", (getter)cms_profile_getattr_icc_viewing_condition},

{NULL}};

Expand Down Expand Up @@ -1467,8 +1467,8 @@ cms_transform_getattr_outputMode(CmsTransformObject *self, void *closure) {
}

static struct PyGetSetDef cms_transform_getsetters[] = {
{"inputMode", cms_transform_getattr_inputMode},
{"outputMode", cms_transform_getattr_outputMode},
{"inputMode", (getter)cms_transform_getattr_inputMode},
{"outputMode", (getter)cms_transform_getattr_outputMode},
{NULL}};

static PyTypeObject CmsTransform_Type = {
Expand Down
16 changes: 8 additions & 8 deletions src/_imagingft.c
Expand Up @@ -1281,14 +1281,14 @@ font_getattr_glyphs(FontObject *self, void *closure) {
}

static struct PyGetSetDef font_getsetters[] = {
{"family", font_getattr_family},
{"style", font_getattr_style},
{"ascent", font_getattr_ascent},
{"descent", font_getattr_descent},
{"height", font_getattr_height},
{"x_ppem", font_getattr_x_ppem},
{"y_ppem", font_getattr_y_ppem},
{"glyphs", font_getattr_glyphs},
{"family", (getter)font_getattr_family},
{"style", (getter)font_getattr_style},
{"ascent", (getter)font_getattr_ascent},
{"descent", (getter)font_getattr_descent},
{"height", (getter)font_getattr_height},
{"x_ppem", (getter)font_getattr_x_ppem},
{"y_ppem", (getter)font_getattr_y_ppem},
{"glyphs", (getter)font_getattr_glyphs},
{NULL}};

static PyTypeObject Font_Type = {
Expand Down
2 changes: 1 addition & 1 deletion src/decode.c
Expand Up @@ -249,7 +249,7 @@ static struct PyMethodDef methods[] = {

static struct PyGetSetDef getseters[] = {
{"pulls_fd",
_get_pulls_fd,
(getter)_get_pulls_fd,
NULL,
"True if this decoder expects to pull from self.fd itself.",
NULL},
Expand Down
2 changes: 1 addition & 1 deletion src/display.c
Expand Up @@ -246,7 +246,7 @@ _getattr_size(ImagingDisplayObject *self, void *closure) {
}

static struct PyGetSetDef getsetters[] = {
{"mode", _getattr_mode}, {"size", _getattr_size}, {NULL}};
{"mode", (getter)_getattr_mode}, {"size", (getter)_getattr_size}, {NULL}};

static PyTypeObject ImagingDisplayType = {
PyVarObject_HEAD_INIT(NULL, 0) "ImagingDisplay", /*tp_name*/
Expand Down
2 changes: 1 addition & 1 deletion src/encode.c
Expand Up @@ -315,7 +315,7 @@ static struct PyMethodDef methods[] = {

static struct PyGetSetDef getseters[] = {
{"pushes_fd",
_get_pushes_fd,
(getter)_get_pushes_fd,
NULL,
"True if this decoder expects to push directly to self.fd",
NULL},
Expand Down
2 changes: 1 addition & 1 deletion src/path.c
Expand Up @@ -537,7 +537,7 @@ path_getattr_id(PyPathObject *self, void *closure) {
return Py_BuildValue("n", (Py_ssize_t)self->xy);
}

static struct PyGetSetDef getsetters[] = {{"id", path_getattr_id}, {NULL}};
static struct PyGetSetDef getsetters[] = {{"id", (getter)path_getattr_id}, {NULL}};

static PyObject *
path_subscript(PyPathObject *self, PyObject *item) {
Expand Down

0 comments on commit b083f13

Please sign in to comment.