1
0
mirror of https://github.com/golang/go synced 2024-10-04 05:21:22 -06:00
Commit Graph

5194 Commits

Author SHA1 Message Date
Robert Griesemer
ce89f213a8 go/parser: Better comment for ParseFile.
The name ParseFile was kept as it indicates that
this function parses a Go 'SourceFile' per the
Go spec. Similarly, the other functions (ParseExpr,
ParseStmtList, ParseDeclList) parse the corresponding
constructs as defined in the Go spec.

Fixes #1311.

R=r, rsc
CC=golang-dev
https://golang.org/cl/3453042
2010-12-07 13:44:01 -08:00
Rob Pike
1ce6245d6c throughout: fix broken calls to Printf etc.
I have written a tool to verify Printf calls, and although it's not
ready to be reviewed yet it's already uncovered a spate of problems
in the repository.  I'm sending this CL to break the changes into
pieces; as the tool improves it will find more, I'm sure.

R=rsc
CC=golang-dev
https://golang.org/cl/3427043
2010-12-07 16:42:54 -05:00
Russ Cox
8694959b12 http: fix build
R=dsymonds
TBR=dsymonds
CC=golang-dev
https://golang.org/cl/3425044
2010-12-07 16:20:15 -05:00
Eoghan Sherry
cab83650d1 gc: skip undefined symbols in import .
Fixes #1284.

R=ken3, rsc
CC=golang-dev
https://golang.org/cl/3210041
2010-12-07 16:16:01 -05:00
Russ Cox
b15c4245c5 crypto/tls: add *Config argument to Dial
Document undocumented exported names.
Allow nil Rand, Time, RootCAs in Config.

Fixes #1248.

R=agl1
CC=golang-dev
https://golang.org/cl/3481042
2010-12-07 16:15:15 -05:00
Christian Himpel
2660c2a7be crypto/tls: fix build of certificate generation example
R=agl1, rsc
CC=golang-dev
https://golang.org/cl/3366041
2010-12-07 16:14:55 -05:00
Michael Hoisie
bfac91a6b9 exec.LookPath: return os.PathError instad of os.ENOENT, it's more descriptive.
R=rsc
CC=golang-dev
https://golang.org/cl/3448042
2010-12-07 15:57:00 -05:00
Nigel Tao
688a83128d html: move the sanity checking of the entity map from runtime
(during init) to test-time (via gotest).

R=gri
CC=golang-dev
https://golang.org/cl/3466044
2010-12-08 07:55:03 +11:00
David Symonds
ae2495c5b0 http: Add EncodeQuery, a handy helper function for constructing URL query strings.
R=stephenm, rsc
CC=golang-dev
https://golang.org/cl/2985042
2010-12-07 15:54:04 -05:00
Wei Guangjing
70deac67cf 8l : add dynimport to import table in Windows PE, initial make cgo dll work.
R=rsc, brainman, Joe Poirier, mattn
CC=golang-dev
https://golang.org/cl/2166041
2010-12-07 15:28:33 -05:00
Albert Strasheim
836643400c build: Allow archiver to be specified in the environment with HOST_AR.
R=rsc
CC=golang-dev
https://golang.org/cl/2515043
2010-12-07 15:28:26 -05:00
Roger Peppe
24a78a026d bufio: make Reader.Read implement io.Reader semantics
R=rsc
CC=golang-dev
https://golang.org/cl/3395042
2010-12-07 14:54:15 -05:00
Albert Strasheim
cf6c212197 syscall, net: Add Recvmsg and Sendmsg on Linux.
Working on issue 1101.

R=rsc
CC=golang-dev
https://golang.org/cl/2331044
2010-12-07 13:40:14 -05:00
Russ Cox
ed7c3f3127 flag: handle multiple calls to flag.Parse
R=r
CC=golang-dev
https://golang.org/cl/3071041
2010-12-07 13:19:01 -05:00
Robert Griesemer
14eb03f614 go/scanner: remove Tokenize() - was only used in tests
R=r
CC=golang-dev
https://golang.org/cl/3415042
2010-12-07 10:08:00 -08:00
Eoghan Sherry
6aa85d1cbe gc: fix method offsets of anonymous interfaces
Fixes #1290.

R=rsc
CC=golang-dev
https://golang.org/cl/3259043
2010-12-07 12:56:26 -05:00
Dean Prichard
cd319092e0 sync: small naming fix for armv5
R=rsc
CC=golang-dev
https://golang.org/cl/3268042
2010-12-07 12:05:00 -05:00
Andrew Gerrand
79dcf180a2 runtime: fix build for nacl
R=lvd
CC=golang-dev
https://golang.org/cl/3391044
2010-12-07 15:24:46 +11:00
Ryan Hitchman
f503e26379 html: unescape numeric entities, and complete the named entities table, including two-character entities.
Fixes #1233.

R=nigeltao
CC=golang-dev
https://golang.org/cl/3445041
2010-12-07 12:13:47 +11:00
Nigel Tao
08a47d6f60 html: first cut at a parser.
R=gri
CC=golang-dev
https://golang.org/cl/3355041
2010-12-07 12:02:36 +11:00
Robert Griesemer
2fd2991eac godoc: don't call flush if position is not valid
(fixes new godoc crash when looking at spec)

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/3488041
2010-12-06 15:34:23 -08:00
Robert Griesemer
5a9ad8b9e3 go/ast: use token.Pos instead of token.Position; adjust all dependent code
Specifically:

	* lib/godoc:
	- provide file set (FSet) argument to formatters where needed

	* src/cmd:
	- cgo, ebnflint, godoc, gofmt, goinstall: provide file set (fset) where needed
	- godoc: remove local binary search with sort.Search (change by rsc),
	  extract file set for formatters

	* src/pkg:
	- exp/eval: remove embedded token.Position fields from nodes and replace
	  with named token.Pos fields; add corresponding Pos() accessor methods
	- go/token: added file.Line(), changed signature of File.Position()

	* test/fixedbugs/:
	- bug206.go: change test to not rely on token.Pos details

	* added various extra comments
	* Runs all.bash
	* gofmt formats all of src, misc w/o changes
	* godoc runs

	* performance:
	- The new version of godoc consumes about the same space after indexing
	  has completed, but indexing is half the speed. Significant space savings
	  are expected from smaller ASTs, but since they are thrown away after a
	  file has been indexed, this is not visible anymore. The slower indexing
	  time is due to the much more expensive computation of line information.
	  However, with the new compressed position information, indexing can be
	  rewritten and simplified. Furthermore, computing the line info can be
	  done more efficiently.

        New godoc, immediately after indexing completed (best of three runs):

	  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
	44381 godoc        0.0%  0:38.00   4    19    149  145M   184K   148M   176M

	2010/12/03 17:58:35 index updated (39.231s, 18505 unique words, 386387 spots)
	2010/12/03 17:58:35 bytes=90858456 footprint=199182584
	2010/12/03 17:58:36 bytes=47858568 footprint=167295224

	Old godoc, immediately after indexing completed (best of three runs):

	  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
	23167 godoc        0.0%  0:22.02   4    17    132  129M   184K   132M   173M

	2010/12/03 14:51:32 index updated (24.892s, 18765 unique words, 393830 spots)
	2010/12/03 14:51:32 bytes=66404528 footprint=163907832
	2010/12/03 14:51:32 bytes=46282224 footprint=163907832

	The different numbers for unique words/spots stem from the fact the the
	two workspaces are not exactly identical. The new godoc maintains a large
	file set data structure during indexing which (probably) is the reason
	for the larger heap (90858456 vs 66404528) before garbage collection.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3050041
2010-12-06 14:23:18 -08:00
Russ Cox
92bfd850e0 net: fix TestDialGoogle
TBR=r
CC=golang-dev
https://golang.org/cl/3417042
2010-12-06 14:07:36 -08:00
Yuval Pavel Zholkover
8221eb9103 8l, runtime: fix Plan 9 386 build.
8l was broken by commit 7ac0d2eed9, it caused .data to be page aligned in the file - which is not how Plan 9 expects things to be.
Also .rodata was layed out in a similar fashion.

Not sure when signame was introduced, but added a stub.
Removed the symo assignment in asm.c as it is not currently used.

Fix runtime breakage after commit 629c065d36 which prefixes all external symbols with runtime·.

R=rsc
CC=golang-dev
https://golang.org/cl/2674041
2010-12-06 16:38:28 -05:00
Eoghan Sherry
ff4e08f60d math: improve accuracy of Exp2
Note:
* Exp2 doesn't have a special case for very small arguments
* Exp2 hasn't been subject to a proper error analysis

Also:
* add tests for Exp2 with integer argument
* always test Go versions of Exp and Exp2

R=rsc
CC=Charlie Dorian, PeterGo, golang-dev
https://golang.org/cl/3481041
2010-12-06 16:24:51 -05:00
Russ Cox
6eee9ed507 time: fix build
Allow less precise timing on build machines.

TBR=r
CC=golang-dev
https://golang.org/cl/3391043
2010-12-06 16:22:32 -05:00
Rob Pike
42cfe48ffc use the new %U format for runes
R=rsc
CC=golang-dev
https://golang.org/cl/3483041
2010-12-06 14:38:25 -05:00
Rob Pike
53eaf40eba netchan: fix dumb locking bug introduced in recent editing.
-found by Dave Cheney

R=rsc
CC=golang-dev
https://golang.org/cl/3460042
2010-12-06 14:29:05 -05:00
Rob Pike
e26f9b3420 flag: fix format error in boolean error report. just use %q; the values are strings.
R=rsc
CC=golang-dev
https://golang.org/cl/3418043
2010-12-06 14:23:52 -05:00
Rob Pike
730e39cd13 fmt: add %U format for standard Unicode representation of integer values.
fmt.Printf("%U", 1) yields "U+0001"
It's essentially "U+%.4x" but lets you override the precision works in scan, too.

R=rsc
CC=golang-dev
https://golang.org/cl/3423043
2010-12-06 14:23:37 -05:00
Roger Peppe
e2d1595c81 time: make After use fewer goroutines and host processes.
With credit to Gustavo Niemeyer, who hinted at this approach
in #go-nuts.

R=adg, rsc, niemeyer, r
CC=golang-dev
https://golang.org/cl/3416043
2010-12-06 14:19:30 -05:00
Roger Peppe
415545e539 bytes: add Buffer.UnreadRune, Buffer.UnreadByte
R=rsc, r
CC=golang-dev
https://golang.org/cl/3421041
2010-12-06 14:10:10 -05:00
Luuk van Dijk
9a71bb00bb [68]l: generate debug info for builtin structured types. prettyprinting in gdb.
R=rsc
CC=golang-dev
https://golang.org/cl/3309041
2010-12-03 19:19:33 +01:00
Jamie Gennis
b88b38ac12 go/printer: preserve newlines in func parameter lists
Fixes #1179.

R=gri
CC=golang-dev
https://golang.org/cl/3225042
2010-12-02 10:42:10 -08:00
Stefan Nilsson
6f1835dce0 Sort: reduced stack depth to lg(n) in quickSort
Doing the tail recursion elimination explicitly
seems safer than leaving it to the compiler;
the code is still clean and easy to understand.

R=r, r2, gri
CC=golang-dev
https://golang.org/cl/3373041
2010-12-02 09:18:20 -08:00
Brad Fitzpatrick
042a7a81d3 http: consume request body before next request
Fixes #1306.

R=rsc
CC=golang-dev
https://golang.org/cl/3332043
2010-12-01 20:00:19 -08:00
Rob Pike
5e4882a325 template: implement multi-word variable instantation for formatters.
Before one could say
	{field}
or
	{field|formatter}
Now one can also say
	{field1 field2 field3}
or
	{field1 field2 field3|formatter}
and the fields are passed as successive arguments to the formatter,
analogous to fmt.Print.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/3385041
2010-12-01 17:10:40 -08:00
Rob Pike
d1524217df template: change the signature of formatters for future development.
Make them more like Printf, with a ... final argument.  This breaks
code with existing formatters but not the templates that use them.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/3378041
2010-12-01 13:33:49 -08:00
Kyle Consalus
009aebdba8 Removed bytes.Add and bytes.AddByte; we now have 'append'.
Changed all uses of bytes.Add (aside from those testing bytes.Add) to append(a, b...).
Also ran "gofmt -s" and made use of copy([]byte, string) in the fasta benchmark.

R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/3302042
2010-12-01 11:59:13 -08:00
Roger Peppe
1f90447e31 log: ensure writes are atomic.
This means that any Writer can be used safely
even when Output is called concurrently.
Fixes #1302.

R=r, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/3300042
2010-12-01 10:15:42 -08:00
Benny Siegert
b06dc26a58 path: Windows support for Split
Make Split work on backslashes as well as on slashes under Windows
and support the "C:filename" special case. Also add corresponding
tests.

R=r, rsc, PeterGo, r2, brainman
CC=golang-dev
https://golang.org/cl/3008041
2010-11-30 17:17:45 -08:00
Luuk van Dijk
555feea117 runtime: fix windows breakage
R=iant
CC=golang-dev
https://golang.org/cl/3344044
2010-12-01 00:19:00 +01:00
Rob Pike
fdeda13f9e fmt: fix documentation format glitch. no content to change.
Fixes #1313.

R=gri
CC=golang-dev
https://golang.org/cl/3361041
2010-11-30 14:28:33 -08:00
Adam Langley
3cb4bdb9ce utf8: make EncodeRune's destination the first argument.
R=r
CC=golang-dev
https://golang.org/cl/3364041
2010-11-30 16:59:43 -05:00
Adam Langley
287045085d crypto/elliptic: use a Jacobian transform
(Speeds up the code about 25x)

R=r
CC=golang-dev
https://golang.org/cl/3359042
2010-11-30 16:58:59 -05:00
Rob Pike
6540c85c7f fmt.Scan: accept Inf and NaN
Fixes #1308.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/3280045
2010-11-30 12:59:52 -08:00
Rob Pike
448c05d7c8 strconv: Atof on Infs and NaNs
R=rsc
CC=golang-dev
https://golang.org/cl/3359041
2010-11-30 12:53:42 -08:00
Rob Pike
b389646243 sort: avoid overflow in pivot calculation.
thanks to snilsson@nada.kth.se for the original CL.

R=gri
CC=golang-dev, snilsson
https://golang.org/cl/3280044
2010-11-30 10:37:57 -08:00
Eoghan Sherry
0dc24603eb big: fix (*Rat) SetFrac64(a, b) when b < 0.
R=gri
CC=golang-dev
https://golang.org/cl/3352041
2010-11-30 10:23:27 -08:00
Luuk van Dijk
85cae877f5 runtime: parallel definitions in Go for all C structs.
R=rsc
CC=golang-dev
https://golang.org/cl/3308041
2010-11-30 18:21:26 +01:00
Peter Mundy
37b7e3db73 godoc: fix doc typo
Consistently use 6060 as the port number.

R=gri
CC=golang-dev
https://golang.org/cl/3287042
2010-11-29 14:31:24 -08:00
Luuk van Dijk
f08baa38f8 [68]l: correct dwarf location for globals and ranges for arrays.
R=rsc
CC=golang-dev
https://golang.org/cl/3306042
2010-11-29 19:25:33 +01:00
Rob Pike
d90d0ede3f fmt: allow "% X" as well as "% x"
R=rsc, cw, PeterGo
CC=golang-dev
https://golang.org/cl/3319042
2010-11-29 07:30:36 -08:00
Anschel Schaffer-Cohen
f5bc87cb75 exp/eval: build fix for parser.ParseFile API change.
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/3283042
2010-11-29 09:25:31 +11:00
Mathieu Lonjaret
387d58e790 compress/flate: fix typo in comment.
R=golang-dev, nigeltao_gnome, nigeltao
CC=golang-dev
https://golang.org/cl/3334041
2010-11-26 13:05:22 +11:00
Alex Brainman
4e69976a60 runtime: fix SysFree to really free memory on Windows
Fixes #1294.

R=golang-dev, PeterGo, iant
CC=golang-dev
https://golang.org/cl/3271041
2010-11-24 11:47:35 +11:00
Wei Guangjing
95c341fc78 net: add ReadFrom and WriteTo windows version.
Fixes #1275.

R=rsc, brainman
CC=golang-dev
https://golang.org/cl/3136042
2010-11-22 11:01:30 -05:00
Anthony Martin
1ee4512b98 gc: better error message for bad type in channel send
# test program
1 package main
2
3 type C chan int
4
5 func F(c C) {
6 	c <- true
7 }

# old error
test.go:6: cannot use true (type bool) as type int in function argument

# new error
test.go:6: cannot use true (type bool) as type int in channel send

R=rsc, ejsherry
CC=golang-dev
https://golang.org/cl/3231042
2010-11-22 10:59:51 -05:00
Robert Griesemer
e21aac29ba position.go: more flexible AddFile method
This will make it easier to use Pos values
together with suffix arrays by slightly de-
coupling the mapping of Pos values to global
offsets.

R=rsc
CC=golang-dev
https://golang.org/cl/3231041
2010-11-20 21:30:36 -08:00
Ken Thompson
8cb8ba14a5 more on dynamic hash in compound literals.
thanks to vskrap, andrey mirtchovski,
and Eoghan Sherry.

R=rsc
CC=golang-dev
https://golang.org/cl/3245041
2010-11-20 15:58:28 -08:00
Robert Griesemer
b1fd0860df godoc: use correct time stamp to indicate accuracy of search result
- compare against fsModified to check if index is out of date
- don't change fsModified if there are no user-mapped file systems

R=rsc, iant
CC=golang-dev
https://golang.org/cl/3213041
2010-11-19 14:05:12 -08:00
Adam Langley
b84b20b820 crypto/cipher: add CFB and OCFB mode.
(Files which I left out of the initial commit to keep it small.)

R=rsc
CC=golang-dev
https://golang.org/cl/3183043
2010-11-19 16:17:58 -05:00
Russ Cox
b51f0c5cca index/suffixarray: use sort.Search
R=gri
CC=golang-dev
https://golang.org/cl/3200041
2010-11-19 16:04:25 -05:00
Adam Langley
07791d04d6 crypto/cipher: add package
cipher is intended to replace crypto/block over time. This
change only adds basic parts: CBC and CTR mode and doesn't add
the package to the top-level Makefile.

R=r, rsc
CC=golang-dev
https://golang.org/cl/3069041
2010-11-19 14:12:07 -05:00
Robert Griesemer
ad21c42f05 godoc: compute search index for all file systems under godoc's observation
R=rsc
CC=golang-dev
https://golang.org/cl/3209041
2010-11-18 19:55:38 -08:00
Ken Thompson
b3dd22fecb adjustable hash code in
typecheck of composit literals
to get rid of n^2 behavior.

R=rsc
CC=golang-dev
https://golang.org/cl/3208041
2010-11-18 13:07:34 -08:00
Ian Lance Taylor
1fab0cd12a Makefiles: Don't define _64BIT now that 6c does it by default.
R=rsc
CC=golang-dev
https://golang.org/cl/3207041
2010-11-18 12:34:47 -08:00
Ian Lance Taylor
553a88cfe7 cgo: Print required space after parameter name in wrapper function.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/3206041
2010-11-18 12:34:04 -08:00
Ian Lance Taylor
d853b594b4 6c: automatically #define _64BIT.
This makes it much easier to use a tool like Swig which needs
to run either 8c or 6c on generated code which #include's
"runtime.h".

R=ken2, rsc
CC=golang-dev
https://golang.org/cl/3205041
2010-11-18 10:26:41 -08:00
Russ Cox
285298b975 sort: invert meaning of f in Search
Backwards incompatible change, but makes
it easier to reason about non-idiomatic searches:
now f specifies what is sought.

R=gri
CC=golang-dev
https://golang.org/cl/3195042
2010-11-18 11:46:07 -05:00
Russ Cox
19f0e4603d sort: edit doc comment for Search
Change comment to be more generic,
with indexed data structure search as
one common use case.

Fix typo []data.

R=gri, rog
CC=golang-dev
https://golang.org/cl/3159041
2010-11-18 07:16:09 -05:00
Andrew Gerrand
3fa6dcaca4 rpc: add RegisterName to allow override of default type name
R=r, r2
CC=golang-dev
https://golang.org/cl/2890041
2010-11-18 14:14:42 +11:00
Robert Griesemer
6aeaa5d3fe go/token position: code improvements per rsc's suggestion
R=rsc
CC=golang-dev
https://golang.org/cl/3183041
2010-11-17 17:00:25 -08:00
Robert Griesemer
ac966ac706 position.go: test cases for token.Pos
- adjustments to position.go due to changed sort.Search semantics
- various minor fixes

R=rsc
CC=golang-dev, r
https://golang.org/cl/3079041
2010-11-17 12:17:40 -08:00
Robert Griesemer
e38b7f4953 godoc: bug fix in relativePath
This fixes a problem with relativePath, where
a prefix was not recognized because it ended
in "//" as opposed to just "/".

Also: Minor unrelated cleanup of a declaration.

R=rsc
CC=golang-dev
https://golang.org/cl/3146041
2010-11-17 11:03:33 -08:00
Robert Griesemer
18ae633472 token/position: implemented Pos
A pos value represents a file-set specific, accurate
source position value. It is 8x smaller in size than
the corresponding Position value (4 bytes vs 32 bytes).

Using Pos values instead of Position values in AST
saves approx. 25MBytes of memory when running godoc
on the current repository.

This CL introduces the Pos, File, and FileSet data
types; it does not affect existing code. Another
(pending CL) will make the change to all dependent
source files.

Missing: tests

R=r
CC=golang-dev, rsc
https://golang.org/cl/2936041
2010-11-12 16:39:33 -08:00
Alex Brainman
a2a4e0c01a exec: enable tests on windows
Fixes #1104.

R=golang-dev, mattn, r
CC=Joe Poirier, golang-dev
https://golang.org/cl/3051041
2010-11-13 11:15:09 +11:00
Robert Griesemer
8f651ff742 sort.Search: slightly more precise wording in comment
(+ some cosmetic changes)

R=iant, iant2
CC=golang-dev
https://golang.org/cl/3076041
2010-11-12 16:08:56 -08:00
Roger Peppe
bac478da1c sort: simplify semantics of Search.
As discussed earlier.

R=gri
CC=golang-dev
https://golang.org/cl/3025042
2010-11-12 15:57:33 -08:00
Kyle Consalus
81cb189a06 Remove unnecessary casts in Get() methods.
Cleaner, but also results in a 25%+ performance improvement for Get()/SetValue() on my machine.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/3072041
2010-11-12 15:25:25 -08:00
Ken Thompson
48cc88d063 arm is not little-endian
R=rob
CC=golang-dev
https://golang.org/cl/3075041
2010-11-12 14:27:55 -08:00
Benny Siegert
8530e8ef65 strings: add LastIndexAny
The need for a LastIndexAny function has come up in the discussion
for https://golang.org/cl/3008041/. This function is
implemented analogously to lastIndexFunc, using functions from
the utf8 package.

R=r, rsc, PeterGo
CC=golang-dev
https://golang.org/cl/3057041
2010-11-12 12:47:50 -08:00
Rob Pike
f0d174b776 gc: fix arm build
R=ken2
CC=golang-dev
https://golang.org/cl/3074041
2010-11-12 12:46:46 -08:00
Adam Langley
fb784785f5 crypto/elliptic: add package
elliptic implements several standard elliptic curves over prime fields.

R=r, r2
CC=golang-dev
https://golang.org/cl/3065041
2010-11-12 14:55:32 -05:00
Ken Thompson
8613eb56b2 last of the arm conversions
R=rsc
CC=golang-dev
https://golang.org/cl/3053041
2010-11-11 19:54:35 -08:00
Robert Griesemer
6498c1d468 sort.Search: added extra test to verify efficiency
R=r
CC=golang-dev
https://golang.org/cl/3048041
2010-11-11 14:52:37 -08:00
Robert Griesemer
febde3882b sort.Search: more typos
R=r
CC=golang-dev
https://golang.org/cl/3042041
2010-11-11 13:52:49 -08:00
Adam Langley
ffa9000b75 crypto/x509: policy OID support and fixes.
* Add support for certificate policy identifiers
        * Fix the version number of generated certificates
        * Fix the parsing of version numbers
        * Fix the case of multiple name entries (it should have been a list of
          tagged values, not a tagged list of values).

R=r
CC=golang-dev
https://golang.org/cl/3044041
2010-11-11 15:50:40 -05:00
Robert Griesemer
86630fe6ad sort.Search: fix typo in documentation
R=r
CC=golang-dev
https://golang.org/cl/3016043
2010-11-11 10:51:59 -08:00
Alex Brainman
b611137098 runtime: free memory allocated by windows CommandLineToArgv
R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/3003043
2010-11-11 10:38:45 +11:00
Ian Lance Taylor
e8605b1279 runtime: omit runtime· prefix from static functions (in ARM code).
R=r
CC=golang-dev
https://golang.org/cl/3026041
2010-11-10 15:23:20 -08:00
Ian Lance Taylor
7e69c90ade runtime: Add some missing runtime· prefixes to ARM asm code.
R=r, r2
CC=golang-dev
https://golang.org/cl/3024041
2010-11-10 15:10:19 -08:00
Ian Lance Taylor
be0b649eb1 path: Fix Glob when it finds a file in directory position.
When searching a list of directories, the files which match
the pattern are accumulated in a slice.  If the glob has a
wildcard for the directory, and the wildcard matches a file
rather than a directory, then the files found so far are
discarded.  E.g., path.Glob("*/x") in a directory which
contains both files and subdirectories.  This patch avoids
discarding matches found so far when a file is found.

R=r
CC=bsiegert, golang-dev
https://golang.org/cl/3015042
2010-11-10 13:25:49 -08:00
Robert Griesemer
194dde22c3 sort: binary search for sorted slices
R=r, r2
CC=golang-dev
https://golang.org/cl/2997041
2010-11-10 13:19:28 -08:00
Roger Peppe
089c21ea52 testing: delete redundant name argument to Benchmark().
[it was a carry over from the previous iteration]

R=r
CC=golang-dev
https://golang.org/cl/3016041
2010-11-10 09:39:26 -08:00
Ken Thompson
cb3754fd43 fix error converting result of complex
division. resolves issue 1261.

R=rsc
CC=golang-dev
https://golang.org/cl/2985043
2010-11-09 17:39:36 -08:00
Robert Griesemer
56bfe95e7f go/ast: change embedded token.Position fields to named fields
This is in preparation for a different position representation.
It also resolves situations where a node would be printed as
it's node position simply because the embedded token.Position
has a String method.

R=r
CC=golang-dev
https://golang.org/cl/2991041
2010-11-09 11:26:54 -08:00
Roger Peppe
e9afb9d399 container/list: make Remove return Value of removed element.
When it is known that there is already at least one element in the
list, it is awkwardly verbose to use three lines and an extra
variable declaration to remove the first or last item (a common
case), rather than use a simple expression.

a stack:
	stk.PushFront(x)
	x = stk.Front().Remove().(T)

vs.
	stk.PushFront(x)
	e := stk.Front()
	e.Remove()
	x = e.Value.(T)
[An alternative CL might be to add PopFront and PopBack methods].

R=gri
CC=golang-dev
https://golang.org/cl/3000041
2010-11-09 08:58:23 -08:00
Evan Shaw
49fdfe21dd bytes: SSE for bytes.IndexByte on amd64
Performance on 2.8 GHz Intel Core i7:

Before:
BenchmarkIndexByte4K  1000000              2997 ns/op        1366.70 MB/s
BenchmarkIndexByte4M      500           3049772 ns/op        1375.28 MB/s
BenchmarkIndexByte64M      50          49582280 ns/op        1353.48 MB/s

After:
BenchmarkIndexByte4K 10000000               298 ns/op       13744.97 MB/s
BenchmarkIndexByte4M    10000            285993 ns/op       14665.76 MB/s
BenchmarkIndexByte64M     500           4618172 ns/op       14531.48 MB/s

R=rsc, PeterGo, r2, r
CC=golang-dev
https://golang.org/cl/2888041
2010-11-08 17:33:53 -08:00
Rob Pike
e9c901dbf4 json: don't indirect before testing for custom unmarshaler
Fixes #1260.

R=gri
CC=golang-dev
https://golang.org/cl/2994041
2010-11-08 15:33:00 -08:00
Robert Griesemer
9f19392f1a os.Expand: don't call append for each non-variable char
R=r
CC=golang-dev
https://golang.org/cl/2993041
2010-11-08 15:13:35 -08:00
Rob Pike
02469b8200 strconv: quote erroneous string in errors
Fixes #1253.

R=gri
CC=golang-dev
https://golang.org/cl/2990041
2010-11-08 15:08:41 -08:00
Rob Pike
26cda27b0f os: add Expand function to evaluate environment variables.
Fixes #1258.

R=gri, msolo, bradfitzpatrick, r2
CC=golang-dev
https://golang.org/cl/2988041
2010-11-08 13:25:01 -08:00
Luuk van Dijk
fbd92dba96 6l/8l: generate dwarf variable names with disambiguating suffix.
R=rsc
CC=golang-dev
https://golang.org/cl/2733042
2010-11-08 19:48:21 +01:00
Wei Guangjing
11ace8e975 net: fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/2932041
2010-11-05 23:08:18 -04:00
Peter Mundy
3b44fbe869 testing: rename type Test to InternalTest
type Benchmark has been renamed to InternalBenchmark

R=rsc
CC=golang-dev
https://golang.org/cl/2942042
2010-11-05 23:05:53 -04:00
Russ Cox
9e1ee8ff4f env.bash: more quoting in case of spaces
R=r, r2
CC=golang-dev
https://golang.org/cl/2938041
2010-11-05 23:04:08 -04:00
Russ Cox
81cf9f7e63 libmach: detail for darwin errors
R=r, r2
CC=golang-dev
https://golang.org/cl/2937041
2010-11-05 23:03:53 -04:00
Peter Mundy
fa7341aafd syscall: use 64-bit file size for truncation on Linux
Truncate and Ftruncate for 32-bit Linux should use 64-bit
offset system calls.

R=rsc
CC=golang-dev, royger
https://golang.org/cl/2943041
2010-11-05 16:41:23 -04:00
Christopher Wedgwood
6101788972 io: use SetFinalizer more elegantly in Pipe
(this works now that issue 751 is resolved)

R=rsc
CC=golang-dev
https://golang.org/cl/2834041
2010-11-05 15:05:39 -04:00
Rob Pike
c9d39dca8d gob: don't add "." if package path is empty when registering a type.
R=rsc
CC=golang-dev
https://golang.org/cl/2939041
2010-11-05 11:22:28 -07:00
Eric Clark
40d10a34db gc: doc nit
R=rsc, r
CC=golang-dev
https://golang.org/cl/2918042
2010-11-05 11:21:54 -07:00
Keith Rarick
a144e3ec36 net: provide public access to file descriptors
Fixes #918.

R=rsc, rog, brainman
CC=golang-dev
https://golang.org/cl/2904041
2010-11-05 14:02:03 -04:00
Russ Cox
9ce0eb2d07 runtime: explain nacl closure failure
R=r, r2
CC=golang-dev
https://golang.org/cl/2889042
2010-11-05 14:00:46 -04:00
Evan Shaw
4d429c7fe5 6l: More SSE instruction fixes
PSADBW and PSHUFL had the wrong prefixes.

R=rsc
CC=golang-dev
https://golang.org/cl/2836041
2010-11-05 13:59:53 -04:00
Benny Siegert
a4f3d647d4 path: add Glob
As discussed in http://groups.google.com/group/golang-dev/browse_thread/thread/926b7d550d98ec9e,
add a simple "path expander" function, which returns all the
files matching the given pattern. This function is called Glob
after glob(3) in libc.

Also add a convenience function, hasMeta, that checks whether
a string contains one of the characters which are specially handled
by Match.

R=rsc, r, r2
CC=golang-dev
https://golang.org/cl/2476041
2010-11-05 10:47:56 -07:00
Rob Pike
9f7f69d300 gob: when sending an interface value, indirect down to the
underlying type; otherwise encoding fails when sending
a pointer value.

R=rsc
CC=golang-dev
https://golang.org/cl/2922041
2010-11-05 10:36:27 -07:00
Adam Langley
836529a63c crypto/tls: use pool building for certificate checking
Previously we checked the certificate chain from the leaf
upwards and expected to jump from the last cert in the chain to
a root certificate.

Although technically correct, there are a number of sites with
problems including out-of-order certs, superfluous certs and
missing certs.

The last of these requires AIA chasing, which is a lot of
complexity. However, we can address the more common cases by
using a pool building algorithm, as browsers do.

We build a pool of root certificates and a pool from the
server's chain. We then try to build a path to a root
certificate, using either of these pools.

This differs from the behaviour of, say, Firefox in that Firefox
will accumulate intermedite certificate in a persistent pool in
the hope that it can use them to fill in gaps in future chains.

We don't do that because it leads to confusing errors which only
occur based on the order to sites visited.

This change also enabled SNI for tls.Dial so that sites will return
the correct certificate chain.

R=rsc
CC=golang-dev
https://golang.org/cl/2916041
2010-11-05 09:54:56 -04:00
Alex Brainman
2b18b18263 runtime: fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/2923041
2010-11-05 17:27:12 +11:00
Graham Miller
23c41a1ef2 Small addition to previous optimization of memequal as discussed here: http://groups.google.com/group/golang-nuts/browse_thread/thread/f591ba36d83723c0/9aba02d344045f38
R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/2880041
2010-11-04 13:45:18 -07:00
Robert Griesemer
3a50d721a8 go/scanner: line comments may end in EOF
R=rsc
CC=golang-dev
https://golang.org/cl/2908041
2010-11-04 13:15:42 -07:00
Russ Cox
132e5435e3 gc: line comments may end in EOF
R=ken2
CC=golang-dev
https://golang.org/cl/2907041
2010-11-04 16:04:04 -04:00
Russ Cox
68b4255a96 runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries.  The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.

The symbols left alone are:

	** known to cgo **
	_cgo_free
	_cgo_malloc
	libcgo_thread_start
	initcgo
	ncgocall

	** known to linker **
	_rt0_$GOARCH
	_rt0_$GOARCH_$GOOS
	text
	etext
	data
	end
	pclntab
	epclntab
	symtab
	esymtab

	** known to C compiler **
	_divv
	_modv
	_div64by32
	etc (arch specific)

Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.

Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.

R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 14:00:19 -04:00
Ian Lance Taylor
d2d650bdc9 Use future official DWARF language code for Go.
http://dwarfstd.org/ShowIssue.php?issue=101014.1&type=open

Informally accepted for future DWARF 5.

R=lvd
CC=golang-dev, rsc
https://golang.org/cl/2881042
2010-11-04 08:45:25 -07:00
Chris Jones
25b1e83262 net: fix LookupSRV
R=rsc, chris
CC=golang-dev
https://golang.org/cl/2420041
2010-11-04 10:30:39 -04:00
Ken Thompson
9c6df3ca13 add hardware floating point.
currently, softfloat does not work and
there are some unsigned-to-float conversion errors.

R=rsc
CC=golang-dev
https://golang.org/cl/2886041
2010-11-03 17:31:07 -07:00
Rob Pike
0aa9d84b56 units: fix compilation
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/2865041
2010-11-03 12:20:37 -07:00
Adam Langley
02939dec80 crypto: switch block ciphers to detination first.
Previously all the functions took two arguments: src, dst. This is the
reverse of the usual Go style and worth changing sooner rather than
later.

Unfortunately, this is a change that the type system doesn't help
with. However, it's not a subtle change: any unittest worth the name
should catch this.

R=rsc, r
CC=golang-dev
https://golang.org/cl/2751042
2010-11-03 10:43:43 -04:00
Adam Langley
b5135b34c9 crypto: add cast5
CAST5 is the default OpenPGP cipher.

(This won't make Rob any happier about the size of crypto/, of course.)

It already has dst, src in that order but it doesn't have any users yet so I figure it's better than changing it later.

R=rsc, gri, r
CC=golang-dev
https://golang.org/cl/2762042
2010-11-03 10:39:15 -04:00
Robert Griesemer
417e22b584 sync: fix typo in documentation
R=rsc, adg
CC=golang-dev
https://golang.org/cl/2841041
2010-11-02 16:01:07 -07:00
Kai Backman
95b40f6ca1 Fix a deadlock bug in the rpc client. The panic will trigger
regularly when client connections are flaky (probably another
issue).

(credits to jussi@tinkercad.com for finding the issue)

R=rsc, r
CC=golang-dev, jussi
https://golang.org/cl/2831042
2010-11-02 14:04:56 -07:00
Rob Pike
59315fbfb5 netchan: fix locking bug.
There's no need to hold the client mutex when calling encode, since encode itself
uses a mutex to make the writes atomic.  However, we need to keep
the messages ordered, so add a mutex for that purpose alone.
Fixes #1244.

R=rsc
CC=golang-dev
https://golang.org/cl/2833041
2010-11-02 10:58:27 -07:00
Robert Griesemer
396228a652 go/scanner: removed scanner/internal-only uses of token.Position
First step towards a more light-weight implementation of token.Position:
- only use token.Position for reporting token and error position
- use offsets only for scanner control
- no interface changes yet

R=rsc
CC=golang-dev
https://golang.org/cl/2825041
2010-11-02 10:38:07 -07:00
Alex Brainman
8f8f625cb1 8l: pe generation fixes
Restore ability to have different file and
section alignment in generated pe file.

Stop generating .bss pe section, it is
part of .data now.

Some code refactoring.

R=rsc, vcc
CC=golang-dev
https://golang.org/cl/2731041
2010-11-02 10:56:56 +11:00
Robert Griesemer
ce98044523 fix build
R=rsc
CC=golang-dev
https://golang.org/cl/2820041
2010-11-01 15:25:39 -07:00
Brad Fitzpatrick
b0afb931a8 Use strings.Contains in src/cmd/...
R=r
CC=golang-dev, r2, rsc
https://golang.org/cl/2819041
2010-11-01 15:21:35 -07:00
Robert Griesemer
7996924c89 go/printer: do not remove parens around composite literals starting with a type name in control clauses
(even when they are nested inside an expression).

Fixes #1243.

R=rsc
CC=golang-dev
https://golang.org/cl/2817041
2010-11-01 15:08:03 -07:00
Robert Griesemer
9384fdc96a go/ast: add Inspect function for easy AST inspection w/o a visitor
R=rsc
CC=golang-dev
https://golang.org/cl/2770044
2010-11-01 15:06:34 -07:00
Wei Guangjing
035696c59a debug/pe, cgo: add windows support
R=rsc, mattn
CC=golang-dev
https://golang.org/cl/1976045
2010-11-01 17:52:26 -04:00
Brad Fitzpatrick
e198a5086a strings: Contains
Tiny helper to avoid strings.Index(s, sub) != -1

R=rsc, r2, r
CC=golang-dev
https://golang.org/cl/2265044
2010-11-01 14:32:48 -07:00
Rob Pike
e8436689ad gotest: if the benchmark list is empty, print it in a way that
gofmt will leave alone.

R=rsc, bradfitz, bradfitzpatrick
CC=golang-dev
https://golang.org/cl/2816041
2010-11-01 14:23:07 -07:00
Albert Strasheim
6442f38a91 syscall: SIO constants for Linux
R=rsc
CC=golang-dev
https://golang.org/cl/2303043
2010-11-01 16:42:33 -04:00
Roger Peppe
270bad3939 testing: add Benchmark to allow benchmarks to be run without gotest.
R=rsc
CC=golang-dev
https://golang.org/cl/2506042
2010-11-01 16:15:17 -04:00
Michael Hoisie
7b4eed7d66 http server: don't send trailing '0' for chunked encoding when responding with 304 NotModified
R=rsc, adg
CC=golang-dev
https://golang.org/cl/2723041
2010-11-01 16:15:03 -04:00
Russ Cox
276003adb1 build: fiddle with make variables
Fixes #1234.

R=r, r2
CC=golang-dev
https://golang.org/cl/2735043
2010-11-01 16:14:58 -04:00
Anthony Martin
51b15d68aa libutf: update to Unicode 5.2.0 to match pkg/unicode
R=rsc, r, PeterGo, r2
CC=golang-dev
https://golang.org/cl/2753045
2010-11-01 16:14:48 -04:00
Evan Shaw
884dceca1f 6a/6l: fix MOVOU encoding
The andproto field was set incorrectly, causing 6a to encode illegal
instructions.

R=rsc
CC=golang-dev
https://golang.org/cl/2781042
2010-11-01 16:14:43 -04:00
Robert Griesemer
68ac0c1d94 go/scanner: don't accept '\x0g' character escape (bug fix)
Added more test cases.

R=rsc
CC=golang-dev
https://golang.org/cl/2804041
2010-11-01 12:50:21 -07:00
Rob Pike
6dc4c58f87 gob: documentation. this time for sure.
if the interface value is nil, it sends no value,

R=rsc, adg
CC=golang-dev
https://golang.org/cl/2801042
2010-10-31 17:48:19 -07:00
Rob Pike
fbfb1d9e72 mkrunetype: install a Makefile and tweak it slightly so it can be built.
R=rsc
CC=golang-dev
https://golang.org/cl/2813041
2010-10-31 17:46:26 -07:00
Rob Pike
41ac2f8a42 gob: update documentation about wire format for interfaces.
R=rsc
CC=golang-dev
https://golang.org/cl/2814041
2010-10-31 15:08:45 -07:00
Rob Pike
7f7cb166c8 gob: several fixes.
1) Be sure to use the eval-time encoder/decoder rather than
the compile-time decoder.  In a few cases the receiver for
the compiling encoder was being pickled incorrectly into a
closure.
(This is the fix for issue 1238).

2) Get the innermost name right when given a pointer to an
unnamed type.

3) Use a count to delineate interface values, making it
possible to ignore values without having a concrete type
to encode into.  This is a protocol change but only for the
new feature, so it shouldn't affect anyone.  The old test
worked because, amazingly, it depended on bug #1.

Fixes #1238.

R=rsc, albert.strasheim
CC=golang-dev
https://golang.org/cl/2806041
2010-10-31 13:41:30 -07:00
Alex Brainman
a8c4da996e syscall: fix windows build
R=golang-dev
CC=golang-dev
https://golang.org/cl/2713043
2010-10-30 23:55:22 +11:00
Alex Brainman
7812b79627 syscall: fix Stat(path) where path is directory with trailing '/' on windows
Fixes #1220.

R=rsc, r
CC=golang-dev
https://golang.org/cl/2728043
2010-10-30 23:06:49 +11:00
Rob Pike
c490bb6f81 gob: clarify the comments about installing the debug/dumper.
R=rsc
CC=golang-dev
https://golang.org/cl/2789043
2010-10-29 15:52:25 -07:00
Rob Pike
96b9efe8a9 gob: make the debugging (dumping) code work again. Mostly rewrite it, in fact.
It's still not compiled in by default.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2754043
2010-10-29 15:07:56 -07:00
Robert Griesemer
907e998cba go/scanner: added another test case, clarified some code
R=rsc
CC=golang-dev
https://golang.org/cl/2741042
2010-10-29 15:07:04 -07:00
Robert Griesemer
7eb5c9a520 ebnf: use append
R=r, rsc
CC=golang-dev
https://golang.org/cl/2799041
2010-10-28 21:23:24 -07:00
Robert Griesemer
75855a8f5e tabwriter: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2798041
2010-10-28 21:23:04 -07:00
Robert Griesemer
5762cd3755 go/doc: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2792041
2010-10-28 17:26:01 -07:00
Rob Pike
4e9cc085d2 testing: eliminate testing/regexp
Rather than updating the stripped-down regexp implementation embedded
in testing, delete it by passing the one function we need from the package
main file created by gotest.

R=rsc
CC=golang-dev
https://golang.org/cl/2761043
2010-10-28 16:54:24 -07:00
Rob Pike
1f4d54ea01 regexp: eliminate vector in favor of append.
R=rsc
CC=golang-dev
https://golang.org/cl/2795041
2010-10-28 15:54:01 -07:00
Robert Griesemer
fafb116c75 go/printer: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2793041
2010-10-28 15:09:47 -07:00
Robert Griesemer
098e94173a go/typechecker: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2736044
2010-10-28 15:09:21 -07:00
Andrew Gerrand
6062515a93 container/list: document iteration
R=rsc
CC=golang-dev
https://golang.org/cl/2768042
2010-10-29 08:48:16 +11:00
Robert Griesemer
302b0ff942 go/parser: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2720042
2010-10-28 13:36:28 -07:00
Robert Griesemer
12be168b4b godoc: bug fix (bug introduced with revision 3ee58453e961)
(thanks to Chris Dollin for identifying the cause)

Fixes #1237.

R=rsc
CC=golang-dev
https://golang.org/cl/2753043
2010-10-28 08:44:25 -07:00
Russ Cox
69c4e9380b use append
R=gri, r, r2
CC=golang-dev
https://golang.org/cl/2743042
2010-10-27 19:47:23 -07:00
Russ Cox
d8b5d039cd gc: implement append
R=ken2
CC=golang-dev
https://golang.org/cl/2757042
2010-10-27 17:56:32 -07:00
Andrew Gerrand
250ac87368 rpc: expose Server type to allow multiple RPC Server instances
R=r, rsc, msolo, sougou
CC=golang-dev
https://golang.org/cl/2696041
2010-10-28 11:05:56 +11:00
Brad Fitzpatrick
ad7d24ac4b image/png: speed up paletted encoding ~25%
Avoids a lot of redundant bounds checks.

R=nigeltao, rsc
CC=golang-dev
https://golang.org/cl/2678041
2010-10-27 22:48:18 +11:00
Russ Cox
d86ab015f7 use copy
R=gri
CC=golang-dev
https://golang.org/cl/2763041
2010-10-26 21:52:54 -07:00
Russ Cox
e48c0fb562 5g, 6g, 8g: generate code for string index
instead of calling function.

R=ken2
CC=golang-dev
https://golang.org/cl/2762041
2010-10-26 21:11:17 -07:00
Russ Cox
705c0382e8 big: arm assembly, faster software mulWW, divWW
Reduces time spent running crypto/rsa test by 65%.

Fixes #1227.

R=gri, PeterGo
CC=golang-dev
https://golang.org/cl/2743041
2010-10-26 21:10:17 -07:00
Rob Pike
f437d4d356 gob: must register basic types to store them in interfaces.
Fixes #1230.

R=rsc
CC=golang-dev
https://golang.org/cl/2750041
2010-10-26 17:07:39 -07:00
Nigel Tao
3bb036958c gob: package doc fixes.
R=r, r2, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2748041
2010-10-27 10:46:00 +11:00
Russ Cox
82c6f5e3d1 gc, runtime: copy([]byte, string)
R=ken2
CC=golang-dev
https://golang.org/cl/2741041
2010-10-26 08:36:07 -07:00
Russ Cox
8fff9166f6 arm: enable all tests
ARM functionality is now completely working.
(Or if it's not, we'll fix it.)

R=ken2
CC=golang-dev
https://golang.org/cl/2738041
2010-10-25 21:25:13 -07:00
Russ Cox
da26e27c05 debug/gosym: do not run when cross-compiling
R=r
CC=golang-dev
https://golang.org/cl/2737041
2010-10-25 18:00:42 -07:00
Russ Cox
7c2b1597c6 arm: precise float64 software floating point
Adds softfloat64 to generic runtime
(will be discarded by linker when unused)
and adds test for it.  I used the test to check
the software code against amd64 hardware
and then check the software code against
the arm and its simulation of hardware.
The latter should have been a no-op (testing
against itself) but turned up a bug in 5c causing
the vlrt.c routines to miscompile.

These changes make the cmath, math,
and strconv tests pass without any special
accommodations for arm.

R=ken2
CC=golang-dev
https://golang.org/cl/2713042
2010-10-25 17:55:50 -07:00
Robert Griesemer
e351533aab big: delete unnecessary type decls
R=rsc, r
CC=golang-dev
https://golang.org/cl/2732041
2010-10-25 17:45:43 -07:00
Robert Griesemer
19b8fc788c tabwriter: delete unnecessary type declaration
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2733041
2010-10-25 17:45:26 -07:00
Robert Griesemer
c77f090085 go/scanner: delete unnecessary type declarations
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2735041
2010-10-25 17:44:54 -07:00
Rob Pike
5556f733c7 gotest: generate correct gofmt-formatted _testmain.go
Fixes #1225.

R=adg
CC=golang-dev
https://golang.org/cl/2729041
2010-10-25 17:03:25 -07:00
Andrew Gerrand
ec8f8149d2 goinstall: display helpful message when encountering a cgo package.
R=rsc
CC=golang-dev
https://golang.org/cl/2701042
2010-10-26 10:59:30 +11:00
Russ Cox
35f8a3f90e runtime: remove .c generated from .goc during make clean
R=r
CC=golang-dev
https://golang.org/cl/2704042
2010-10-25 16:54:59 -07:00
Russ Cox
079cbddbd8 arm: fix signal handler
R=ken2
CC=golang-dev
https://golang.org/cl/2670042
2010-10-26 01:32:36 +02:00
Russ Cox
b0ad7a4268 5g: complex "regalloc"
R=ken2
CC=golang-dev
https://golang.org/cl/2727041
2010-10-26 01:26:33 +02:00
Russ Cox
41b5fb4761 5c: implement uint32 -> float
There are other missing conversion cases
still but they do not show up in my tests.
This one is needed for vlrt.c's _v2d (int64, uint64 -> float).

Thankfully, VFP has a single instruction to do this.

R=ken2
CC=golang-dev
https://golang.org/cl/2726041
2010-10-25 16:18:16 -07:00
Andrew Gerrand
6e87a0abc9 build: only print "You need to add foo to PATH" when needed
Fixes #1223.

R=bradfitz
CC=golang-dev
https://golang.org/cl/2701041
2010-10-25 16:38:48 +11:00
Andrew Gerrand
32a6613e94 container/list: elide redundant tests and fix comment typo
R=dsymonds
CC=golang-dev
https://golang.org/cl/2700041
2010-10-25 14:50:47 +11:00
Andrew Gerrand
01389b966e container/list: fix Remove bug and use pointer to self as identifier
Remove wasn't nil'ing the *Element.id. This property was exploited
by MoveToFront and MoveToBack internally, so I renamed the existing
Remove to "remove", and created an exported wrapper "Remove" that does
the right thing for the user's sake.

Also, saved an allocation by using *List as the id rather than *byte.

Fixes #1224.

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/2685042
2010-10-25 14:37:30 +11:00
Fazlul Shahriar
ee065332dd goinstall: don't wrongly error out with "multiple package names"
Fixes #1215.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/2695042
2010-10-25 13:13:00 +11:00
Luuk van Dijk
4228e62259 6l/8l: global and local variables and type info.
R=rsc
CC=golang-dev
https://golang.org/cl/2201044
2010-10-24 23:07:52 +02:00
Rob Pike
c28fa513f5 gob: error cleanup 2
Simplify error handling during the compilation phase.

R=rsc
CC=golang-dev
https://golang.org/cl/2652042
2010-10-22 16:07:26 -07:00
Rob Pike
f593b37f23 gobs: error cleanup part 1.
Remove err from the encoderState and decoderState types, so we're
not always copying to and from various copies of the error, and then
use panic/recover to eliminate lots of error checking.

another pass might take a crack at the same thing for the compilation phase.

R=rsc
CC=golang-dev
https://golang.org/cl/2660042
2010-10-22 15:16:34 -07:00
Russ Cox
1dd0319be3 runtime: print unknown types in panic
R=r
CC=golang-dev
https://golang.org/cl/2683041
2010-10-22 17:04:32 -04:00
Russ Cox
e5e9211071 5l, 6l, 8l: introduce sub-symbols
Sub-symbols are laid out inside a larger symbol
but can be addressed directly.

Use to make Mach-O pointer array not a special case.

Will use later to describe ELF sections.

Glimpses of the beginning of ELF loading.

R=ken2
CC=golang-dev
https://golang.org/cl/2623043
2010-10-22 15:27:50 -04:00
Rob Pike
5d9064697b gob: allow exchange of interface values
The implemetation describes each value as a string identifying the
concrete type of the value, followed by the usual encoding of that
value.  All types to be exchanged as contents of interface values
must be registered ahead of time with the new Register function.
Although this would not seem strictly necessary, the linker garbage
collects unused types so without some mechanism to guarantee
the type exists in the binary, there could be unpleasant surprises.
Moreover, the receiver needs a reflect.Type of the value to be
written in order to be able to save the data. A Register function
seems necessary.

The implementation may require defining types in the middle of
of sending a value.  The old code never did this. Therefore there
has been some refactoring to make the encoder and decoder
work recursively.

This change changes the internal type IDs. Existing gob archives
will break with this change.  Apologies for that. If this is a deal
breaker it should be possible to create a conversion tool.

Error handling is too complicated in this code. A subsequent
change should clean it up.

R=rsc
CC=golang-dev
https://golang.org/cl/2618042
2010-10-22 11:17:40 -07:00
Robert Griesemer
3478891d12 gofmt -s -w src misc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
2010-10-22 10:06:33 -07:00
Robert Griesemer
f613015e0e go ast/parser/printer: permit elision of composite literal types for composite literal elements
gofmt: added -s flag to simplify composite literal expressions through type elision where possible

R=rsc
CC=golang-dev
https://golang.org/cl/2319041
2010-10-22 10:03:14 -07:00
Russ Cox
1c8f185611 arm: 3 more tests pass
R=ken2
CC=golang-dev
https://golang.org/cl/2666041
2010-10-22 05:53:03 +02:00
Russ Cox
45c48d51f7 5g: missed one case last night
R=ken2
CC=golang-dev
https://golang.org/cl/2658042
2010-10-22 05:50:45 +02:00
Russ Cox
8ffc4ec5d0 gc: implement new composite literal spec
R=ken2
CC=golang-dev
https://golang.org/cl/2350041
2010-10-21 23:17:20 -04:00
Ken Thompson
e5bd12ea90 bug right shifting 64 bits
by a variable that equals 32

R=rsc
CC=golang-dev
https://golang.org/cl/2645042
2010-10-21 18:15:00 -07:00
Rob Pike
b12f32372a Make.inc: delete unnecessary -no-inline flag to quietgcc
R=rsc
CC=golang-dev
https://golang.org/cl/2654041
2010-10-21 11:00:54 -07:00
Russ Cox
4fd12c04c5 fix windows build
R=ken2
CC=golang-dev
https://golang.org/cl/2650041
2010-10-21 13:06:17 -04:00
Russ Cox
d10963b6d7 fix arm build
R=ken2
CC=golang-dev
https://golang.org/cl/2649041
2010-10-21 13:03:59 -04:00
Russ Cox
833c06581a fix build
R=ken2
CC=golang-dev
https://golang.org/cl/2621042
2010-10-21 12:50:23 -04:00
Robert Griesemer
b57b10f992 go/parser: consume auto-inserted semi when calling ParseExpr()
Fixes #1170.

R=rsc
CC=golang-dev
https://golang.org/cl/2622041
2010-10-21 08:40:33 -07:00
Russ Cox
49084db386 ld: abandon symbol-driven archive loading
Load the entire archive file instead.
Reduces I/O by avoiding additional passes
through libraries to resolve symbols.
Go packages always need all the files anyway
(most often, all 1 of them).

R=ken2
CC=golang-dev
https://golang.org/cl/2613042
2010-10-21 11:39:47 -04:00
Russ Cox
1451695f86 encoding/binary: give LittleEndian, BigEndian specific types
Giving them specific types has the benefit that
binary.BigEndian.Uint32(b) is now a direct call, not an
indirect via a mutable interface value, so it can potentially
be inlined.

Recent changes to the spec relaxed the rules for comparison,
so this code is still valid:

	func isLittle(o binary.ByteOrder) { return o == binary.LittleEndian }

The change does break this potential idiom:

	o := binary.BigEndian
	if foo {
		o = binary.LittleEndian
	}

That must rewrite to give o an explicit binary.ByteOrder type.
On balance I think the benefit from the direct call and inlining
outweigh the cost of breaking that idiom.

R=r, r2
CC=golang-dev
https://golang.org/cl/2427042
2010-10-21 11:25:14 -04:00
David Symonds
4f6fb1b775 net: fix comment on Dial to mention unix/unixgram.
R=rsc
CC=golang-dev
https://golang.org/cl/2639041
2010-10-21 08:17:24 -04:00
Russ Cox
69188ad9bb arm: prop up software floating point
Just enough to make mov instructions work,
which in turn is enough to make strconv work
when it avoids any floating point calculations.
That makes a bunch of other packages pass
their tests.

Should suffice until hardware floating point
is available.

Enable package tests that now pass
(some due to earlier fixes).

Looks like there is a new integer math bug
exposed in the fmt and json tests.

R=ken2
CC=golang-dev
https://golang.org/cl/2638041
2010-10-21 06:56:20 +02:00
Fumitoshi Ukai
64cc5be4ad web socket: fix short Read
Fixes #1145.

R=rsc
CC=golang-dev
https://golang.org/cl/2302042
2010-10-20 22:36:06 -04:00
Fazlul Shahriar
3ee49850a0 goinstall: fix documentation typo
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2585043
2010-10-21 10:47:02 +11:00
Andrew Gerrand
06492d47cb build: add gobuilder and goplay to run.bash
gobuilder: fix build to work with new log package

R=rsc
CC=golang-dev
https://golang.org/cl/2592041
2010-10-21 10:46:10 +11:00
Yasuhiro Matsumoto
1c9dfb7647 os: correct Stat S_ISDIR on Windows
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/2598041
2010-10-21 10:29:45 +11:00
Russ Cox
231fcea7e6 5l: two stack split bugs in one day
An ARM expert could probably phrase the
comparison in fewer instructions, but this works.

R=ken2
CC=golang-dev
https://golang.org/cl/2620041
2010-10-20 18:11:53 -04:00
Russ Cox
10b53867e8 encoding/hex: fix typo
Thanks to avadh4all for spotting it.

Fixes #1214.

R=r, r2
CC=golang-dev
https://golang.org/cl/2616041
2010-10-20 16:38:57 -04:00
Russ Cox
0db8d3df4c gc: select receive with implicit conversion
Fixes #1172.

R=ken2
CC=golang-dev
https://golang.org/cl/2615041
2010-10-20 16:38:25 -04:00
Ken Thompson
6096fc83cd code gen error for *(complex)++
includes array[i]++ and slice[i]++

R=rsc
CC=golang-dev
https://golang.org/cl/2614041
2010-10-20 13:18:00 -07:00
Russ Cox
6a3b29895f runtime: don't let select split stack
Fixes #1209.

R=ken2
CC=golang-dev
https://golang.org/cl/2612041
2010-10-20 15:54:17 -04:00
Russ Cox
c026c91b5c arm: fix typo in softfloat
R=kaib
CC=golang-dev
https://golang.org/cl/2608041
2010-10-20 15:35:37 -04:00
Russ Cox
c2b91d4889 6l: correct logic for morestack choice
The frame that gets allocated is for both
the args and the autos.  If together they
exceed the default frame size, we need to
tell morestack about both so that it allocates
a large enough frame.

Sanity check stack pointer in morestack
to catch similar bugs.

R=ken2
CC=golang-dev
https://golang.org/cl/2609041
2010-10-20 12:16:39 -07:00
Russ Cox
4ae9311174 arm: more tests pass
R=ken2
CC=golang-dev
https://golang.org/cl/2606041
2010-10-20 11:43:27 -04:00
Russ Cox
1142b60dad syscall/arm: correct 64-bit system call arguments
Thanks to kaib for the tip.

R=ken2
CC=golang-dev
https://golang.org/cl/2596043
2010-10-20 10:39:46 -04:00
Russ Cox
c00f9f49bb 6g: avoid too-large immediate constants
R=ken2
CC=golang-dev
https://golang.org/cl/2566042
2010-10-20 00:40:06 -04:00
Rob Pike
97f3a80d93 reflect: add InterfaceValue.Get to enable setting of an interface
value (through unsafe means) without having a reflect.Type
of type *interface{} (pointer to interface).  This is needed to make
gob able to handle interface values by a method analogous to
the way it handles maps.

R=rsc
CC=golang-dev
https://golang.org/cl/2597041
2010-10-19 21:25:28 -07:00
Rob Pike
321f0c7fe2 gob: break documentation into a separate doc.go file
R=adg, r2
CC=golang-dev
https://golang.org/cl/2596041
2010-10-19 20:39:29 -07:00
Russ Cox
17c32ad712 http: do not close connection after sending HTTP/1.0 request
Fixes #671.

R=adg, cw
CC=golang-dev
https://golang.org/cl/2431042
2010-10-19 23:29:25 -04:00
Alex Brainman
5e4963d9e8 8l: fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/2595041
2010-10-20 14:06:00 +11:00
Yasuhiro Matsumoto
a9725396c0 os: change TestForkExec so it can run on windows
R=brainman, vcc, Joe Poirier, rsc
CC=golang-dev
https://golang.org/cl/2530041
2010-10-20 09:46:24 +11:00
Nigel Tao
a3bcf4b664 nntp: remove nntp package from the standard library.
R=adg
CC=golang-dev
https://golang.org/cl/2470045
2010-10-20 09:43:27 +11:00
Russ Cox
d5dffb9f29 8l: fix references to INITDAT in windows pe.c
R=ken2
CC=golang-dev
https://golang.org/cl/2588041
2010-10-19 18:17:07 -04:00
Russ Cox
19fd5c787f 5l, 6l, 8l: link pclntab and symtab as ordinary rodata symbols
That is, move the pc/ln table and the symbol table
into the read-only data segment.  This eliminates
the need for a special load command to map the
symbol table into memory, which makes the
information available on systems that couldn't handle
the magic load to 0x99000000, like NaCl and ARM QEMU
and Linux without config_highmem=y.  It also
eliminates an #ifdef and some clumsy code to
find the symbol table on Windows.

The bad news is that the binary appears to be bigger
than it used to be.  This is not actually the case, though:
the same amount of data is being mapped into memory
as before, and the tables are still read-only, so they're
still shared across multiple instances of the binary as
they were before.  The difference is just that the tables
aren't squirreled away in some section that "size" doesn't
know to look at.

This is a checkpoint.
It probably breaks Windows and breaks NaCl more
than it used to be broken, but those will be fixed.
The logic involving -s needs to be revisited too.

Fixes #871.

R=ken2
CC=golang-dev
https://golang.org/cl/2587041
2010-10-19 18:07:19 -04:00
Russ Cox
01df088f8d 5l, 6l, 8l: separate pass to fix addresses
Lay out code before data.

R=ken2
CC=golang-dev
https://golang.org/cl/2490043
2010-10-19 13:08:17 -04:00
Luuk van Dijk
54aba2e6dd [68]l: expose genasmsym.
R=rsc
CC=golang-dev
https://golang.org/cl/2512042
2010-10-19 18:09:18 +02:00
Andrew Gerrand
f1e1fd8b46 gc: update usage string in doc.go
R=rsc, r2, r
CC=golang-dev
https://golang.org/cl/2550041
2010-10-19 09:26:11 +11:00
Rob Pike
1ffb1f2b66 netchan: add new method Hangup to terminate transmission on a channel
Fixes #1151.

R=rsc
CC=golang-dev
https://golang.org/cl/2469043
2010-10-18 15:09:43 -07:00
Florian Uekermann
e9c35ac55d big: add random number generation
Adds func (z *Int) RandIntn(src rand.Source,n *Int) *Int

R=rsc
CC=golang-dev, gri
https://golang.org/cl/2315045
2010-10-18 14:09:20 -04:00
Russ Cox
71c4244430 5l: handle jump to middle of floating point sequence
R=ken2
CC=golang-dev
https://golang.org/cl/2473042
2010-10-18 13:44:39 -04:00
Russ Cox
2012604002 runtime: fix arm softfloat again for R12
Missed a case, so now generalized.

R=ken2
CC=golang-dev
https://golang.org/cl/2540042
2010-10-18 13:24:19 -04:00
Russ Cox
9cc8e9ef48 runtime: fix amd64 build (broke by 386 support for Plan 9)
TBR=r
CC=golang-dev
https://golang.org/cl/2556041
2010-10-18 13:01:10 -04:00
Yuval Pavel Zholkover
99a10eff16 8l, runtime: initial support for Plan 9
No multiple processes/locks, managed to compile
and run a hello.go (with print not fmt).  Also test/sieve.go
seems to run until 439 and stops with a
'throw: all goroutines are asleep - deadlock!'
- just like runtime/tiny.

based on Russ's suggestions at:
http://groups.google.com/group/comp.os.plan9/browse_thread/thread/cfda8b82535d2d68/243777a597ec1612

Build instructions:
cd src/pkg/runtime
make clean && GOOS=plan9 make install
this will build and install the runtime.

When linking with 8l, you should pass -s to suppress symbol
generation in the a.out, otherwise the generated executable will not run.

This is runtime only, the porting of the toolchain has already
been done: http://code.google.com/p/go-plan9/source/browse
in the plan9-quanstro branch.

R=rsc
CC=golang-dev
https://golang.org/cl/2273041
2010-10-18 12:32:55 -04:00
Russ Cox
6ac08ba638 runtime: update arm softfloat - no more R12
R=ken2
CC=golang-dev
https://golang.org/cl/2555041
2010-10-18 12:24:59 -04:00
Russ Cox
67941bf644 gc: say that shift must be unsigned integer
R=ken2
CC=golang-dev
https://golang.org/cl/2519044
2010-10-18 11:28:57 -04:00
Russ Cox
3d0a85785a 5l: data-relocatable code layout
R=ken2
CC=golang-dev
https://golang.org/cl/2479043
2010-10-18 11:09:59 -04:00
Luuk van Dijk
a647f59c1f [68]l: proper end of instruction ranges in dwarf.
R=rsc
CC=golang-dev
https://golang.org/cl/2542042
2010-10-17 22:35:55 +02:00
Luuk van Dijk
cc9e6b5cdb [68]l: fix off by one instruction in dwarf frame unwinding.
R=rsc
CC=golang-dev
https://golang.org/cl/2543043
2010-10-17 21:13:55 +02:00
Rob Pike
8abb8e1d20 log: update the documentation to clarify the behavior
R=rsc, PeterGo
CC=golang-dev
https://golang.org/cl/2519043
2010-10-17 09:20:23 -07:00
Russ Cox
8052786e51 5l: stop using R12 as SB
Because the SB is only good for 8k and Go programs
tend to have much more data than that, SB doesn't
save very much.  A fmt.Printf-based hello world program
has  360 kB text segment.  Removing SB makes the text
500 bytes (0.14%) longer.

R=ken2, r2, ken3
CC=golang-dev
https://golang.org/cl/2487042
2010-10-17 11:41:23 -04:00
Wei Guangjing
77eb94c032 8l: fix windows build.
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/2543042
2010-10-15 23:37:14 -04:00
Russ Cox
eb6f683691 8l: function at a time code layout
R=ken2
CC=golang-dev
https://golang.org/cl/2481042
2010-10-15 20:19:57 -04:00
Rob Pike
e39bd1dd56 log: roll back the rollback of the deprecation of the old interface.
R=adg
CC=golang-dev
https://golang.org/cl/2521042
2010-10-15 13:14:29 -07:00
Russ Cox
6e18e8c82f 8l: blind attempt to fix windows build
or at least gather more information

R=ken2
CC=golang-dev
https://golang.org/cl/2515042
2010-10-15 15:29:25 -04:00
Luuk van Dijk
49a835fc97 gc: keep track of real actual type of identifiers.
R=rsc
CC=golang-dev
https://golang.org/cl/2519042
2010-10-15 21:25:34 +02:00
Russ Cox
9c20485268 6l: function at a time code layout
Also change the span-dependent jump algorithm
to use fewer iterations:

* resolve forward jumps at their targets (comefrom list)
* mark jumps as small or big and only do small->big
* record whether a jump failed to be encodable

These changes mean that a function with only small
jumps can be laid out in a single iteration, and the
vast majority of functions take just two iterations.
I was seeing a maximum of 5 iterations before; the
max now is 3 and there are fewer that get even that far.

R=ken2
CC=golang-dev
https://golang.org/cl/2537041
2010-10-15 15:18:47 -04:00
Russ Cox
837c204ada 6l, 8l: avoid recursion in asmandsz
The old code said

	if(x) {
		handle a
		return
	}
	aa = *a
	rewrite aa to make x true
	recursivecall(&aa)

The new code says

	params = copy out of a
	if(!x) {
		rewrite params to make x true
	}
	handle params

but it's hard to see that in the Rietveld diffs because
it gets confused by changes in indentation.

Avoiding the recursion makes other changes easier.

R=ken2
CC=golang-dev
https://golang.org/cl/2533041
2010-10-15 13:01:03 -04:00
Russ Cox
be2c2120d0 5l, 6l, 8l: accumulate data image during import
Using explicit relocations internally, we can
represent the data for a particular symbol as
an initialized block of memory instead of a
linked list of ADATA instructions.  The real
goal here is to be able to hand off some of the
relocations to the dynamic linker when interacting
with system libraries, but a pleasant side effect is
that the memory image is much more compact
than the ADATA list, so the linkers use less memory.

R=ken2
CC=golang-dev
https://golang.org/cl/2512041
2010-10-14 23:48:40 -04:00
Rob Pike
84834feffd log: roll back deprecation of old API to apply fix to log.Output in public release.
R=adg
CC=golang-dev
https://golang.org/cl/2525042
2010-10-14 18:02:08 -07:00
Andrew Gerrand
568eccd12d log: fix custom output bug
R=r
CC=golang-dev
https://golang.org/cl/2525041
2010-10-15 11:55:51 +11:00
Russ Cox
0b2af925db arm: enable 6 more tests after net fix
R=ken2
CC=golang-dev
https://golang.org/cl/2520042
2010-10-14 17:15:45 -04:00
Russ Cox
14d2242fb9 syscall: fix arm networking
Suggested by fango (fan.howard@gmail.com)

R=r, r2
CC=golang-dev
https://golang.org/cl/2514041
2010-10-14 16:13:44 -04:00
Rob Pike
b6cd8f869d log: delete deprecated functionality
Fixes #1195.

R=rsc
CC=golang-dev
https://golang.org/cl/2504043
2010-10-14 12:50:36 -07:00
Russ Cox
9b15ad8c22 arm: adjust recover for new reflect.call
R=ken2
CC=golang-dev
https://golang.org/cl/2471043
2010-10-14 10:45:32 -04:00
Evan Shaw
df74d8df09 smtp: new package
R=rsc, iant, agl
CC=golang-dev
https://golang.org/cl/2052042
2010-10-13 22:07:28 -04:00
Rob Pike
52e3c99cfb bufio: bulletproof UnreadRune
After a fill(), there is nothing to back up.  Make sure UnreadRune
recognizes the situation.

Fixes #1137.
(Stops the crash, but doesn't make UnreadRune usable after a Peek()).

R=rsc
CC=golang-dev
https://golang.org/cl/2498041
2010-10-13 17:12:43 -07:00
Russ Cox
d6df301774 arm: enable 8 more packages
The remaining failures include:

* something about bit operations?
	crypto/block
	encoding/binary

* something about file I/O?
	archive/tar
	archive/zip
	debug/dwarf
	debug/elf
	debug/macho
	image/png

* floating point
	cmath
	expvar
	flag
	fmt
	gob
	json
	math
	strconv
	template
	xml

* network (maybe fixed by a pending CL)
	http
	netchan
	rpc
	rpc/jsonrpc
	syslog
	websocket

* line numbers
	log

* haven't bothered / not sure
	exp/datafmt
	exp/eval
	go/printer
	os
	os/signal
	testing/quick

R=ken2
CC=golang-dev
https://golang.org/cl/2496041
2010-10-13 18:16:44 -04:00
Ken Thompson
b33f5d537f fix arm bug in reflect.call
R=rsc
CC=golang-dev
https://golang.org/cl/2475042
2010-10-13 13:24:14 -07:00
Russ Cox
d9c989fa25 various: avoid %ld etc
The Plan 9 tools assume that long is 32 bits.
We converted all instances of long to int32 when
importing the code but missed the print formats.
Because int32 is always int on the compilers we use,
it is never correct to use %lux, %ld, etc.  Convert to %ux, %d, etc.

(It matters because on 64-bit gcc, long is 64 bits,
so we were printing 32-bit quantities with 64-bit formats.)

R=ken2
CC=golang-dev
https://golang.org/cl/2491041
2010-10-13 16:20:22 -04:00
Russ Cox
085be1740a 5l, 6l, 8l: first pass cleanup
* Maintain Sym* list for text with individual
  prog lists instead of using one huge list and
  overloading p->pcond.
* Comment what each file is for.
* Move some output code from span.c to asm.c.
* Move profiling into prof.c, symbol table into symtab.c.
* Move mkfwd to ld/lib.c.
* Throw away dhog dynamic loading code.
* Throw away Alef become.
* Fix printing of WORD instructions in 5l -a.

Goal here is to be able to handle each piece of text or data
as a separate piece, both to make it easier to load the
occasional .o file and also to make it possible to split the
work across multiple threads.

R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/2335043
2010-10-13 15:51:21 -04:00
Russ Cox
d42903119b 5l, 6l, 8l: indent, outdent
This is entirely adding and removing tabs.
It looks weird but will make the diffs for the
next change easier to read.

R=ken2
CC=golang-dev
https://golang.org/cl/2490041
2010-10-13 15:19:53 -04:00
Rob Pike
dd8afb800b log: fix out-of-date package comment
R=rsc
CC=golang-dev
https://golang.org/cl/2485041
2010-10-13 11:05:45 -07:00
Andrew Gerrand
78d19b9b73 runtime: remove done TODO from SetFinalizer
R=rsc
CC=golang-dev
https://golang.org/cl/2472041
2010-10-13 14:40:02 +11:00
Nigel Tao
93159e32e7 image: add an offset to Tiled.
R=r, r2
CC=golang-dev
https://golang.org/cl/2469041
2010-10-13 12:05:21 +11:00
Rob Pike
712109f1f1 log: reduce allocations
Use a bytes.Buffer in log writing instead of string concatenation.
Should reduce the number of allocations significantly.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2417042
2010-10-12 17:27:14 -07:00
Roger Peppe
d465ea5724 netchan: export before import when testing.
Fixes some race conditions.

R=r
CC=golang-dev
https://golang.org/cl/2456041
2010-10-12 15:05:53 -07:00
Jim McGrath
8a1b2e59ef 6l: work with OS X nm/otool
6l was skipping emitting the (2 byte) symbol table if there were no imported or exported
symbols. You can't just drop the symbol table entirely - the linker dies if you have
a linkedit section but no table. You can omit the linkedit section or both the linkedit
and the dlyd parts in the right circumstances, but that seems much more risky to me.

R=rsc
CC=golang-dev
https://golang.org/cl/2421042
2010-10-12 16:52:17 -04:00
Rob Pike
12da5a90e0 log: new interface
New logging interface simplifies and generalizes.

1) Loggers now have only one output.
2) log.Stdout, Stderr, Crash and friends are gone.
	Logging is now always to standard error by default.
3) log.Panic* replaces log.Crash*.
4) Exiting and panicking are not part of the logger's state; instead
	the functions Exit* and Panic* simply call Exit or panic after
	printing.
5) There is now one 'standard logger'.  Instead of calling Stderr,
	use Print etc.  There are now triples, by analogy with fmt:
		Print, Println, Printf
	What was log.Stderr is now best represented by log.Println,
	since there are now separate Print and Println functions
	(and methods).
6) New functions SetOutput, SetFlags, and SetPrefix allow global
	editing of the standard logger's properties.   This is new
	functionality. For instance, one can call
		log.SetFlags(log.Lshortfile|log.Ltime|log.Lmicroseconds)
	to get all logging output to show file name, line number, and
	time stamp.

In short, for most purposes
	log.Stderr -> log.Println or log.Print
	log.Stderrf -> log.Printf
	log.Crash -> log.Panicln or log.Panic
	log.Crashf -> log.Panicf
	log.Exit -> log.Exitln or log.Exit
	log.Exitf -> log.Exitf (no change)

This has a slight breakage: since loggers now write only to one
output, existing calls to log.New() need to delete the second argument.
Also, custom loggers with exit or panic properties will need to be
reworked.

All package code updated to new interface.

The test has been reworked somewhat.

The old interface will be removed after the new release.
For now, its elements are marked 'deprecated' in their comments.

Fixes #1184.

R=rsc
CC=golang-dev
https://golang.org/cl/2419042
2010-10-12 12:59:18 -07:00
Russ Cox
d687ea5588 arm: fix syscall build again
R=ken2
CC=golang-dev
https://golang.org/cl/2465041
2010-10-12 15:16:47 -04:00
Russ Cox
2a19865012 arm: regenerate ztypes_linux_arm.go (fix build)
R=adg
CC=golang-dev
https://golang.org/cl/2404043
2010-10-12 10:24:55 -04:00
Mikio Hara
b390c4b9d6 syscall: add sockaddr_ll support for linux/386, linux/amd64
R=rsc, albert.strasheim
CC=golang-dev
https://golang.org/cl/2356042
2010-10-12 09:48:56 -04:00
Wei Guangjing
d3a2118b8a syscall: implement WaitStatus and Wait4() for windows
R=brainman, rsc, kardia, Joe Poirier
CC=golang-dev
https://golang.org/cl/1910041
2010-10-12 15:42:07 +11:00
Russ Cox
ded12ee4b5 arm: fix build
Effectively reverts https://code.google.com/p/go/source/detail?r=8c52477401ad
Should make ARM build pass again, but untested.
Probably still bugs involving reflect.call somewhere.

R=ken2
CC=golang-dev
https://golang.org/cl/2416042
2010-10-11 23:58:51 -04:00
Nigel Tao
a3e971d355 image: another build fix regarding ColorImage.
R=adg
TBR=adg
CC=golang-dev
https://golang.org/cl/2449041
2010-10-12 14:33:37 +11:00
Nigel Tao
cd0a75f3d7 exp/draw: unbreak build.
R=adg
CC=golang-dev
https://golang.org/cl/2448041
2010-10-12 14:05:50 +11:00
Nigel Tao
b5a480f035 image: add image.Tiled type, the Go equivalent of Plan9's repl bit.
Make ColorImage methods' receiver type be a pointer.

R=r, rsc
CC=golang-dev
https://golang.org/cl/2345043
2010-10-12 13:44:11 +11:00
Eric Clark
fcc0c00228 Make.cmd: remove $(OFILES)
The linker doesn't support multiple object files (maybe it did in the past?)

R=rsc
CC=golang-dev
https://golang.org/cl/2444041
2010-10-11 22:39:37 -04:00
Russ Cox
e6ecf9765a exp/iterable: delete
Package iterable has outlived its utility.

It is an interesting demonstration, but it encourages
people to use iteration over channels where simple
iteration over array indices or a linked list would be
cheaper, simpler, and have fewer races.

R=dsymonds, r
CC=golang-dev
https://golang.org/cl/2436041
2010-10-11 22:38:42 -04:00
Andrew Gerrand
f75129894c build: fix darwin/386 build
R=rsc
CC=golang-dev
https://golang.org/cl/2443041
2010-10-12 11:49:05 +11:00
Russ Cox
054be1b6c3 ld: be less picky about bad line number info
Fixes #1175.

R=lvd
CC=golang-dev
https://golang.org/cl/2439041
2010-10-11 16:21:03 -04:00
Rob Pike
570f59c109 new command gotry.
An exercise in reflection and an unusual tool.

From the usage message:

usage: gotry [packagedirectory] expression ...
Given one expression, gotry attempts to evaluate that expression.
Given multiple expressions, gotry treats them as a list of arguments
and result values and attempts to find a function in the package
that, given the first few expressions as arguments, evaluates to
the remaining expressions as results.  If the first expression has
methods, it will also search for applicable methods.

If there are multiple expressions, a package directory must be
specified. If there is a package argument, the expressions are
evaluated in an environment that includes
	import . "packagedirectory"

Examples:
	gotry 3+4
		# evaluates to 7
	gotry strings '"abc"' '"c"' 7-5
		# finds strings.Index etc.
	gotry regexp 'MustCompile("^[0-9]+")' '"12345"' true
		# finds Regexp.MatchString

R=rsc, PeterGo, r2
CC=golang-dev
https://golang.org/cl/2352043
2010-10-11 12:40:13 -07:00
Roger Peppe
17c9c01912 netchan: zero out request to ensure correct gob decoding.
Gob decoding does not overwrite fields which are zero
in the encoder.
Fixes #1174.

R=r, r2
CC=golang-dev
https://golang.org/cl/2337044
2010-10-11 12:36:16 -07:00
Jim McGrath
3d0726b04d 6l: correct offset for __nl_symbol_ptr in Mach-O.
Fixes malformed object message from nm etc.
Fixes #1180.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/2390042
2010-10-11 14:45:01 -04:00
Jim McGrath
0f6926474f 6l: fix Mach-O LC_RPATH
Fixes #1177.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/2387042
2010-10-11 14:39:41 -04:00
Sam Thorogood
3b9c9d2125 expvar: add (*Int).Set
R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/2336044
2010-10-11 13:14:07 -04:00
Adam Langley
2d8e2482cc crypto/tls: make SetReadTimeout work.
Fixes #1181.

R=rsc, agl1, cw, r2
CC=golang-dev
https://golang.org/cl/2414041
2010-10-11 10:41:01 -04:00
Adam Langley
f6e2eab8e0 crypto/tls: better error messages for certificate issues.
Fixes #1146.

R=rsc, agl1
CC=golang-dev
https://golang.org/cl/2380042
2010-10-11 10:39:56 -04:00
Andrew Gerrand
1e66a21348 time: add After
Permits one to easily put a timeout in a select:

select {
case <-ch:
	// foo
case <-time.After(1e6):
	// bar
}

R=r, rog, rsc, sameer1, PeterGo, iant, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2321043
2010-10-11 13:45:26 +11:00
Nigel Tao
fd311cb144 exp/draw/x11: support X11 vendors other than "The X.Org Foundation".
R=adg, ehog.hedge
CC=golang-dev
https://golang.org/cl/2385041
2010-10-09 11:22:14 +11:00
Ken Thompson
ed575dc2b9 bug in stack size in arm.
stack is off by one if calling
through reflect.Call

R=rsc
CC=golang-dev
https://golang.org/cl/2400041
2010-10-08 16:46:05 -07:00
Andrew Gerrand
3f032d5670 build: add GOHOSTOS and GOHOSTARCH environment variables.
Auto-detect both if not set, and if GOARCH is not set use GOHOSTARCH.

GOHOSTARCH is used to set the -m32 or -m64 flags for gcc.

This is so that 64-bit can build binaries that run on 32-bit systems.

R=rsc, iant, brainman
CC=golang-dev
https://golang.org/cl/2342045
2010-10-08 18:52:28 +11:00
Anthony Martin
5781a00e00 big: fix panic and round correctly in Rat.FloatString
R=gri, rsc
CC=golang-dev
https://golang.org/cl/2212044
2010-10-07 16:10:48 +02:00
Russ Cox
1f6f563900 5l, 8l: dregs
R=ken2
CC=golang-dev
https://golang.org/cl/2390041
2010-10-07 07:51:37 -04:00
Russ Cox
1b6282a799 runtime: fix tiny build
Reported by Jeff Allen.

R=r, r2
CC=golang-dev
https://golang.org/cl/2385042
2010-10-07 06:46:01 -04:00
Russ Cox
2408a4bbbd net: allow _ in names
Enables lookup of _jabber._tcp.gmail.com's SRV record.

Fixes #1167.

R=r, r2
CC=golang-dev
https://golang.org/cl/2353043
2010-10-07 06:45:50 -04:00
Russ Cox
7eb13b95a3 runtime: fix argument dump in traceback
Was printing words at SP instead of at FP
after shuffle due to nascent flag.

R=r, r2
CC=golang-dev
https://golang.org/cl/2316044
2010-10-07 06:45:40 -04:00
Russ Cox
53fff1e74d gc: maybe the code is only mostly dead
R=ken2
CC=golang-dev
https://golang.org/cl/2346044
2010-10-07 06:36:39 -04:00
Luuk van Dijk
2ad521c19a [568]a: precise linenumbers for statements.
R=rsc, ken2, r, rsc1
CC=golang-dev
https://golang.org/cl/2297042
2010-10-07 11:13:06 +02:00
Russ Cox
2a7019894a gc: better error for method non-call
was
x.go:7: must call (&b).*Buffer·Write

now
x.go:7: method b.Write is not an expression, must be called

Fixes #1171.

R=ken2
CC=golang-dev
https://golang.org/cl/2384042
2010-10-07 04:42:44 -04:00
Russ Cox
410927d1ad gc: elide dead code
R=ken2
CC=golang-dev
https://golang.org/cl/2365044
2010-10-07 04:42:26 -04:00
Russ Cox
42c26b734c gc: fix error for 1 <- "foo"
was
x.go:4: invalid operation: 1 <- "foo" (send to receive-only type int)

now
x.go:4: invalid operation: 1 <- "foo" (send to non-chan type int)

R=ken2
CC=golang-dev
https://golang.org/cl/2330042
2010-10-07 03:33:42 -04:00
Graham Miller
62355959c6 runtime: faster strequal, memequal
Fixes #1161.

R=rsc, cwvh
CC=golang-dev
https://golang.org/cl/2317044
2010-10-07 03:13:24 -04:00
Russ Cox
a0a7768b21 net: comment pedantry
Fixes #1167.

R=r, r2
CC=golang-dev
https://golang.org/cl/2290044
2010-10-06 11:54:53 -04:00
Russ Cox
8599a83727 runtime: correct iteration of large map values
The hash_next_and_deref was a dreg from a
previous large value scheme.

Fixes #1163.

R=r, r2
CC=golang-dev
https://golang.org/cl/2369043
2010-10-06 11:54:41 -04:00
Russ Cox
335a318c27 build: disable archive/zip for nacl (fix build)
TBR=adg
CC=golang-dev
https://golang.org/cl/2290045
2010-10-06 11:25:40 -04:00
Russ Cox
01385b400d gc: ... bug
Fixes #1165.

R=ken2
CC=golang-dev
https://golang.org/cl/2339042
2010-10-06 11:12:30 -04:00
Russ Cox
30dd191171 gc: O(1) string comparison when lengths differ
R=ken2
CC=golang-dev
https://golang.org/cl/2331045
2010-10-06 09:53:12 -04:00
Russ Cox
30edda690f ld: share asmlc
R=ken2
CC=golang-dev
https://golang.org/cl/2373043
2010-10-06 09:52:54 -04:00
Stephen Ma
8d130f5d2d http: return the correct error if a header line is too long.
R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/2372042
2010-10-06 22:04:18 +11:00
Mikio Hara
4e3c58cd62 net: fix comment
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2358041
2010-10-06 21:47:25 +11:00
Albert Strasheim
8b905489ab syscall: add ucred structure for SCM_CREDENTIALS over UNIX sockets.
Working on issue 1101.

R=golang-dev, rsc, adg
CC=golang-dev
https://golang.org/cl/2338042
2010-10-06 21:32:31 +11:00
Stephen Ma
5043f0a1ad bufio: minor documentation fix.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2301045
2010-10-06 19:39:30 +11:00
Luuk van Dijk
454f03ff0b 6g: set kind to KindUnsafePointer where appropriate in reflect structures.
R=rsc, ken2, r
CC=golang-dev
https://golang.org/cl/2355043
2010-10-05 21:17:16 +02:00
Alex Brainman
4d4b74c7b3 websocket: enable tests on windows
Fixes #1110.

R=golang-dev, adg
CC=Joe Poirier, golang-dev
https://golang.org/cl/2367041
2010-10-05 11:02:15 +11:00
Rob Pike
f73f9ad4ad fmt: allow %d on []byte
Fixes #1159.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/2305043
2010-10-04 11:57:48 +02:00
Alex Brainman
17fe2479bf os: make tests work on windows
Fixes #1105.

R=golang-dev, r
CC=Joe Poirier, golang-dev
https://golang.org/cl/2343043
2010-10-04 17:31:49 +11:00
Russ Cox
a3c682267f gc: various bugs
Fixes #1016.
Fixes #1152.
Fixes #1153.

R=ken2
CC=golang-dev
https://golang.org/cl/2344042
2010-10-03 11:50:44 -04:00
Russ Cox
f481afae53 Make.pkg: remove .so before installing new one
On Linux, overwriting an mmap'ed file causes
all the MAP_PRIVATE pages to get refreshed
with the new content, even ones that have been
modified by the process that did the mmap.

One specific instance of this is that after the
dynamic linker has relocated a page from a .so,
overwriting the .so will un-relocate it, making
the next use of one of the no-longer-relocated
addresses incorrect and probably crash the
program.

Linux must go out of its way to break programs
in this way: the pages have already been copied
on write, so they're not shared with the file system
cache, and it trashes them anyway.  The manual
says the behavior when the file gets overwritten
is "undefined".  Removing before copy avoids the
undefined behavior.

R=iant
CC=golang-dev, msolo
https://golang.org/cl/2333045
2010-10-01 16:02:18 -04:00
Russ Cox
d4e6df98f4 arm: enable 9 more package tests
R=ken2
CC=golang-dev
https://golang.org/cl/2345041
2010-10-01 00:18:07 -04:00
Andrew Gerrand
03babfc626 Use Errorf where appropriate.
R=r, r2
CC=golang-dev
https://golang.org/cl/2308043
2010-10-01 14:14:18 +10:00
Andrew Gerrand
558477eeb1 fmt: add Errorf helper function
This crops up in a lot of places.
It's just a one-liner, but doesn't add any dependancies.
Seems worth it.

R=r, r2
CC=golang-dev
https://golang.org/cl/2344041
2010-10-01 14:04:55 +10:00
Ken Thompson
57858b70fb code gen error for
lv += f()
fixes asn1 and maybe more

R=rsc
CC=golang-dev
https://golang.org/cl/2341042
2010-09-30 18:02:38 -07:00
Russ Cox
52d619cfdf gc: bug308
confused by using isddd for both ONAME and OCALL

Fixes #1136.

R=ken2
CC=golang-dev
https://golang.org/cl/2314043
2010-09-30 15:05:01 -04:00
Russ Cox
779dfea487 gc: correct buffer size in sprint, add -L to show full paths
R=ken2
CC=golang-dev
https://golang.org/cl/2338041
2010-09-30 15:02:43 -04:00
Russ Cox
bee2d5b0ad gc, spec, tests: no auto-indirect of pointer to interface value
Implies no embedding of pointer to interface value either.

R=gri, iant, ken2, r, r2
CC=golang-dev
https://golang.org/cl/2289041
2010-09-30 14:59:41 -04:00
Russ Cox
6117652d8d libcgo: fix comment
R=r, r2
CC=golang-dev
https://golang.org/cl/2329042
2010-09-30 14:58:29 -04:00
Russ Cox
32b31342bd fix arm build on darwin leopard
TBR=r
CC=golang-dev
https://golang.org/cl/2333043
2010-09-30 14:48:33 -04:00
Russ Cox
7389ab8d21 runtime: serialize mcache allocation
Fixes racy regex-dna-parallel crashes.

R=r, r2
CC=golang-dev
https://golang.org/cl/2308042
2010-09-30 14:09:19 -04:00
Stephen Ma
ae5cb2c581 http: fix http handler signature changes previously missed
R=adg, rsc
CC=golang-dev
https://golang.org/cl/2303041
2010-09-30 13:22:28 +10:00
David Symonds
763cb8ad11 6prof: more accurate usage message.
R=r, r2
CC=golang-dev
https://golang.org/cl/2323042
2010-09-29 20:17:18 -07:00
Russ Cox
cf74232260 build: disable archive/zip on arm
R=adg
TBR=adg
CC=golang-dev
https://golang.org/cl/2326041
2010-09-29 23:11:00 -04:00
Andrew Gerrand
a00b98ec3f archive/zip: new package for reading ZIP files
R=rsc
CC=golang-dev
https://golang.org/cl/2125042
2010-09-30 11:59:46 +10:00
Russ Cox
e642503d6f 6l, 8l: fix -K implementation
R=ken2
CC=golang-dev
https://golang.org/cl/2313041
2010-09-29 15:10:14 -04:00
Stephen Ma
fd9a5d22c6 http: revised http Handler interface
R=rsc
CC=golang-dev
https://golang.org/cl/1993043
2010-09-29 14:30:12 +10:00
Russ Cox
ffdb855be1 build: clear custom variables like GREP_OPTIONS
Fixes #946.

R=r, r2
CC=golang-dev
https://golang.org/cl/2137048
2010-09-28 23:51:55 -04:00
Russ Cox
2f7a5b3379 arm: 10 more package tests pass
R=ken2
CC=golang-dev
https://golang.org/cl/2298041
2010-09-28 23:46:36 -04:00
Russ Cox
6a1ea00d59 gotest: leave _testmain.go for "make clean" to clean up
R=r, brainman
CC=golang-dev
https://golang.org/cl/2297041
2010-09-28 22:59:16 -04:00
Russ Cox
2278ef7e1a libcgo: don't build for NaCl
R=nigeltao
CC=golang-dev
https://golang.org/cl/2290041
2010-09-28 21:53:06 -04:00
Russ Cox
5b7e50a0aa runtime: fix freebsd build
TBR=r
CC=golang-dev
https://golang.org/cl/2296041
2010-09-28 21:37:12 -04:00
Ken Thompson
a2d2341e80 arm code gen error in unsign extend
R=rsc
CC=golang-dev
https://golang.org/cl/2295041
2010-09-28 18:12:46 -07:00
Russ Cox
81041369b2 runtime: fix build
On systems where the mmap succeeds
(e.g., sysctl -w vm.mmap_min_addr=0)
it changes the signal code delivered for a
nil fault from ``page not mapped'' to
``invalid permissions for page.''

TBR=r
CC=golang-dev
https://golang.org/cl/2294041
2010-09-28 20:50:00 -04:00
Russ Cox
649aab835f runtime: add mmap of null page just in case
R=r, iant, robert.swiecki, rsc1
CC=golang-dev
https://golang.org/cl/1904044
2010-09-28 20:30:01 -04:00
Russ Cox
2ccbf83b32 6l, 8l: elfsetstring is only for .shstrtab
Was also recording for .dynstrtab which made the
table run out of space and would have caused confusion
if the ELF code tried to refer to any of the strings.

R=r
CC=golang-dev
https://golang.org/cl/2288041
2010-09-28 15:18:02 -04:00
Russ Cox
a400b0e7d7 json: do not write to unexported fields
Fixes #977.
Fixes #451.

R=r, r2
CC=golang-dev
https://golang.org/cl/2246049
2010-09-28 14:40:23 -04:00
Russ Cox
00ffd59c1a gc: fix reflect table method receiver
Fixes #451.
Fixes #770.

R=ken2
CC=golang-dev
https://golang.org/cl/2207045
2010-09-28 13:43:50 -04:00
Russ Cox
05cc83bf4e various: appease the ubuntu gcc monster
Silence warnings about not checking
return values from read and write system calls.

R=r, r2
CC=golang-dev
https://golang.org/cl/2258045
2010-09-28 13:00:13 -04:00
Russ Cox
ec13ed1fce gc: insert semicolon at EOF if needed
R=ken2, gri
CC=golang-dev
https://golang.org/cl/2208053
2010-09-28 10:35:02 -04:00
Charles L. Dorian
b233ac8f18 math: Fix off-by-one error in Ilogb and Logb.
Fixes #1141.

R=rsc
CC=adg, golang-dev
https://golang.org/cl/2194047
2010-09-28 10:15:21 -04:00
Brad Fitzpatrick
fbab1f1bad http: support HTTP/1.0 Keep-Alive
R=rsc, bradfitz1
CC=golang-dev
https://golang.org/cl/2261042
2010-09-27 21:55:04 -04:00
Russ Cox
5c3827cb9f http: correct escaping of different parts of URL
Fixes #1076.

R=adg
CC=golang-dev
https://golang.org/cl/2248045
2010-09-27 21:54:04 -04:00
Robert Griesemer
9ff4565e2b gofmt: stability improvement
There are a variety of token pairs that if printed
without separating blank may combine into a different
token sequence. Most of these (except for INT + .)
don't happen at the moment due to the spacing
introduced between expression operands. However, this
will prevent errors should the expression spacing
change.

R=rsc
CC=golang-dev
https://golang.org/cl/2207044
2010-09-27 15:03:15 -07:00
Robert Griesemer
20430f03bc go/scanner: treat EOF like a newline for purposes of semicolon insertion
R=rsc
CC=golang-dev
https://golang.org/cl/2216054
2010-09-27 12:39:55 -07:00
Rob Pike
b4e358d7e1 utf8.String: provide an Init method to avoid unnecessary allocation
when creating an array of Strings.

R=rsc
CC=golang-dev
https://golang.org/cl/2267046
2010-09-27 12:06:29 -07:00
Russ Cox
2d5e732c54 gc: eliminate duplicates in method table
Fixes #906.

R=ken2
CC=golang-dev
https://golang.org/cl/2279042
2010-09-27 14:09:10 -04:00
Russ Cox
7e92e1cbfa gc: fix non-canonical import error message
Fixes #1142.

R=ken2
CC=golang-dev
https://golang.org/cl/2218046
2010-09-27 12:59:26 -04:00
Russ Cox
929fdd860b runtime: correct stats in SysFree
R=r
CC=golang-dev
https://golang.org/cl/2254047
2010-09-27 12:50:01 -04:00
Russ Cox
9b62461a8f gc: allow select case expr = <-c
Fixes #1139.

R=ken2
CC=golang-dev
https://golang.org/cl/2194046
2010-09-27 12:04:21 -04:00
Balazs Lecz
4bfcfcf89f syscall: add inotify on Linux
R=rsc
CC=golang-dev
https://golang.org/cl/2241045
2010-09-27 11:44:26 -04:00
Wei Guangjing
6a624fa5f5 libcgo: set g, m in thread local storage for windows 386.
R=rsc
CC=golang-dev, vcc
https://golang.org/cl/2216051
2010-09-27 09:44:56 -04:00
Alex Brainman
f2db47d427 syscall: fix windows value of IPV6_V6ONLY
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2213048
2010-09-27 11:42:58 +10:00
Andrew Gerrand
b15b0a0cd9 bytes: fix typo in AddByte comment
Fixes #1140.

R=golang-dev
CC=golang-dev
https://golang.org/cl/2240043
2010-09-27 11:41:43 +10:00
Alex Brainman
e4245f2502 syscall: add IPPROTO_IPV6 and IPV6_V6ONLY const to fix nacl and windows build
R=golang-dev
CC=golang-dev
https://golang.org/cl/2204050
2010-09-25 21:24:12 +10:00
Rob Pike
2f80d328e8 utf8.String: Slice(i,j)
R=rsc
CC=golang-dev
https://golang.org/cl/2225048
2010-09-25 08:52:29 +10:00
Russ Cox
b1f44a120f gc: improve error message for x \= 0
was
x.go:2: syntax error: unexpected $undefined

now
x.go:2: syntax error: unexpected \

R=ken2
CC=golang-dev
https://golang.org/cl/2267044
2010-09-24 17:09:31 -04:00
Rob Pike
6f32c82953 utf8: Add new type String to automate string indexing by code point.
R=rsc, rog
CC=golang-dev
https://golang.org/cl/2275041
2010-09-25 06:58:34 +10:00
Russ Cox
d47266558d net: enable v4-over-v6 on ip sockets
Not all OS make that the default.
Can finally do this now that the syscall package
has the right definitions.

Fixes #679.

R=r
CC=golang-dev
https://golang.org/cl/2204048
2010-09-24 16:52:06 -04:00
Russ Cox
b031b5cfde net: fix crash in DialIP
Reported by jan.newmarch.

Fixes #1130.

R=r
CC=golang-dev
https://golang.org/cl/2212043
2010-09-24 16:50:50 -04:00
Robert Griesemer
daf64bf567 gofmt: don't substitute invalid positions with valid ones in rewrites
Fixes rewrite bug: 'f(x) -> f(0)' where functions "picked up" ... arguments.

R=rsc
CC=golang-dev
https://golang.org/cl/2279041
2010-09-24 12:58:08 -07:00
Russ Cox
5c4917ce33 syscall: rebuild z files
darwin/386
darwin/amd64
freebsd/386
freebsd/amd64
linux/386
linux/amd64
nacl/386

TBR=adg
CC=golang-dev
https://golang.org/cl/2198047
2010-09-24 15:17:20 -04:00
Russ Cox
f33ef07f38 syscall: fix socketpair in syscall_bsd
THIS WILL BREAK THE BUILD.

The z files have socketpair code in them that was
written by hand; breaking the build with this is the first
step in getting rid of that hand-written code.

R=adg
TBR=adg
CC=golang-dev
https://golang.org/cl/2197050
2010-09-24 14:59:34 -04:00
Russ Cox
dabd9fe920 syscall: work harder to avoid doing this ever again
TBR=adg
CC=golang-dev
https://golang.org/cl/2218044
2010-09-24 14:52:10 -04:00
Russ Cox
5bd0bea7d2 syscall: fix mkall.sh for nacl
TBR=adg
CC=golang-dev
https://golang.org/cl/2208050
2010-09-24 14:38:17 -04:00
Russ Cox
908b0683e1 syscall: fix permissions on mksysnum_nacl.sh
TBR=adg
CC=golang-dev
https://golang.org/cl/2208049
2010-09-24 11:03:54 -07:00
Russ Cox
9a96fb3a29 mkall.sh, mkerrors.sh: work more broadly
work on FreeBSD even without /usr/src/sys.
work on systems where gcc -static is broken.

TBR so I can test my semi-automated z builder.

TBR=adg
CC=golang-dev
https://golang.org/cl/2215046
2010-09-24 13:37:02 -04:00
Russ Cox
fb7e175d1f debug/proc: ... changes (fix build)
TBR=gri
CC=golang-dev
https://golang.org/cl/2229047
2010-09-24 13:12:50 -04:00
Russ Cox
d8fc38c7b8 crypto/ocsp: update for asn1 change (fix build)
TBR=gri
CC=golang-dev
https://golang.org/cl/2221044
2010-09-24 13:08:35 -04:00
Russ Cox
8206bafb22 asn1: make interface consistent with json
Replace Marshal with MarshalToMemory
(no one was using old Marshal anyway).

Swap arguments to Unmarshal.

Fixes #1133.

R=agl1
CC=golang-dev
https://golang.org/cl/2249045
2010-09-24 12:34:18 -04:00
Russ Cox
1d315a8abd gc: printing of ...
R=ken2
CC=golang-dev
https://golang.org/cl/2218043
2010-09-24 12:29:20 -04:00
Dan Sinclair
8d87ccad0b xml: Allow entities inside CDATA tags
Fixes #1112.

R=rsc
CC=golang-dev
https://golang.org/cl/2255042
2010-09-24 12:23:01 -04:00
Russ Cox
2ee420fa5e ... changes
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/2273042
2010-09-24 11:55:48 -04:00
Russ Cox
75dd8fdb34 gc: ... changes
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/2208047
2010-09-24 11:55:30 -04:00
Russ Cox
6cf1a34402 build: use full path when compiling libraries
Makes gdb display full paths in backtrace.
Dropped during the most recent reorg.

R=r
CC=golang-dev
https://golang.org/cl/2216047
2010-09-24 11:55:16 -04:00
Russ Cox
34d413f562 runtime: fix unwindstack crash
Bug and fix identified by Alexey Gokhberg.
Fixes #1135.

R=r, brainman
CC=golang-dev
https://golang.org/cl/2198046
2010-09-23 23:04:32 -04:00
Rob Pike
e439345dfd bufio.UnreadRune: fix bug at EOF
Fixes #1132.

R=rsc
CC=golang-dev
https://golang.org/cl/2215045
2010-09-24 12:28:14 +10:00
Nigel Tao
099d7b4d1d exp/draw: remove "this isn't ready yet" comments.
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2248046
2010-09-24 12:15:49 +10:00
Peter Mundy
bfb127612a os: check for valid arguments in windows Readdir
Fixes #1129.

R=rsc, brainman
CC=Joe Poirier, golang-dev
https://golang.org/cl/2211045
2010-09-23 22:06:59 -04:00
Russ Cox
7c9f0f0109 html: disable print
Everything is incomplete.
Let's not make noise like this a habit.

R=nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2272041
2010-09-23 22:05:42 -04:00
Russ Cox
052cd29dd6 nacl: update instructions for new SDK
R=nigeltao_gnome, nigeltao
CC=golang-dev
https://golang.org/cl/2253042
2010-09-23 22:05:20 -04:00