Closed Bug 80067 Opened 23 years ago Closed 23 years ago

assignment vs. equality typos

Categories

(SeaMonkey :: General, defect, P2)

Tracking

(Not tracked)

RESOLVED FIXED
mozilla0.9.1

People

(Reporter: dr, Assigned: dr)

Details

(Whiteboard: [ready for checkin])

Attachments

(1 file)

I noticed a few probable assignment (=) vs. equality (==) typos in the code:

content/base/src/nsGenericElement.cpp:
  if (rv = NS_CONTENT_ATTR_NOT_THERE) {
content/events/src/nsDOMEvent.cpp:
  if (mEvent->eventStructType = NS_MOUSE_EVENT) {
  if (mEvent->eventStructType = NS_KEY_EVENT) {
extensions/xmlterm/base/mozXMLTermSession.cpp:
  if ((styleChanges = 1) &&
xpcom/base/nsDebugHelpWin32.cpp:
  if(gHooks = this)
xpcom/reflect/xptcall/src/md/os2/xptcinvoke_icc.cpp:
  if( cpcount = 0 ) {
  } else if( cpcount = 1 )

I'm mostly positive that the ones in content and xpcom/reflect are typos, and
not entirely sure about the ones in extensions/xmlterm and xpcom/base.
r=mkaply on the OS/2 change
Thanks mkaply! joki, jst, mjudge and svn, could you check your bits of this
patch too? Thanks!
Status: NEW → ASSIGNED
Nice catsh with the assignment vs. equality typos.

I don't approve of these changes tho:

-  nsresult rv = NS_STATIC_CAST(nsIContent *,
-                               this)->GetAttribute(nsid, nameAtom, aReturn);
+  nsCOMPtr<nsIContent> content(do_QueryInterface(this));
+  nsresult rv = content->GetAttribute(nsid, nameAtom, aReturn);

This will cause an extra QI call for no good reason, the static cast is
perfectly safe. Undo those changes and sr=jst.
nsDebugWin32 r=mjudge
ok, i made jst's requested changes, and i'm ready to checkin if/when the tree
opens...
Priority: -- → P2
Whiteboard: [ready for checkin]
Target Milestone: --- → mozilla0.9.1
fixed
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: