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

1004 Commits

Author SHA1 Message Date
Devon H. O'Dell
2eb9171dfb Fix missing explicit GOBIN in src/pkg/Makefile. Clean up creation of
QUOTED_GOBIN. Re-take of 181077; fixes copy-pasta that broke build.

Fixes #468

R=rsc
CC=golang-dev
https://golang.org/cl/183125
2010-01-06 07:47:56 -08:00
Ivan Krasin
597e57f4d5 Add http.CanonicalPath and tests for it. Remove BUG(rsc) from url.go.
R=rsc, imkrasin
CC=golang-dev
https://golang.org/cl/179126
2010-01-06 07:47:40 -08:00
Ivan Krasin
e324e4099f Propagate error to the caller in json.Marshal. Fixes issue 445.
R=rsc, imkrasin
CC=golang-dev
https://golang.org/cl/179125
2010-01-06 07:25:17 -08:00
Russ Cox
32594bd43d rollback of https://golang.org/cl/181077
(broke build)

TBR=dho
https://golang.org/cl/181139
2010-01-05 16:54:27 -08:00
Evan Shaw
1c819cb194 xml: Fix comment so that example code compiles
R=rsc
CC=golang-dev
https://golang.org/cl/181138
2010-01-05 16:50:52 -08:00
Russ Cox
cfbee34a27 big: fix ProbablyPrime bug, comments
(changes adopted from alc, agl)

R=agl1, agl
CC=golang-dev
https://golang.org/cl/181137
2010-01-05 16:49:05 -08:00
Devon H. O'Dell
e032ab9dc8 Fix missing explicit GOBIN in src/pkg/Makefile. Clean up creation of QUOTED_GOBIN
Fixes #468

R=rsc
CC=golang-dev
https://golang.org/cl/181077
2010-01-05 16:22:40 -08:00
Devon H. O'Dell
10cdec9262 syscall: add nanosleep on FreeBSD
Fixes #461

R=rsc
CC=golang-dev
https://golang.org/cl/181059
2010-01-05 09:21:15 -08:00
Roger Peppe
0281b71580 net: make Dial correctly return nil on error.
R=rsc
CC=golang-dev
https://golang.org/cl/181135
2010-01-05 09:20:02 -08:00
Robert Griesemer
50442290bb Simplified parser interface.
R=rsc, r
CC=golang-dev, rog
https://golang.org/cl/183116
2010-01-04 17:26:01 -08:00
Rob Pike
a0ee18bdd5 Check for errors when writing fields of a struct.
R=rsc
CC=golang-dev, jack.palevich
https://golang.org/cl/183109
2010-01-05 11:33:06 +11:00
Roger Peppe
f221067fe8 Allow a nil Ident to print without crashing.
Allow Walk of []Decl

R=gri
CC=golang-dev, rsc
https://golang.org/cl/183112
2010-01-04 10:34:37 -08:00
Yongjian Xu
ca0def6659 Remove redundant size check in resize. Let callers worry about that and resize should just do "resize".
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/181111
2010-01-02 11:09:22 +11:00
Rob Pike
5a44338159 trivial bug: []byte is special but [3]byte is not.
modify a test to verify the fix.

R=rsc
CC=golang-dev
https://golang.org/cl/183090
2009-12-31 12:47:20 +11:00
Rob Pike
a58b69e1d0 improve some type switches now that multiple types per case are supported.
R=rsc
CC=golang-dev
https://golang.org/cl/181089
2009-12-30 08:33:48 +11:00
Robert Griesemer
e01459f567 Apply symmetric changes to sha1 and sha256 as to md4 and md5.
R=agl, agl1
CC=golang-dev
https://golang.org/cl/183083
2009-12-29 11:41:44 -08:00
Nigel Tao
5042a4e9f9 PNG decoder now handles transparent paletted images.
Fixes #439.

R=r
CC=golang-dev
https://golang.org/cl/181087
2009-12-29 15:23:55 +11:00
Nigel Tao
50d3447a36 JPEG decoder now handles RST (restart) markers.
R=r
CC=golang-dev
https://golang.org/cl/181075
2009-12-29 15:20:53 +11:00
Rob Pike
e7601e2980 add a debugging printer to the gob package.
used only for debugging, debug.go is not normally part of the package source.

also add a dump program to call it.

R=rsc
CC=golang-dev
https://golang.org/cl/183075
2009-12-29 14:03:33 +11:00
Rob Pike
1f5511560e remove all references to gobType() from the decoder.
Fixes #470.

R=rsc
CC=golang-dev
https://golang.org/cl/183074
2009-12-29 14:03:12 +11:00
Robert Griesemer
f0fcb2d59f Symmetric changes to md4.go as for md5.go.
Use uint index variables in some cases instead
of int to enable strength reduction; this makes
it possible for the compiler to reduce % into
masks.

Old code: 6g -S md4.go md4block.go | grep "md4block.go:44"
0471 (md4block.go:44) MOVL    AX,BX
0472 (md4block.go:44) MOVL    AX,BP
0473 (md4block.go:44) MOVL    AX,R8
0474 (md4block.go:44) SARL    $31,R8
0475 (md4block.go:44) SHRL    $30,R8
0476 (md4block.go:44) ADDL    R8,BP
0477 (md4block.go:44) SARL    $2,BP
0478 (md4block.go:44) IMULL   $4,BP
0479 (md4block.go:44) SUBL    BP,BX
0480 (md4block.go:44) MOVLQSX BX,BX
0481 (md4block.go:44) LEAQ    shift1+0(SB),BP
0482 (md4block.go:44) CMPL    BX,8(BP)
0483 (md4block.go:44) JCS     ,485
0484 (md4block.go:44) CALL    ,runtime.throwindex+0(SB)
0485 (md4block.go:44) MOVQ    (BP),BP
0486 (md4block.go:44) MOVL    (BP)(BX*4),DI

New code: 6g -S md4.go md4block.go | grep "md4block.go:44"
0471 (md4block.go:44) MOVL    AX,BX
0472 (md4block.go:44) ANDL    $3,BX
0473 (md4block.go:44) MOVLQZX BX,BX
0474 (md4block.go:44) LEAQ    shift1+0(SB),BP
0475 (md4block.go:44) CMPL    BX,8(BP)
0476 (md4block.go:44) JCS     ,478
0477 (md4block.go:44) CALL    ,runtime.throwindex+0(SB)
0478 (md4block.go:44) MOVQ    (BP),BP
0479 (md4block.go:44) MOVL    (BP)(BX*4),DI

R=agl, agl1
CC=golang-dev
https://golang.org/cl/181086
2009-12-28 17:20:33 -08:00
Robert Griesemer
9d07d37f31 A couple of tighter loops.
(I was looking at this code accidentally because of some gofmt
issues and thought that one could write this more effectively.
You may have deliberately chosen not to use ranges here to make
the index range clearer. Just let me know.)

R=agl, agl1
CC=golang-dev
https://golang.org/cl/181084
2009-12-28 15:48:58 -08:00
Rob Pike
33311a7945 fix dumb bug: must write out default values inside arrays and slices
Fixes #459.

R=rsc, imkrasin, sonia
CC=golang-dev
https://golang.org/cl/181073
2009-12-29 07:41:53 +11:00
Robert Griesemer
b6adb3272f simplify some code that is using vectors
R=agl, agl1
CC=golang-dev
https://golang.org/cl/181080
2009-12-28 12:27:43 -08:00
Adam Langley
3c6bf09539 crypto/tls: make Listener a pointer.
Listener contains private members and 6g now enforces that private
members cannot be assigned outside of their package.

R=rsc
CC=golang-dev
https://golang.org/cl/183073
2009-12-28 11:40:01 -08:00
Devon H. O'Dell
1245e93b2c Update documentation around time.Sleep to specify its precision, and suggest
a possible interface for more granular sleep times.

Fixes issue #260.

R=rsc, r
CC=golang-dev
https://golang.org/cl/181058
2009-12-25 08:24:00 +11:00
Ian Lance Taylor
2be4897800 Use t.Errorf for formatted error output.
R=dsymonds1
CC=golang-dev
https://golang.org/cl/183049
2009-12-23 22:08:49 -08:00
Peter Froehlich
e1033d07b4 Add query to find number of subexpressions.
This was convenient for me to have without being forced
to parse the regexp myself. I'd understand if it's not
really wanted, but I also think that some meta information
about compiled regexps would be fine.

R=r, rsc
CC=golang-dev
https://golang.org/cl/183044
2009-12-24 08:43:35 +11:00
Robert Griesemer
b266f39b85 remove nums.sh
R=rsc
CC=golang-dev
https://golang.org/cl/181049
2009-12-23 13:15:00 -08:00
Rob Pike
96da3e96c3 implement .repeats for maps.
Fixes #309.

R=rsc
CC=golang-dev
https://golang.org/cl/181044
2009-12-24 07:41:56 +11:00
Adam Langley
9ebb59634e crypto/tls: extensions and Next Protocol Negotiation
Add support for TLS extensions in general and Next Protocol
Negotiation in particular.

R=rsc
CC=golang-dev
https://golang.org/cl/181045
2009-12-23 11:13:09 -08:00
Peter Froehlich
3f25c8a2ef Fix comment for Chmod.
R=r, rsc
CC=golang-dev
https://golang.org/cl/183042
2009-12-23 08:49:38 -08:00
Robert Griesemer
a0862ea568 Cleanup: remove Exp ending in identifiers
as it is not needed anymore (only one impl.
of vector package).

Makefile, vector_test.go, and nogen_test.go
were modified manually (find/replace), the
other files (intvector_test.go, strinvector_test.go
are generated).

Runs all tests.

R=r
https://golang.org/cl/182041
2009-12-22 18:45:36 -08:00
Robert Griesemer
8c7d001602 Replace container/vector with exp/vector (faster).
Manual changes to the following files:
src/pkg/Makefile
src/pkg/exp/vector/Makefile (now: src/pkg/container/vector/Makefile)

R=rsc, r
CC=golang-dev
https://golang.org/cl/181041
2009-12-22 18:25:27 -08:00
Robert Griesemer
36d645f5fa add comment (warning about generated files)
R=r
CC=golang-dev
https://golang.org/cl/180108
2009-12-22 15:14:10 -08:00
Rob Pike
148ee9c009 fix up %p
- use an interface {Get()}
- implement Get for maps, slices
- for slices, retrieves the address of the end of the array, which will give the
	same value for every slice of the same array.

R=rsc
CC=golang-dev
https://golang.org/cl/179129
2009-12-23 07:34:17 +11:00
Russ Cox
d488c4b4ac json: fix doc comment
R=gri
CC=golang-dev
https://golang.org/cl/179128
2009-12-22 09:47:02 -08:00
Rob Pike
2e853ec88a Allow %p on reference types, for debugging.
(Also fix case sensitivity in test for PTR inside fmt_test.go)
Fixes #441.

R=rsc, iant
CC=golang-dev
https://golang.org/cl/180112
2009-12-22 17:02:00 +11:00
Jan Mercl
b15fefd7d7 Experimental alternative implementation of the vector package
R=gri
CC=rsc
https://golang.org/cl/178048
2009-12-21 14:34:54 -08:00
Rob Pike
1f0e6a4c99 new comments for bytes.NewBuffer and NewBufferString.
corrects a common misunderstanding about NewBuffer.

R=rsc
CC=golang-dev
https://golang.org/cl/179106
2009-12-19 08:42:31 +11:00
Adam Langley
50d6c81d4a runtime: fix race condition
(Thanks to ken and rsc for pointing this out)

rsc:
	ken pointed out that there's a race in the new
	one-lock-per-channel code.  the issue is that
	if one goroutine has gone to sleep doing

	select {
	case <-c1:
	case <-c2:
	}

	and then two more goroutines try to send
	on c1 and c2 simultaneously, the way that
	the code makes sure only one wins is the
	selgen field manipulation in dequeue:

	       // if sgp is stale, ignore it
	       if(sgp->selgen != sgp->g->selgen) {
		       //prints("INVALID PSEUDOG POINTER\n");
		       freesg(c, sgp);
		       goto loop;
	       }

	       // invalidate any others
	       sgp->g->selgen++;

	but because the global lock is gone both
	goroutines will be fiddling with sgp->g->selgen
	at the same time.

