Closed Bug 729246 Opened 8 years ago Closed 8 years ago

fix clang warnings in Cocoa widgets

Categories

(Core :: Widget: Cocoa, defect)

12 Branch
x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: jaas, Assigned: jaas)

Details

Attachments

(1 file, 1 obsolete file)

7.16 KB, patch
smichaud
: review+
Details | Diff | Splinter Review
Attached patch fix v1.0 (obsolete) — Splinter Review
This patch fixes almost all warnings.
Attachment #599296 - Flags: review?(smichaud)
Comment on attachment 599296 [details] [diff] [review]
fix v1.0

-      HIThemeMenuDrawInfo mdi = {
-        version: 0,
-        menuType: IsDisabled(aFrame, eventState) ?
-            static_cast<ThemeMenuType>(kThemeMenuTypeInactive) :
-            static_cast<ThemeMenuType>(kThemeMenuTypePopUp)
-      };
+      HIThemeMenuDrawInfo mdi;
+      mdi.version = 0;
+      mdi.menuType = IsDisabled(aFrame, eventState) ?
+                       static_cast<ThemeMenuType>(kThemeMenuTypeInactive) :
+                       static_cast<ThemeMenuType>(kThemeMenuTypePopUp);

The original code initialized all the non-specified fields of the
HIThemeMenuDrawInfo structure to zero -- which is correct.  The new
code leaves most of the non-specified fields uninitialized.

Probably you should add something like the following just after
"HIThemeMenuDrawInfo mdi;"

bzero(&mdi, sizeof(HIThemeMenuDrawInfo));

Otherwise this seems fine.
Attachment #599296 - Flags: review?(smichaud) → review-
Attached patch fix v1.1Splinter Review
Good catch, I actually thought of that but got distracted and forgot.
Attachment #599296 - Attachment is obsolete: true
Attachment #599326 - Flags: review?(smichaud)
Attachment #599326 - Flags: review?(smichaud) → review+
https://hg.mozilla.org/mozilla-central/rev/40d9e3a8a4cf
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.