]> gitweb.factorcode.org Git - factor.git/commitdiff
Replace "win32-error-string throw" with windows-error instance throwing
authorAlexander Iljin <ajsoft@yandex.ru>
Tue, 28 Jun 2016 22:23:36 +0000 (01:23 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 25 Nov 2019 15:06:59 +0000 (07:06 -0800)
Remove win32-error-string, because there was only one place it was used in.

basis/alien/libraries/windows/windows.factor
basis/calendar/windows/windows.factor
basis/io/files/info/windows/windows.factor
basis/io/sockets/secure/windows/windows.factor
basis/windows/errors/errors.factor
extra/talks/tc-lisp-talk/tc-lisp-talk.factor

index 249bcff57a4622aae92cf0db7e412e90bc53790b..03a2e8b8d4825814e6a64376b396db2741fcc965 100644 (file)
@@ -1,8 +1,9 @@
-USING: alien.libraries io.pathnames system windows.errors ;
+USING: alien.libraries io.pathnames system windows.errors
+windows.kernel32 ;
 IN: alien.libraries.windows
 
 M: windows >deployed-library-path
     file-name ;
 
 M: windows dlerror ( -- message )
-    win32-error-string ;
+    GetLastError n>win32-error-string ;
index 80253ea91b77f1f6b28830c20dc8a5bd67a3dcb8..f866fe81fa55d107754a90bc3a7d922af54350bd 100644 (file)
@@ -31,7 +31,7 @@ IN: calendar.windows
 M: windows gmt-offset ( -- hours minutes seconds )
     TIME_ZONE_INFORMATION <struct>
     dup GetTimeZoneInformation {
-        { TIME_ZONE_ID_INVALID [ win32-error-string throw ] }
+        { TIME_ZONE_ID_INVALID [ win32-error ] }
         { TIME_ZONE_ID_UNKNOWN [ Bias>> ] }
         { TIME_ZONE_ID_STANDARD [ Bias>> ] }
         { TIME_ZONE_ID_DAYLIGHT [ [ Bias>> ] [ DaylightBias>> ] bi + ] }
index 90d17a03d5df390de3e99cfe3ac3979fb8837a69..99eccd1c0f7c94da2bee3515a2c3a3acaf3cdfb0 100644 (file)
@@ -19,7 +19,7 @@ TUPLE: windows-file-info < file-info-tuple attributes ;
 
 : get-compressed-file-size ( path -- n )
     { DWORD } [ GetCompressedFileSize ] with-out-parameters
-    over INVALID_FILE_SIZE = [ win32-error-string throw ] [ >64bit ] if ;
+    over INVALID_FILE_SIZE = [ win32-error ] [ >64bit ] if ;
 
 : set-windows-size-on-disk ( file-info path -- file-info )
     over attributes>> +compressed+ swap member? [
@@ -183,7 +183,7 @@ CONSTANT: names-buf-length 16384
     [ path-length FindNextVolume ] with-out-parameters
     swap 0 = [
         GetLastError ERROR_NO_MORE_FILES =
-        [ drop f ] [ win32-error-string throw ] if
+        [ drop f ] [ win32-error ] if
     ] [ alien>native-string ] if ;
 
 : find-volumes ( -- array )
index 59eccfed19fd5f6fcd3991509c9b1dc75962fc3e..c1b8e3936d6d0382ec46b0ef3b2508ac42eb7c5f 100644 (file)
@@ -14,7 +14,7 @@ M: openssl ssl-certificate-verification-supported? f ;
 
 : load-windows-cert-store ( string -- HCERTSTORE )
     [ f ] dip CertOpenSystemStore
-    [ win32-error-string throw ] when-zero ;
+    [ win32-error ] when-zero ;
 
 : X509-NAME. ( X509_NAME -- )
     f 0 X509_NAME_oneline
index 5679a62ebad98ec724c8a37817b7b6646292315f..f5e5314e2f6d1d629177c18977a2590eebaefa8b 100644 (file)
@@ -717,9 +717,6 @@ CONSTANT: FORMAT_MESSAGE_MAX_WIDTH_MASK   0x000000FF
     [ drop "Unknown error 0x" id 0xffff,ffff bitand >hex append ]
     [ alien>native-string [ blank? ] trim ] if ;
 
-: win32-error-string ( -- str )
-    GetLastError n>win32-error-string ;
-
 ERROR: windows-error n string ;
 
 : (win32-error) ( n -- )
index 8a6b5d97e543ff5f66f06e99922e0ca8018b35e0..c0353a3e40eeafa5c0a828227909561e79644d65 100644 (file)
@@ -456,7 +456,7 @@ xyz
     \"TIME_ZONE_INFORMATION\" <c-object>
     dup GetTimeZoneInformation {
         { TIME_ZONE_ID_INVALID [
-            win32-error-string throw
+            win32-error
         ] }
         { TIME_ZONE_ID_STANDARD [
             TIME_ZONE_INFORMATION-Bias