Bug 817176: Add "(void)" cast to silence GCC unused-var warning for an intentionally-unused variable. r=bsmith

This commit is contained in:
Daniel Holbert 2012-11-30 16:59:42 -08:00
parent c4f2a727fb
commit eb0138e91d

View File

@ -7,6 +7,9 @@
#include "nsNSSComponent.h"
#include "nsSmartCardMonitor.h"
#include "nsSmartCardEvent.h"
#include "mozilla/unused.h"
using namespace mozilla;
//
// The SmartCard monitoring thread should start up for each module we load
@ -26,8 +29,6 @@
static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID);
#include <assert.h>
// self linking and removing double linked entry
// adopts the thread it is passed.
class SmartCardThreadEntry {
@ -73,8 +74,7 @@ SmartCardThreadList::~SmartCardThreadList()
void
SmartCardThreadList::Remove(SECMODModule *aModule)
{
SmartCardThreadEntry *current;
for (current = head; current; current=current->next) {
for (SmartCardThreadEntry *current = head; current; current = current->next) {
if (current->thread->GetModule() == aModule) {
// NOTE: automatically stops the thread and dequeues it from the list
delete current;
@ -83,13 +83,15 @@ SmartCardThreadList::Remove(SECMODModule *aModule)
}
}
// adopts the thread passwd to it. Starts the thread as well
// adopts the thread passed to it. Starts the thread as well
nsresult
SmartCardThreadList::Add(SmartCardMonitoringThread *thread)
{
SmartCardThreadEntry *current = new SmartCardThreadEntry(thread, head, nullptr,
&head);
// OK to forget current here, it's on the list
// OK to forget current here, it's on the list.
unused << current;
return thread->Start();
}