MCPcopy Index your code
hub / github.com/Shopify/go-lua / fieldArguments

Function fieldArguments

bit32.go:53–61  ·  view source on GitHub ↗
(l *State, fieldIndex int)

Source from the content-addressed store, hash-verified

51}
52
53func fieldArguments(l *State, fieldIndex int) (uint, uint) {
54 f, w := CheckInteger(l, fieldIndex), OptInteger(l, fieldIndex+1, 1)
55 ArgumentCheck(l, 0 <= f, fieldIndex, "field cannot be negative")
56 ArgumentCheck(l, 0 < w, fieldIndex+1, "width must be positive")
57 if f+w > bitCount {
58 Errorf(l, "trying to access non-existent bits")
59 }
60 return uint(f), uint(w)
61}
62
63var bitLibrary = []RegistryFunction{
64 {"arshift", func(l *State) int {

Callers 1

bit32.goFile · 0.85

Calls 4

CheckIntegerFunction · 0.85
OptIntegerFunction · 0.85
ArgumentCheckFunction · 0.85
ErrorfFunction · 0.85

Tested by

no test coverage detected