DoxigAlpha

intShift

Function parameters

Parameters

#
T:type
x:anytype

Type definitions in this namespace

Types

#

Returns the number of bytes consumed by headers.

Functions

#
feed
Returns the number of bytes consumed by headers.

Source

Implementation

#
inline fn intShift(comptime T: type, x: anytype) T {
    switch (@import("builtin").cpu.arch.endian()) {
        .little => return @truncate(x >> (@bitSizeOf(@TypeOf(x)) - @bitSizeOf(T))),
        .big => return @truncate(x),
    }
}