From 838e336594e410898667fa06b15f1116a3b586fd Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 19 Aug 2017 09:46:43 +0200 Subject: sys, prog: switch values to to uint64 We currently use uintptr for all values. This won't work for 32-bit archs. Moreover in some cases we use uintptr but assume that it is always 64-bits (e.g. in encodingexec). Switch everything to uint64. Update #324 --- pkg/csource/csource.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/csource') diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go index 163a9b065..6ac5d2eba 100644 --- a/pkg/csource/csource.go +++ b/pkg/csource/csource.go @@ -259,13 +259,13 @@ func generateTestFunc(w io.Writer, opts Options, calls []string, name string) { } func generateCalls(exec []byte, opts Options) ([]string, int) { - read := func() uintptr { + read := func() uint64 { if len(exec) < 8 { panic("exec program overflow") } v := *(*uint64)(unsafe.Pointer(&exec[0])) exec = exec[8:] - return uintptr(v) + return v } resultRef := func() string { arg := read() @@ -332,8 +332,8 @@ loop: case prog.ExecArgCsumInet: fmt.Fprintf(w, "\tstruct csum_inet csum_%d;\n", n) fmt.Fprintf(w, "\tcsum_inet_init(&csum_%d);\n", n) - csum_chunks_num := read() - for i := uintptr(0); i < csum_chunks_num; i++ { + csumChunksNum := read() + for i := uint64(0); i < csumChunksNum; i++ { chunk_kind := read() chunk_value := read() chunk_size := read() @@ -383,7 +383,7 @@ loop: } } nargs := read() - for i := uintptr(0); i < nargs; i++ { + for i := uint64(0); i < nargs; i++ { typ := read() size := read() _ = size -- cgit mrf-deployment