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

Delta Between Two Patch Sets: misc/cgo/test/fpvar.go

Issue 9835047: code review 9835047: cmd/cgo: Add support for C function pointers (Closed)
Left Patch Set: diff -r d881cb1ffc14 https://code.google.com/p/go Created 10 years, 7 months ago
Right Patch Set: diff -r d881cb1ffc14 https://code.google.com/p/go Created 10 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « misc/cgo/test/cgo_test.go ('k') | src/cmd/cgo/doc.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2013 The Go Authors. All rights reserved. 1 // Copyright 2013 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 // This file contains test cases for cgo. 5 // This file contains test cases for cgo with function pointer variables.
iant 2013/08/07 17:22:02 Please change this comment to // This file contai
6 6
7 package cgotest 7 package cgotest
8 8
9 /* 9 /*
10 typedef int (*intFunc) (); 10 typedef int (*intFunc) ();
11 11
12 int 12 int
13 bridge_int_func(intFunc f) 13 bridge_int_func(intFunc f)
14 { 14 {
15 return f(); 15 return f();
(...skipping 25 matching lines...) Expand all
41 } 41 }
42 res2 := callCBridge(f) 42 res2 := callCBridge(f)
43 if r2 := int(res2); r2 != expected { 43 if r2 := int(res2); r2 != expected {
44 t.Errorf("got %d, want %d", r2, expected) 44 t.Errorf("got %d, want %d", r2, expected)
45 } 45 }
46 r3 := callBridge(f) 46 r3 := callBridge(f)
47 if r3 != expected { 47 if r3 != expected {
48 t.Errorf("got %d, want %d", r3, expected) 48 t.Errorf("got %d, want %d", r3, expected)
49 } 49 }
50 } 50 }
LEFTRIGHT

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