From: Alexander Iljin Date: Tue, 24 May 2016 17:42:48 +0000 (+0300) Subject: Delete throw-win32-error, replace with win32-error calls X-Git-Tag: 0.99~3647 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=e1be081ec93061d1e236d6d6f4c1778feef854c2 Delete throw-win32-error, replace with win32-error calls --- diff --git a/basis/io/directories/windows/windows.factor b/basis/io/directories/windows/windows.factor index 76cc8f33f0..083c5187fb 100644 --- a/basis/io/directories/windows/windows.factor +++ b/basis/io/directories/windows/windows.factor @@ -31,7 +31,7 @@ ERROR: file-delete-failed path error ; : (delete-file) ( path -- ) dup DeleteFile 0 = [ GetLastError ERROR_ACCESS_DENIED = - [ delete-read-only-file ] [ throw-win32-error ] if + [ delete-read-only-file ] [ win32-error ] if ] [ drop ] if ; M: windows delete-file ( path -- ) diff --git a/basis/io/files/windows/windows.factor b/basis/io/files/windows/windows.factor index 0531551b60..518fa8daab 100644 --- a/basis/io/files/windows/windows.factor +++ b/basis/io/files/windows/windows.factor @@ -117,7 +117,7 @@ M: windows init-io ( -- ) : handle>file-size ( handle -- n/f ) (handle>file-size) [ GetLastError ERROR_INVALID_FUNCTION = - [ f ] [ throw-win32-error ] if + [ f ] [ win32-error ] if ] unless* ; ERROR: seek-before-start n ; @@ -400,7 +400,7 @@ M: windows home 0 [ FindFirstStream ] keepd over INVALID_HANDLE_VALUE = [ - 2drop throw-win32-error + 2drop win32-error ] [ 1vector swap file-streams-rest ] if ; diff --git a/basis/windows/errors/errors.factor b/basis/windows/errors/errors.factor index 82e8701d16..5679a62eba 100644 --- a/basis/windows/errors/errors.factor +++ b/basis/windows/errors/errors.factor @@ -740,9 +740,6 @@ ERROR: windows-error n string ; dup n>win32-error-string windows-error ] if ; -: throw-win32-error ( -- * ) - win32-error-string throw ; - : check-invalid-handle ( handle -- handle ) dup INVALID_HANDLE_VALUE = [ win32-error ] when ; @@ -758,11 +755,7 @@ CONSTANT: expected-io-errors expected-io-errors member? ; : expected-io-error ( error-code -- ) - dup expected-io-error? [ - drop - ] [ - throw-win32-error - ] if ; + expected-io-error? [ win32-error ] unless ; : io-error ( return-value -- ) { 0 f } member? [ GetLastError expected-io-error ] when ;