Closed Bug 455393 Opened 16 years ago Closed 16 years ago

Remove v1 string ABI compatibility code

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b1

People

(Reporter: benjamin, Assigned: benjamin)

Details

Attachments

(1 file)

We have a fair bit of code to support the v1 string ABI (the one from the Mozilla 1.4 SDK, which was made obsolete in Mozilla 1.7). We turned this off by default for FF3, and we should just remove this code now, because it can be very confusing to identify which method signature is being called.

The attached patch has been tested through the tryserver. Most of this is a no-op removal of the old ifdefed code. There is one significant change: I have removed the nsTAString_CharT type, which is not actually defined to nsAString, and moved the relevant typedefs to nsTSubstring, which is the new nsAString.
Attachment #338725 - Flags: review?(dbaron)
Comment on attachment 338725 [details] [diff] [review]
remove v1 string ABI compatibility code, rev. 1

>-// If some platform(s) can't handle our template that matches literal strings,
>-// then we'll disable it on those platforms.
>-#ifndef NS_DISABLE_LITERAL_TEMPLATE
>-#  if (defined(_MSC_VER) && (_MSC_VER < 1310)) || (defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x560)) || (defined(__HP_aCC) && (__HP_aCC <= 012100))
>-#    define NS_DISABLE_LITERAL_TEMPLATE
>-#  endif
>-#endif /* !NS_DISABLE_LITERAL_TEMPLATE */

I think you need this somewhere.  If not, why not?

>+   *   nsDepedendentSubstring for wide characters

Too many "de"s.
Comment on attachment 338725 [details] [diff] [review]
remove v1 string ABI compatibility code, rev. 1

>+   * allocation.  It is normally not a good idea to use this class on the
>+   * heap, because it will allocate space which may be wasted if the string
>+   * it contains is significantly smaller or larger than 40 characters.

Not sure where "40 characters" comes from; the buffer size is 64 characters.  I presume you meant to say 64?

(Side note:  we should really have a version with an int template...)

r=dbaron with that and the above comments fixed.
Attachment #338725 - Flags: review?(dbaron) → review+
I don't need that block in nsSubstring.h any more because it simply forwards to nsAString.h which has the exact same logic.
Pushed: http://hg.mozilla.org/mozilla-central/rev/7e95620116b1
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b1
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: