diff options
| author | Andrew Gallant <[email protected]> | 2013-08-11 20:54:15 -0400 |
|---|---|---|
| committer | Andrew Gallant <[email protected]> | 2013-08-11 20:54:15 -0400 |
| commit | eb7c38953b074e33f86861a3da4c05623cd44fc6 (patch) | |
| tree | 0393a0a57afb536c401afb5e3587384c282ddd00 /xv/xv.go | |
| parent | 8bc7a097c3aeddc1832d47cd74a9a365ab1f86ad (diff) | |
Padding on a list is on the length of the list.
There was a bug where padding was being computed on each element of the
list. Close #5.
Diffstat (limited to 'xv/xv.go')
| -rw-r--r-- | xv/xv.go | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -130,9 +130,9 @@ func AdaptorInfoListBytes(buf []byte, list []AdaptorInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // AdaptorInfoListSize computes the size (bytes) of a list of AdaptorInfo values. @@ -223,9 +223,9 @@ func AttributeInfoListBytes(buf []byte, list []AttributeInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // AttributeInfoListSize computes the size (bytes) of a list of AttributeInfo values. @@ -474,9 +474,9 @@ func EncodingInfoListBytes(buf []byte, list []EncodingInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // EncodingInfoListSize computes the size (bytes) of a list of EncodingInfo values. @@ -542,9 +542,9 @@ func FormatListBytes(buf []byte, list []Format) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -662,9 +662,9 @@ func ImageListBytes(buf []byte, list []Image) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ImageListSize computes the size (bytes) of a list of Image values. @@ -892,9 +892,9 @@ func ImageFormatInfoListBytes(buf []byte, list []ImageFormatInfo) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } // ImageFormatInfoListSize computes the size (bytes) of a list of ImageFormatInfo values. @@ -1062,9 +1062,9 @@ func RationalListBytes(buf []byte, list []Rational) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( |
