| Summary: | Remove unnecessary comparison and casting in GlyphBuffer.h | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Eleni Maria Stea <estea> | ||||
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | UNCONFIRMED --- | ||||||
| Severity: | Trivial | CC: | e.barg0089, ews-watchlist, mmaxfield, sam, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Local Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Eleni Maria Stea
2021-05-10 05:54:09 PDT
Created attachment 428166 [details]
Patch
I had only built this on Linux/GCC and received warnings about unsigned which were fixed when I removed the cast. But it seems that it was required (EWS failure) above. This bug report is invalid. Comment on attachment 428166 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=428166&action=review > Source/WebCore/platform/graphics/GlyphBuffer.h:81 > - if (result < 0 || static_cast<unsigned>(result) >= stringLength) > + if (result >= stringLength) This is not true on all platforms. When USE(CG) is true, GlyphBufferStringOffset (the type of result) is CFIndex which is 'signed long'. The real issue that we should try to solve is using the same types here if we can. Re-opening, I think we should at least see if we can converge on the same type. Myles do you know Myles, can you think of anything good we can do to make it so non-CG ports and CG ports can use these types consistently? I agree, sorry I closed it. Besides I think that at least the part where we check it's < 0 should be removed because we always use unsigned: either unsigned int or unsigned long Comment on attachment 428166 [details]
Patch
Remove bug
Comment on attachment 428166 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=428166&action=review > Source/WebCore/platform/graphics/GlyphBuffer.h:79 > { Revert all properties Well, as I said above, USE(CG) uses CFIndex which is signed (either signed long or signed long long). |