mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 538476 Allow ToInteger to take an nsresult* parameter to match the external string API r=bsmedberg
This commit is contained in:
parent
17e7509306
commit
546b738179
@ -280,7 +280,9 @@ class nsTString_CharT : public nsTSubstring_CharT
|
||||
* @return int rep of string value, and possible (out) error code
|
||||
*/
|
||||
NS_COM PRInt32 ToInteger( PRInt32* aErrorCode, PRUint32 aRadix=kRadix10 ) const;
|
||||
|
||||
PRInt32 ToInteger( nsresult* aErrorCode, PRUint32 aRadix=kRadix10 ) const {
|
||||
return ToInteger(reinterpret_cast<PRInt32*>(aErrorCode), aRadix);
|
||||
}
|
||||
|
||||
/**
|
||||
* |Left|, |Mid|, and |Right| are annoying signatures that seem better almost
|
||||
|
@ -982,11 +982,15 @@ static const ToIntegerTest kToIntegerTests[] = {
|
||||
|
||||
PRBool test_string_tointeger()
|
||||
{
|
||||
PRInt32 rv;
|
||||
PRInt32 i;
|
||||
nsresult rv;
|
||||
for (const ToIntegerTest* t = kToIntegerTests; t->str; ++t) {
|
||||
PRInt32 result = nsCAutoString(t->str).ToInteger(&rv, t->radix);
|
||||
if (rv != t->rv || result != t->result)
|
||||
return PR_FALSE;
|
||||
result = nsCAutoString(t->str).ToInteger(&i, t->radix);
|
||||
if ((nsresult)i != t->rv || result != t->result)
|
||||
return PR_FALSE;
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user