If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Prune 662 blocks of #if 0

NEW
Unassigned

Status

()

Core
General
17 years ago
9 years ago

People

(Reporter: Jeffrey Baker, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

17 years ago
There sure is a lot of $if 0 in Mozilla.  Some of these blocks contain code
which will land in the future, while others contain long since dead code.  My
intent is to prune the latter, thereby clarifying the source code a bit.  I will
produce patches for each top level source code directory.
(Reporter)

Comment 1

17 years ago
Here's a prime candidate from nsTextHelper in widget/gtk:

186 //-------------------------------------------------------------------------
187 NS_IMETHODIMP nsTextHelper::GetSelection(PRUint32 *aStartSel, PRUint32 *aEndSel)
188 {
189 #if 0
190 XmTextPosition left;
191 XmTextPosition right;
192 
193 if (XmTextGetSelectionPosition(mTextWidget, &left, &right)) {
194 *aStartSel = (PRUint32)left;
195 *aEndSel   = (PRUint32)right;
196 } else {
197 printf("nsTextHelper::GetSelection Error getting positions\n");
198 return NS_ERROR_FAILURE;
199 }
200 #endif
201 return NS_OK;
202 }

Is that Motif?  Yes, it is!  The whole method is commented out.  It's actually
something of a shame that we even bother to push a stack frame to enter this
method.  Hopefully the compilers are optimizing this away.

Comment 2

17 years ago
before you go out and kill all of the motif code, you might want to ask the 
guy who's trying to resurrect motif if any of it is of any use to him.

I think the real answer is that most of the widgets in widget/src/* aren't 
actually used by mozilla at all (they might be used by the *embed apps). -- I 
keep running into that when i try to figure out what stuff actually needs 
implementation for BeOS.

I'm slightly wrong, as the only client in this case isn't *embed, it's viewer 
(aka the app everyone wants to kill).
(Reporter)

Comment 3

17 years ago
After an exhaustive lxr investigation, I conclude that there are no consumers of
nsTextHelper::GetSelection() at all.  Good thing, since it doesn't fulfill its
interface.
(Reporter)

Comment 4

17 years ago
Oh I forgot to mention that I don't condone "#if 0" as a history mechanism. 
That's why we have CVS.  For cripes sake, this same commented out block of Motif
code is even present in the Mac source.
Product: Browser → Seamonkey

Updated

9 years ago
Assignee: jwbaker → nobody
Component: General → General
Product: SeaMonkey → Core
QA Contact: doronr → general
You need to log in before you can comment on or make changes to this bug.