Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
7fd51f2f
Commit
7fd51f2f
authored
Jun 16, 2011
by
Yasuhiro Matsumoto
Committed by
Brad Fitzpatrick
Jun 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: use strict in perl scripts
R=golang-dev, bradfitz, rsc CC=golang-dev
https://golang.org/cl/4609047
parent
0193139b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
22 deletions
+28
-22
mksyscall.pl
src/pkg/syscall/mksyscall.pl
+8
-6
mksyscall_windows.pl
src/pkg/syscall/mksyscall_windows.pl
+14
-16
mksysnum_darwin.pl
src/pkg/syscall/mksysnum_darwin.pl
+2
-0
mksysnum_freebsd.pl
src/pkg/syscall/mksysnum_freebsd.pl
+2
-0
mksysnum_linux.pl
src/pkg/syscall/mksysnum_linux.pl
+2
-0
No files found.
src/pkg/syscall/mksyscall.pl
View file @
7fd51f2f
...
...
@@ -19,11 +19,13 @@
# block, as otherwise the system call could cause all goroutines to
# hang.
$cmdline
=
"mksyscall.pl "
.
join
(
' '
,
@ARGV
);
$errors
=
0
;
$_32bit
=
""
;
$nacl
=
0
;
$plan9
=
0
;
use
strict
;
my
$cmdline
=
"mksyscall.pl "
.
join
(
' '
,
@ARGV
);
my
$errors
=
0
;
my
$_32bit
=
""
;
my
$nacl
=
0
;
my
$plan9
=
0
;
if
(
$ARGV
[
0
]
eq
"-b32"
)
{
$_32bit
=
"big-endian"
;
...
...
@@ -66,7 +68,7 @@ sub parseparam($) {
return
(
$1
,
$2
);
}
$text
=
""
;
my
$text
=
""
;
while
(
<>
)
{
chomp
;
s/\s+/ /g
;
...
...
src/pkg/syscall/mksyscall_windows.pl
View file @
7fd51f2f
...
...
@@ -23,9 +23,11 @@
# //sys LoadLibrary(libname string) (handle uint32, errno int) [failretval==-1] = LoadLibraryA
# and is [failretval==0] by default.
$cmdline
=
"mksyscall_windows.pl "
.
join
(
' '
,
@ARGV
);
$errors
=
0
;
$_32bit
=
""
;
use
strict
;
my
$cmdline
=
"mksyscall_windows.pl "
.
join
(
' '
,
@ARGV
);
my
$errors
=
0
;
my
$_32bit
=
""
;
binmode
STDOUT
;
...
...
@@ -62,10 +64,10 @@ sub parseparam($) {
return
(
$1
,
$2
);
}
$text
=
""
;
$vars
=
""
;
$mods
=
""
;
$modnames
=
""
;
my
$text
=
""
;
my
$vars
=
""
;
my
$mods
=
""
;
my
$modnames
=
""
;
while
(
<>
)
{
chomp
;
s/\s+/ /g
;
...
...
@@ -91,7 +93,7 @@ while(<>) {
if
(
$modname
eq
""
)
{
$modname
=
"kernel32"
;
}
$modvname
=
"mod$modname"
;
my
$modvname
=
"mod$modname"
;
if
(
$modnames
!~
/$modname/
)
{
$modnames
.=
".$modname"
;
$mods
.=
"\t$modvname = loadDll(\"$modname.dll\")\n"
;
...
...
@@ -103,7 +105,7 @@ while(<>) {
}
# System call pointer variable name.
$sysvarname
=
"proc$sysname"
;
my
$sysvarname
=
"proc$sysname"
;
# Returned value when failed
if
(
$failcond
eq
""
)
{
...
...
@@ -111,17 +113,13 @@ while(<>) {
}
# Decide which version of api is used: ascii or unicode.
if
(
$sysname
!~
/W$/
)
{
$strconvfunc
=
"StringBytePtr"
;
}
else
{
$strconvfunc
=
"StringToUTF16Ptr"
;
}
my
$strconvfunc
=
$sysname
!~
/W$/
?
"StringBytePtr"
:
"StringToUTF16Ptr"
;
# Winapi proc address variable.
$vars
.=
sprintf
"\t%s = getSysProcAddr(%s, \"%s\")\n"
,
$sysvarname
,
$modvname
,
$sysname
;
# Go function header.
my
$out
=
join
(
', '
,
@out
);
$out
=
join
(
', '
,
@out
);
if
(
$out
ne
""
)
{
$out
=
" ($out)"
;
}
...
...
@@ -242,7 +240,7 @@ while(<>) {
$failexpr
=
"$name $failcond"
;
}
}
$failexpr
=~
s/(=)([0-9A-Za-z\-+])/
\1 \
2/
;
# gofmt compatible
$failexpr
=~
s/(=)([0-9A-Za-z\-+])/
$1 $
2/
;
# gofmt compatible
if
(
$name
eq
"errno"
)
{
# Set errno to "last error" only if returned value indicate failure
$body
.=
"\tif $failexpr {\n"
;
...
...
src/pkg/syscall/mksysnum_darwin.pl
View file @
7fd51f2f
...
...
@@ -5,6 +5,8 @@
#
# Generate system call table for Darwin from sys/syscall.h
use
strict
;
my
$command
=
"mksysnum_darwin.pl "
.
join
(
' '
,
@ARGV
);
print
<<EOF;
...
...
src/pkg/syscall/mksysnum_freebsd.pl
View file @
7fd51f2f
...
...
@@ -6,6 +6,8 @@
# Generate system call table for FreeBSD from master list
# (for example, /usr/src/sys/kern/syscalls.master).
use
strict
;
my
$command
=
"mksysnum_freebsd.pl "
.
join
(
' '
,
@ARGV
);
print
<<EOF;
...
...
src/pkg/syscall/mksysnum_linux.pl
View file @
7fd51f2f
...
...
@@ -3,6 +3,8 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
use
strict
;
my
$command
=
"mksysnum_linux.pl "
.
join
(
' '
,
@ARGV
);
print
<<EOF;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment