Bug 252666

Summary: Fix JPEGImageDecoder boolean enum and #define TRUE/FALSE mix
Product: WebKit Reporter: Giulio Benetti <giulio.benetti>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Linux   
Attachments:
Description Flags
Fix JPEGImageDecoder boolean enum and #define TRUE/FALSE mix
none
Fix JPEGImageDecoder boolean enum and #define TRUE/FALSE mix
mcatanzaro: review+, mcatanzaro: commit-queue-
Fix JPEGImageDecoder boolean enum and #define TRUE/FALSE mix none

Description Giulio Benetti 2023-02-21 07:57:14 PST
Created attachment 465108 [details]
Fix JPEGImageDecoder boolean enum and #define TRUE/FALSE mix

jpeglib.h contains a typedef enum for boolean type but LCMSUniquePtr.h include files that can contain #define TRUE/FALSE.
This way build fails with:
JPEGImageDecoder.cpp:343:43: error: invalid conversion from ‘int’ to ‘boolean’

This is because TRUE or FALSE should be an enum instead they get defined as 1 or 0.
Comment 1 Giulio Benetti 2023-02-21 08:08:03 PST
Created attachment 465109 [details]
Fix JPEGImageDecoder boolean enum and #define TRUE/FALSE mix

Fix JPEGImageDecoder boolean enum and #define TRUE/FALSE mix
https://bugs.webkit.org/show_bug.cgi?id=252666

Reviewed by NOBODY (OOPS!).

jpeglib.h contains a typedef enum for boolean type but LCMSUniquePtr.h
include files that can contain #define TRUE/FALSE. This way build fails
with:
JPEGImageDecoder.cpp:343:43: error: invalid conversion from ‘int’ to ‘boolean’

This is because TRUE or FALSE should be an enum instead they get defined
as 1 or 0. To fix this move jpeglib.h inclusion after LCMSUniquePtr.h
inclusion.

Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h:
Comment 2 Michael Catanzaro 2023-02-21 09:15:51 PST
Comment on attachment 465109 [details]
Fix JPEGImageDecoder boolean enum and #define TRUE/FALSE mix

View in context: https://bugs.webkit.org/attachment.cgi?id=465109&action=review

Sigh, OK....

> Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h:41
> +#include "jpeglib.h"

Preexisting issue: should be #include <jpeglib.h>
Comment 3 Giulio Benetti 2023-02-21 09:51:52 PST
Created attachment 465111 [details]
Fix JPEGImageDecoder boolean enum and #define TRUE/FALSE mix

I've just pushed --force to branch and attached I use angular parenthesis.
Comment 4 EWS 2023-02-21 15:05:15 PST
Committed 260633@main (360f2f938bba): <https://commits.webkit.org/260633@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 465111 [details].