Closed Bug 64016 Opened 24 years ago Closed 24 years ago

Remove nsCString::GetBuffer()

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla0.8.1

People

(Reporter: jag+mozbugs, Assigned: jag+mozbugs)

References

Details

Attachments

(8 files)

GetBuffer() has been depricated in favor of get() to get more unity in code.

This bug will be for tracking changing of all nsCString::GetBuffer() uses to
nsCString::get() so GetBuffer can be removed.
do you seriously expect anyone to review this ;-?

notes to self:
write("T",1), += " ",
non PR ints..
comparisons w/ nsnull, null, 0
.Length() > 0
initializers should be in the order of class definition

General questions:
title.AssignWithConversion("Error");        // localization
rv = 
picker->SetDefaultString(NS_ConvertASCIItoUCS2(suggested.get()).GetUnicode() );
rv =a => rv = a

I think there was only one rv =a, please fix that. Cleaning up the other 
nonsense is for someone else.
Keywords: approval, patch, review
Well, I'm hoping someone will, seeing how I've kept this patch mostly to fixing
|GetBuffer()| uses, and do explicit |get()| where needed (though not everywhere
yet). If I'd add all that other fixing up I'm sure this will just gather dust.
Here are comments on the first part of the first patch, up to and including
nsAbCard.cpp:

nsLocationImpl.cpp:
  filed bug 64041 on other issues

nsLocalService.cpp:
  should use langcstr.ToNewCString()  (2 times)
  should untabify?

nsDocumentEncoder.cpp:
  This code (around the first change) is rather evil.  Maybe you should fix it,
  or at least file a bug on its owner?
| rv =a => rv = a

| nsLocalService.cpp:
|   should use langcstr.ToNewCString()  (2 times)
|   should untabify?

Those are done, and some more strdup -> ToNewCString() . strlen -> Length()
changes.

| nsDocumentEncoder.cpp:
|   This code (around the first change) is rather evil.  Maybe you should
|   fix it, or at least file a bug on its owner?

I guess I'll file a bug...
r=dbaron on attachment 21491 [details] [diff] [review] up to and including nsImapIncomingServer.cpp, with
the following comments:

nsAddressBook.cpp:
 * should file bug on AddressBookParser::AddLdifColToDatabase to switch
   colType from nsCAutoString to nsLiteralCString and use new string
   tools in nsReadableUtils.h

 * Perhaps it would be better to rename the valueSlot parameter to
   column rather than changing all the uses.

nsMsgThread.cpp:
 * Perhaps it would be better to reorder the initializers rather than
   the members themselves?  It seems the members are more likely
   to be in the "intended" order.
It turns out someone else already checked in the change to nsMsgThread.cpp, but
in general I think you're right that it's better to change the initializer order
than the member order.

Attaching a patch for the issues in nsAddressBook.cpp, will hopefully remember
to file that new bug :-) (Perhaps turn it into a general clean-up one? Remove
some CIDs, replace WITH_SERVICE macros, etc.)
I'd like to have all the |.get| changes in for mozilla0.9.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
Great :-) How best can we get that done? (Other than r=/a= grunt work).
Priority: -- → P3
Depends on: 70075
Depends on: 70090
No longer depends on: 70090
Blocks: 70090
Okay, started from scratch with a new patch and way less noise.

Taking this bug from scc so I have it on my radar.
Assignee: scc → disttsc
Status: ASSIGNED → NEW
builds on Mac :-)
26508 r=timeless
26178 r=timeless w/ few requests
NS_CONST_CAST(char*,var.get()),(char*)var.get() => var.get()
new nsCString(var.get()) => var.ToNewCString()
afaik .Append*(var.get) drop .get() [also for .Equals?]
> NS_CONST_CAST(char*,var.get()),(char*)var.get() => var.get()

Specifically for |->SetSpec| on nsIURI. Done.

timeless: some of those (char*) / NS_CONST_CAST(char*, ...) are needed for
ugliness like nsUnescape.

> new nsCString(var.get()) => var.ToNewCString()

Actually |.ToNewString()|, but it just does |return new nsCString(var);|, so
I'll just drop the |.get()|. Done.

> afaik .Append*(var.get) drop .get() [also for .Equals?]

Done.

I've also removed |.get()| in |new nsCStringKey(var.get());|

I'm building now with these changes, I'll attach the new patch when that
compiles fine.
Patch mostly checked in. nsString.h change this weekend.
Target Milestone: mozilla0.9 → mozilla0.8.1
*grmbl*

Thanks syd. Take all the fun out of it, why don't you ;-p

Marking this fixed.
Status: NEW → RESOLVED
Closed: 24 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: