Closed Bug 562439 Opened 14 years ago Closed 14 years ago

comparison between signed and unsigned integer expressions: itemCount and targetIndex

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: jaas)

Details

Attachments

(1 file, 1 obsolete file)

In function ‘NSMenuItem* NativeMenuItemWithLocation(NSMenu*, NSStr
ing*)’:
nsStandaloneNativeMenu.mm:146: warning: comparison between signed and unsigned integer expressions
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #442160 - Flags: review?(joshmoz)
Comment on attachment 442160 [details] [diff] [review]
patch

>     NSUInteger targetIndex = [[indexes objectAtIndex:i] intValue];
>-    NSInteger itemCount = [currentSubmenu numberOfItems];
>+    NSUInteger itemCount = [currentSubmenu numberOfItems];

'numberOfItems' returns NSInteger. It is the other variable that has the wrong type. We should be calling 'integerValue' instead of 'intValue', and the variable type for 'targetIndex' should be 'NSInteger'.
Attachment #442160 - Flags: review?(joshmoz) → review-
Attached patch fix v1.1Splinter Review
I wrote a patch to test this so I'll just post it.
Assignee: timeless → joshmoz
Attachment #442160 - Attachment is obsolete: true
Attachment #442511 - Flags: review?(mstange)
Attachment #442511 - Flags: review?(mstange) → review+
pushed to mozilla-central

http://hg.mozilla.org/mozilla-central/rev/fb4ae7942300
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: