Closed Bug 1317368 Opened 7 years ago Closed 7 years ago

"implicit conversion of nullptr constant to 'bool'" in nsISupportsImpl.h

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1316978
Tracking Status
firefox52 --- affected

People

(Reporter: arai, Unassigned)

References

Details

Attachments

(1 obsolete file)

Bug 1316432 changes this
  NSCAP_LOG_ASSIGNMENT(this, 0);
to
  NSCAP_LOG_ASSIGNMENT(this, nullptr);

however, NSCAP_LOG_ASSIGNMENT's definition are the following:

  #define NSCAP_LOG_ASSIGNMENT(_c, _p)                                \
    if (_p)                                                           \
      NS_LogCOMPtrAddRef((_c),static_cast<nsISupports*>(_p))

it should be |if (!!_p)|, to convert literal nullptr to bool.
so far I see nullptr in NSCAP_LOG_ASSIGNMENT argument,
applied same change to NSCAP_LOG_RELEASE just in case.
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Attachment #8810461 - Flags: review?(nfroyd)
Comment on attachment 8810461 [details] [diff] [review]
Explicitly convert pointer to bool when pointer can be nullptr constant.

fixed by bug 1316978.
Attachment #8810461 - Attachment is obsolete: true
Attachment #8810461 - Flags: review?(nfroyd)
Assignee: arai.unmht → nobody
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.