Closed Bug 328625 Opened 15 years ago Closed 15 years ago

Fix missing casts and remove some dead code from bookmarks code

Categories

(Camino Graveyard :: General, defect)

PowerPC
macOS
defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bugzilla-graveyard, Assigned: bugzilla-graveyard)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file, 1 obsolete file)

Getting several compiler warnings in our bookmarks code, and there's a huge block of validation code commented out in BookmarkViewController.mm. The forthcoming patch fixes this stuff, at least in part.
Attachment #213226 - Flags: review?(stuart.morgan)
Comment on attachment 213226 [details] [diff] [review]
fixes several casts, a spelling error, and removes unused validation code

Looks fine and still builds.
r=me
Attachment #213226 - Flags: superreview?
Attachment #213226 - Flags: review?(stuart.morgan)
Attachment #213226 - Flags: review+
Comment on attachment 213226 [details] [diff] [review]
fixes several casts, a spelling error, and removes unused validation code

sr?=mento
Attachment #213226 - Flags: superreview? → superreview?(mark)
Comment on attachment 213226 [details] [diff] [review]
fixes several casts, a spelling error, and removes unused validation code

>Index: mozilla/camino/src/bookmarks/BookmarkViewController.mm
>===================================================================
>@@ -771,17 +771,17 @@
> // XXX unused
> -(void) displayBookmarkInOutlineView:(BookmarkItem *)aBookmarkItem

OK.  Are we ever going to kill abandoned code?  #if 0 it out?

>@@ -841,17 +841,17 @@
> 
>   if ([mBookmarksOutlineView numberOfSelectedRows] == 1)
>   {
>     BookmarkItem *item = [self selectedBookmarkItem];
>     // if it's a folder, use it
>     if ([item isKindOfClass:[BookmarkFolder class]])
>     {
>       *outIndex = (int)[(BookmarkFolder*)item count];
>-      return item;
>+      return (BookmarkFolder*)item;

It's unclean to cast to the same type twice in a row.  How about:

  BookmarkFolder* selectedFolder = (BookmarkFolder*) item;
  *outIndex = [selectedFolder count];
  return selectedFolder;

sr=me, as long as "s" means "second" :)
Attachment #213226 - Flags: superreview?(mark) → superreview+
Comment on attachment 213226 [details] [diff] [review]
fixes several casts, a spelling error, and removes unused validation code

Bitrotted.
Attachment #213226 - Attachment is obsolete: true
Checked in, trunk and 1_8.  Thanks for the cleanup patch.

Your second patch was so much smaller than the first, so I looked at the diff-to-diff diff and also fixed the "its" -> "it's" comment.  For validateMenuItem:, I turned the /* */ into an #if 0 block.  #if 0.  The better way to kill.  Bugs check in, but they don't check out.
Status: NEW → RESOLVED
Closed: 15 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.