Warnings in nsMenuBarX.cpp

RESOLVED FIXED

Status

Core Graveyard
GFX: Mac
--
trivial
RESOLVED FIXED
14 years ago
9 years ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

Trunk
PowerPC
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

14 years ago
In file included from /Users/timeless/mozilla/widget/src/cocoa/nsMenuBarX.cpp:64:
/Developer/Headers/FlatCarbon/Traps.h:1:2: warning: #warning Traps.h is not
available on Mac OS X
/Users/timeless/mozilla/widget/src/cocoa/nsMenuBarX.h: In constructor
   `nsMenuBarX::nsMenuBarX()':
/Users/timeless/mozilla/widget/src/cocoa/nsMenuBarX.h:154: warning: member
   initializers for `nsIDocument*nsMenuBarX::mDocument'
/Users/timeless/mozilla/widget/src/cocoa/nsMenuBarX.h:141: warning:   and `
   PRUint32 nsMenuBarX::mCurrentCommandID'
/Users/timeless/mozilla/widget/src/cocoa/nsMenuBarX.cpp:88: warning:   will be
   re-ordered to match declaration order
/Users/timeless/mozilla/widget/src/cocoa/nsMenuBarX.cpp:89: warning: unused
   variable `OSStatus status'
(Assignee)

Comment 1

14 years ago
/Users/timeless/mozilla/widget/src/cocoa/nsMenuBarX.cpp: In member function
   `virtual nsresult nsMenuBarX::AddMenu(nsIMenu*)':
/Users/timeless/mozilla/widget/src/cocoa/nsMenuBarX.cpp:570: warning: unused
   variable `OSStatus status'

Comment 2

14 years ago
Created attachment 128932 [details] [diff] [review]
Current diff between my sources and current CVS

Submitted in response to the warnings in the current bug. Grateful if SKS would

review those parts of this patch which are a positive contribution to Mozilla
and commit

Comment 3

14 years ago
You are probably compiling a non-DEBUG build as the two variables you mention
are used in ASSERTION statements.

Some people suggest that that variables used only for debugging and asserting
should be conditionally declared only in DEBUG builds (so that they are not
accidentally used for some real purpose).

I enclose my patch for this file which I think solves the problem in a different
way & I would be grateful for any comments.

I request a review of this patch and/or instructions on how to use the relevant
flags.
(Assignee)

Comment 4

14 years ago
Created attachment 128957 [details] [diff] [review]
my diff

err, i meant to attach a patch, and this specific bug also accidentally posted
early, i meant to filter out some of the warnings. here's the patch that i had
in my tree just so you can see it. the original warnings for this bug were lost
when the computer i'm using here rebooted :(.

wrt debug only stuff yes don't worry about those warnings. i'm sorry this bug
came out so badly.

Comment 5

14 years ago
You don't seem to be checking the return value of
::SetMenuItemHierarchicalMenu(mRootMenu, 1, sAppleMenu);
at all. Is this what you mean?
(Assignee)

Comment 6

14 years ago
Comment on attachment 128957 [details] [diff] [review]
my diff

I'm not storing the return since the old code didn't check it. if someone
actually wanted to check the return, someone could...
Attachment #128957 - Flags: superreview?(sfraser)
Attachment #128957 - Flags: review?(mozeditor)

Updated

14 years ago
Attachment #128957 - Flags: review?(mozeditor) → review+

Comment 7

14 years ago
Comment on attachment 128957 [details] [diff] [review]
my diff

sr=tor
Attachment #128957 - Flags: superreview?(sfraser) → superreview+
(Assignee)

Comment 8

14 years ago
checked in
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.