зеркало из https://github.com/mozilla/gecko-dev.git
fixing bug 9560.
install.DiskSpaceAvailable() now returns the correct value, as much as a unsigned 32bit type can hold. It should really be stored in a unsigned 64bit type. I'll file it as a seperate bug against nsFileSpec.
This commit is contained in:
Родитель
657d8da2ac
Коммит
001061784d
|
@ -616,7 +616,7 @@ nsInstall::DeleteFile(const nsString& aFolder, const nsString& aRelativeFileName
|
|||
}
|
||||
|
||||
PRInt32
|
||||
nsInstall::DiskSpaceAvailable(const nsString& aFolder, PRInt32* aReturn)
|
||||
nsInstall::DiskSpaceAvailable(const nsString& aFolder, PRUint32* aReturn)
|
||||
{
|
||||
nsFileSpec fsFolder(aFolder);
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ class nsInstall
|
|||
|
||||
PRInt32 DeleteComponent(const nsString& aRegistryName, PRInt32* aReturn);
|
||||
PRInt32 DeleteFile(const nsString& aFolder, const nsString& aRelativeFileName, PRInt32* aReturn);
|
||||
PRInt32 DiskSpaceAvailable(const nsString& aFolder, PRInt32* aReturn);
|
||||
PRInt32 DiskSpaceAvailable(const nsString& aFolder, PRUint32* aReturn);
|
||||
PRInt32 Execute(const nsString& aJarSource, const nsString& aArgs, PRInt32* aReturn);
|
||||
PRInt32 Execute(const nsString& aJarSource, PRInt32* aReturn);
|
||||
PRInt32 FinalizeInstall(PRInt32* aReturn);
|
||||
|
|
|
@ -629,7 +629,7 @@ PR_STATIC_CALLBACK(JSBool)
|
|||
InstallDiskSpaceAvailable(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsInstall *nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);
|
||||
PRInt32 nativeRet;
|
||||
PRUint32 nativeRet;
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
@ -650,7 +650,18 @@ InstallDiskSpaceAvailable(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
return JS_FALSE;
|
||||
}
|
||||
|
||||
*rval = INT_TO_JSVAL(nativeRet);
|
||||
if ( nativeRet <= JSVAL_INT_MAX )
|
||||
*rval = INT_TO_JSVAL(nativeRet);
|
||||
else
|
||||
{
|
||||
JSInt64 l;
|
||||
jsdouble d;
|
||||
|
||||
JSLL_UI2L( l, nativeRet );
|
||||
JSLL_L2D( d, l );
|
||||
|
||||
JS_NewDoubleValue( cx, d, rval );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче