Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Delta Between Two Patch Sets: src/pkg/syscall/mksysnum_darwin.pl

Issue 4609047: code review 4609047: syscall: use strict in perl scripts (Closed)
Left Patch Set: diff -r cf1155385bb7 http://go.googlecode.com/hg/ Created 13 years, 9 months ago
Right Patch Set: diff -r 6c9c33c799f1 http://go.googlecode.com/hg/ Created 13 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/syscall/mksyscall_windows.pl ('k') | src/pkg/syscall/mksysnum_freebsd.pl » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #!/usr/bin/perl 1 #!/usr/bin/perl
2 # Copyright 2009 The Go Authors. All rights reserved. 2 # Copyright 2009 The Go Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style 3 # Use of this source code is governed by a BSD-style
4 # license that can be found in the LICENSE file. 4 # license that can be found in the LICENSE file.
5 # 5 #
6 # Generate system call table for Darwin from sys/syscall.h 6 # Generate system call table for Darwin from sys/syscall.h
7 7
8 use strict; 8 use strict;
9 use warnings;
10 9
11 my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 10 my $command = "mksysnum_darwin.pl " . join(' ', @ARGV);
12 11
13 print <<EOF; 12 print <<EOF;
14 // $command 13 // $command
15 // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT 14 // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
16 15
17 package syscall 16 package syscall
18 17
19 const ( 18 const (
20 EOF 19 EOF
21 20
22 while(<>){ 21 while(<>){
23 if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 22 if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){
24 my $name = $1; 23 my $name = $1;
25 my $num = $2; 24 my $num = $2;
26 $name =~ y/a-z/A-Z/; 25 $name =~ y/a-z/A-Z/;
27 print " SYS_$name = $num;" 26 print " SYS_$name = $num;"
28 } 27 }
29 } 28 }
30 29
31 print <<EOF; 30 print <<EOF;
32 ) 31 )
33 EOF 32 EOF
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b