Skip to content

Add default case to switch - #10306

Merged
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:warning
Oct 25, 2026
Merged

hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:warning

Conversation

@radarhere

Copy link
Copy Markdown
Member

Compiling locally, I found that #10122 introduced

  src/libImaging/Geometry.c:670:13: warning: 5 enumeration values not handled in switch: 'IMAGING_TRANSFORM_LANCZOS', 'IMAGING_TRANSFORM_BOX', 'IMAGING_TRANSFORM_HAMMING'... [-Wswitch]
    670 |     switch (filterid) {
        |             ^~~~~~~~
...
  src/libImaging/Geometry.c:670:13: note: add missing switch cases
    670 |     switch (filterid) {
        |             ^
    671 |         case IMAGING_TRANSFORM_NEAREST:
    672 |             if (im->image8) {
    673 |                 switch (im->type) {
    674 |                     case IMAGING_TYPE_UINT8:
    675 |                         return nearest_filter8;
    676 |                     case IMAGING_TYPE_I16:
    677 |                         return nearest_filter16;
    678 |                 }
    679 |             } else {
    680 |                 return nearest_filter32;
    681 |             }
    682 |             break;
    683 |         case IMAGING_TRANSFORM_BILINEAR:

This PR adds a default case to the switch.

@hugovk
hugovk merged commit f58197e into python-pillow:main Oct 25, 2026
58 of 59 checks passed
@radarhere
radarhere deleted the warning branch October 25, 2026 12:58
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