Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: R14->R15



At 9:21 PM -0700 5/22/02, Tom Becker wrote:
I don't recommend defining CString_AC as CStr255_AC. It would have the
effect of changing the MacApp implementation.

Darn! But yes, it would.

> const char* data() const
{ return CChar255_AC(*this); }

That's returning a pointer to temporary stack data. It's inherently unsafe.

True, but that's what the qBackwardCompatible operator const char * has been doing for years. Our code already relies on it, and I've encountered no problems to date. It does require that inlining be turned on, per the comment in the header.

How about:

#if MA_Version >= 0x0F00
#define MyString CString_AC
#else
#define MyString CStr255_AC
#endif

And then try a global search and replace of CStr255 and CStr255_AC with MyString within my sources? It might work, and certainly should work through MacApp R14.

Any suggestions as to a more informative name than MyString? Perhaps CMacAppString would do the trick.

I think it has to be a #define rather than a typedef, so you can override
methods that take a string as an argument.

Agreed.

Thanks for the suggestions!

--
Adam Wildavsky Extreme Programmer Tameware, LLC
email@hidden http://www.tameware.com
_______________________________________________
macapp-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macapp-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: R14->R15 (From: Tom Becker <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.