If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Signed/unsigned comparison build warnings PathCairo.cpp

RESOLVED FIXED in mozilla27

Status

()

Core
Graphics
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks: 1 bug)

Trunk
mozilla27
x86_64
Linux
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

4 years ago
Three build warnings in PathCairo.cpp:
{
gfx/2d/PathCairo.cpp:273:31 [-Wsign-compare] comparison between signed and unsigned integer expressions
gfx/2d/PathCairo.cpp:277:27 [-Wsign-compare] comparison between signed and unsigned integer expressions
gfx/2d/PathCairo.cpp:287:40 [-Wsign-compare] comparison between signed and unsigned integer expressions
}
(Assignee)

Updated

4 years ago
Blocks: 918613
(Assignee)

Comment 1

4 years ago
Created attachment 814718 [details] [diff] [review]
fix v1

The first and third loop variables are compared against vector::size(), which returns vector<foo>::size_type;  the second loop var is compared against 'uint32_t pointCount', so I made that one a uint32_t.  So I changed the loop vars' types to match.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #814718 - Flags: review?(jmuizelaar)
(Assignee)

Comment 2

4 years ago
Created attachment 814719 [details] [diff] [review]
fix v2 (using std::vector<cairo_path_data_t>::size_type) [Nope, this is too ugly]

oops; forgot to qref. That first patch used size_t instead of the more-pedantically-correct std::vector<cairo_path_data_t>::size_type (which this version uses)

(I'm happy with either; feel free to reject this and r+ the other patch if you'd prefer the concise version)
Attachment #814718 - Attachment is obsolete: true
Attachment #814718 - Flags: review?(jmuizelaar)
Attachment #814719 - Flags: review?(jmuizelaar)
(Assignee)

Comment 3

4 years ago
Comment on attachment 814719 [details] [diff] [review]
fix v2 (using std::vector<cairo_path_data_t>::size_type) [Nope, this is too ugly]

Actually, looks like Jeff's on vacation. Bas, could you review?

(If you're put off by the vector<...>::size_type cruft, see other patch for a prettier size_t version)
Attachment #814719 - Flags: review?(jmuizelaar) → review?(bas)
Comment on attachment 814718 [details] [diff] [review]
fix v1

Review of attachment 814718 [details] [diff] [review]:
-----------------------------------------------------------------

I sadly have to admit I prefer this even though it's strictly a tiny bit less correct :).
Attachment #814718 - Flags: review+
(Assignee)

Updated

4 years ago
Attachment #814718 - Attachment is obsolete: false
(Assignee)

Comment 5

4 years ago
Thanks!

(I prefer size_t, too; and IIRC, it's guaranteed to be equivalent as long as we're not instantiating vector<> with a custom allocator)
(Assignee)

Updated

4 years ago
Attachment #814719 - Attachment description: fix v2 (using std::vector<cairo_path_data_t>::size_type) → fix v2 (using std::vector<cairo_path_data_t>::size_type) [Nope, this is too ugly]
Attachment #814719 - Flags: review?(bas)
(Assignee)

Comment 6

4 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/b4c3caf8f741
Flags: in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/b4c3caf8f741
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.