Repository: qpid-proton Updated Branches: refs/heads/master bbf8a6a30 -> eafd08104
PROTON-1390: Go fix use of unsafe.Sizeof(0) Work around gccgo bug by using unsafe.Sizeof(int(0)). This is in any case better as it makes the type clearer. Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/9fc393a4 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/9fc393a4 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/9fc393a4 Branch: refs/heads/master Commit: 9fc393a4584cafddfba3666e30f6d8762bae837f Parents: bbf8a6a Author: Alan Conway <[email protected]> Authored: Tue Jan 17 17:12:13 2017 -0500 Committer: Alan Conway <[email protected]> Committed: Tue Jan 17 19:41:56 2017 -0500 ---------------------------------------------------------------------- proton-c/bindings/go/src/qpid.apache.org/amqp/marshal.go | 4 ++-- proton-c/bindings/go/src/qpid.apache.org/amqp/unmarshal.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9fc393a4/proton-c/bindings/go/src/qpid.apache.org/amqp/marshal.go ---------------------------------------------------------------------- diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/marshal.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/marshal.go index bce7323..e3d4e10 100644 --- a/proton-c/bindings/go/src/qpid.apache.org/amqp/marshal.go +++ b/proton-c/bindings/go/src/qpid.apache.org/amqp/marshal.go @@ -143,7 +143,7 @@ func marshal(v interface{}, data *C.pn_data_t) { case int64: C.pn_data_put_long(data, C.int64_t(v)) case int: - if unsafe.Sizeof(0) == 8 { + if unsafe.Sizeof(int(0)) == 8 { C.pn_data_put_long(data, C.int64_t(v)) } else { C.pn_data_put_int(data, C.int32_t(v)) @@ -157,7 +157,7 @@ func marshal(v interface{}, data *C.pn_data_t) { case uint64: C.pn_data_put_ulong(data, C.uint64_t(v)) case uint: - if unsafe.Sizeof(0) == 8 { + if unsafe.Sizeof(int(0)) == 8 { C.pn_data_put_ulong(data, C.uint64_t(v)) } else { C.pn_data_put_uint(data, C.uint32_t(v)) http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9fc393a4/proton-c/bindings/go/src/qpid.apache.org/amqp/unmarshal.go ---------------------------------------------------------------------- diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/unmarshal.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/unmarshal.go index 8f380a7..9b9cfd3 100644 --- a/proton-c/bindings/go/src/qpid.apache.org/amqp/unmarshal.go +++ b/proton-c/bindings/go/src/qpid.apache.org/amqp/unmarshal.go @@ -330,7 +330,7 @@ func unmarshal(v interface{}, data *C.pn_data_t) { case C.PN_INT: *v = int(C.pn_data_get_int(data)) case C.PN_LONG: - if unsafe.Sizeof(0) == 8 { + if unsafe.Sizeof(int(0)) == 8 { *v = int(C.pn_data_get_long(data)) } else { panic(newUnmarshalError(pnType, v)) @@ -350,7 +350,7 @@ func unmarshal(v interface{}, data *C.pn_data_t) { case C.PN_UINT: *v = uint(C.pn_data_get_uint(data)) case C.PN_ULONG: - if unsafe.Sizeof(0) == 8 { + if unsafe.Sizeof(int(0)) == 8 { *v = uint(C.pn_data_get_ulong(data)) } else { panic(newUnmarshalError(pnType, v)) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
