Author: particle
Date: Wed Nov 12 21:06:36 2008
New Revision: 32592
Modified:
trunk/runtime/parrot/library/File/Spec.pir
trunk/runtime/parrot/library/pcre.pir
trunk/t/library/File_Spec.t
trunk/t/op/sprintf.t
Log:
[CAGE] use sysinfo op for querying 'osname'
patch courtesy of jimmy++, with modifications
Modified: trunk/runtime/parrot/library/File/Spec.pir
==============================================================================
--- trunk/runtime/parrot/library/File/Spec.pir (original)
+++ trunk/runtime/parrot/library/File/Spec.pir Wed Nov 12 21:06:36 2008
@@ -30,7 +30,7 @@
Since these functions are different for most operating systems, each set of
OS specific routines is available in a separate module, including:
- *File::Spec::Unix
+ File::Spec::Unix
*File::Spec::Mac
*File::Spec::OS2
File::Spec::Win32
@@ -52,6 +52,7 @@
.namespace [ 'File::Spec' ]
+.include 'sysinfo.pasm'
.sub VERSION :method
.local string version
@@ -64,7 +65,7 @@
'_init'()
.local string osname
- osname= '_get_osname'()
+ osname= sysinfo .SYSINFO_PARROT_OS
.local string platform
platform= '_get_module'( osname )
@@ -100,14 +101,6 @@
.end
-.include 'sysinfo.pasm'
-
-.sub '_get_osname'
- $S0 = sysinfo .SYSINFO_PARROT_OS
- .return ( $S0 )
-.end
-
-
.sub '_get_module'
.param string osname
@@ -148,7 +141,7 @@
typeof name, self
.local string osname
- osname= '_get_osname'()
+ osname= sysinfo .SYSINFO_PARROT_OS
.local string module
module= '_get_module'( osname )
@@ -166,9 +159,6 @@
.return(class)
.end
-
-.include 'library/config.pir'
-
# Local Variables:
# mode: pir
# fill-column: 100
Modified: trunk/runtime/parrot/library/pcre.pir
==============================================================================
--- trunk/runtime/parrot/library/pcre.pir (original)
+++ trunk/runtime/parrot/library/pcre.pir Wed Nov 12 21:06:36 2008
@@ -42,16 +42,16 @@
=cut
+.include "sysinfo.pasm"
+
.sub init
.local pmc libpcre
.local pmc pcre_function
- .local pmc config
.local string osname
.local int loaded
- config = _config()
- osname = config['osname']
-
+ osname = sysinfo .SYSINFO_PARROT_OS
+
if 'MSWin32' == osname goto LIB_WIN32
if 'cygwin' == osname goto LIB_CYGWIN
@@ -203,8 +203,6 @@
.return( ver )
.end
-.include "library/config.pir"
-
=back
=head1 BUGS
Modified: trunk/t/library/File_Spec.t
==============================================================================
--- trunk/t/library/File_Spec.t (original)
+++ trunk/t/library/File_Spec.t Wed Nov 12 21:06:36 2008
@@ -6,7 +6,7 @@
use warnings;
use lib qw( t . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 21;
+use Parrot::Test tests => 20;
=head1 NAME
@@ -94,17 +94,6 @@
OUT
## testing private subs
-pir_output_is( $PRE . <<'CODE'. $POST, <<"OUT", "_get_osname" );
- .local string osname
- .local pmc get_osname
- get_osname = get_hll_global [ 'File::Spec' ], '_get_osname'
- osname= get_osname()
- print osname
- goto END
-CODE
-$^O
-OUT
-
pir_output_is( $PRE . <<'CODE'. $POST, <<'OUT', "_get_module" );
.local string module
.local pmc get_module
Modified: trunk/t/op/sprintf.t
==============================================================================
--- trunk/t/op/sprintf.t (original)
+++ trunk/t/op/sprintf.t Wed Nov 12 21:06:36 2008
@@ -60,11 +60,11 @@
.const int TESTS = 308
.sub main :main
- load_bytecode 'config.pir'
load_bytecode 'Test/Builder.pir'
load_bytecode 'PGE.pbc'
load_bytecode 'PGE/Dumper.pbc'
.include "iglobals.pasm"
+ .include "sysinfo.pasm"
# Variable declarations, initializations
.local pmc test # the test harness object.
@@ -455,6 +455,7 @@
throw $P1
.end
+
.sub 'find_skip_in_description'
.param string description
@@ -477,11 +478,8 @@
.local pmc iter
iter = new 'Iterator', skip_os
- .local pmc config
- config = _config()
-
.local string osname
- osname = config['osname']
+ osname = sysinfo .SYSINFO_PARROT_OS
iter_loop:
unless iter goto iter_end