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

Side by Side Diff: src/cmd/cgo/main.go

Issue 5307066: code review 5307066: non-pkg: gofix -r error (Closed)
Patch Set: diff -r 586479483dd6 https://go.googlecode.com/hg/ Created 13 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/cmd/cgo/gcc.go ('k') | src/cmd/cgo/out.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Cgo; see gmp.go for an overview. 5 // Cgo; see gmp.go for an overview.
6 6
7 // TODO(rsc): 7 // TODO(rsc):
8 // Emit correct line number annotations. 8 // Emit correct line number annotations.
9 // Make 6g understand the annotations. 9 // Make 6g understand the annotations.
10 10
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 if nerrors > 0 { 248 if nerrors > 0 {
249 os.Exit(2) 249 os.Exit(2)
250 } 250 }
251 } 251 }
252 252
253 // Record what needs to be recorded about f. 253 // Record what needs to be recorded about f.
254 func (p *Package) Record(f *File) { 254 func (p *Package) Record(f *File) {
255 if p.PackageName == "" { 255 if p.PackageName == "" {
256 p.PackageName = f.Package 256 p.PackageName = f.Package
257 } else if p.PackageName != f.Package { 257 } else if p.PackageName != f.Package {
258 » » error(token.NoPos, "inconsistent package names: %s, %s", p.Packa geName, f.Package) 258 » » error_(token.NoPos, "inconsistent package names: %s, %s", p.Pack ageName, f.Package)
259 } 259 }
260 260
261 if p.Name == nil { 261 if p.Name == nil {
262 p.Name = f.Name 262 p.Name = f.Name
263 } else { 263 } else {
264 for k, v := range f.Name { 264 for k, v := range f.Name {
265 if p.Name[k] == nil { 265 if p.Name[k] == nil {
266 p.Name[k] = v 266 p.Name[k] = v
267 } else if !reflect.DeepEqual(p.Name[k], v) { 267 } else if !reflect.DeepEqual(p.Name[k], v) {
268 » » » » error(token.NoPos, "inconsistent definitions for C.%s", k) 268 » » » » error_(token.NoPos, "inconsistent definitions fo r C.%s", k)
269 } 269 }
270 } 270 }
271 } 271 }
272 272
273 p.ExpFunc = append(p.ExpFunc, f.ExpFunc...) 273 p.ExpFunc = append(p.ExpFunc, f.ExpFunc...)
274 p.Decl = append(p.Decl, f.AST.Decls...) 274 p.Decl = append(p.Decl, f.AST.Decls...)
275 } 275 }
OLDNEW
« no previous file with comments | « src/cmd/cgo/gcc.go ('k') | src/cmd/cgo/out.go » ('j') | no next file with comments »

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