Closed Bug 421615 Opened 14 years ago Closed 14 years ago

unused variable ‘tmp’ in NS_IMPL_CYCLE_COLLECTION_0

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta5

People

(Reporter: tuukka.tolvanen, Assigned: tuukka.tolvanen)

Details

Attachments

(1 file)

In member function ‘virtual nsresult FileSystemDataSource::cycleCollection::Unlink(void*)’:
http://mxr.mozilla.org/mozilla/source/rdf/datasource/src/nsFileSystemDataSource.cpp#254
warning: unused variable ‘tmp’
 254 NS_IMPL_CYCLE_COLLECTION_0(FileSystemDataSource) 

http://mxr.mozilla.org/mozilla/source/xpcom/glue/nsCycleCollectionParticipant.h#605
 605 #define NS_IMPL_CYCLE_COLLECTION_0(_class)                                     \
...
 607  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)                                 \
 608  NS_IMPL_CYCLE_COLLECTION_UNLINK_END                                           \

which expand to

 261   NS_IMETHODIMP                                                                \
 262   NS_CYCLE_COLLECTION_CLASSNAME(_class)::Unlink(void *p)                       \
 263   {                                                                            \
 264     nsISupports *s = static_cast<nsISupports*>(p);                             \
 265     NS_ASSERTION(CheckForRightISupports(s),                                    \
 266                  "not the nsISupports pointer we expect");                     \
 267     _class *tmp = Downcast(s);
 295     return NS_OK;                                                              \
 296   }

by the looks of things what's wanted instead of UNLINK_BEGIN UNLINK_END is

 298 #define NS_IMPL_CYCLE_COLLECTION_UNLINK_0(_class)                              \
 299   NS_IMETHODIMP                                                                \
 300   NS_CYCLE_COLLECTION_CLASSNAME(_class)::Unlink(void *p)                       \
 301   {                                                                            \
 302     NS_ASSERTION(CheckForRightISupports(static_cast<nsISupports*>(p)),         \
 303                  "not the nsISupports pointer we expect");                     \
 304     return NS_OK;                                                              \
 305   }
ah, love the wrapping. can has comment preview in bugzilla? ;)
Attached patch patch1Splinter Review
Assignee: nobody → tuukka.tolvanen
Status: NEW → ASSIGNED
Attachment #308083 - Flags: superreview?
Attachment #308083 - Flags: review?
Attachment #308083 - Flags: superreview?(dbaron)
Attachment #308083 - Flags: superreview?
Attachment #308083 - Flags: review?(dbaron)
Attachment #308083 - Flags: review?
Comment on attachment 308083 [details] [diff] [review]
patch1

r+sr=dbaron
Attachment #308083 - Flags: superreview?(dbaron)
Attachment #308083 - Flags: superreview+
Attachment #308083 - Flags: review?(dbaron)
Attachment #308083 - Flags: review+
Attachment #308083 - Flags: approval1.9?
Comment on attachment 308083 [details] [diff] [review]
patch1

a1.9=beltzner
Attachment #308083 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Checking in xpcom/glue/nsCycleCollectionParticipant.h;
/cvsroot/mozilla/xpcom/glue/nsCycleCollectionParticipant.h,v  <--  nsCycleCollectionParticipant.h
new revision: 3.14; previous revision: 3.13
done
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta5
You need to log in before you can comment on or make changes to this bug.