Explorar o código

goprotobuf: Revert cfe37a63cede.

TBR=adg
CC=golang-dev
http://codereview.appspot.com/4657066
David Symonds %!s(int64=14) %!d(string=hai) anos
pai
achega
39f27f4a82
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      proto/properties.go

+ 4 - 4
proto/properties.go

@@ -109,8 +109,8 @@ type Properties struct {
 	dec     decoder
 	valDec  valueDecoder // set for bool and numeric types only
 	scratch uintptr
-	sizeof  int // calculations of scratch space
-	alignof int
+	sizeof  uintptr // calculations of scratch space
+	alignof uintptr
 
 	// If this is a packable field, this will be the decoder for the packed version of the field.
 	packedDec decoder
@@ -483,7 +483,7 @@ func GetProperties(t reflect.Type) *StructProperties {
 		}
 		scratch = align(scratch, p.alignof)
 		p.scratch = scratch
-		scratch += uintptr(p.sizeof)
+		scratch += p.sizeof
 		prop.tags[p.Tag] = i
 	}
 	prop.reqCount = reqCount
@@ -496,7 +496,7 @@ func GetProperties(t reflect.Type) *StructProperties {
 
 // Alignment of the data in the scratch area.  It doesn't have to be
 // exact, just conservative.  Returns the first number >= o that divides s.
-func align(o uintptr, s int) uintptr {
+func align(o uintptr, s uintptr) uintptr {
 	if s != 0 {
 		for o%uintptr(s) != 0 {
 			o++