This results in a 7% slowdown in the single threaded case for a
ping-pong microbenchmark.

Since the cas predominantly succeeds, adding a simple check first
didn't make any difference.

R=rsc
CC=golang-dev
https://golang.org/cl/180068
2009-12-18 12:25:53 -08:00
Robert Griesemer
057e7d9fae fix build, enable an exp/eval's assignment check
now that the parser doesn't do this test anymore

R=rsc
CC=golang-dev
https://golang.org/cl/179105
2009-12-18 11:21:11 -08:00
Robert Griesemer
5dc6c80843 report an error for illegal octal numbers instead of treating them as floats
added more test cases
some capitalization cleanups

R=rsc
CC=golang-dev
https://golang.org/cl/180085
2009-12-18 10:52:11 -08:00
Robert Griesemer
c5f41cc58c removed semantic check from parsers
R=rsc
CC=golang-dev
https://golang.org/cl/179099
2009-12-18 10:51:47 -08:00
Kai Backman
d85bb81878 first stub for softfloats, intercepts float instructions and skips
them in the stream.

R=rsc
https://golang.org/cl/174052
2009-12-17 16:08:42 -08:00
Ben Olive
d2a835fbf3 time: add ISO 8601 time format
Fixes #431.

R=r, rsc
CC=golang-dev
https://golang.org/cl/179079
2009-12-17 13:39:13 -08:00
Tor Andersson
a812332151 Updated the XGB python script to generate semicolon-free
source for xproto.go.

R=rsc
CC=golang-dev
https://golang.org/cl/180074
2009-12-17 12:19:40 -08:00
Russ Cox
08579c26dd runtime: if os/signal is not in use, crash on
most signals, so that ordinary programs
	can be killed, for example.

Fixes #434.

R=dsymonds1
CC=golang-dev, hoisie
https://golang.org/cl/180064
2009-12-16 20:20:50 -08:00
Nigel Tao
8bf58725b2 Basic image/jpeg decoder.
This is not a complete JPEG implementation (e.g. it does not handle
progressive JPEGs or restart markers), but I was able to take a photo
with my phone, and view the resultant JPEG in pure Go.

The decoder is simple, but slow. The Huffman decoder in particular
should be easily improvable, but optimization is left to future
changelists. Being able to inline functions in the inner loop should
also help performance.

The output is not pixel-for-pixel identical to libjpeg, although
identical behavior isn't necessarily a goal, since JPEG is a lossy
codec. There are at least two reasons for the discrepancy.

First, the inverse DCT algorithm used is the same as Plan9's
src/cmd/jpg, which has different rounding errors from libjpeg's
default IDCT implementation. Note that libjpeg actually has three
different IDCT implementations: one floating point, and two fixed
point. Out of those four, Plan9's seemed the simplest to understand,
partly because it has no #ifdef's or C macros.

Second, for 4:2:2 or 4:2:0 chroma sampling, this implementation does
nearest neighbor upsampling, compared to libjpeg's triangle filter
(e.g. see h2v1_fancy_upsample in jdsample.c).

The difference from the first reason is typically zero, but sometimes
1 (out of 256) in YCbCr space, or double that in RGB space. The
difference from the second reason can be as large as 8/256 in YCbCr
space, in regions of steep chroma gradients. Informal eyeballing
suggests that the net difference is typically imperceptible, though.

R=r
CC=golang-dev, rsc
https://golang.org/cl/164056
2009-12-17 10:32:17 +11:00
Robert Griesemer
b6bac1c0a5 Don't ignore flags controlling the amount of source code parsed
in parser's ParsePkgFile and ParsePackage functions.

R=rsc
CC=golang-dev, rog
https://golang.org/cl/180070
2009-12-16 14:12:24 -08:00