Commit a54ac5f3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 049293ed
This diff is collapsed.
...@@ -143,6 +143,14 @@ func byte2bool(b byte) bool { ...@@ -143,6 +143,14 @@ func byte2bool(b byte) bool {
return b != 0 return b != 0
} }
func bool2byte(b bool) byte {
if b {
return 1
} else {
return 0
}
}
// NOTE py.None encodes as '\xff' * 8 (-> we use NaN for None) // NOTE py.None encodes as '\xff' * 8 (-> we use NaN for None)
// NOTE '\xff' * 8 represents FP NaN but many other NaN bits representation exist // NOTE '\xff' * 8 represents FP NaN but many other NaN bits representation exist
func float64_NEOEncode(b []byte, f float64) { func float64_NEOEncode(b []byte, f float64) {
......
...@@ -224,8 +224,8 @@ func (d *decoder) genPrologue(recvName, typeName string) { ...@@ -224,8 +224,8 @@ func (d *decoder) genPrologue(recvName, typeName string) {
func (e *encoder) genEpilogue() { func (e *encoder) genEpilogue() {
e.emit("return int(nwrote) + %v /*, nil*/", e.n) e.emit("return int(nwrote) + %v /*, nil*/", e.n)
e.emit("\noverflow:") e.emit("\n/*overflow:")
e.emit("panic(0) //return 0, ErrEncodeOverflow") e.emit("panic(0) */ //return 0, ErrEncodeOverflow")
e.emit("}") e.emit("}")
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment