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

4693 Commits

Author SHA1 Message Date
Kai Backman
534dbc738f arm: fix build, regenerate syscall files
R=r
CC=golang-dev
https://golang.org/cl/1952046
2010-08-23 13:25:14 +03:00
Andrew Gerrand
4642708984 io: prevent ReadAtLeast spinloop if min > len(buf)
R=r, heresy.mc
CC=golang-dev
https://golang.org/cl/2017042
2010-08-23 12:04:15 +10:00
Scott Lawrence
d125faeed0 net/ipsock.go: fix error checking bug
Check oserr, not err for non-nil (err is never changed)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1965042
2010-08-22 22:12:56 +10:00
Scott Lawrence
e5518feaf8 http: fix typo in http.Request documentation
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/2004044
2010-08-22 14:44:00 +10:00
Russ Cox
c560c8a9c3 libmach: implement register fetch for 32-bit x86 kernel
Also use memmove to silence some gcc warnings.

Fixes #1036.

R=r, EtherealMachine
CC=golang-dev
https://golang.org/cl/1943049
2010-08-20 20:49:47 -04:00
Robert Griesemer
dbbe32ee53 fix build
Also: Copyright notices only need the year the file was created.

R=rsc
CC=golang-dev, krasin
https://golang.org/cl/2021041
2010-08-20 11:20:12 -07:00
Ivan Krasin
5a0274399a syscall: regenerate syscall/z* files for linux/386, linux/amd64
DISTRIB_DESCRIPTION="Ubuntu 10.04 LTS"

Use <sys/user.h> instead of <linux/user.h>
See http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00834.html for more details.

R=imkrasin, rsc
CC=golang-dev
https://golang.org/cl/1957041
2010-08-20 09:12:21 -04:00
Ken Thompson
3dc3ef4cf7 attempt to gete better registeration
from the builtin structures (strings,
slices, interfaces)

R=rsc
CC=golang-dev
https://golang.org/cl/2007043
2010-08-19 18:18:51 -07:00
Robert Griesemer
1a667f52d8 go/ast Fprint: handle cycles in AST
Augmented ASTs may contain cycles. Keep
track of already printed objects and refer
to them with a line number instead of
printing them again.

R=rsc
CC=golang-dev
https://golang.org/cl/1998042
2010-08-19 16:03:02 -07:00
Rob Pike
9d3eb29a29 mime: delete unnecessary constant conversions.
R=rsc
CC=golang-dev
https://golang.org/cl/1984043
2010-08-20 07:42:02 +10:00
Adam Langley
4abfc4fff0 crypto/ocsp: add missing Makefile
R=rsc
CC=golang-dev
https://golang.org/cl/2018041
2010-08-19 16:33:58 -04:00
Robert Griesemer
3112bb0727 go/ast, gofmt: facility for printing AST nodes
go/ast: implement Fprint and print functions to
print AST nodes

gofmt: print AST nodes by setting -ast flag

R=rsc, r
CC=golang-dev
https://golang.org/cl/1981044
2010-08-19 09:39:35 -07:00
Christopher Wedgwood
bdeebf4907 clean.bash: fix standalone runs
R=rsc
CC=golang-dev
https://golang.org/cl/1933043
2010-08-19 00:09:11 -04:00
Eric Clark
95fa16a892 cgo: add C.GoStringN
Function to create a GoString with a known length so it can contain NUL
bytes anywhere in the string. Some C libraries have strings like this.

R=rsc
CC=golang-dev
https://golang.org/cl/2007042
2010-08-18 22:29:05 -04:00
Rob Pike
6e76298744 fmt: add sentence about return values to docs for Printf etc.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/1952045
2010-08-19 12:07:24 +10:00
Luuk van Dijk
ca9098ee94 Dwarf output for 6l.
Part 1, general scaffolding and pc/lc sections.

R=rsc, r, ken2
CC=golang-dev
https://golang.org/cl/1987042
2010-08-18 16:53:22 +02:00
Russ Cox
632417e5e7 run.bash: fix freebsd build (i hope)
R=adg
CC=golang-dev
https://golang.org/cl/2012041
2010-08-18 10:22:57 -04:00
Russ Cox
da392d9136 build: no required environment variables
R=adg, r, PeterGo
CC=golang-dev
https://golang.org/cl/1942044
2010-08-18 10:08:49 -04:00
Russ Cox
31339c3224 cgo: fix build: use $GCC, not $CC
I'm not sure there's a better way.
Cgo is juggling two different C compilers.

Fixes #1008.

R=iant
CC=golang-dev
https://golang.org/cl/1972044
2010-08-18 10:03:01 -04:00
Russ Cox
3bf656327e http: parse query string always, not just in GET
Fixes #985.

R=dsymonds, dsymonds1
CC=golang-dev
https://golang.org/cl/1963044
2010-08-17 20:01:50 -04:00
Russ Cox
8dc4c0b45f jsonrpc: use error: null for success, not error: ""
handle missing id in server.

Fixes #1017.
Fixes #1018.

R=r
CC=golang-dev
https://golang.org/cl/1986044
2010-08-17 18:55:42 -04:00
Luuk van Dijk
340f28deab runtime: correct line numbers for .goc files.
Linenumbers start at 1.
Also call goc2c with an absolute pathi to preserve debug info.

R=rsc, r, ken2
CC=golang-dev
https://golang.org/cl/1954049
2010-08-18 00:16:05 +02:00
Robert Griesemer
a48b35e961 reflect: allow PtrValue.PointTo(nil)
(Argument: For any *PtrValue p, it should
always be possible to do: p.PointTo(p.Elem()),
even if p.Elem() is nil.)

Fixes #1028.

R=rsc
CC=golang-dev, r
https://golang.org/cl/1938044
2010-08-17 15:12:28 -07:00
Scott Lawrence
a240af3822 Make.common: add .PHONY rule
to prevent files named 'clean', 'bench', etc... preventing proper build

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1976044
2010-08-17 17:35:48 -04:00
Roger Peppe
781c54d06c Fix template package so that data items
preceded by white space parse correctly.

R=r
CC=golang-dev
https://golang.org/cl/2010041
2010-08-17 23:13:07 +10:00
Roger Peppe
e5aad81930 Remove relic "once" import from time/zoneinfo.go
R=rsc, r
CC=golang-dev
https://golang.org/cl/2005042
2010-08-17 23:08:19 +10:00
Robert Griesemer
fa80a73bee gofmt: do not modify multi-line string literals
tabwriter: Introduce a new flag StripEscape to control
if tabwriter.Escape chars should be stripped or passed
through unchanged.

go/printer: Don't modify tabwriter.Escape'd text. This
involved a new implementation of the internal trimmer
object.

Does not affect formatting of any existing code under
$GOROOT/src and $GOROOT/misc.

Fixes #1030.

R=rsc
CC=golang-dev
https://golang.org/cl/1943045
2010-08-16 21:37:10 -07:00
Alex Brainman
b243d57eb4 os: preserve "=C:" like env variables in env block on windows and bug fix in Clearenv()
R=rsc
CC=golang-dev
https://golang.org/cl/1995043
2010-08-17 11:38:26 +10:00
Rob Pike
30ab8cf792 template: retain leading space if the line is not an action.
R=rsc
CC=golang-dev
https://golang.org/cl/1985042
2010-08-17 09:44:16 +10:00
Rob Pike
316961c172 fmt/print: remove a TODO regarding printing renamed byte slices.
the solution must work around a weakness in the reflection library:
there is no way to do type-safe conversions under reflection.

R=rsc
CC=golang-dev
https://golang.org/cl/2000041
2010-08-17 08:34:40 +10:00
Rob Pike
69fe3dd754 regexp: grow slices dynamically in the 'All' routines.
R=rsc
CC=golang-dev
https://golang.org/cl/1953044
2010-08-16 15:17:34 -07:00
Mikkel Krautz
c47123d07b crypto/tls: client certificate support.
This changeset implements client certificate support in crypto/tls
for both handshake_server.go and handshake_client.go

The updated server implementation sends an empty CertificateAuthorities
field in the CertificateRequest, thus allowing clients to send any
certificates they wish. Likewise, the client code will only respond
with its certificate when the server requests a certificate with this
field empty.

R=agl, rsc, agl1
CC=golang-dev
https://golang.org/cl/1975042
2010-08-16 11:22:22 -04:00
Nigel Tao
07053ac6e4 image/png: support 16-bit color.
R=r, mpl
CC=golang-dev
https://golang.org/cl/1944043
2010-08-16 23:33:20 +10:00
Ken Thompson
5b0c317c9c code optimization on slices
R=rsc
CC=golang-dev
https://golang.org/cl/1942043
2010-08-13 19:39:36 -07:00
Rob Pike
b21611b963 fmt/print: give %p priority, analogous to %T
Fixes #1024.

R=rsc
CC=golang-dev
https://golang.org/cl/1961042
2010-08-14 07:37:03 +10:00
Ken Thompson
3efb4c3b63 fix bounds check in error recovery
(thanks to avp@mit.edu)

R=rsc
CC=golang-dev
https://golang.org/cl/1998041
2010-08-13 14:30:18 -07:00
Robert Griesemer
1f9dfa294f go AST: First step towards augmenting AST with full type information.
- change ast.Ident back to contain the name and adjust all dependent code
- identifier object information will be added again through an optional
  typechecker phase (in the works).
- remove tracking of scopes in parser - it's easier to do this in a separate
  phase (in the works)
- in godoc, generate popup info table directly instead of through a formatter
  for simpler data flow (at the expense of a little bit more code)

Runs all tests.

As a result of this change, the currently shown popup information
(const, var, type, func, followed by identifier name) will not be
shown anymore temporarily.

R=rsc
CC=golang-dev
https://golang.org/cl/1994041
2010-08-13 10:42:18 -07:00
Rob Pike
be97fa4c79 fmt/print: honor Formatter in Print, Println.
Rearrange code to clarify handling of %T, Formatter, GoStringer, and Stringer.

R=rsc
CC=golang-dev
https://golang.org/cl/1973043
2010-08-13 17:26:32 +10:00
Russ Cox
e2bde5cf9b runtime: fix another stack split bug
Makes godoc --http=:1234 not crash on linux/amd64.

R=r
CC=golang-dev
https://golang.org/cl/1975044
2010-08-12 23:26:54 -07:00
Alex Brainman
79c62aaa99 os: implement env using native windows api.
Fixes #864.

R=rsc
CC=golang-dev
https://golang.org/cl/1975043
2010-08-13 14:29:23 +10:00
Rob Pike
a621a7ef74 delete pkg/once
R=rsc
CC=golang-dev
https://golang.org/cl/1995041
2010-08-13 12:53:27 +10:00
Robert Griesemer
10ae88f4ab partial correction for CL 1983043: fix various godoc-related regexp calls
R=rsc
CC=golang-dev
https://golang.org/cl/1987041
2010-08-12 11:28:50 -07:00
Rob Pike
079a117469 regexp: delete the deprecated methods and tests.
R=golang-dev
CC=golang-dev
https://golang.org/cl/1956044
2010-08-12 17:16:37 +10:00
Mikio Hara
e41987c821 net: make IPv6 String method standards compliant
draft-ietf-6man-text-addr-representation-07 will introduce
a canonical textual representation format for IPv6 address.

R=rsc
CC=golang-dev
https://golang.org/cl/1856047
2010-08-12 00:03:01 -07:00
Rob Pike
d31ee536e8 update the tree to use the new regexp methods
R=rsc
CC=golang-dev
https://golang.org/cl/1983043
2010-08-12 16:48:41 +10:00
Rob Pike
4fb5883253 testing: delete the less useful methods in the testing regexp package
We can add them back using the new naming scheme should it become important.

R=rsc
CC=golang-dev
https://golang.org/cl/1968042
2010-08-12 16:47:52 +10:00
Russ Cox
1d77ff5b6b 6g, 8g: handle slice by sub-word-sized index (uint8, int8, uint16, int16)
R=ken2
CC=golang-dev
https://golang.org/cl/1960042
2010-08-11 22:27:47 -07:00
Russ Cox
26dde76cee gopack: handle long lines in export data
Also, if the header is bad, exit with a non-zero status.

Other calls to Brdline in the tree, by category:

Reading symbol name from object file:
./cmd/5l/obj.c:486: 		name = Brdline(f, '\0');
./cmd/6l/obj.c:535: 		name = Brdline(f, '\0');
./cmd/8l/obj.c:564: 		name = Brdline(f, '\0');
./libmach/sym.c:292: 		cp = Brdline(bp, '\0');

Reading archive header line (fixed, short):
./cmd/gc/lex.c:287: 	if((a = Brdline(b, '\n')) == nil)
./cmd/gc/lex.c:303: 	if((p = Brdline(b, '\n')) == nil)

Reading object file header line (fixed, short):
./cmd/ld/lib.c:421: 	line = Brdline(f, '\n');

Reading undefined symbol list (unused code):
./cmd/ld/lib.c:773: 	while((l = Brdline(b, '\n')) != nil){

Implementing Brdstr:
./libbio/brdstr.c:36: 		p = Brdline(bp, delim);

The symbol names ones will cause a problem loudly if they
fail: they'll error out with symbol name too long.  This means
that you can't define an enormous struct without giving the
type a name and then stick it in an interface, because the
type's symbol name will be too long for the object file.
Since this will be a loud failure instead of a silent one,
I'm willing to wait until it comes up in practice.

R=r
CC=golang-dev
https://golang.org/cl/1982041
2010-08-11 22:17:20 -07:00
Russ Cox
14e0df34fd 5g, 8g: dead code (already removed from 6g)
R=ken2
CC=golang-dev
https://golang.org/cl/1983041
2010-08-11 21:58:29 -07:00
Rob Pike
6610d79eda regexp: new regularized methods for matching.
The previous set was spotty, incomplete, and confusing.
This CL proposes a regular, clean set with clearer names.
It's also complete.  Many existing methods will be deprecated,
but not in this CL.  Ditto for the tests.

R=rsc, gri
CC=golang-dev, rog
https://golang.org/cl/1946041
2010-08-12 14:41:52 +10:00
Robert Griesemer
d75074974a gofmt: if a semicolon is found unexpectedly, report detailed cause
go/scanner: return information on semicolon (real or inserted) when
	    found in source
go/parser:  better error message when a semicolon is found unexpectedly

For instance, if an unexpected semicolon is found that was automatically
inserted, the parser error message is now:

    "expected '}', found newline"

Fixes #1006.

R=rsc
CC=golang-dev
https://golang.org/cl/1936044
2010-08-11 21:25:52 -07:00
Rob Pike
32a81fa8bb sync.once: document that Do cannot be invoked recursively.
documentation change only.

R=rsc
CC=golang-dev
https://golang.org/cl/1964043
2010-08-12 12:59:37 +10:00
Kyle Consalus
8fcdc6a1e2 Small performance improvements to the HTML tokenizer based on your 'TODO's.
R=nigeltao_golang
CC=golang-dev
https://golang.org/cl/1941042
2010-08-12 09:45:34 +10:00
Scott Lawrence
bca3151042 template: added ParseFile method for template.Template
Fixes #971.

Parse/ParseFile methods of Template now match template.Parse and .ParseFile methods.
Also made tests being run on Parse and ParseFile be run on Template.ParseFile as well.

R=r
CC=golang-dev
https://golang.org/cl/1741059
2010-08-11 14:04:03 +10:00
Russ Cox
a9a62eef6b gc: bug302
Fixed by http://code.google.com/p/go/source/detail?r=d1f41e20a90e
This just adds a test and checks the return value of Bprint.

R=ken2
CC=golang-dev
https://golang.org/cl/1949042
2010-08-10 17:39:38 -07:00
Russ Cox
9d5da464ff libbio: fix Bprint bug
Make Bprint work even when the amount of output
exceeds the available buffer space.

R=r
CC=golang-dev
https://golang.org/cl/1968041
2010-08-10 17:38:28 -07:00
Nigel Tao
753c9b5710 exp/draw: fix drawRGBA when x0 > x1 and we have to draw right-to-left.
R=r
CC=golang-dev
https://golang.org/cl/1940042
2010-08-11 10:10:17 +10:00
Rob Pike
2bf8741c0f rpc: catch errors from ReadResponseBody.
Fixes #1014.

R=rsc
CC=golang-dev
https://golang.org/cl/1941041
2010-08-10 16:55:02 -07:00
Robert Griesemer
b0d0de59a1 fix build: update exp/draw/draw_test.go
R=nigeltao
CC=golang-dev
https://golang.org/cl/1962041
2010-08-10 10:11:28 -07:00
Robert Griesemer
d754309489 godoc: report Status 404 if a pkg or file is not found
Fixes #1005.

R=rsc, r
CC=golang-dev
https://golang.org/cl/1935041
2010-08-10 09:52:02 -07:00
Robert Griesemer
9714c2208b asn1: remove superfluous if's, unused function
R=adg
CC=golang-dev
https://golang.org/cl/1743059
2010-08-10 09:50:21 -07:00
Nigel Tao
7d3173fc1d exp/draw: remove the Color, Point and Rectangle types.
image: introduce Transparent and Opaque.

R=r
CC=golang-dev
https://golang.org/cl/1947042
2010-08-10 22:05:11 +10:00
Scott Lawrence
4368a78755 gopack documentation: fixed typo
(Removed extraneous "program".)

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1950041
2010-08-10 18:01:00 +10:00
Nigel Tao
d4e23b7e37 image: fix comment typo.
R=adg
CC=golang-dev
https://golang.org/cl/1952041
2010-08-10 17:56:57 +10:00
Nigel Tao
b50a3d95e1 image: change image representation from slice-of-slices to linear buffer,
stride and rect.

R=r
CC=golang-dev, rog
https://golang.org/cl/1849041
2010-08-10 16:34:57 +10:00
Nigel Tao
56b989f1b9 First cut of an HTML tokenizer (and eventually a parser).
R=r, rsc, gri, rsc1
CC=golang-dev
https://golang.org/cl/1814044
2010-08-10 16:08:21 +10:00
Nigel Tao
96d7c8d4a8 exp/draw/x11: temporarily workaround compiler bug 1011.
R=r
CC=golang-dev
https://golang.org/cl/1951041
2010-08-10 15:53:19 +10:00
Mathieu Lonjaret
90a6c91890 png: grayscale support.
R=nigeltao_golang, r
CC=golang-dev
https://golang.org/cl/1897049
2010-08-10 12:25:08 +10:00
Nigel Tao
5eb35e4247 image: replace Width and Height by Bounds, and introduce the Point and
Rect types.

The actual image representation is unchanged. A future change will
replace the {[][]color} with {[]color, stride int, r Rectangle} and
possibly a clip region.

The draw.Color, draw.Point and draw.Rect types will be removed in a
future change. Trying to do it in this one polluted the diff with
trivia.

R=r, rsc
CC=golang-dev
https://golang.org/cl/1918047
2010-08-10 12:08:52 +10:00
Rob Pike
46db2e3c25 regexp: document that backslashes are the escape character.
Fixes #1013.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/1938041
2010-08-09 15:11:02 -07:00
Scott Lawrence
d5cfb3b3d5 goinstall docs: fixed typos
(Added mising closing quotes.)

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1902049
2010-08-09 10:45:20 -07:00
Evan Shaw
28a0971caf big: Several fixes to bitwise functions
Fixed:
* SetString calls in bitwise tests
* Aliasing problem with self bitwise test
* One test case that was just flat out wrong
* Slice panics in nat.or and nat.xor
* Aliasing problems in Int.And, Int.AndNot, Int.Or, Int.Xor

Fixes #1007.

R=gri
CC=golang-dev
https://golang.org/cl/1895049
2010-08-09 10:21:54 -07:00
Nicholas Waples
e2c7e53dcf asn1 incorrectly encoded signed integers. When determining the
encoded length it was not taking into account the sign bit.

Fixes #997.

R=agl1, gri
CC=golang-dev
https://golang.org/cl/1870047
2010-08-09 10:25:54 -04:00
Alex Brainman
bc4a9caa41 runtime: free memory returned by windows GetEnvironmentStrings
R=golang-dev
CC=golang-dev
https://golang.org/cl/1917048
2010-08-09 11:30:33 +10:00
Alex Brainman
dbef0711d4 os: fix ForkExec() handling of envv == nil
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1913047
2010-08-09 11:21:20 +10:00
Nigel Tao
893fdbbe5d image: introduce Decode and RegisterFormat.
R=r, rsc
CC=golang-dev
https://golang.org/cl/1849054
2010-08-09 10:44:38 +10:00
Russ Cox
844a86317d net/textproto: new package, with example net/dict
Generic text-based network protcol library for SMTP-like protocols.
HTTP and NNTP should be changed to use this package,
and I expect that SMTP and POP3 will be able to use it too.

R=cemeyer, nigeltao_golang, r
CC=golang-dev, petar-m
https://golang.org/cl/889041
2010-08-06 17:37:45 -07:00
Rob Pike
18063d4686 fmt.Scan: empty strings are errors
Fixes #1002.

R=rsc
CC=golang-dev
https://golang.org/cl/1882046
2010-08-07 10:02:04 +10:00
Kai Backman
df88fc6109 arm: bugfixes and syscall
- integer divide by zero raises panic
- float comparisons involving NaNs work
- syscall interface actually handles return
  values and errno correctly.

R=rsc, bradfitzpatrick
CC=golang-dev
https://golang.org/cl/1847047
2010-08-06 16:57:49 -07:00
Charles L. Dorian
c8c2bdbc59 math: fix amd64 Hypot.
Underflow/overflow tests for exp_amd64.s

Fixes #957.

R=rsc
CC=golang-dev
https://golang.org/cl/1817041
2010-08-06 16:50:48 -07:00
Roger Peppe
b92db49c26 encoding/binary: add complex
R=rsc
CC=golang-dev
https://golang.org/cl/1879043
2010-08-06 16:44:38 -07:00
Anschel Schaffer-Cohen
8055f47029 exp/iterable: add UintArray
all other basic types seem to be represented.

R=rsc
CC=golang-dev
https://golang.org/cl/1919042
2010-08-06 16:39:18 -07:00
Alex Brainman
e96b6835a9 fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/1890045
2010-08-06 09:42:55 +10:00
Rob Pike
c78be462a0 once: replace all uses of package once with sync.Once.
package once remains for now; will be deleted after next release.

R=golang-dev, brainman
CC=golang-dev
https://golang.org/cl/1914046
2010-08-06 06:14:41 +10:00
Christian Himpel
75f6a0c759 bytes: add IndexRune, FieldsFunc and To*Special
Basically these functions are implemented the same way as the
corresponding functions in the strings package.  Test functions
are implemented for IndexRune and FieldsFunc.

Additionally two typos are fixed in packages bytes and strings.

R=r
CC=golang-dev
https://golang.org/cl/1696062
2010-08-05 23:11:06 +10:00
Rob Pike
895c5db6df sync: add sync.Once, a proposed replacement for package once.
This implementation is simpler and more useful, since it can work
with methods.

R=rsc
CC=golang-dev
https://golang.org/cl/1864051
2010-08-05 13:31:10 +10:00
Alex Brainman
8251e72aea path: fix comment for Split()
R=golang-dev
CC=golang-dev
https://golang.org/cl/1905050
2010-08-05 11:43:53 +10:00
Robert Griesemer
d9e2631b53 go/parser.ParseFiles: don't override error (to nil) if there is one
Also: Return first instead of last error as that seems more useful.

R=r
CC=golang-dev
https://golang.org/cl/1897050
2010-08-04 18:02:43 -07:00
Robert Griesemer
ed8c23149f fix build: literal types cannot be parenthesized anymore
R=rsc
CC=golang-dev
https://golang.org/cl/1849055
2010-08-04 17:58:56 -07:00
Russ Cox
e473f42b2d amd64: use segment memory for thread-local storage
Returns R14 and R15 to the available register pool.
Plays more nicely with ELF ABI C code.
In particular, our signal handlers will no longer crash
when a signal arrives during execution of a cgo C call.

Fixes #720.

R=ken2, r
CC=golang-dev
https://golang.org/cl/1847051
2010-08-04 17:50:22 -07:00
Robert Griesemer
03f42934c1 gofmt/go/parser: strengthen syntax checks
- don't allow parenthesized receiver base types or anonymous fields
- fixed a couple of other omissions
- adjusted gofmt test script
- removed several TODOs

R=rsc
CC=golang-dev
https://golang.org/cl/1897043
2010-08-04 17:21:02 -07:00
Alex Brainman
12576f9e70 goinstall: check for error from exec.*Cmd.Wait() before using its result
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1923043
2010-08-04 17:18:57 -07:00
Christian Himpel
6b8ec5c572 cgo: generate correct multiple return value function invocations
Fixes #967.

R=rsc
CC=golang-dev
https://golang.org/cl/1855051
2010-08-04 17:15:04 -07:00
Robert Griesemer
a6449b66a4 gofmt: make code more readable by avoiding redeclaration
R=r
CC=golang-dev
https://golang.org/cl/1910045
2010-08-03 23:39:01 -07:00
Scott Lawrence
99aab8bacb bytes: added test case for explode with blank string.
Tests for the equivalent of the strings.explode("") panic bug (issue 980).

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1850052
2010-08-04 13:33:24 +10:00
Anthony Martin
2db4c3d779 json: object members must have a value
R=rsc
CC=golang-dev
https://golang.org/cl/1847050
2010-08-03 17:05:00 -07:00
Nigel Tao
27e249049e bufio: introduce Peek.
I'll leave whether or not this obsoletes UnreadByte for a future CL.

R=r, rsc
CC=golang-dev
https://golang.org/cl/1912042
2010-08-04 09:44:02 +10:00
Rob Pike
e45b58fe96 os: change the type of permissions argument for Open etc. to uint32.
Besides being more correct, it protects against people accidentally
exchanging the permission and open mode arguments to Open.

R=rsc
CC=golang-dev
https://golang.org/cl/1904045
2010-08-04 08:34:52 +10:00
Tarmigan Casebolt
1badb46313 websocket: correct challenge response
Tested against latest Chrome.

R=ukai, rsc
CC=golang-dev
https://golang.org/cl/1743053
2010-08-03 14:34:44 -07:00
Peter Mundy
12befd063b os: Null device
R=rsc, cw
CC=golang-dev
https://golang.org/cl/1854042
2010-08-03 13:03:50 -07:00
Kai Backman
311973ea56 arm: remove old qemu dependency from gotest
R=rsc
CC=golang-dev
https://golang.org/cl/1678063
2010-08-03 13:03:40 -07:00
Adam Langley
7748a7f159 crypto/x509: unwrap Subject Key Identifier
RFC 5280, 4.2.1.2 says:
  SubjectKeyIdentifier ::= KeyIdentifier
  KeyIdentifier ::= OCTET STRING

Previously, we were failing to unwrap the second level of OCTET STRING
encoding.

Fixes #993.

R=rsc
CC=golang-dev
https://golang.org/cl/1917044
2010-08-03 12:26:48 -04:00
Russ Cox
3f19d8ae8d gc: empty select
R=ken2
CC=golang-dev
https://golang.org/cl/1871057
2010-08-03 01:07:57 -07:00
Russ Cox
585eae3bce gc: bug301
Fixes #990.

R=ken2
CC=golang-dev
https://golang.org/cl/1742055
2010-08-03 01:07:40 -07:00
Russ Cox
c6cb303a8a gc: bug299, bug300
R=ken2
CC=golang-dev
https://golang.org/cl/1731057
2010-08-03 00:53:32 -07:00
Russ Cox
9bac9d23d3 gc: index bounds tests and fixes
move constant index checking to front end
x[2:1] is a compile-time error now too

R=ken2
CC=golang-dev
https://golang.org/cl/1848056
2010-08-03 00:26:02 -07:00
Scott Lawrence
0cd8777255 strings: fix Split("", "", -1)
Fixes #980.

Made it return an empty array, rather than crash.
Added relevant test cases to strings.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1914041
2010-08-03 13:35:14 +10:00
Alex Brainman
a79a9098da syscall: make sure go error numbers do not clash with windows system errors
R=rsc
CC=golang-dev
https://golang.org/cl/1857049
2010-08-03 12:04:41 +10:00
Nigel Tao
244b6583b7 image: introduce Gray and Gray16 types, and remove the named colors
except for Black and White.

R=rsc
CC=golang-dev, mpl, r
https://golang.org/cl/1903049
2010-08-03 10:57:53 +10:00
Rob Pike
3f5966dcc0 io: consolidate multi_reader and multi_writer into a single file, multi.go
R=rsc
CC=golang-dev
https://golang.org/cl/1860046
2010-08-03 08:04:33 +10:00
Nigel Tao
55badd474b image/png: use image-specific methods for checking opacity.
R=rsc
CC=golang-dev, mpl
https://golang.org/cl/1894047
2010-08-02 09:52:15 +10:00
Bill Neubauer
6d37724c15 websocket: fix bug involving spaces in header keys
R=rsc, ukai
CC=golang-dev
https://golang.org/cl/1669056
2010-07-30 12:27:03 -07:00
Russ Cox
68b0a87966 runtime: do not fall through in SIGBUS/SIGSEGV
Faults beyond the first page are not expected
and should fail loudly.  They are not subject to recover.

R=r
CC=golang-dev
https://golang.org/cl/1915042
2010-07-30 11:32:55 -07:00
Kai Backman
8d76a15122 arm: bugfixes (stack clobbering, indices)
also changed zerodivide to output "BUG"

R=rsc
CC=golang-dev
https://golang.org/cl/1871055
2010-07-30 10:37:51 +03:00
Andrew Gerrand
3402c5e8fe misc/builder: support for uploading tarballs to googlecode
R=rsc
CC=golang-dev
https://golang.org/cl/1784042
2010-07-30 14:00:59 +10:00
Joe Poirier
b57ffae094 cov and prof: implement windows version (just function stubs and build mods)
R=brainman, rsc
CC=golang-dev
https://golang.org/cl/1676054
2010-07-30 11:47:11 +10:00
Yuusei Kuwana
c21e2f3925 mime: add AddExtensionType
For example:
mime.AddExtensionType(".m3u8", "application/x-mpegURL")
mime.AddExtensionType(".ts", "video/MP2T")

R=rsc, rsc1
CC=golang-dev
https://golang.org/cl/1698046
2010-07-29 14:12:04 -07:00
Robert Griesemer
bc0a1c61f7 scanner: better comment
R=rsc
CC=golang-dev
https://golang.org/cl/1900044
2010-07-29 13:02:27 -07:00
Rob Pike
2c0bbf99b9 fmt.Print: fix bug in placement of spaces introduced when ...T went in.
Fixes #976.

R=rsc, chris tighe, r
CC=golang-dev
https://golang.org/cl/1697057
2010-07-29 10:50:09 -07:00
Alex Brainman
45e12c7cd3 runtime: fix bug introduced in revision 4a01b8d28570
R=rsc
CC=golang-dev
https://golang.org/cl/1874046
2010-07-29 16:54:01 +10:00
Wei Guangjing
adc13b1e48 net: implement windows version of LookupHost/Port/SRV
R=brainman, rsc
CC=golang-dev
https://golang.org/cl/1748042
2010-07-29 14:58:28 +10:00
Russ Cox
491a3ca5b7 gc: fix SIGBUS
R=ken2
CC=golang-dev
https://golang.org/cl/1906042
2010-07-28 18:21:50 -07:00
Fazlul Shahriar
4f64ecfdda http: add https client support
Fixes #851.

R=rsc
CC=golang-dev
https://golang.org/cl/1729052
2010-07-28 18:13:56 -07:00
Rob Pike
518df525d8 fmt: move comment into doc.go.
Fix the documentation of newline handling in *f routines
to match the implementation.

R=rsc
CC=golang-dev
https://golang.org/cl/1899042
2010-07-28 13:11:22 -07:00
Brad Fitzpatrick
719cde2c47 io: MultiReader and MultiWriter
Little helpers I've found useful.

R=adg, rsc, r, gri
CC=golang-dev
https://golang.org/cl/1764043
2010-07-28 11:30:00 -07:00
Kai Backman
fa4da33315 arm: minor bugfixes.
R=rsc
CC=golang-dev
https://golang.org/cl/1692057
2010-07-28 15:58:35 +03:00
Russ Cox
f930d28164 5g: fix build
R=ken2
CC=golang-dev
https://golang.org/cl/1893042
2010-07-27 13:43:58 -07:00
Andrew Gerrand
4501e18aa5 bufio: fix optimisation test
Fixes #949.

R=rsc
CC=golang-dev
https://golang.org/cl/1886046
2010-07-27 17:22:45 +10:00
Andrew Gerrand
fc4ba1546c net: add nil checks to several String methods to avoid panics
Fixes #945.

R=r
CC=golang-dev
https://golang.org/cl/1848049
2010-07-27 17:22:22 +10:00
Andrew Gerrand
8b821696cc bytes, strings: mention the n < 0 case in Split/SplitAfter doc comment
R=r, rsc
CC=golang-dev
https://golang.org/cl/1669055
2010-07-27 15:06:08 +10:00
Russ Cox
711f075987 gc: include signal.h (fix build)
R=ken2
CC=golang-dev
https://golang.org/cl/1871049
2010-07-26 18:41:36 -07:00
Robert Griesemer
0b133d8ac1 godoc: accept '.', '!', and '?' as end of first sentence of package documentation
R=rsc
CC=golang-dev
https://golang.org/cl/1875049
2010-07-26 17:34:40 -07:00
Russ Cox
f20c2e1cf5 gc: more crash avoidance
Fixes #961.
Fixes #962.

R=ken2
CC=golang-dev
https://golang.org/cl/1903043
2010-07-26 17:34:17 -07:00
Russ Cox
9a442211c6 6l: more invalid input files
Fixes #963.
Fixes #964.

R=r
CC=golang-dev
https://golang.org/cl/1874045
2010-07-26 17:34:02 -07:00
Russ Cox
b49561d884 gc: graceful exit on seg fault
R=ken2
CC=golang-dev
https://golang.org/cl/1882043
2010-07-26 16:52:51 -07:00
Rob Pike
a59e113fcb fmt.Scanf: handle trailing spaces.
Fixes #954.

R=rsc
CC=golang-dev
https://golang.org/cl/1864046
2010-07-26 16:38:35 -07:00
Peter Mundy
036584395d runtime: fix goc2c for rename to goc2c and *.goc
Release 2010-04-27. runtime: rename cgo2c, *.cgo to goc2c, *.goc
to avoid confusion with real cgo.

R=rsc
CC=golang-dev
https://golang.org/cl/1868047
2010-07-26 16:21:27 -07:00
Russ Cox
5ee02eef4c net: TCPConn.SetNoDelay, back by popular demand
R=r
CC=golang-dev
https://golang.org/cl/1880047
2010-07-26 16:19:39 -07:00
Robert Griesemer
4188504f38 godoc: display synopses for all packages that have some kind of documentation.
Fixes #953.

R=rsc
CC=golang-dev
https://golang.org/cl/1862046
2010-07-26 15:27:42 -07:00
Russ Cox
607eaea456 gc: fix smaller-than-pointer-sized receivers in interfaces
Fixes #812.

R=ken2
CC=golang-dev
https://golang.org/cl/1904041
2010-07-26 15:25:10 -07:00
Russ Cox
7b240e8135 gc: import dot shadowing bug
R=ken2
CC=golang-dev
https://golang.org/cl/1873047
2010-07-26 14:21:39 -07:00
Wei Guangjing
ad4f95d365 syscall: add windows version of Pipe()
R=brainman, rsc
CC=golang-dev
https://golang.org/cl/1715046
2010-07-26 15:55:01 +10:00
Andrew Gerrand
f656a87697 prof: fix typo in usage string
Fixes #948.

R=rsc
CC=golang-dev
https://golang.org/cl/1890043
2010-07-26 14:46:53 +10:00
Alex Brainman
4d87e8ab08 net: fix crashing Read/Write when passed empty slice on windows
Fixes #921.

R=rsc
CC=golang-dev
https://golang.org/cl/1862043
2010-07-26 12:50:03 +10:00
Alex Brainman
eee095399f syscall: improve windows errno handling
R=rsc, Joe Poirier, PeterGo
CC=golang-dev
https://golang.org/cl/1872045
2010-07-26 10:24:48 +10:00
Alex Brainman
aa4639faf1 fix windows Make.cmd:
- TARG had extra space at the end;
- it should be set before "all" target.

R=rsc, Joe Poirier
CC=golang-dev
https://golang.org/cl/1846042
2010-07-26 09:55:25 +10:00
Daniel Theophanes
7f9e247489 syscall: add ForkExec, Syscall12 on Windows
R=brainman, rsc
CC=golang-dev
https://golang.org/cl/1578041
2010-07-26 09:43:35 +10:00
Vinu Rajashekhar
e57657683f runtime/extern.go: clear a small error in a comment.
R=iant, rsc
CC=golang-dev
https://golang.org/cl/1741058
2010-07-24 19:10:21 -07:00
Fazlul Shahriar
e356f1d88f bytes: port IndexFunc and LastIndexFunc from strings package
This CL basically applies the same changes as

	http://code.google.com/p/go/source/detail?r=5e0a29014e8e

but for bytes package.

R=r, rog
CC=golang-dev
https://golang.org/cl/1670052
2010-07-23 12:34:35 -07:00
Russ Cox
fa3d86ca39 libmach: correct handling of .5 files with D_REGREG addresses
undo workaround in gc

Fixes #943.

R=kaib
CC=golang-dev
https://golang.org/cl/1889041
2010-07-22 09:00:34 -07:00
Russ Cox
2cc9d339e6 fix build
bug introduced in https://golang.org/cl/1886043

R=r
CC=golang-dev
https://golang.org/cl/1848047
2010-07-22 08:55:56 -07:00
Andrew Gerrand
d34174cfb5 build: clean.bash to check that GOOS and GOARCH are set
R=rsc
CC=golang-dev
https://golang.org/cl/1843046
2010-07-22 10:15:36 +10:00
Micah Stetson
d1e7cffe6c gotest: fix the glob pattern in the top-of-file comment
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/1847042
2010-07-22 10:07:26 +10:00
Russ Cox
916f896a3b ld: various bug fixes
Fixes #937.
Fixes #938.
Fixes #939.
Fixes #940.

R=r
CC=golang-dev
https://golang.org/cl/1886043
2010-07-21 13:44:49 -07:00
Andrey Mirtchovski
8629e5a648 strings.Bytes: fix typo in comment
R=adg, rsc
CC=golang-dev
https://golang.org/cl/1886042
2010-07-21 12:01:15 -07:00
Ian Lance Taylor
9a2f0029bc io: Avoid another race condition in pipes.
Goroutine 1:
  Call Read on read half of pipe, entering pipeHalf.rw.
  Check ioclosed field, which is false.
  Send data to p.c1
  Wait for response on p.c2.

Goroutine 2:
  Call Close on read half of pipe, entering pipeHalf.close.
  Set closed field.
  Send error to p.cclose.
  Set ioclosed field.
  Send 1 to p.done.
  Return and exit goroutine.

Goroutine 3:
  This is the goroutine running pipe.run, and for some reason
  it has started late.
  Read error from p.rclose; set rerr and continue.
  Read 1 from p.done; increment ndone and continue.
  Read data from r1 (sent by goroutine 1); set r1 = nil and continue

Now goroutine 1 is waiting for a response, and goroutine 3 is
waiting for something else to happen.

This patch fixes the race by having the runner check whether
the read half is closed when it is asked for read data, and
similarly for the corresponding race on the write half.

This patch also fixes the similar race in which ndone gets
bumped up to 2 while there is a reader or writer waiting.

There is still another race to fix.  It is possible for the
read half and the write half to both be closed, and for the
runner goroutine to exit, all before the runner goroutine sees
the request from a reader.  E.g., in the above, have goroutine
2 also close the write half, and have goroutine 3 see both
done messages before it sees the request from goroutine 1.

R=rsc
CC=golang-dev
https://golang.org/cl/1862045
2010-07-21 10:57:46 -07:00
Peter Mundy
6a6d8fdcd3 syscall: On Windows, Errstr FormatMessage has no values to insert.
For the Windows version of syscall Errstr, set the
FORMAT_MESSAGE_IGNORE_INSERTS value of the FormatMessage
Flags argument when there are no values to insert.

R=rsc, brainman
CC=golang-dev
https://golang.org/cl/1868043
2010-07-21 09:40:08 -07:00
Adam Langley
7be849d4a6 crypto/tls: add client-side SNI support and PeerCertificates.
SNI (Server Name Indication) is a way for a TLS client to
indicate to the server which name it knows the server by. This
allows the server to have several names and return the correct
certificate for each (virtual hosting).

PeerCertificates returns the list of certificates presented by
server.

R=r
CC=golang-dev
https://golang.org/cl/1741053
2010-07-21 11:36:01 -04:00
Adam Langley
8286ee4c5b crypto/ocsp: add package to parse OCSP responses.
OCSP is the preferred X.509 revocation mechanism. X.509 certificates
        can contain a URL from which can be fetched a signed response saying
        "this certificate is valid until $x" (where $x is usually 7 days in the
        future). These are called OCSP responses and they can also be included
        in the TLS handshake itself ("OCSP stapling")

R=rsc, r
CC=golang-dev
https://golang.org/cl/1875043
2010-07-21 10:07:22 -04:00
Kai Backman
47b6400556 arm: fix build by disabling list copying optimization for 5g.
R=rsc
CC=golang-dev
https://golang.org/cl/1697053
2010-07-21 14:14:21 +03:00
Andrew Gerrand
61fb9ccc8d os: change comment on O_APPEND to be more accurate
R=rsc
CC=golang-dev
https://golang.org/cl/1870042
2010-07-21 17:11:28 +10:00
Alex Brainman
42dd7a6dae net(windows): properly handle EOF in (*netFD).Read().
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1848045
2010-07-20 23:51:07 -07:00
Russ Cox
0decedf636 gc: various bug fixes
Fixes #935.
Fixes #936.
Fixes #941.

R=ken2
CC=golang-dev
https://golang.org/cl/1867042
2010-07-20 23:45:33 -07:00
Rob Pike
de228c0e0c bytes: add Title
R=rsc
CC=golang-dev
https://golang.org/cl/1872042
2010-07-20 19:53:59 -07:00
Rob Pike
a0d1c9263e gobs: fix bug in singleton arrays
Fixes #934.

R=rsc
CC=golang-dev
https://golang.org/cl/1869043
2010-07-20 19:53:28 -07:00
Robert Griesemer
8f9aeb5a66 gofmt: fix some linebreak issues
- don't lose empty lines after labels
- canonicalize number of line breaks
- gofmt src misc, fixes a couple of irregular breaks

R=rsc
CC=golang-dev
https://golang.org/cl/1843044
2010-07-20 09:29:31 -07:00
Kai Backman
36057e721e more soft float support. passes several basic tests
but with less precision than hardware counterparts.

fixed a number of tests to output BUG when they failed.
changed the runner to distinghuish between output
and output containing ^BUG

R=rsc
CC=dho, golang-dev
https://golang.org/cl/1778041
2010-07-20 15:53:16 +03:00
Rob Pike
8684a08989 strings: add Title
strings.ToTitle converts all characters to title case, which for consistency with the
other To* functions it should continue to do.  This CL adds string.Title, which
does a proper title-casing of the string.
A similar function for package bytes will follow once this is settled.
Fixes #933.

R=rsc
CC=golang-dev
https://golang.org/cl/1869042
2010-07-20 00:03:59 -07:00
Ken Thompson
f6b93ab432 change floating literal normalization
from word-oriented to bit-oriented.
this will increase fp literal precision
by up to a full word.

R=rsc
CC=golang-dev
https://golang.org/cl/1859044
2010-07-19 16:10:46 -07:00
Robert Griesemer
a5fe54aa2b tabwriter: fix a comment to fix godoc output
R=r
CC=golang-dev
https://golang.org/cl/1857043
2010-07-19 11:33:11 -07:00
Adam Langley
9929ee92e7 asn1: Enumerated, Flag and GeneralizedTime support.
Add support for ASN.1 ENUMERATED types.

        Add a magic type, asn1.Flag, for the cases where the presence of an
        empty explicit tag is semantically meaningful.

        Add support for GeneralizedTime.

R=rsc
CC=golang-dev
https://golang.org/cl/1684055
2010-07-19 11:11:40 -04:00
Adam Langley
02786d263c time: fix parsing of minutes in time zones.
R=r
CC=golang-dev
https://golang.org/cl/1830041
2010-07-19 11:08:04 -04:00
James Whitehead
18d8c7dac6 http/transferWriter: Write body when content length unknown
Fixes #923.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/1846043
2010-07-19 14:05:27 +10:00
Russ Cox
2d6ae385e1 linux/386: use Xen-friendly ELF TLS instruction sequence
Fixes #465.

R=iant
CC=golang-dev
https://golang.org/cl/1665051
2010-07-17 16:54:03 -07:00
Peter Mundy
bc2ee6b8c6 utf16: fix cyclic dependency when testing on Windows
(on Windows, syscall depends on utf16)

R=rsc
CC=golang-dev
https://golang.org/cl/1664053
2010-07-17 16:52:53 -07:00
Ken Thompson
95b93c28e3 1. got 29 (Mpscale) more bits of precision
out of floating constant multiply
2. added rounding code to "const fix=float"
to allow up to 29 (Mpscale) bits of
slop and still get an exact fixed constant.

fixes #931

R=rsc
CC=golang-dev
https://golang.org/cl/1692055
2010-07-17 16:32:40 -07:00
Russ Cox
b693847ea8 gc: print error detail about failure to open import
R=ken2
CC=golang-dev
https://golang.org/cl/1872041
2010-07-16 21:38:51 -07:00
Russ Cox
e692977af3 5l, 6l, 8l: reject invalid input files
Fixes #925.
Fixes #926.
Fixes #927.
Fixes #928.
Fixes #929.
Fixes #930.

R=r
CC=golang-dev
https://golang.org/cl/1752044
2010-07-16 16:16:17 -07:00
Rob Pike
8519134b98 fix typo in lex.c comment
R=rsc
CC=golang-dev
https://golang.org/cl/1862044
2010-07-16 15:08:31 -07:00
Ken Thompson
19d7fc4026 change line pragma from
//line number file
to
	//line file:number

R=rsc
CC=golang-dev
https://golang.org/cl/1868041
2010-07-16 13:34:36 -07:00
Russ Cox
d1e2f73b1d big: attempt to fix arm build
R=gri
CC=golang-dev
https://golang.org/cl/1752043
2010-07-16 11:18:45 -07:00
Ian Lance Taylor
385bfd4ca0 Remove unused declaration.
R=rsc
CC=golang-dev
https://golang.org/cl/1686054
2010-07-16 11:05:38 -07:00
Ian Lance Taylor
8a95821694 cgo: If CC is set in environment, use it rather than "gcc".
R=rsc
CC=golang-dev
https://golang.org/cl/1842042
2010-07-16 11:01:04 -07:00
Ken Thompson
444066e56d interpret lines that look like
//line 10 units.y
which is equiv to c
	#line 10 units.y
the purpose is to generate diagnostics
that correctly point to preprocessed source.

R=rsc
CC=golang-dev
https://golang.org/cl/1863042
2010-07-15 20:21:33 -07:00
Russ Cox
4c0de303ce gc: bug294
Fixes #800.

R=ken2
CC=golang-dev
https://golang.org/cl/1855043
2010-07-15 16:42:32 -07:00
Russ Cox
ece6a8c549 gc: bug293
Fixes #846.

R=ken2
CC=golang-dev
https://golang.org/cl/1862042
2010-07-15 16:14:06 -07:00
Russ Cox
cdb446feb5 gc: bug292
Fixes #843.

R=ken2
CC=golang-dev
https://golang.org/cl/1729051
2010-07-15 16:13:47 -07:00
Robert Griesemer
496a935376 bignum: delete package - functionality subsumed by package big
R=rsc
CC=golang-dev
https://golang.org/cl/1742045
2010-07-15 16:08:53 -07:00
Russ Cox
b2a919fc29 gc: issue 894
Fixes #894.

R=ken2
CC=golang-dev
https://golang.org/cl/1701051
2010-07-15 15:25:32 -07:00
Russ Cox
31c07dfddf gc: issue 901
Fixes #901.

R=ken2
CC=golang-dev
https://golang.org/cl/1674049
2010-07-15 15:22:51 -07:00
Russ Cox
08a263a991 gc: bug291
Fixes #915.

R=ken2
CC=golang-dev
https://golang.org/cl/1856042
2010-07-15 15:17:42 -07:00
Russ Cox
691d765121 gc: bug274
R=ken2
CC=golang-dev
https://golang.org/cl/1742044
2010-07-15 15:05:56 -07:00
Russ Cox
17f90c68c6 gc: fix handling of types inside function bodies
Fixes #849.
Fixes #920.

R=ken2
CC=golang-dev
https://golang.org/cl/1841042
2010-07-15 14:25:50 -07:00
Ian Lance Taylor
84f67eb8e6 Build libcgo.so with $(CC), not the gcc on PATH.
Change make.bash to make sure that $(CC) is defined to match
the compiler used to build the tools.

R=rsc
CC=golang-dev
https://golang.org/cl/1853041
2010-07-15 14:15:39 -07:00
Ian Lance Taylor
5958fd7f89 Clarify that a new goroutine is not started for each finalizer.
R=rsc
CC=golang-dev
https://golang.org/cl/1698051
2010-07-15 12:32:38 -07:00
Russ Cox
9867ced972 cgo: use new command line syntax: -- separates cgo flags from gcc flags
Fixes #922.

R=r
CC=golang-dev
https://golang.org/cl/1664051
2010-07-15 09:41:21 -07:00
Brad Fitzpatrick
9b64fef71a mime/multipart and HTTP multipart/form-data support
Somewhat of a work-in-progress (in that MIME is a large spec), but this is
functional and enough for discussion and/or code review.

In addition to the unit tests, I've tested with curl and Chrome with
a variety of test files, making sure the digests of files are unaltered
when read via a multipart Part.

R=rsc, adg, dsymonds1, agl1
CC=golang-dev
https://golang.org/cl/1681049
2010-07-14 17:26:14 -07:00
Russ Cox
e9bcbc5398 os: use /tmp again
R=adg
CC=golang-dev
https://golang.org/cl/1823041
2010-07-14 17:25:46 -07:00
Joe Poirier
9028d6bf7c windows: append executable extension (done as per Russ' suggestion)
R=rsc
CC=brainman, golang-dev
https://golang.org/cl/1690053
2010-07-14 17:21:13 -07:00
Russ Cox
0432f289f7 cgo: various bug fixes
* remember #defined names, so that C.stdout can refer
  to the real name (on OS X) __stdoutp.
* better handling of #defined constant expressions
* allow n, err = C.strtol("asdf", 0, 123) to get errno as os.Error
* write all output files to current directory
* don't require gcc output if there was no input

Fixes #533.
Fixes #709.
Fixes #756.

R=r
CC=dho, golang-dev, iant
https://golang.org/cl/1734047
2010-07-14 17:17:53 -07:00
Robert Griesemer
a3855235cd fix build: reverting exp/eval Makefile to old form
(gofmt doesn't exist when this is built)

R=rsc
CC=golang-dev
https://golang.org/cl/1838041
2010-07-14 10:11:12 -07:00
Evan Shaw
b97292791b exp/eval: Converted from bignum to big
Also in this CL:
* Removed util.go, as its functionality is in big
* Removed some semicolons from the code generated by gen.go
* Added a generate target to Makefile
* Removed an outdated TODO from value.go

R=gri
CC=golang-dev
https://golang.org/cl/1780042
2010-07-14 09:39:59 -07:00
Adam Langley
c9406f930d crypto/tls: add client OCSP stapling support.
R=r, rsc
CC=golang-dev
https://golang.org/cl/1750042
2010-07-14 10:40:15 -04:00
Russ Cox
cec007d3d2 runtime: better error for send/recv on nil channel
R=ken2
CC=golang-dev
https://golang.org/cl/1835041
2010-07-13 17:27:26 -07:00
Russ Cox
2e3dc2cc35 crypto/rand: add missing Unlock
R=r
CC=golang-dev
https://golang.org/cl/1812043
2010-07-13 12:37:47 -07:00
Andrew Gerrand
da795fcefc runtime/tiny: style and doc tweaks
R=r, rsc
CC=golang-dev
https://golang.org/cl/1821041
2010-07-13 10:47:52 +10:00
Russ Cox
11f9c03986 fix build
R=gri
CC=golang-dev
https://golang.org/cl/1813042
2010-07-12 17:46:03 -07:00
Peter Mundy
b6850fe739 os: Use TempFile with default TempDir for temp test files
Use io/ioutil.TempFile with default os.TempDir for temporary test files.
For os_test.go temporary test files, use a local file system and OS
independent directory names. Avoid problems with NFS.

Fixes #848.

R=adg
CC=golang-dev
https://golang.org/cl/1806043
2010-07-13 10:31:51 +10:00
Andrew Gerrand
48e4d67b23 websocket: fix comment indentation
To make code samples formatted correctly by godoc.

R=r, ukai, rsc
CC=golang-dev, gri
https://golang.org/cl/1738048
2010-07-13 10:29:41 +10:00
Robert Griesemer
d9c47cd8c8 container/vector: rename Data() -> Copy()
R=rsc
CC=golang-dev
https://golang.org/cl/1814043
2010-07-12 17:22:21 -07:00
Rob Pike
18d78dd7b1 tweak comment for %#X
Fixes #904.

R=rsc
CC=golang-dev
https://golang.org/cl/1803043
2010-07-12 16:57:11 -07:00
Russ Cox
36560d2b4a pem: print \n after 1 header line too
rearrange to make reason for if clear.

Fixes #911.

R=agl1
CC=golang-dev
https://golang.org/cl/1774044
2010-07-12 16:48:49 -07:00
Peter Mundy
ccd28e8eb6 crypto/rand for Windows
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/1773041
2010-07-12 16:37:53 -07:00
Rob Pike
c9f83372d8 add missing argument to usage message.
Fixes #912.

R=rsc
CC=golang-dev
https://golang.org/cl/1819041
2010-07-12 16:31:51 -07:00
Andrew Gerrand
880beafc9f http: fix ParseURL to handle //relative_path properly
Fixes #900.

R=rsc
CC=golang-dev
https://golang.org/cl/1756042
2010-07-13 09:21:42 +10:00
Robert Griesemer
97bcf049f7 big: added a few missing functions:
- sign to determine if a value is < 0, == 0, > 0
- abs to compute absolute value
- Rat.IsInt to test if a rational number is representable as an integer

R=rsc
CC=golang-dev
https://golang.org/cl/1761042
2010-07-12 16:09:27 -07:00
Robert Griesemer
345f9c9eb2 container/vector: remove Iter() from interface
(Iter() is almost never the right mechanism to call.
Per discussion with rsc.)

R=rsc
CC=golang-dev
https://golang.org/cl/1771043
2010-07-12 13:51:42 -07:00
Charles L. Dorian
c28bd5445c math: amd64 version of log
Benchmarks 25ns/op (was 58ns/op) on 2.53GHz Intel Core 2 Duo.

R=rsc
CC=golang-dev
https://golang.org/cl/1740043
2010-07-12 11:30:11 -07:00
Micah Stetson
b5b6ce0804 json: Add HTMLEscape
R=rsc
CC=golang-dev
https://golang.org/cl/1496042
2010-07-12 11:26:41 -07:00
Vinu Rajashekhar
a9a24d4d8a Corrected a print statement from printing netfd to fd.
R=iant
CC=golang-dev
https://golang.org/cl/1805041
2010-07-10 14:40:48 -07:00
Robert Griesemer
71ed4eb7a5 fix build: adjustest a few tests that I missed before
R=r
CC=golang-dev
https://golang.org/cl/1762044
2010-07-09 13:11:20 -07:00
Robert Griesemer
d87f7e2392 gofmt: update test script
R=r
CC=golang-dev
https://golang.org/cl/1791041
2010-07-09 13:03:25 -07:00
Robert Griesemer
7529d32ee1 go/parser: require that '...' parameters are followed by a type
(matching latest syntax changes)

R=r
CC=golang-dev
https://golang.org/cl/1762042
2010-07-09 13:02:32 -07:00
Evan Shaw
2e00bf9877 big: Improvements to Rat.SetString
* Allow an exponent part. This is necessary for exp/eval.
* Fix a bug for input that had no numbers after the decimal.
* In Int.SetString, allow a leading + sign.
* In Int.SetString, error if the input is "-" with no number.
* In nat.scan, normalize the resulting nat.

R=gri
CC=golang-dev
https://golang.org/cl/1733045
2010-07-09 11:24:31 -07:00
Peter Mundy
56b3e5d644 io: fix SectionReader Seek to seek backwards
Fixes #899.

R=golang-dev, rminnich, adg
CC=golang-dev
https://golang.org/cl/1749041
2010-07-08 16:57:07 +10:00
Markus Duft
d49c0d71f6 runtime/tiny: add destroyLock stub, and docs for additional VMs
updated thread.c to provide destroylock, which seems to be
	      required to link.
        updated README with different virtualization programs.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/1746047
2010-07-08 00:15:47 +10:00
Adam Langley
a169e6cc6a http, crypto/tls: followup fixes from 1684051.
(TBR because this is just addressing previous review comments.)

R=r
CC=golang-dev
https://golang.org/cl/1697048
2010-07-02 16:43:48 -04:00
Adam Langley
fc23def67f crypto/tls, http: Make HTTPS servers easier.
R=r, adg, rsc
CC=golang-dev
https://golang.org/cl/1684051
2010-07-02 13:00:18 -04:00
Russ Cox
44eaaaaa78 ld: fix handling of "". names in #pragma dynimport/dynexport
Fixes #728.

R=r
CC=golang-dev
https://golang.org/cl/1706053
2010-07-01 21:48:13 -07:00
Russ Cox
81c3e8cabc gc: implement new len spec, range bug fix, optimization
Fixes #885.

R=ken2
CC=golang-dev
https://golang.org/cl/1680048
2010-07-01 18:04:25 -07:00
Russ Cox
971a04f1dc implications of len spec change
R=r
CC=golang-dev
https://golang.org/cl/1712048
2010-07-01 17:49:28 -07:00
Rob Pike
dc6a95e979 strconv.Uitob64: allow conversion of 64-bit binaries (buffer was too small).
panic if base is invalid.

R=rsc
CC=golang-dev
https://golang.org/cl/1702050
2010-07-01 14:44:21 -07:00
Rob Pike
38f1231f3e strings and bytes.Split: make count of 0 mean 0, not infinite.
Use a count of -1 for infinity.  Ditto for Replace.

R=rsc
CC=golang-dev
https://golang.org/cl/1704044
2010-07-01 14:08:14 -07:00
Russ Cox
285312a05c 6l: drop confusing comment
R=ken2
CC=golang-dev
https://golang.org/cl/1693047
2010-07-01 12:51:00 -07:00
Russ Cox
e5009e29ea 6a: assemble CMPPD as 6l expects
libmach: disassemble CMPPD as 6a expects

R=ken2
CC=Charlie Dorian, golang-dev
https://golang.org/cl/1704046
2010-07-01 12:36:29 -07:00
Russ Cox
bf10982739 6l: implement MOVLQZX as "mov", not "movsxd"
(Here, quoted strings are the official AMD names.)

The amd64 "movsxd" instruction, when invoked
with a 64-bit REX prefix, moves and sign extends
a 32-bit value from register or memory into a
64-bit register.  6.out.h spells this MOVLQSX.

6.out.h also includes MOVLQZX, the zero extending
version, which it implements as "movsxd" without
the REX prefix.  Without the REX prefix it's only sign
extending 32 bits to 32 bits (i.e., not doing anything
to the bits) and then storing in a 32-bit register.
Any write to a 32-bit register zeros the top half of the
corresponding 64-bit register, giving the advertised effect.
This particular implementation of the functionality is
non-standard, because an ordinary 32-bit "mov" would
do the same thing.

Because it is non-standard, it is often mishandled or
not handled by binary translation tools like valgrind.
Switching to the standard "mov" makes the binaries
work better with those tools.

It's probably useful in 6c and 6g to have an explicit
instruction, though, so that the intent of the size
change is clear.  Thus we leave the concept of MOVLQZX
and just implement it by the standard "mov" instead of
the non-standard 32-bit "movsxd".

Fixes #896.

R=ken2
CC=golang-dev
https://golang.org/cl/1733046
2010-07-01 12:18:35 -07:00
Charles L. Dorian
9038de0373 cmath: correct IsNaN for argument cmplx(Inf, NaN)
R=rsc
CC=golang-dev
https://golang.org/cl/1705041
2010-06-30 23:34:33 -07:00
Gustavo Niemeyer
ae33032893 goinstall: support for Bazaar+Launchpad
With these changes, goinstall is now able to use branches
maintained with Bazaar located in Launchpad.

Project aliases such as /project and /project/series are
supported in addition to specific user or team branches
such as /~user/project/branch.  Temporary branches under
the +junk special project are also supported.

As a curious side effect, since Launchpad is able to import
code from other locations, they can be indirectly
accessible too if desired.

R=rsc
CC=golang-dev
https://golang.org/cl/1699050
2010-06-30 23:33:49 -07:00
Russ Cox
489494cac3 cgo: use slash-free relative paths for .so references
The Makefile and cgo now rewrite / to _ when creating the path.
The .so for gosqlite.googlecode.com/hg/sqlite is named
cgo_gosqlite.googlecode.com_hg_sqlite.so, and then 6l and 8l
both include a default rpath of $GOROOT/pkg/$GOOS_$GOARCH.
This should make it easier to move binaries from one system
to another.

Fixes #857.

R=iant, r
CC=golang-dev
https://golang.org/cl/1700048
2010-06-30 23:31:27 -07:00
Russ Cox
7c9ed7946c 8g: out of register bug fix
Fixes #868.

R=ken2
CC=golang-dev
https://golang.org/cl/1695049
2010-06-30 20:45:50 -07:00
Russ Cox
ed39c764b8 gc: do not crash on bad [...]T
Fixes #879.

R=ken2
CC=golang-dev
https://golang.org/cl/1678048
2010-06-30 20:34:31 -07:00
Daniel Fleischman
040f081842 template: fix typo in doc comment
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1665047
2010-06-30 19:57:26 -07:00
Russ Cox
0bf413ab8e bytes, strings: add Replace
This is the Replace I suggested in the review of CL 1114041.
It's true that we already have

	regexp.MustCompile(regexp.QuoteMeta(old)).ReplaceAll(s, new)

but because this Replace is doing a simpler job it is
simpler to call and inherently more efficient.

I will add the bytes implementation and tests to the
CL after the strings one has been reviewed.

R=r, cw
CC=golang-dev
https://golang.org/cl/1731048
2010-06-30 18:03:09 -07:00
Adam Langley
269df58270 x509: fix English.
(addressing comments from 1741045)

R=r
CC=golang-dev
https://golang.org/cl/1678047
2010-06-30 18:05:38 -04:00
Adam Langley
9c09ed13d2 x509: support non-self-signed certs.
For generating non-self-signed certs we need to be able to specify a
public key (for the signee) which is different from the private key (of
the signer).

R=rsc
CC=golang-dev
https://golang.org/cl/1741045
2010-06-30 18:02:31 -04:00
Ivan Krasin
400f7a6ba5 syscall: add socketpair
R=rsc
CC=golang-dev
https://golang.org/cl/1319042
2010-06-30 14:58:21 -07:00
Charles L. Dorian
a0117bafa0 math: amd64 versions of exp and fabs
Benchmark of exp to 28 ns/op from 64 ns/op,
on 2.53GHz Intel Core 2 Duo.

R=rsc
CC=golang-dev
https://golang.org/cl/1594041
2010-06-30 14:44:27 -07:00
Peter Mundy
0e25775518 io/ioutil.TempFile for Windows
Fixes #834.

R=rsc, brainman
CC=golang-dev
https://golang.org/cl/1686047
2010-06-30 13:52:34 -07:00
Ian Lance Taylor
7c1be45f58 io: Avoid race condition in pipe.
One goroutine started up and was waiting in rw.  Then another
goroutine decided to close the pipe.  The closing goroutine
stalled calling p.io.Lock() in pipeHalf.close.  (This happened
in gccgo).  If the closing goroutine had been able to set the
ioclosed flag, it would have gone on to tell the runner that
the pipe was closed, which would then send an EINVAL to the
goroutine sleeping in rw.  Unlocking p.io before sleeping in
rw avoids the race.

R=rsc, rsc1
CC=golang-dev
https://golang.org/cl/1682048
2010-06-30 13:14:46 -07:00
Andrew Gerrand
d3c3c15b17 http: client_test nil pointer fix
Fixes #893.

R=rsc
CC=golang-dev
https://golang.org/cl/1687045
2010-06-30 18:57:27 +10:00
Andrew Gerrand
4f340f5051 godoc: canonicalize codewalk paths
R=rsc
CC=golang-dev
https://golang.org/cl/1729046
2010-06-30 17:56:51 +10:00
Alex Brainman
9d5f80b0c6 time: implement timezones for windows
Fixes #761.

R=PeterGo, adg, rsc
CC=golang-dev
https://golang.org/cl/1121042
2010-06-29 22:29:09 -07:00
Alex Brainman
bb9261bf3b net: initial attempt to implement windows version
R=rsc, Mateusz Czaplinski
CC=golang-dev
https://golang.org/cl/1600041
2010-06-29 20:23:39 -07:00
Russ Cox
829896168c ld: fix implementation of -u
R=r
CC=golang-dev
https://golang.org/cl/1678046
2010-06-29 18:59:48 -07:00
Kirklin McDonald
0046d51e06 net: add support for DNS SRV requests.
Fixes #758.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/1078041
2010-06-30 10:54:24 +10:00
Russ Cox
774333685e runtime: fix scheduling bug - world wasn't stopping
Fixes #886.

R=r
CC=golang-dev
https://golang.org/cl/1667051
2010-06-29 17:47:27 -07:00
Rob Pike
64b6a789a1 strconv: fix %.1f, 0.09
Fixes #822.
Credit to https://golang.org/cl/1442041 by danielfleischman

R=rsc
CC=golang-dev
https://golang.org/cl/1738047
2010-06-29 16:51:56 -07:00
Rob Pike
21f8ae8fec strconv: fix %.2g, 40
Fixes #845.

R=rsc
CC=golang-dev
https://golang.org/cl/1673049
2010-06-29 16:39:17 -07:00
Ken Thompson
1246ad8390 code gen bug in len(nil) and cap(nil)
fixes #892

R=rsc
CC=golang-dev
https://golang.org/cl/1745042
2010-06-29 12:48:24 -07:00
Vinu Rajashekhar
00ad47f906 Move the function Run() back into fd.go.
R=iant
CC=golang-dev, rsc
https://golang.org/cl/1748041
2010-06-29 12:04:04 -07:00
Rob Pike
da69685ee5 gob: a couple of tiny simplifications using Kind()
R=rsc
CC=golang-dev
https://golang.org/cl/1695046
2010-06-29 10:14:32 -07:00
Alex Brainman
059c7ba996 runtime: fix windows build
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/1747041
2010-06-29 07:12:14 -07:00
Nigel Tao
715425bf6f exp/draw/x11: implement the mapping from keycodes to keysyms.
R=rsc
CC=golang-dev, rog
https://golang.org/cl/1739042
2010-06-29 10:54:41 +10:00
Ian Lance Taylor
807605d0fc Only catch all signals if os/signal package imported.
Fixes #776.

R=rsc
CC=golang-dev
https://golang.org/cl/1745041
2010-06-28 17:14:17 -07:00
Rob Pike
d4384ff7f5 netchan: use gob DecodeValue to eliminate the need for a pointer value
in Import and Export.

R=rsc
CC=golang-dev
https://golang.org/cl/1707047
2010-06-28 17:12:09 -07:00
Rob Pike
12a4d84371 gob: add DecodeValue and EncodeValue
R=rsc
CC=golang-dev
https://golang.org/cl/1698045
2010-06-28 17:11:54 -07:00
Ken Thompson
2795282b50 compiler fatal error in switch.
fixes #867.

R=rsc
CC=golang-dev
https://golang.org/cl/1691045
2010-06-28 16:30:55 -07:00
Peter Mundy
ea88de805e syscall: Add syscall_bsd.go to zsycall_freebsd_386.go
Revision: 5885c9d10f created syscall_bsd.go for code used
by Darwin and other *BSDs, which should have included
FreeBSD. mksyscall.sh to generate new zsyscall_freebsd_386.go.

Fixes #862.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/1701048
2010-06-29 09:11:02 +10:00
Rob Pike
08483defac rpc: allow non-struct args and reply (they must still be pointers)
R=rsc
CC=golang-dev
https://golang.org/cl/1722046
2010-06-28 16:05:54 -07:00
Rob Pike
eb20ba6d01 netchan: allow chan of basic types now that gob can handle such
R=rsc
CC=golang-dev
https://golang.org/cl/1741041
2010-06-28 15:59:54 -07:00
Rob Pike
5245ea771d fmt.Printf: fix bug in handling of %#v.
nice side effect: slices now obey their format verb. example:
	fmt.Printf("%q\n", []string{"a"})

R=rsc
CC=golang-dev
https://golang.org/cl/1729045
2010-06-28 14:11:38 -07:00
Rob Pike
a26ab29ab8 gob: allow transmission of things other than structs at the top level.
also fix a bug handling nil maps: before, would needlessly send empty map

R=rsc
CC=golang-dev
https://golang.org/cl/1739043
2010-06-28 14:09:47 -07:00
Vinu Rajashekhar
e0334ab798 Move the functions, newPollServer and Run, from fd.go
to a new source file.

R=iant, rsc
CC=golang-dev
https://golang.org/cl/1670046
2010-06-28 13:58:56 -07:00
Ken Thompson
e5d748a333 8g compiler missing call to splitclean().
fixes #887.

R=rsc
CC=golang-dev
https://golang.org/cl/1675050
2010-06-28 12:19:12 -07:00
Ken Thompson
33da9afc3e optimization of static initialization
R=rsc
CC=golang-dev
https://golang.org/cl/1677049
2010-06-27 17:37:01 -07:00
Rob Pike
56f3c70111 fmt.Scan: fix handling of EOFs.
Fixes #876.

R=rsc
CC=golang-dev
https://golang.org/cl/1675048
2010-06-24 15:24:25 -07:00
Rob Pike
37a6bc838b gob: add support for complex numbers
R=rsc
CC=golang-dev
https://golang.org/cl/1708048
2010-06-24 15:07:28 -07:00
Russ Cox
6d8b8101ea gc: fix crash for nested complex division
R=ken2
CC=golang-dev
https://golang.org/cl/1720043
2010-06-23 10:55:50 -04:00
Christopher Wedgwood
57e1888741 Build draw/x11. Skip for test.
R=nigeltao_golang
CC=golang-dev, r, rsc
https://golang.org/cl/1690043
2010-06-23 15:08:27 +10:00
Rob Pike
e05c3668d2 regexp: restore accidentally deleted test item.
R=rsc
CC=golang-dev
https://golang.org/cl/1714044
2010-06-22 16:11:21 -07:00
Rob Pike
a8cd6c2012 regexp: bug fix: need to track whether match begins with fixed prefix.
Fixes #872.

R=rsc
CC=golang-dev
https://golang.org/cl/1731043
2010-06-22 16:02:14 -07:00
Rob Pike
537e5f4b7e debug/dwarf: update PDF link.
Fixes #881.

R=iant
CC=golang-dev
https://golang.org/cl/1696044
2010-06-22 14:56:16 -07:00
Russ Cox
e63ae242e6 runtime: split extern.go into debug.go, extern.go, sig.go.
move mal next to the other malloc functions.

R=r
CC=golang-dev
https://golang.org/cl/1701045
2010-06-21 20:53:49 -07:00
Russ Cox
44ca04d3d6 big, bytes: move assembly externs to separate file
to make it easier to build package without assembly.

R=r, r2
CC=golang-dev
https://golang.org/cl/1680045
2010-06-21 19:53:08 -07:00
Russ Cox
f374575fb7 net: move Dial, Listen out of net.go.
now net.go is only type definitions, not active code.

R=r
CC=golang-dev
https://golang.org/cl/1708046
2010-06-21 19:52:30 -07:00
Russ Cox
6519a6ba5b ld: add -u flag to check safe bits; discard old -u, -x flags
R=r, r2
CC=golang-dev
https://golang.org/cl/1707043
2010-06-21 18:03:49 -07:00
Russ Cox
121a16fa95 runtime: delete old types
R=r
CC=golang-dev
https://golang.org/cl/1715043
2010-06-21 18:03:25 -07:00
Christopher Wedgwood
7edd49614c net: Fix ICMP test.
Ping IDs should be limited to 16-bits.  Fix failure printing.

R=rsc
CC=golang-dev, jean-christophe smith <jeanchristophe.smith
https://golang.org/cl/1682043
2010-06-21 16:40:44 -07:00
Russ Cox
226b5fc666 syslog: use local network for tests
R=r
CC=golang-dev
https://golang.org/cl/1724042
2010-06-21 13:48:49 -07:00
Russ Cox
fc090a3a54 reflect: add Type.Bits method, add tags to prohibit conversions
gob: substitute slice for map

R=r
CC=golang-dev
https://golang.org/cl/1699045
2010-06-21 13:19:29 -07:00
Russ Cox
2fc0b4f01b gc: include struct field tags in type equality
R=ken2
CC=golang-dev
https://golang.org/cl/1667048
2010-06-21 13:06:39 -07:00
Russ Cox
96d35c6984 pkg/Makefile: allow DISABLE_NET_TESTS=1 to disable network tests
netchan, rpc, websocket: run test servers on 127.0.0.1,
to avoid conflict with OS X firewall.

TBR=r
CC=golang-dev
https://golang.org/cl/1689046
2010-06-21 13:05:38 -07:00
Roger Peppe
3ce29380d5 goinstall: process dependencies for package main
Currently to install a command, you have to manually
goinstall each of the remote packages that it depends on.
This patch lets goinstall P work where P is
contains files in package main.
It does not actually build the package, but
it installs all of its dependencies and prints a message
to that effect.

R=rsc
CC=golang-dev
https://golang.org/cl/1301043
2010-06-21 11:01:20 -07:00
Russ Cox
1b79cd2e71 undo changes accidentally included in 09c5add99d50
R=ken2
CC=golang-dev
https://golang.org/cl/1736042
2010-06-20 12:45:39 -07:00
Russ Cox
45bdf0367e reflect: add Kind, remove Int8Type, Int8Value, etc.
update other code to match.

R=r
CC=golang-dev
https://golang.org/cl/1680044
2010-06-20 12:16:25 -07:00
Russ Cox
9f002f6892 gc: delete debug print
R=ken2
CC=golang-dev
https://golang.org/cl/1732043
2010-06-20 12:15:10 -07:00
Russ Cox
a212d174ac gc: better error messages for interface failures, conversions
x.go:13: cannot use t (type T) as type Reader in assignment:
	T does not implement Reader (Read method requires pointer receiver)
x.go:19: cannot use q (type Q) as type Reader in assignment:
	Q does not implement Reader (missing Read method)
		have read()
		want Read()
x.go:22: cannot use z (type int) as type Reader in assignment:
	int does not implement Reader (missing Read method)

x.go:24: too many arguments to conversion to complex: complex(1, 3)

R=ken2
CC=golang-dev
https://golang.org/cl/1736041
2010-06-20 11:45:53 -07:00
Russ Cox
ceb868bf0a gc: fix build - subnode not addable in complexgen
R=ken2
CC=golang-dev
https://golang.org/cl/1677047
2010-06-20 11:21:43 -07:00
Russ Cox
a674c024c7 nacl: fix build
TBR=r
CC=golang-dev
https://golang.org/cl/1706044
2010-06-18 22:45:42 -07:00
Russ Cox
2d3e47ca10 strconv: add AtofN, FtoaN
R=r
CC=golang-dev
https://golang.org/cl/1700043
2010-06-18 22:43:37 -07:00
Rob Pike
3748d22672 fmt.Scanf: improve error message when input does not match format
R=rsc
CC=golang-dev
https://golang.org/cl/1693043
2010-06-18 20:37:03 -07:00
Russ Cox
21ff75bc0e complex divide: match C99 implementation
R=iant, ken2, r, r2, ken3
CC=golang-dev
https://golang.org/cl/1686044
2010-06-18 15:46:00 -07:00
Brad Fitzpatrick
743f818218 http: reply to Expect 100-continue requests automatically
This CL replaces my earlier https://golang.org/cl/1640044/show
in which Continue handling was explicit.  Instead, this CL makes
it automatic.  Reading from Body() is an implicit acknowledgement
that the request headers were fine and the body is wanted.  In that
case, the 100 Continue response is written automatically when the
request continues the "Expect: 100-continue" header.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/1610042
2010-06-16 10:15:39 -07:00
Nigel Tao
93ea2ae362 cmd/gotest: Delete temporary _testmain.go files.
R=rsc
TBR=rsc
CC=golang-dev
https://golang.org/cl/1675047
2010-06-16 13:37:07 +10:00
Nigel Tao
6de79ee0ef image: add an Alpha16 type, for completeness.
R=rsc
CC=golang-dev, rog
https://golang.org/cl/1707042
2010-06-16 12:36:07 +10:00
Rob Pike
d60312c4c0 fmt.Scan: fix %c in the case where the input does not implement ReadRune itself.
While we're at it, clean up and test the code to guarantee we see every byte when
the text is erroneous UTF-8.

Fixes #866.

R=rsc
CC=golang-dev
https://golang.org/cl/1712042
2010-06-15 17:41:11 -07:00
Rob Pike
9baa7a51ba bytes.Buffer.ReadFrom: fix bug.
Fixes #852.

R=rsc
CC=golang-dev
https://golang.org/cl/1680042
2010-06-15 17:40:47 -07:00
Russ Cox
c9172fb2a3 runtime: correct fault for 16-bit divide on Leopard
R=r
CC=golang-dev
https://golang.org/cl/1703041
2010-06-14 18:07:17 -07:00
Rob Pike
177746ba31 fmt.Printf: write tests for %T.
Fix a bug that caused it to ignore field widths.

R=rsc
CC=golang-dev
https://golang.org/cl/1704041
2010-06-14 17:42:31 -07:00
Rob Pike
d482c163be fmt.Print*: reimplement to switch on type first.
This shortens, simplifies and regularizes the code significantly.
(Improvements to reflect could make another step.)
Passes all.bash.

One semantic change occurs: The String() method changes
behavior. It used to run only for string formats such as %s and %q.
Instead, it now runs whenever the item has the method and the
result is then processed by the format as a string. Besides the
regularization, this has three effects:

	1) width is honored for String() items
	2) %x works for String() items
	3) implementations of String that merely recur will recur forever

Regarding point 3, example from the updated documentation:
	type X int
	func (x X) String() string { return Sprintf("%d", x) }
should cast the value before recurring:
	func (x X) String() string { return Sprintf("%d", int(x)) }

R=rsc
CC=golang-dev
https://golang.org/cl/1613045
2010-06-14 17:16:35 -07:00
Nigel Tao
43b3a247d3 html: sync testdata/webkit to match WebKit tip.
R=rsc
CC=golang-dev
https://golang.org/cl/1701041
2010-06-15 09:07:47 +10:00
Roger Peppe
18274e0075 Add IndexFunc and LastIndexFunc.
Change TrimRight and TrimLeft to use these functions.
Incidentally fix minor bug in TrimRight.
Add some test cases for this.
YMMV whether it's worth saving the closure allocation.

R=r, r2
CC=golang-dev, hoisie, rsc
https://golang.org/cl/1198044
2010-06-14 14:54:48 -07:00
Russ Cox
d5a80d0ba4 gc: no more ...
various cleanup, deleting unused code

R=ken2
CC=golang-dev
https://golang.org/cl/1663041
2010-06-14 11:24:51 -07:00
Russ Cox
6672b40c09 remove uses of ... from tree, add one test
R=r
CC=golang-dev
https://golang.org/cl/1662041
2010-06-14 11:23:11 -07:00
Nigel Tao
44a17e9df7 exp/draw: small draw.drawGlyphOver optimization.
Make dpix variable names consistent.

R=rsc
CC=golang-dev
https://golang.org/cl/1563041
2010-06-14 16:49:43 +10:00
Russ Cox
76da2780c3 gc: less aggressive name binding, for better line numbers in errors
Cleans up a few other corner cases too.

R=ken2
CC=golang-dev
https://golang.org/cl/1592045
2010-06-12 11:17:24 -07:00
Russ Cox
53a529ab2b runtime: fix 386 signal handler bug
Cannot assume that g == m->curg at time of signal.
Must save actual g and restore.

Fixes flaky crashes with messages like

throw: malloc mlookup
throw: malloc/free - deadlock
throw: unwindstack on self
throw: free mlookup

(and probably others) when running cgo.

R=iant
CC=golang-dev
https://golang.org/cl/1648043
2010-06-12 10:48:04 -07:00
Russ Cox
9d72aaabda gopack: add S flag to force marking a package as safe
R=r
CC=golang-dev
https://golang.org/cl/1597044
2010-06-12 10:47:42 -07:00
Russ Cox
089da369a3 8l: correct test for sp == top of stack in 8l -K code
R=ken2
CC=golang-dev
https://golang.org/cl/1627042
2010-06-11 16:17:47 -07:00
Russ Cox
ee0bca35a4 gopack: simplify go metadata code
There's only one Go object file per package now,
so there's no need to parse the metadata and merge
metadata from multiple files.  Just save the original
and use it as __.PKGDEF verbatim.

R=r
CC=golang-dev
https://golang.org/cl/1647042
2010-06-11 15:29:19 -07:00
Russ Cox
d20ad1c75a gc: change -u to require imports to be marked safe
R=ken2
CC=golang-dev
https://golang.org/cl/1597043
2010-06-11 15:28:43 -07:00
Ian Lance Taylor
fe43325b30 Pad Go symbol table out to page boundary when linking dynamically.
This avoids a crash when using cgo where glibc's malloc thinks
that it can use some of the memory following the symbol table.
This fails because the symbol table is mapped read-only, which
affects the whole page.

R=rsc
CC=golang-dev
https://golang.org/cl/1616042
2010-06-11 13:41:49 -07:00
Alex Brainman
c1e20720f7 runtime: switch to OS stack during Windows syscall
R=rsc
CC=golang-dev
https://golang.org/cl/1381041
2010-06-11 01:38:12 -07:00
Alex Brainman
fdb460ec11 runtime: free lock handles on Windows
R=rsc
CC=golang-dev
https://golang.org/cl/1652041
2010-06-11 00:53:54 -07:00
Rob Pike
62b5c7c69d add path.Base, analogous to Unix basename
R=rsc
CC=golang-dev
https://golang.org/cl/1633042
2010-06-09 19:59:22 -07:00
Adam Langley
5f0319c0a6 asn1: allow '*' in PrintableString.
Although technically incorrect, we want this in order to parse X.509
certificates where a wildcard hostname ("*.example.com") has been put
into a PrintableString.

Fixes #850.

R=rsc
CC=golang-dev
https://golang.org/cl/1615043
2010-06-09 20:52:41 -04:00
Robert Griesemer
e0e5c150b0 exp/eval test: fix build
R=r
CC=golang-dev
https://golang.org/cl/1599043
2010-06-09 15:52:42 -07:00
Robert Griesemer
ace5269dfe go/scanner: report illegal escape sequences
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1636043
2010-06-09 15:19:22 -07:00
Russ Cox
a2a7d473f4 gc: more cleanup
* disallow surrogate pair runes.
 * diagnose impossible type assertions
 * eliminate another static buffer.
 * do not overflow lexbuf.
 * add -u flag to disable package unsafe.

R=ken2
CC=golang-dev
https://golang.org/cl/1619042
2010-06-09 11:00:55 -07:00
Russ Cox
565b5dc076 gc: new typechecking rules
* Code for assignment, conversions now mirrors spec.
* Changed some snprint -> smprint.
* Renamed runtime functions to separate
  interface conversions from type assertions:
  convT2I, assertI2T, etc.
* Correct checking of \U sequences.

Fixes #840.
Fixes #830.
Fixes #778.

R=ken2
CC=golang-dev
https://golang.org/cl/1303042
2010-06-08 18:50:02 -07:00
Russ Cox
6aaef04469 misc cleanup: gofmt + &x -> x[0:] conversion
R=gri
CC=golang-dev
https://golang.org/cl/1620042
2010-06-08 17:51:57 -07:00
Robert Griesemer
f29fb251dc go/printer: deleted dead code
(remains of the semicolon conversion)

R=rsc
CC=golang-dev
https://golang.org/cl/1623041
2010-06-08 17:46:04 -07:00
Robert Griesemer
4337c7c0bc gofmt: update test script so it can run to completion again
R=rsc
CC=golang-dev
https://golang.org/cl/1621041
2010-06-08 17:25:04 -07:00
Robert Griesemer
3f3ff2bd5c go/parser: correct position of empty statement ';'
(caused certain files to not be idempotent under gofmt)

- corrected golden files for go/printer
- slightly simplified some code in nodes.go (no impact on formatting)
- these changes have no impact on gofmt output of .go files under src, misc

fallthrough statement considered harmful!

R=rsc
CC=golang-dev
https://golang.org/cl/1593042
2010-06-08 17:06:26 -07:00
Robert Griesemer
98b27814ae gc: better error message when ~ operator is found
Fixes #844.

R=ken2, rsc, ken3
CC=golang-dev
https://golang.org/cl/1593041
2010-06-07 18:27:26 -07:00
Robert Griesemer
0c222d6e49 gc: backslash newline is not a legal escape sequence in strings
Fixes #827.

R=ken2
CC=golang-dev, rsc
https://golang.org/cl/1592041
2010-06-07 18:10:48 -07:00
Andrew Gerrand
9b3c743f82 http: add Head function for making HTTP HEAD requests
R=rsc
CC=golang-dev
https://golang.org/cl/1581041
2010-06-08 01:28:40 +02:00
Daniel Theophanes
129c6c14d1 runtime: finish pchw -> tiny, added gettime for tiny
R=rsc
CC=golang-dev
https://golang.org/cl/1514041
2010-06-07 14:18:42 -07:00
Andrew Gerrand
8334d107c4 http: fix erroneous comment
R=r
CC=golang-dev
https://golang.org/cl/1539042
2010-06-06 17:18:09 +02:00
Nigel Tao
64784801cd HTML5 parser test data from WebKit.
R=rsc
CC=golang-dev
https://golang.org/cl/1559041
2010-06-04 17:47:22 -07:00
Nigel Tao
37fba90bc7 Fixes #836.
R=gri
CC=golang-dev
https://golang.org/cl/1548042
2010-06-04 17:30:39 -07:00
Nigel Tao
2006667931 draw.Draw fast paths for the Over operator.
Time (us) to draw a 200x200 src onto an image.RGBA dst with the Over
operator. Each case was measured three separate times, and the sorted
times are reported.

Fill case (where src is an image.ColorImage):
Before:
7438, 7511, 7526
After:
3073, 3087, 3102

Copy case (where src is an image.RGBA):
Before:
9506, 9510, 9563
After:
5262, 5300, 5344

R=rsc
CC=golang-dev
https://golang.org/cl/1532041
2010-06-03 17:19:00 -07:00
Nigel Tao
c2e9f0c562 Add Opaque method to the image types.
R=rsc
CC=golang-dev
https://golang.org/cl/1533041
2010-06-03 17:18:26 -07:00
Rob Pike
9a70762ac9 fmt.Scan: %c
R=rsc
CC=golang-dev
https://golang.org/cl/1518042
2010-06-03 17:03:22 -07:00
Russ Cox
28852c1531 io/ioutil: add TempFile
R=r
CC=golang-dev
https://golang.org/cl/1472042
2010-06-03 16:29:34 -07:00
Russ Cox
24baca4936 http: handle status 304 correctly
- cannot send body
  - should not send body-related headers

R=r
CC=golang-dev
https://golang.org/cl/1499041
2010-06-03 16:09:37 -07:00
Rob Pike
962e8b8736 fmt.Scan: field widths
Also fix an interface bug: white-space-delimited doesn't work well for cases like "%d, %d" on "23, 23")

R=rsc
CC=golang-dev
https://golang.org/cl/1502041
2010-06-03 16:06:41 -07:00
Charles L. Dorian
3fb8d2ad84 math: fix typo in Exp2 benchmark
Was timing Exp, not Exp2.

R=rsc, r
CC=golang-dev
https://golang.org/cl/1521042
2010-06-03 15:04:22 -07:00
Rob Pike
04721ff309 netchan: fix typo in test
R=rsc
CC=golang-dev
https://golang.org/cl/1522041
2010-06-03 13:16:09 -07:00
Nigel Tao
2e632088ce Fix typo in xml comments.
R=rsc
CC=golang-dev
https://golang.org/cl/1503041
2010-06-03 00:56:53 -07:00
Kyle Consalus
aae02a1855 Optimization to regexp _CharClass: keep track of overall range of
charclass to avoid unnecessarily iterating over ranges.
    Also, use the fact that IntVector is an []int to avoid method calls.
    On my machine, this brings us from ~27500 ns/op to ~17500 ns/op in the benchmark I've added (it is also faster in the case where a range check
    doesn't help, added a benchmark for this too.)

    I'd also like to propose that "[]", and "[^]" be disallowed. They aren't useful as far as I can tell, they aren't widely supported, and they make reasoning about character classes a bit more complicated.

R=r
CC=golang-dev
https://golang.org/cl/1495041
2010-06-02 23:04:44 -07:00
Charles L. Dorian
3d4c97b82c math: Pow special cases (signed zero, IEEE 754-2008)
Also added more tests for acosh, hypot, log, log10, log2
in all_test.go.

R=rsc
CC=golang-dev
https://golang.org/cl/1417041
2010-06-02 20:55:47 -07:00
Rob Pike
6106c63abc fmt.Scan: scan []byte arguments
R=rsc
CC=golang-dev
https://golang.org/cl/1486041
2010-06-02 16:28:01 -07:00
Russ Cox
041d978d84 bufio: change ReadSlice to match description
On error, ReadSlice is defined to return the available data
and advance past that data, but it was not behaving that
way for err == ErrBufferFull, making it harder for callers to
handle well.

R=r
CC=golang-dev
https://golang.org/cl/1480041
2010-06-02 16:17:18 -07:00
Rob Pike
4fc97c4703 fmt.Scanf: implement formats, provide Sscanf (strings)
- provide convenience functions for scanning strings
- enable Scanf etc.
- update doc comments

R=rsc
CC=golang-dev
https://golang.org/cl/1451044
2010-06-02 14:58:31 -07:00
Russ Cox
8ae29642b1 big: fix spelling of Euclidean
R=gri
CC=golang-dev
https://golang.org/cl/1372042
2010-06-02 12:53:15 -07:00
Rob Pike
5df40b434d fmt.Scan: renamings, strings, errors
- implement scanning for all renamed types
	(compiler bug stops complex from being renamable,
	so it can't be tested but the code is there)
- %q %x for strings
- error handling now done with panic/recover

R=rsc
CC=golang-dev
https://golang.org/cl/1458041
2010-06-01 15:22:01 -07:00
Rob Pike
b8a89972ee fmt.Scan: renamings, strings, errors
- implement scanning for all renamed types
	(compiler bug stops complex from being renamable,
	so it can't be tested but the code is there)
- %q %x for strings
- error handling now done with panic/recover

R=rsc
CC=golang-dev
https://golang.org/cl/1458041
2010-06-01 15:21:21 -07:00
Russ Cox
cd016d7558 gc: fix export of complex types
R=ken2
CC=golang-dev
https://golang.org/cl/1442042
2010-06-01 14:48:57 -07:00
Robert Griesemer
ab215f73fc big: bug fix for Quo aliasing problem
Fixes #820.

R=rsc
CC=golang-dev
https://golang.org/cl/1453041
2010-06-01 14:37:11 -07:00
Michael Hoisie
0c77ba96da goinstall: Use 'git pull' instead of 'git checkout' when updating a git repo.
R=rsc
CC=golang-dev
https://golang.org/cl/1395041
2010-06-01 14:27:45 -07:00
Evan Shaw
69879f0414 runtime: Fix printing -Inf
R=rsc
CC=golang-dev
https://golang.org/cl/1258044
2010-06-01 14:08:15 -07:00
Vinu Rajashekhar
0d64fa19f8 Correct the regexp for finding unix signal names.
For example, earlier, the regexp would accept SIGQUEUE_MAX
  as a unix signal with name SIGQUEUE. Now it is ignored.

R=iant
CC=golang-dev, golang-nuts, joel.sherrill
https://golang.org/cl/1452041
2010-06-01 12:02:00 -07:00
Nigel Tao
c3080418d6 Fix typo in gob docs. They were introduced in revision 3199778baf
"change the encoding of uints...".

R=r
CC=golang-dev
https://golang.org/cl/1436041
2010-05-31 17:35:59 -07:00
Fazlul Shahriar
eed5bb3bee vector: undo changes to autogenerated files
Also, move Do() to vector.go, so that Do() for IntVector and StringVector
is autogenerated.

The only files edited are Makefile, defs.go, and vector.go. The rest are
autogenerated with "make generate".

R=r
CC=golang-dev, hoisie
https://golang.org/cl/1435041
2010-05-31 15:53:55 -07:00
Rob Pike
ce9da214b7 fmt: fix end-of-array error in parsenum.
Fixes #821.

R=rsc
CC=golang-dev
https://golang.org/cl/1434041
2010-05-31 14:57:32 -07:00
Michael Hoisie
ebb1c8b912 IntVector.Do now takes an f(int), and StringVector.Do now takes an f(string).
R=r
CC=golang-dev
https://golang.org/cl/1433041
2010-05-31 14:55:30 -07:00
Rob Pike
8af4acf59d fmt.Scan: refactor the implementation so format-driven and normal scanning use the same function.
simplifies the code significantly.
Still TODO:
	- proper format handling
	- strings

R=rsc
CC=golang-dev
https://golang.org/cl/1432041
2010-05-31 14:53:15 -07:00
Rob Pike
e6600ea17d fmt.Scan:
- reimplement integer scanning to handle renamed basic integer types
- start implementation of Fscanf and Scanf; not yet ready for general use.

This intermediate CL is a useful checkpoint. A similar change needs to be
done for float and complex, but it seemed worth getting the approach
reviewed before making those changes.

R=rsc
CC=golang-dev
https://golang.org/cl/1418041
2010-05-31 10:56:58 -07:00
Alex Brainman
901976cfc3 implement os.FileInfo.*time_ns for windows
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/1145044
2010-05-31 13:43:40 +02:00
Ian Lance Taylor
1192c175fe Correct _cgo_free when C ABI does not pass first arg on stack.
It turns out that _cgo_malloc is used, via cmalloc in
runtime/cgocall.c, which is called by code generated by out.go
for the ·_C_CString function.  I can't find a call to
_cgo_free, but given _cgo_malloc we might as well keep
_cgo_free.  This patch fixes it so that it should work on
amd64.

R=rsc
CC=golang-dev
https://golang.org/cl/1399041
2010-05-30 22:22:47 -07:00
Andrew Gerrand
a63f73c196 net: fix typo
Fixes #819.

R=rsc
CC=golang-dev
https://golang.org/cl/1421041
2010-05-31 07:05:41 +02:00
Rob Pike
752b47cfc5 netchan: improve closing and shutdown. there's still more to do.
Fixes #805.

R=rsc
CC=golang-dev
https://golang.org/cl/1400041
2010-05-28 22:32:29 -07:00
Nigel Tao
2bb59fd71a Make image.Color.RGBA return 16 bit color instead of 32 bit color.
R=rsc
CC=golang-dev
https://golang.org/cl/1388041
2010-05-28 12:59:21 -07:00
Alex Brainman
d5a8647d80 syscall: windows SysAlloc should use stdcall_raw not syscall
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1382041
2010-05-28 11:47:09 -07:00
Alex Brainman
12923e43f2 syscall: windows syscall trace to assist debugging
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1383041
2010-05-28 11:46:10 -07:00
Rob Pike
0580deafaf fmt.Scan: add Fscan and Fscanln and make Scan and Scanln
read from standard input.  Add description of scanning to
the package comment.

R=rsc
CC=golang-dev
https://golang.org/cl/1390041
2010-05-28 11:29:27 -07:00
Roger Peppe
1fda1323d4 Add Rectangle.Eq and Point.In.
Fix Rectangle.Clip.
It could return a non-canonical rectangle if its arguments
did not overlap.
e.g. Rect(0, 0, 10, 10).Clip(Rect(0, 20, 10, 30)) -> Rect(0, 20, 10, 10)

R=rsc, r
CC=golang-dev, golang-dev
https://golang.org/cl/1290041
2010-05-27 17:19:47 -07:00
Russ Cox
bb84f4b5d2 changes &x -> x[0:] for array to slice conversion
R=gri
CC=golang-dev
https://golang.org/cl/1326042
2010-05-27 14:51:47 -07:00
Rob Pike
7ee6d44e4f fmt.Scan: custom formatters
R=rsc
CC=golang-dev
https://golang.org/cl/1315042
2010-05-26 18:16:41 -07:00
Rob Pike
6965b407dd fmt.Scan: custom formatters
R=rsc
CC=golang-dev
https://golang.org/cl/1315042
2010-05-26 18:15:09 -07:00
Robert Griesemer
a4129988a4 godoc: collect package comments from all package files, not just the first one found
R=r
CC=golang-dev
https://golang.org/cl/1331041
2010-05-26 13:44:27 -07:00
Adam Langley
f199f292e7 big: add ModInverse.
ModInverse is just a small wrapper around GcdInt, but it's nice to
have in order to be clear about what one is doing in other code.

R=gri, agl1
CC=golang-dev
https://golang.org/cl/1244045
2010-05-26 15:58:58 -04:00
Rob Pike
5b77928478 fmt: fix 386 build. error strings differ for overflow on 386.
R=gri
CC=golang-dev
https://golang.org/cl/1316042
2010-05-26 10:01:52 -07:00
Rob Pike
71f130f55c fmt.Scan, fmt.Scanln: Start of a simple scanning API in the fmt package.
Still to do:
	- composite types
	- user-defined scanners
	- format-driven scanning
The package comment will be updated when more of the functionality is in place.

R=rsc
CC=golang-dev
https://golang.org/cl/1252045
2010-05-25 21:02:35 -07:00
Nigel Tao
0c662f60a5 Optimize exp/draw/x11 flusher inner loop.
On my laptop, time to prepare and write 800x600 pixels over the
socket falls from 125-ish ms to 80-ish ms.

Thanks to Roger Peppe for the suggestion.

R=r
CC=golang-dev
https://golang.org/cl/1228044
2010-05-24 19:32:42 -07:00
Russ Cox
6a060200cc 8g: out of register bug
Fixes #806.

R=ken2
CC=golang-dev
https://golang.org/cl/1281042
2010-05-24 17:22:51 -07:00
Russ Cox
ea941f09bf gc: more accurate error description
R=ken2
CC=golang-dev
https://golang.org/cl/1284041
2010-05-24 17:07:51 -07:00
Russ Cox
566f598046 fix build - nacl stubs
TBR=nigeltao
CC=golang-dev
https://golang.org/cl/1259042
2010-05-24 17:00:21 -07:00
Russ Cox
8c2bc4419b gc: fix shift/reduce conflict in go.y export syntax
Fixes #771.

R=ken2
CC=golang-dev
https://golang.org/cl/1267042
2010-05-24 16:55:23 -07:00
Russ Cox
9fc9246bf3 gc: bug281 - bad overlap in stack copy
Fixes #807.

R=ken2
CC=golang-dev
https://golang.org/cl/1283041
2010-05-24 16:54:24 -07:00
Christopher Wedgwood
5c19c4e5e3 net: udp, implement BindToDevice
R=rsc
CC=golang-dev, r
https://golang.org/cl/1271041
2010-05-24 16:53:23 -07:00
Evan Shaw
751fc425ee big: Rat test improvements
R=gri
CC=golang-dev
https://golang.org/cl/1270041
2010-05-24 16:38:41 -07:00
Russ Cox
d14baee96e 6g: avoid unnecessary conversion in shift bounds check
R=ken2
CC=golang-dev
https://golang.org/cl/1278042
2010-05-24 15:30:53 -07:00
Russ Cox
2e9b67afa6 gc: bug277 - new conversion syntax
R=ken2
CC=golang-dev
https://golang.org/cl/1220046
2010-05-24 15:25:30 -07:00
Russ Cox
43c0a46ac6 gc: bug280
Fixes #808.

R=ken2
CC=golang-dev
https://golang.org/cl/1273042
2010-05-24 15:25:09 -07:00
Nigel Tao
c95e11db56 Fix typo in exp/draw/x11.
R=rsc
CC=golang-dev
https://golang.org/cl/1282041
2010-05-24 15:07:47 -07:00
Russ Cox
21518ea2af runtime: free old hashmap pieces during resizing
R=r
CC=golang-dev
https://golang.org/cl/1254044
2010-05-24 14:31:10 -07:00
Russ Cox
84edc2e980 libmach: skip __nl_symbol_ptr section on OS X
R=r
CC=golang-dev
https://golang.org/cl/1275042
2010-05-24 14:30:51 -07:00
Russ Cox
5e253645d2 gc: bug278
Fixes #804.

R=ken2
CC=golang-dev
https://golang.org/cl/1224045
2010-05-24 14:22:54 -07:00
Russ Cox
80ac15ec12 gc: fix unsafe.Sizeof on ideal constants
R=ken2
CC=golang-dev
https://golang.org/cl/1280041
2010-05-24 14:18:15 -07:00
Alex Brainman
2a1ee42e2b fix windows build
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/1209048
2010-05-24 11:48:14 -07:00
Nigel Tao
2d8aee45b8 Make draw/x11 treat $DISPLAY the same way x-go-bindings does.
This ought to make draw/x11 work on a Mac.

R=rsc
CC=golang-dev
https://golang.org/cl/1265042
2010-05-24 11:44:09 -07:00
Adam Langley
eadebba36f big: prevent errors in Exp in the face of aliasing
R=gri
CC=golang-dev, golang-dev
https://golang.org/cl/1244044
2010-05-24 14:32:55 -04:00
Andrew Gerrand
977475fd49 syscall: update freebsd_amd64
R=rsc, r
CC=golang-dev
https://golang.org/cl/1268041
2010-05-24 09:58:59 -07:00
Nigel Tao
e974fb949e When making images, allocate one big buffer instead of many small ones.
R=rsc, r
CC=golang-dev
https://golang.org/cl/1267041
2010-05-23 11:12:00 -07:00
Robert Griesemer
72fd5c80f8 go/printer, gofmt: fix printing of labels,
apply gofmt to src, misc

Fixes #752.

R=rsc
CC=golang-dev
https://golang.org/cl/1240044
2010-05-21 20:25:08 -07:00
Robert Griesemer
38b2d10bb2 test/hilbert.go: convert to test case and benchmark for big.Rat
R=rsc
CC=golang-dev
https://golang.org/cl/1231044
2010-05-21 20:20:17 -07:00
Russ Cox
88b308a265 roll back 1193046 - fix build
R=dho
CC=golang-dev
https://golang.org/cl/1257043
2010-05-21 18:29:18 -07:00
Devon H. O'Dell
b94f341bac cgo: better error for no C symbols
R=rsc, iant
CC=golang-dev, graeme.perrow
https://golang.org/cl/1193046
2010-05-21 17:31:18 -07:00
Christopher Wedgwood
13d5a19a98 net: implement raw sockets
R=rsc
CC=golang-dev
https://golang.org/cl/684041
2010-05-21 17:30:40 -07:00
Evan Shaw
5ac88f4a8b big: Add Rat type
Implementations are pretty rough and simple at this point, but it's a start.

R=gri
CC=golang-dev
https://golang.org/cl/1250043
2010-05-21 16:14:55 -07:00
Russ Cox
f58ba18a08 runtime: correct tracebacks for nascent goroutines, even closures
Fixes #780.

R=r
CC=golang-dev
https://golang.org/cl/1221042
2010-05-21 14:40:21 -07:00
Russ Cox
48673d2745 syscall: add Utimes, Futimes stubs for NaCl - fix build
TBR=nigeltao
CC=golang-dev
https://golang.org/cl/1262042
2010-05-21 14:39:10 -07:00
Russ Cox
1d076a6e61 syscall: regenerate zsyscall_linux_arm.go - fix build
R=kaib
CC=golang-dev
https://golang.org/cl/1209047
2010-05-21 14:33:17 -07:00
Robert Griesemer
e8dec0dc05 big: fix Int.SetString comment, simplify implementation,
always return z for nat.scan

R=rsc
CC=golang-dev
https://golang.org/cl/1236043
2010-05-21 14:28:34 -07:00
Robert Griesemer
638ef0794f bignum: deprecate by moving into exp directory
R=rsc
CC=golang-dev
https://golang.org/cl/1211047
2010-05-21 14:14:22 -07:00
Robert Griesemer
e3bfeec474 big: implemented Int.Binomial (to be used in test/hilbert.go with the
forthcoming implementation of big.Rat)

R=rsc
CC=golang-dev
https://golang.org/cl/1229047
2010-05-20 23:10:51 -07:00
Russ Cox
709c5b2481 gc: handle use of builtin function outside function call
tweaks & tests of last bug fix too.

R=ken2
CC=golang-dev
https://golang.org/cl/1207044
2010-05-20 22:57:08 -07:00
Russ Cox
b03d7f4d8f gc: line number bug fix
R=ken2
CC=golang-dev
https://golang.org/cl/1243044
2010-05-20 22:19:50 -07:00
Ken Thompson
09b2de77b5 fix bug 275
R=rsc
CC=golang-dev
https://golang.org/cl/1198046
2010-05-20 20:56:28 -07:00
Russ Cox
9e497c3656 gc: disallow · in Go programs
Fixes #793.

R=ken2
CC=golang-dev
https://golang.org/cl/1249043
2010-05-20 17:34:22 -07:00
Ken Thompson
b0283611e4 fix issue 798
cannot allocate an audomatic temp
while real registers are allocated.
there is a chance that the automatic
will be allocated to one of the
allocated registers. the fix is to
not registerize such variables.

R=rsc
CC=golang-dev
https://golang.org/cl/1202042
2010-05-20 17:31:28 -07:00
Michael Hoisie
9192ec2ea1 netFD: fix race between Close and Read/Write
Fixes #783.

R=rsc, cw
CC=golang-dev
https://golang.org/cl/1207043
2010-05-20 17:13:50 -07:00
Roger Peppe
798140693e Fix Rectangle.Canon()
R=rsc, r, gri
CC=golang-dev
https://golang.org/cl/1239043
2010-05-20 14:33:50 -07:00
Nigel Tao
efda3aba10 Fast-ish path for drawing onto an image.RGBA destination.
Time to draw.Draw a 200x200 image fell from 18.4ms (and 1 malloc) to
5.6ms (and 0 mallocs). It's still relatively slow since it assumes
nothing about the src or mask images, but it does remove the malloc.
There are existing faster, more specialized paths for copies, fills
and image glyph masks.

Also added a "compare to a slow but obviously correct implementation"
check to draw_test.go.

R=rsc, r
CC=golang-dev
https://golang.org/cl/1223044
2010-05-20 13:57:18 -07:00
Christopher Wedgwood
37a6adf1d3 syscall: linux, implement BindToDevice
R=rsc
CC=adg, golang-dev, r
https://golang.org/cl/1253043
2010-05-20 09:43:13 -07:00
Christopher Wedgwood
5265857ac4 syscall: bsd, stub BindToDevice
R=rsc
CC=adg, golang-dev, r
https://golang.org/cl/1257041
2010-05-20 09:39:35 -07:00
Russ Cox
4843b130bb runtime: avoid allocation for fixed strings
R=r
CC=golang-dev
https://golang.org/cl/1083041
2010-05-19 21:33:31 -07:00
Brad Fitzpatrick
1afa2a1b2d os: add Chtimes function
R=rsc, r
CC=golang-dev
https://golang.org/cl/1103041
2010-05-19 17:48:53 -07:00
Russ Cox
cbc01a3e76 syscall: add Utimes on Darwin/FreeBSD, add Futimes everywhere
Needed for CL 1103041 and beyond.

R=adg, bradfitzpatrick
CC=bradfitz, golang-dev
https://golang.org/cl/1172042
2010-05-19 17:47:57 -07:00
Russ Cox
b198c8612e runtime: allow large map values
Fixes #772.

R=ken2
CC=golang-dev
https://golang.org/cl/1206043
2010-05-19 12:57:47 -07:00
Robert Griesemer
a688eb6ee4 big: potential bug fix, cleanups
- implemented setWord, use it where setUint64 is wrong
- divLarge: use fast mulWW, divWW; implemented mulWW, divWW
- better assembly code for addMulVVW

R=rsc
CC=golang-dev
https://golang.org/cl/1258042
2010-05-19 09:36:50 -07:00
Russ Cox
b629687f79 fix build - no netchan tests under NaCl
TBR=r
CC=golang-dev
https://golang.org/cl/1230042
2010-05-18 23:25:07 -07:00
Michael Hoisie
4a3cb1ad2f bytes: add Trim, TrimLeft, TrimRight, and generic functions
R=rsc, r
CC=golang-dev
https://golang.org/cl/946045
2010-05-18 23:01:05 -07:00
Evan Shaw
d2aa74118c gc: Better error when computing remainder of non-int
Previously the compiler would just emit "internal compiler error" when
trying to compute the remainder of floats or complex types.

R=rsc
CC=golang-dev
https://golang.org/cl/1243041
2010-05-18 22:41:12 -07:00
Charles L. Dorian
809479740f math: amd64 versions of fdim, fmax, fmin
Uses the SSE2 max, min instructions. Also shorter sqrt_amd64.s

R=rsc
CC=golang-dev
https://golang.org/cl/1216042
2010-05-18 22:33:50 -07:00
Charles L. Dorian
879241d819 math: signed zero Sqrt special case
IEEE 754 says: sqrt(-0) = -0

R=rsc
CC=golang-dev
https://golang.org/cl/1098041
2010-05-18 22:16:01 -07:00
Robert Griesemer
90d0c3316c big: bug fix for division
Fixes #784.

R=rsc
CC=golang-dev
https://golang.org/cl/1196043
2010-05-18 16:31:49 -07:00
Kyle Consalus
2db47c9083 Trivial optimization.
Cached string indexing in inner loop of Btoui64.

    Before:
    strconv_test.BenchmarkAtoi   5000000           309 ns/op
    strconv_test.BenchmarkAtoiNeg    5000000           325 ns/op
    strconv_test.BenchmarkAtoi64     5000000           465 ns/op
    strconv_test.BenchmarkAtoi64Neg  5000000           469 ns/op

    After:
    strconv_test.BenchmarkAtoi  10000000           182 ns/op
    strconv_test.BenchmarkAtoiNeg   10000000           193 ns/op
    strconv_test.BenchmarkAtoi64    10000000           251 ns/op
    strconv_test.BenchmarkAtoi64Neg 10000000           258 ns/op

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1227042
2010-05-18 16:29:24 -07:00
Roger Peppe
bcdcf395e5 Add Error member to yyLexer type (yyError
has no access to yylex)

R=ken2, ken3
CC=golang-dev
https://golang.org/cl/813047
2010-05-17 12:23:48 -07:00
Robert Griesemer
dbb6232724 big: implemented format support for fmt library, MulRange
- support for binary prefix 0b (to match fmt.Format)
- renamed nat.new -> nat.setUint64 for consistency
- more tests

R=r
CC=golang-dev
https://golang.org/cl/1233041
2010-05-15 10:23:41 -07:00
Christopher Wedgwood
cffdb1e830 build; allow MAKEFLAGS to be set outside the build scripts
R=rsc, r
CC=golang-dev
https://golang.org/cl/1231041
2010-05-15 10:08:29 -07:00
Charles L. Dorian
1d4e2d1adc cmath: add package description
Also update range of Phase and Polar due to signed zero.
[Phase(cmplx(-1, +0)) = pi and Phase(cmplx(-1, -0)) = -pi]

R=rsc, r
CC=golang-dev
https://golang.org/cl/1235041
2010-05-15 10:06:54 -07:00
Robert Griesemer
31f79690f7 gofmt: exclude test w/ illegal syntax from test cases
R=adg
CC=golang-dev
https://golang.org/cl/1228041
2010-05-14 15:45:53 -07:00
Robert Griesemer
650cc32739 go/printer (gofmt): don't lose mandatory semicolons
Fixes #779.

R=r
CC=golang-dev
https://golang.org/cl/1218042
2010-05-14 15:38:25 -07:00
Roger Peppe
14e04f4d40 Prevent Printf crashing when giving an extra nil argument.
R=rsc, r
CC=golang-dev
https://golang.org/cl/1195041
2010-05-13 12:49:48 -07:00
Robert Griesemer
d6acc0646b http: prevent crash if remote server is not responding with "HTTP/"
Fixes #775.

R=rsc
CC=golang-dev
https://golang.org/cl/1180042
2010-05-11 16:50:20 -07:00
Russ Cox
75dbbd2137 netchan: be less chatty during gotest
R=r
CC=golang-dev
https://golang.org/cl/1186041
2010-05-11 14:57:08 -07:00
Russ Cox
4e5bc6a8fe json: fix array -> non-array decoding
Fixes #773.

R=adg
CC=golang-dev
https://golang.org/cl/1120042
2010-05-11 14:38:55 -07:00
Nigel Tao
916426ea76 drawGlyphOver optimization.
Timings (as for change 1122043) go from 49ms to 48ms ish. It's
mostly lost in the noise, but it probably doesn't hurt.

R=r
CC=golang-dev
https://golang.org/cl/1179041
2010-05-11 13:35:16 +10:00
Nigel Tao
d7a6d22852 exp/draw fast path for glyph images.
To draw.Draw a 32x32 image.Alpha 10000 times,
Before: 633ms with 10000 mallocs
After: 49ms with 0 mallocs

These times are just blitting an image.Alpha, and do not include
rasterizing a glyph's vector contours to an image.Alpha.

The "generic" test case in draw_test.go tests this fast path.

R=rsc
CC=golang-dev
https://golang.org/cl/1122043
2010-05-10 10:32:08 +10:00
Rob Pike
b717768b94 template: regularize the handling of interfaces, pointers, and
methods when looking up names.
Fixes #764.

R=rsc
CC=golang-dev
https://golang.org/cl/1170041
2010-05-09 16:40:38 -07:00
Michael Hoisie
834abb8068 json: accept escaped slash in string scanner
R=rsc
CC=golang-dev
https://golang.org/cl/1173041
2010-05-08 17:34:05 -07:00
Robert Griesemer
52cc058172 big: cleanups and performance tuning
- removed last argument (n) from all core arithmetic routines;
  instead, use the length of the result

- simplified nat.make implementation and chose a better capacity
  for new values, removed a TODO in the process

Changing the constant e from 1 (old) to 4 (new) improved
pidigits -s -n 10000 by ~9% (on a 3.06GHz Intel Core 2 Duo):

user	0m3.882s (old)
user	0m3.549s (new)

R=rsc
CC=golang-dev
https://golang.org/cl/1133043
2010-05-08 13:52:36 -07:00
Robert Griesemer
61eb0e71f2 big: more cleanup
- pass []Word instead of *Word to core arithmetic functions
- remove dead code

R=rsc
CC=golang-dev
https://golang.org/cl/1154042
2010-05-07 18:26:31 -07:00
Rob Pike
f023e859cf compress: renamings.
NewDeflater -> NewWriter
NewInflater -> NewReader
Deflater -> Compressor
Inflater -> Decompressor

R=rsc
CC=golang-dev
https://golang.org/cl/1166041
2010-05-07 14:32:34 -07:00
Rob Pike
b541921b66 gob: bug fix: errors encoding the payload were not
returned to caller.

R=rsc
CC=golang-dev
https://golang.org/cl/1164041
2010-05-07 13:30:13 -07:00
Rob Pike
56c5710b38 gob: add an internal commentary example showing how the
values are encoded for transmission.

R=rsc
CC=golang-dev
https://golang.org/cl/1146041
2010-05-07 11:44:41 -07:00
Ian Lance Taylor
e1b47159ab Save the scheduling state even predawn.
This permits cgo callbacks to work when run in init code.
Otherwise cgocallback switches to the wrong stack address.

R=rsc
CC=golang-dev
https://golang.org/cl/1123043
2010-05-06 22:07:03 -07:00
Robert Griesemer
6d7583d5fd fix build (typo in arith_386.s)
R=rsc
CC=golang-dev
https://golang.org/cl/1139042
2010-05-06 19:16:26 -07:00
Robert Griesemer
3f287b5002 big: implemented overlap-tolerant shifts in assembly
- no need to make copies in cases of aliases
- removed deprecated internal shift functions
- minor unrelated simplifications

This change improves pidigits -s -n10000 by almost 20%:

user 0m6.156s (old)
user 0m4.999s (new)

(pidigits -s -n20000 goes from ~25s to ~19s)

R=rsc
CC=golang-dev
https://golang.org/cl/1149041
2010-05-06 18:20:01 -07:00
Rob Pike
eb48bfbbda runtime.GOMAXPROCS: hack it to have it return the old value.
R=rsc
CC=golang-dev
https://golang.org/cl/1140041
2010-05-06 11:50:47 -07:00
Rob Pike
9088f9f245 gob: add test for indirect maps, slices, arrays.
fix a bug in the handling of indirect maps.

R=rsc
CC=golang-dev
https://golang.org/cl/1132042
2010-05-06 10:45:18 -07:00
Russ Cox
6dbba67214 gc: distinguish array, slice literal in error messages
R=ken2
CC=golang-dev
https://golang.org/cl/1138041
2010-05-06 09:34:12 -07:00
Nigel Tao
20ba090978 Make exp/draw/x11 respect $XAUTHORITY.
R=rsc, cw, nigeltao_golang
CC=golang-dev
https://golang.org/cl/1134041
2010-05-06 18:41:42 +10:00
Rob Pike
7861da737e gob: add support for maps.
Because maps are mostly a hidden type, they must be
implemented using reflection values and will not be as
efficient as arrays and slices.

R=rsc
CC=golang-dev
https://golang.org/cl/1127041
2010-05-05 16:46:39 -07:00
Rob Pike
46152bb9fe pkg/Makefile: add netchan to standard package list
R=golang-dev
CC=golang-dev
https://golang.org/cl/1121041
2010-05-05 15:17:26 -07:00
Kyle Consalus
24bfd652ee Conversion from loop to copy().
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1072041
2010-05-05 09:57:53 -07:00
Conrad Meyer
5789c86fc0 Fix a typo in net/unixsock
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1113041
2010-05-05 09:55:11 -07:00
Ken Thompson
a3a0a5fdc3 allow data statements for simple
external variable assignements.

R=rsc
CC=golang-dev
https://golang.org/cl/1094041
2010-05-03 22:51:30 -07:00
Robert Griesemer
b9caa4ac56 big: completed set of Int division routines & cleanups
- renamed Len -> BitLen, simplified implementation
- renamed old Div, Mod, DivMod -> Que, Rem, QuoRem
- implemented Div, Mod, DivMod (Euclidian definition, more
  useful in a mathematical context)
- fixed a bug in Exp (-0 was possible)
- added extra tests to check normalized results everywhere
- uniformly set Int.neg flag at the end of computations
- minor cosmetic cleanups
- ran all tests

R=rsc
CC=golang-dev
https://golang.org/cl/1091041
2010-05-03 18:48:05 -07:00
Russ Cox
32df678894 gc: bug264
Fixes #692.

R=ken2
CC=golang-dev
https://golang.org/cl/1092041
2010-05-03 17:51:48 -07:00
Russ Cox
7d7ebd2fe1 runtime, strconv: tiny cleanups
R=r
CC=golang-dev
https://golang.org/cl/1081042
2010-05-03 17:47:40 -07:00
Russ Cox
b5f54db359 gc: bug267
R=ken2
CC=golang-dev
https://golang.org/cl/1067042
2010-05-03 15:29:59 -07:00
Russ Cox
371b77ad20 gc: error for nested functions, one semicolon problem
R=ken2
CC=golang-dev
https://golang.org/cl/1046042
2010-05-03 15:02:32 -07:00
Russ Cox
9995dec9da big: fix memory corruption in nat.shr
R=gri
CC=golang-dev
https://golang.org/cl/1084041
2010-05-03 14:28:45 -07:00
Russ Cox
23c0aa3916 runtime/arm: fix build
Import _mulv from Inferno again, change R9 to R2.
Not sure what the other differences were for, but
they weren't working.

TBR=kaib
CC=golang-dev
https://golang.org/cl/1079041
2010-05-03 13:24:39 -07:00
Evan Shaw
4d1b1574af big: Add bitwise methods for Int
R=gri
CC=golang-dev
https://golang.org/cl/987041
2010-05-03 11:20:52 -07:00
Russ Cox
e6d0a6c9c1 nacl: another attempt at fixing build
TBR=r
CC=golang-dev
https://golang.org/cl/1077041
2010-05-03 11:12:54 -07:00
Russ Cox
23bf408d41 syscall: fix arm build (fix bugs in generator, to add O_LARGEFILE)
R=r
CC=golang-dev
https://golang.org/cl/1021043
2010-05-03 11:11:01 -07:00
Ian Lance Taylor
b3901dc1d8 Add _cgo_export.[ch] targets so that make knows how they are
built.  Note that they are only built if a //export comment
appears, so other targets should only use them if there is
such a comment.

Fixes #723.

R=rsc
CC=golang-dev
https://golang.org/cl/1073041
2010-05-03 11:07:22 -07:00
Rob Pike
e1d20d0a51 bytes: Change IndexAny to look for UTF-8 encoded characters.
Also improve the implementations of Equals and Compare.

R=rsc
CC=golang-dev
https://golang.org/cl/969047
2010-05-03 10:59:00 -07:00
Giles Lean
3c32300c4d runtime: update godefs usage comment for GOARCH=386 GOOS={darwin,freebsd}
When trying to regenerate src/pkg/runtime/darwin/386/defs.h
on a 64 bit capable Snow Leopard (OS X 10.6.3) system I
needed to add -f -m32 to godefs, as this OS and hardware
combination defaults to 64 bit compilation.

For safety, make the same change to the 32 bit FreeBSD
instructions in .../freebsd/defs.c.  (Tested OK and no
problems introduced.)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1052042
2010-05-03 01:26:39 -07:00
Russ Cox
1964417e41 fix nacl build
TBR=r
CC=golang-dev
https://golang.org/cl/1063042
2010-05-03 00:04:48 -07:00
Charles L. Dorian
37089cce67 math: fix typo in Cbrt description
R=rsc
CC=golang-dev
https://golang.org/cl/979043
2010-05-02 23:33:08 -07:00
Robert Griesemer
26078c395a big: cleanup and removal of redundant functionality
R=rsc
CC=golang-dev
https://golang.org/cl/1048041
2010-05-01 15:11:27 -07:00
Russ Cox
6361f52fc4 gc: be pickier about slice, chan, array, and map sizes
Fixes #589.

R=ken2
CC=golang-dev
https://golang.org/cl/1032044
2010-05-01 13:15:42 -07:00
Russ Cox
cf0e224380 vector: use correct capacity in call to make
R=gri, r, bflm
CC=golang-dev
https://golang.org/cl/1032043
2010-05-01 13:00:01 -07:00
Robert Griesemer
58e77990ba big: use fast shift routines
- fixed a couple of bugs in the process
  (shift right was incorrect for negative numbers)
- added more tests and made some tests more robust
- changed pidigits back to using shifts to multiply
  by 2 instead of add

  This improves pidigit -s -n 10000 by approx. 5%:

  user 0m6.496s (old)
  user 0m6.156s (new)

R=rsc
CC=golang-dev
https://golang.org/cl/963044
2010-04-30 21:25:48 -07:00
Robert Griesemer
161b44c76a big/arith: assembly routines for 386 long shifts (2nd round)
R=rsc
CC=golang-dev
https://golang.org/cl/986044
2010-04-30 14:41:04 -07:00
Russ Cox
c66b49845c 8g: bug272
Fixes #589.

R=ken2
CC=golang-dev
https://golang.org/cl/1043042
2010-04-30 14:04:34 -07:00
Russ Cox
253fd30e66 gc: bug271
Fixes #662.

R=ken2
CC=golang-dev
https://golang.org/cl/978043
2010-04-30 13:27:08 -07:00
Russ Cox
560283c880 gc: bug270
Fixes #746.

R=ken2
CC=golang-dev
https://golang.org/cl/1040042
2010-04-30 13:04:16 -07:00
Russ Cox
74a23646bc 8l: fix absolute path detection on Windows
Fixes #755.

R=ken2
CC=golang-dev
https://golang.org/cl/965047
2010-04-30 12:48:03 -07:00
Alex Brainman
b94ae26073 syscall: handle EOF on pipe - special case on Windows
R=rsc
CC=golang-dev
https://golang.org/cl/962046
2010-04-30 12:46:46 -07:00
Robert Griesemer
ac1d46a22a fix build
R=rsc
CC=golang-dev
https://golang.org/cl/1044041
2010-04-30 12:01:15 -07:00
Robert Griesemer
407dbb42d4 big: improved computation of "karatsuba length" for faster multiplies
This results in an improvement of > 35% for the existing Mul benchmark
using the same karatsuba threshold, and an improvement of > 50% with
a slightly higher threshold (32 instead of 30):

big.BenchmarkMul           500	   6731846 ns/op (old alg.)
big.BenchmarkMul	   500	   4351122 ns/op (new alg.)
big.BenchmarkMul           500	   3133782 ns/op (new alg., new theshold)

Also:
- tweaked calibrate.go, use same benchmark as for Mul benchmark

R=rsc
CC=golang-dev
https://golang.org/cl/1037041
2010-04-30 11:54:27 -07:00
Robert Griesemer
f78b09e673 big: assembly routines for 386 long shifts
R=rsc
CC=golang-dev
https://golang.org/cl/974043
2010-04-30 11:53:37 -07:00
Robert Griesemer
2b0a30c4b5 big: implemented core shift routines in arith.go and
provide assembly versions (for x86-64 for now)

(Not yet used - waiting for previous CL to clear)

R=rsc
CC=golang-dev
https://golang.org/cl/1040041
2010-04-30 09:29:11 -07:00