Closed Bug 131899 Opened 22 years ago Closed 22 years ago

remove nsA{Readable,Writable}{,C}String

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.0

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(2 files, 1 obsolete file)

We should remove nsA{Readable,Writable}{,C}String in favor of
{const ,}nsA{,C}String.  This will reduce confusion since there will be fewer
string classes, and it's been the plan for some time.  It's just never been done.

So I did most of the work using sed.  I used the script:

find mozilla -name "*".cpp -o -name "*".h -o -name "*".idl | while read FILENAME; do
  sed -f mass-change.sed $FILENAME > $FILENAME.$$.tmp
  mv $FILENAME.$$.tmp $FILENAME
done

where mass-change.sed contained:

s/const nsAReadableString/const nsAString/g
s/nsAWritableString/nsAString/g
s/const nsAReadableCString/const nsACString/g
s/nsAWritableCString/nsACString/g
s/nsAReadableString/const nsAString/g
s/nsAReadableCString/const nsACString/g
s/"const nsAString\.h"/"nsAString\.h"/

I then manually redid all the changes within string/, and manually cleaned
various things up in the following files:

     + xpcom/ds/nsIAtom.idl
     + netwerk/cache/src/nsCache.cpp
     + netwerk/protocol/about/src/nsAboutRedirector.cpp
     + extensions/transformiix/source/xslt/txMozillaXMLOutput.h
     + content/xsl/document/src/nsXSLContentSink.cpp
     + htmlparser/src/nsDTDUtils.h htmlparser/src/nsHTMLTags.cpp
     + embedding/components/windowwatcher/src/nsPrompt.cpp

A |cvs diff -u| of this tree yielded a 1.3MB file that touches 647 files.
Attached file complete diff (obsolete) —
(gzipped.  Too bad bugzilla doesn't have a way to enter the 'Content-Encoding'
for attachments as well.)
Don't review the complete diff yet.  I'll attach a human-corrected version later.
Comment on attachment 74884 [details] [diff] [review]
diff of only the "interesting" files mentioned above

sr=jag
Attachment #74884 - Flags: superreview+
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0
Comment on attachment 74905 [details]
complete patch, corrected

sr=jag
Attachment #74905 - Flags: superreview+
By far the bulk of these changes hit content, editor, accessible,
extensions/xmlextras, and htmlparser (in that order, by number of files), so
cc:ing some people who work on that code in case this is a particularly bad time
to do this.
This is fine with editor folks.
Fine with accessibility folks. 
Comment on attachment 74905 [details]
complete patch, corrected

r=scc
Attachment #74905 - Flags: review+
Comment on attachment 74905 [details]
complete patch, corrected

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #74905 - Flags: approval+
Comment on attachment 74905 [details]
complete patch, corrected

This patch has a mistake in 
mozilla/extensions/python/xpcom/src/VariantUtils.cpp which can be fixed by the
change:

 -#include <nsAReadableString.h>
 -#include <nsAWritableString.h>
-+#include <const nsAString.h>
 +#include <nsAString.h>
Are you guys planning on changing what is emitted by the xpidl compiler?
Ah, foolish me. I see that was done months ago.
Fix checked in, 2002-03-23.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: