Skip to content
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

Make os::SurfaceFormat an enum class #4414

Closed

Conversation

martincapello
Copy link
Member

@martincapello martincapello commented Apr 11, 2024

These changes should be merged once the following commit is merged: aseprite/laf@6406feb

Copy link
Collaborator

@aseprite-bot aseprite-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -36,7 +36,7 @@ uint32_t convert_color_to_surface(color_t color, const Palette* palette, const I
}

template<>
uint32_t convert_color_to_surface<RgbTraits, os::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
uint32_t convert_color_to_surface<RgbTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'palette' is unused [misc-unused-parameters]

uint32_t convert_color_to_surface<RgbTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
                                                                                                              ^

this fix will not be applied because it overlaps with another fix

@@ -36,7 +36,7 @@
}

template<>
uint32_t convert_color_to_surface<RgbTraits, os::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
uint32_t convert_color_to_surface<RgbTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'spec' is unused [misc-unused-parameters]

uint32_t convert_color_to_surface<RgbTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
                                                                                                                                        ^

this fix will not be applied because it overlaps with another fix

@@ -45,7 +45,7 @@
}

template<>
uint32_t convert_color_to_surface<GrayscaleTraits, os::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
uint32_t convert_color_to_surface<GrayscaleTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'palette' is unused [misc-unused-parameters]

uint32_t convert_color_to_surface<GrayscaleTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
                                                                                                                    ^

this fix will not be applied because it overlaps with another fix

@@ -45,7 +45,7 @@
}

template<>
uint32_t convert_color_to_surface<GrayscaleTraits, os::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
uint32_t convert_color_to_surface<GrayscaleTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'spec' is unused [misc-unused-parameters]

uint32_t convert_color_to_surface<GrayscaleTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
                                                                                                                                              ^

this fix will not be applied because it overlaps with another fix

@@ -54,7 +54,7 @@
}

template<>
uint32_t convert_color_to_surface<IndexedTraits, os::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
uint32_t convert_color_to_surface<IndexedTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function template specialization 'app::(anonymous namespace)::convert_color_to_surface<doc::IndexedTraits, os::kRgbaSurfaceFormat>' has a primary template declaration with different parameter names [readability-inconsistent-declaration-parameter-name]

uint32_t convert_color_to_surface<IndexedTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
         ^
Additional context

src/app/util/conversion_to_surface.cpp:32: the primary template declaration seen here

uint32_t convert_color_to_surface(color_t color, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
         ^

src/app/util/conversion_to_surface.cpp:56: differing parameters are named here: ('c0'), in primary template declaration: ('color')

uint32_t convert_color_to_surface<IndexedTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
         ^

@@ -64,7 +64,7 @@
}

template<>
uint32_t convert_color_to_surface<BitmapTraits, os::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
uint32_t convert_color_to_surface<BitmapTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function template specialization 'app::(anonymous namespace)::convert_color_to_surface<doc::BitmapTraits, os::kRgbaSurfaceFormat>' has a primary template declaration with different parameter names [readability-inconsistent-declaration-parameter-name]

uint32_t convert_color_to_surface<BitmapTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
         ^
Additional context

src/app/util/conversion_to_surface.cpp:32: the primary template declaration seen here

uint32_t convert_color_to_surface(color_t color, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
         ^

src/app/util/conversion_to_surface.cpp:66: differing parameters are named here: ('c0'), in primary template declaration: ('color')

uint32_t convert_color_to_surface<BitmapTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
         ^

@@ -64,7 +64,7 @@
}

template<>
uint32_t convert_color_to_surface<BitmapTraits, os::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
uint32_t convert_color_to_surface<BitmapTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'spec' is unused [misc-unused-parameters]

uint32_t convert_color_to_surface<BitmapTraits, os::SurfaceFormat::kRgbaSurfaceFormat>(color_t c0, const Palette* palette, const ImageSpec& spec, const os::SurfaceFormatData* fd) {
                                                                                                                                            ^

this fix will not be applied because it overlaps with another fix

@dacap
Copy link
Member

dacap commented Apr 15, 2024

Adding a link to the PR (instead to the commit) just to find it faster: aseprite/laf#83

@dacap
Copy link
Member

dacap commented May 6, 2024

Closing this PR as aseprite/laf#83 was updated to avoid this refactor.

@dacap dacap closed this May 6, 2024
@martincapello martincapello deleted the surfaceFormat-as-enum-class branch May 9, 2024 14:56
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.

None yet

3 participants