Open Bug 549795 Opened 14 years ago Updated 2 years ago

search-and-replace removal of backward compatibility string typedefs in layout/

Categories

(Core :: Layout, defect)

x86
Linux
defect

Tracking

()

People

(Reporter: zwol, Unassigned)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
This patch removes all uses of the "backward compatibility" string typedefs in layout. It was mostly done mechanically, with these commands:

$ cd layout
$ grep -Ewrl 'nsC?Substring|nsAFlatC?String|nsASingleFragmentC?String' * |
  xargs perl -pi -e '
    s/\bnsSubstring\b/nsAString/g;
    s/\bnsASingleFragmentString\b/nsAString/g;
    s/\bnsCSubstring\b/nsACString/g;
    s/\bnsASingleFragmentCString\b/nsACstring/g;
    s/\bnsAFlatString\b/nsString/g;
    s/\bnsAFlatCString\b/nsCString/g'

I then manually inspected the result and fixed up a few places where this threw off the indentation.

Since typedefs are just aliases, I don't believe IID bumps should be required.
Attachment #429915 - Flags: review?(bzbarsky)
Note to enthusiastic people: that command is _not_ safe at top level.  It's _probably_ safe in all top-level directories except xpcom, but I didn't look that hard.  It's not my itch, outside layout. :)
Comment on attachment 429915 [details] [diff] [review]
patch

changed reviewer to bsmedberg since bz disclaims knowledge of the current preferred string nomenclature.
Attachment #429915 - Flags: review?(bzbarsky) → review?(benjamin)
For the record: I have been going by http://mxr.mozilla.org/mozilla-central/source/xpcom/string/public/nsStringFwd.h#84 which lists the removed names as "backward compatibility typedefs".
Comment on attachment 429915 [details] [diff] [review]
patch

Cancelling review for now since I don't think we've decided whether nsSubstring or nsAString is actually the better name... AString has more history behind it, but substring is somewhat clearer.
Attachment #429915 - Flags: review?(benjamin)
If the only difference between nsString and nsAString is that the latter is not guaranteed to be nul-terminated, then I don't think either of "nsAString" nor "nsSubstring" conveys that distinction at a glance.  nsSubstring puts me more in mind of what (as I understand it) nsDependentString does.
I no longer work for Mozilla, I am deassigning myself from bugs I have no intention of working on as a volunteer.
Assignee: zackw → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: