Skip to content

Commit 42be0ee

Browse files
committed
minor adaptions
1 parent 8248770 commit 42be0ee

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

cmd/TCOBSv1CDecode/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func doit(w io.Writer, fSys *afero.Afero) {
3232
if len(os.Args) != 1 {
3333
fmt.Fprintln(w, version, commit, date)
3434
fmt.Fprintln(w, "Feed with a space separated byte sequence to decode a TCOBSv1 sequence.")
35-
fmt.Fprintln(w, "Example: `echo 64 1 2 18 88 25 88 161 | TCOBSv1Decode` will return `0 0 1 2 2 2 2 88 88 88 88 88 88`")
35+
fmt.Fprintln(w, "Example: `echo 64 1 2 18 88 25 88 161 | TCOBSv1CDecode` will return `0 0 1 2 2 2 2 88 88 88 88 88 88`")
3636
return
3737
}
3838

cmd/TCOBSv1CEncode/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func doit(w io.Writer, fSys *afero.Afero) {
3232
if len(os.Args) != 1 {
3333
fmt.Fprintln(w, version, commit, date)
3434
fmt.Fprintln(w, "Feed with a space separated byte sequence to encode it in a TCOBSv1 sequence.")
35-
fmt.Fprintln(w, "Example: `echo 0 0 1 0b10 2 02 0x2 88 88 88 88 88 88 | TCOBSv1Encode` will return `64 1 2 18 88 25 88 161`")
35+
fmt.Fprintln(w, "Example: `echo 0 0 1 0b10 2 02 0x2 88 88 88 88 88 88 | TCOBSv1CEncode` will return `64 1 2 18 88 25 88 161`")
3636
return
3737
}
3838

cmd/TCOBSv2CDecode/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func doit(w io.Writer, fSys *afero.Afero) {
3232
if len(os.Args) != 1 {
3333
fmt.Fprintln(w, version, commit, date)
3434
fmt.Fprintln(w, "Feed with a space separated byte sequence to decode a TCOBSv2 sequence.")
35-
fmt.Fprintln(w, "Example: `echo 96 1 2 66 88 129 128 | TCOBSv2Decode` will return `0 0 1 2 2 2 2 88 88 88 88 88 88`")
35+
fmt.Fprintln(w, "Example: `echo 96 1 2 66 88 129 128 | TCOBSv2CDecode` will return `0 0 1 2 2 2 2 88 88 88 88 88 88`")
3636
return
3737
}
3838

cmd/TCOBSv2CEncode/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func doit(w io.Writer, fSys *afero.Afero) {
3232
if len(os.Args) != 1 {
3333
fmt.Fprintln(w, version, commit, date)
3434
fmt.Fprintln(w, "Feed with a space separated byte sequence to encode it in a TCOBSv2 sequence.")
35-
fmt.Fprintln(w, "Example: `echo 0 0 1 0b10 2 02 0x2 88 88 88 88 88 88 | TCOBSv2Encode` will return `96 1 2 66 88 129 128`")
35+
fmt.Fprintln(w, "Example: `echo 0 0 1 0b10 2 02 0x2 88 88 88 88 88 88 | TCOBSv2CEncode` will return `96 1 2 66 88 129 128`")
3636
return
3737
}
3838

v1/tcobsCEncode.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ import (
1010

1111
// todo: -flto switch does not work on some Windows (Antivirus?) setups.
1212

13-
// CEncode encodes `i` into `o` and returns number of bytes in `o`.
13+
// CEncode encodes `i` into `o` and returns number of bytes.
1414
// For details see https://github.com/rokath/TCOBS/blob/master/docs/TCOBSSpecification.md.
1515
// The CEncode implementation is done in C because the aimed use case is an embedded device running C.
1616
// This function is mainly for testing.
17-
func CEncode(o, i []byte) (n int) {
17+
func CEncode(o, i []byte) int {
1818
if len(i) == 0 {
19-
return
19+
return 0
2020
}
2121
in := unsafe.Pointer(&i[0])
2222
out := unsafe.Pointer(&o[0])
23-
n = int(C.TCOBSEncode(out, in, C.size_t(len(i))))
24-
return
23+
n := int(C.TCOBSEncode(out, in, C.size_t(len(i))))
24+
return n
2525
}

0 commit comments

Comments
 (0)