MCPcopy Create free account
hub / github.com/godbus/dbus / padding

Method padding

encoder.go:52–59  ·  view source on GitHub ↗

pad returns the number of bytes of padding, based on current position and additional offset. and alignment.

(offset, algn int)

Source from the content-addressed store, hash-verified

50// pad returns the number of bytes of padding, based on current position and additional offset.
51// and alignment.
52func (enc *encoder) padding(offset, algn int) int {
53 abs := enc.pos + offset
54 if abs%algn != 0 {
55 newabs := (abs + algn - 1) & ^(algn - 1)
56 return newabs - abs
57 }
58 return 0
59}
60
61// Calls binary.Write(enc.out, enc.order, v) and panics on write errors.
62func (enc *encoder) binwrite(v any) {

Callers 2

alignMethod · 0.95
encodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected