perf(wl): inline typed argument constructors
- commit
- ccdd267a940e07b9920d3e92eb5941d8827e74b4
- author
- brice · · 2026-09-30 05:29 UTC
- parent
- 023ffe9
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +21 -7
M wl/wl.go +21 -7
| @@ -35,13 +35,6 @@ type ( | |||
| 35 | 35 | var ( | |
| 36 | 36 | Connect = wlturbo.Connect | |
| 37 | 37 | NewFixed = wlturbo.NewFixed | |
| 38 | - | ArgUint = wlturbo.ArgUint | |
| 39 | - | ArgInt = wlturbo.ArgInt | |
| 40 | - | ArgFixed = wlturbo.ArgFixed | |
| 41 | - | ArgString = wlturbo.ArgString | |
| 42 | - | ArgArray = wlturbo.ArgArray | |
| 43 | - | ArgObject = wlturbo.ArgObject | |
| 44 | - | ArgFD = wlturbo.ArgFD | |
| 45 | 38 | NewContext = wlturbo.NewContext | |
| 46 | 39 | CloseSentFD = wlturbo.CloseSentFD | |
| 47 | 40 | CheckVersion = wlturbo.CheckVersion | |
| @@ -50,6 +43,27 @@ var ( | |||
| 50 | 43 | UnmapMemory = wlturbo.UnmapMemory | |
| 51 | 44 | ) | |
| 52 | 45 | ||
| 46 | + | // ArgUint constructs a uint argument. | |
| 47 | + | func ArgUint(v uint32) Arg { return wlturbo.ArgUint(v) } | |
| 48 | + | ||
| 49 | + | // ArgInt constructs an int argument. | |
| 50 | + | func ArgInt(v int32) Arg { return wlturbo.ArgInt(v) } | |
| 51 | + | ||
| 52 | + | // ArgFixed constructs a fixed-point argument. | |
| 53 | + | func ArgFixed(v Fixed) Arg { return wlturbo.ArgFixed(v) } | |
| 54 | + | ||
| 55 | + | // ArgString constructs a string argument borrowed until the request returns. | |
| 56 | + | func ArgString(v string) Arg { return wlturbo.ArgString(v) } | |
| 57 | + | ||
| 58 | + | // ArgArray constructs an array argument borrowed until the request returns. | |
| 59 | + | func ArgArray(v []byte) Arg { return wlturbo.ArgArray(v) } | |
| 60 | + | ||
| 61 | + | // ArgObject constructs an object or new_id argument; nil is sent as 0. | |
| 62 | + | func ArgObject(v Object) Arg { return wlturbo.ArgObject(v) } | |
| 63 | + | ||
| 64 | + | // ArgFD marks a descriptor position; the descriptor travels in Request.FDs. | |
| 65 | + | func ArgFD() Arg { return wlturbo.ArgFD() } | |
| 66 | + | ||
| 53 | 67 | // Sentinels for the transport's error classes, so errors.Is works through the | |
| 54 | 68 | // shim as it does through the root package. | |
| 55 | 69 | var ( | |
| @@ -35,13 +35,6 @@ type ( | |||||
| 35 | var ( | 35 | var ( | ||
| 36 | Connect = wlturbo.Connect | 36 | Connect = wlturbo.Connect | ||
| 37 | NewFixed = wlturbo.NewFixed | 37 | NewFixed = wlturbo.NewFixed | ||
| 38 | - | ArgUint = wlturbo.ArgUint | |||
| 39 | - | ArgInt = wlturbo.ArgInt | |||
| 40 | - | ArgFixed = wlturbo.ArgFixed | |||
| 41 | - | ArgString = wlturbo.ArgString | |||
| 42 | - | ArgArray = wlturbo.ArgArray | |||
| 43 | - | ArgObject = wlturbo.ArgObject | |||
| 44 | - | ArgFD = wlturbo.ArgFD | |||
| 45 | NewContext = wlturbo.NewContext | 38 | NewContext = wlturbo.NewContext | ||
| 46 | CloseSentFD = wlturbo.CloseSentFD | 39 | CloseSentFD = wlturbo.CloseSentFD | ||
| 47 | CheckVersion = wlturbo.CheckVersion | 40 | CheckVersion = wlturbo.CheckVersion | ||
| @@ -50,6 +43,27 @@ var ( | |||||
| 50 | UnmapMemory = wlturbo.UnmapMemory | 43 | UnmapMemory = wlturbo.UnmapMemory | ||
| 51 | ) | 44 | ) | ||
| 52 | 45 | ||||
| 46 | + | // ArgUint constructs a uint argument. | |||
| 47 | + | func ArgUint(v uint32) Arg { return wlturbo.ArgUint(v) } | |||
| 48 | + | ||||
| 49 | + | // ArgInt constructs an int argument. | |||
| 50 | + | func ArgInt(v int32) Arg { return wlturbo.ArgInt(v) } | |||
| 51 | + | ||||
| 52 | + | // ArgFixed constructs a fixed-point argument. | |||
| 53 | + | func ArgFixed(v Fixed) Arg { return wlturbo.ArgFixed(v) } | |||
| 54 | + | ||||
| 55 | + | // ArgString constructs a string argument borrowed until the request returns. | |||
| 56 | + | func ArgString(v string) Arg { return wlturbo.ArgString(v) } | |||
| 57 | + | ||||
| 58 | + | // ArgArray constructs an array argument borrowed until the request returns. | |||
| 59 | + | func ArgArray(v []byte) Arg { return wlturbo.ArgArray(v) } | |||
| 60 | + | ||||
| 61 | + | // ArgObject constructs an object or new_id argument; nil is sent as 0. | |||
| 62 | + | func ArgObject(v Object) Arg { return wlturbo.ArgObject(v) } | |||
| 63 | + | ||||
| 64 | + | // ArgFD marks a descriptor position; the descriptor travels in Request.FDs. | |||
| 65 | + | func ArgFD() Arg { return wlturbo.ArgFD() } | |||
| 66 | + | ||||
| 53 | // Sentinels for the transport's error classes, so errors.Is works through the | 67 | // Sentinels for the transport's error classes, so errors.Is works through the | ||
| 54 | // shim as it does through the root package. | 68 | // shim as it does through the root package. | ||
| 55 | var ( | 69 | var ( | ||