The mi_fix_smallint() function
The mi_fix_smallint() function converts the specified 2-byte integer to or from the byte order of the client computer.
Syntax
mi_unsigned_integer mi_fix_smallint (val)
mi_unsigned_integer val;
- val
- The 2-byte integer on which to fix the byte order.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
No | Yes |
Usage
The mi_fix_smallint() function is useful in send and receive support functions for an opaque data type when the opaque type contains mi_smallint components that need to be converted to and from the client byte order.
For maximum portability, this function accepts and returns fully promoted mi_integer values instead of mi_smallint values. Arguments and return values might therefore require casting.
Return values
- An mi_unsigned_integer value
- The value in the desired byte order.
- MI_ERROR
- The function was not successful.