зеркало из https://github.com/mozilla/gecko-dev.git
Explicit conversion required for NEW_STRING_APIS. r=scc
This commit is contained in:
Родитель
5ef034810c
Коммит
9d03c4287b
|
@ -662,7 +662,8 @@ char* nsCString::ToNewCString() const {
|
|||
* @return ptr to new ascii string
|
||||
*/
|
||||
PRUnichar* nsCString::ToNewUnicode() const {
|
||||
nsString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
nsString temp;
|
||||
temp.AssignWithConversion(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
temp.SetCapacity(8); //force temp to have an allocated buffer, even if this is empty.
|
||||
PRUnichar* result=temp.mUStr; //steal temp's buffer
|
||||
temp.mStr=0; //now clear temp's buffer to prevent deallocation
|
||||
|
|
|
@ -719,7 +719,8 @@ nsString* nsString::ToNewString() const {
|
|||
*/
|
||||
char* nsString::ToNewCString() const {
|
||||
|
||||
nsCString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
nsCString temp;
|
||||
temp.AssignWithConversion(GetUnicode(), Length()); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
temp.SetCapacity(8); //force it to have an allocated buffer, even if this is empty.
|
||||
char* result=temp.mStr; //steal temp's buffer
|
||||
temp.mStr=0; //clear temp's buffer to prevent deallocation
|
||||
|
|
|
@ -662,7 +662,8 @@ char* nsCString::ToNewCString() const {
|
|||
* @return ptr to new ascii string
|
||||
*/
|
||||
PRUnichar* nsCString::ToNewUnicode() const {
|
||||
nsString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
nsString temp;
|
||||
temp.AssignWithConversion(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
temp.SetCapacity(8); //force temp to have an allocated buffer, even if this is empty.
|
||||
PRUnichar* result=temp.mUStr; //steal temp's buffer
|
||||
temp.mStr=0; //now clear temp's buffer to prevent deallocation
|
||||
|
|
|
@ -719,7 +719,8 @@ nsString* nsString::ToNewString() const {
|
|||
*/
|
||||
char* nsString::ToNewCString() const {
|
||||
|
||||
nsCString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
nsCString temp;
|
||||
temp.AssignWithConversion(GetUnicode(), Length()); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
temp.SetCapacity(8); //force it to have an allocated buffer, even if this is empty.
|
||||
char* result=temp.mStr; //steal temp's buffer
|
||||
temp.mStr=0; //clear temp's buffer to prevent deallocation
|
||||
|
|
|
@ -662,7 +662,8 @@ char* nsCString::ToNewCString() const {
|
|||
* @return ptr to new ascii string
|
||||
*/
|
||||
PRUnichar* nsCString::ToNewUnicode() const {
|
||||
nsString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
nsString temp;
|
||||
temp.AssignWithConversion(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
temp.SetCapacity(8); //force temp to have an allocated buffer, even if this is empty.
|
||||
PRUnichar* result=temp.mUStr; //steal temp's buffer
|
||||
temp.mStr=0; //now clear temp's buffer to prevent deallocation
|
||||
|
|
|
@ -719,7 +719,8 @@ nsString* nsString::ToNewString() const {
|
|||
*/
|
||||
char* nsString::ToNewCString() const {
|
||||
|
||||
nsCString temp(*this); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
nsCString temp;
|
||||
temp.AssignWithConversion(GetUnicode(), Length()); //construct nsCString with alloc on heap (which we'll steal in a moment)
|
||||
temp.SetCapacity(8); //force it to have an allocated buffer, even if this is empty.
|
||||
char* result=temp.mStr; //steal temp's buffer
|
||||
temp.mStr=0; //clear temp's buffer to prevent deallocation
|
||||
|
|
Загрузка…
Ссылка в новой задаче