- /* Note that "NATIVE" means the trace's endianness, not the host's. */
- if (!stream_class || byte_order <= BT_CTF_BYTE_ORDER_UNKNOWN ||
- byte_order > BT_CTF_BYTE_ORDER_NETWORK) {
- ret = -1;
- goto end;
- }
-
- switch (byte_order) {
- case BT_CTF_BYTE_ORDER_NETWORK:
- case BT_CTF_BYTE_ORDER_BIG_ENDIAN:
- internal_byte_order = BIG_ENDIAN;
- break;
- case BT_CTF_BYTE_ORDER_LITTLE_ENDIAN:
- internal_byte_order = LITTLE_ENDIAN;
- break;
- default:
- ret = -1;
- goto end;
- }
-
- stream_class->byte_order = internal_byte_order;
+ assert(stream_class);
+ assert(byte_order == LITTLE_ENDIAN || byte_order == BIG_ENDIAN);
+ stream_class->byte_order = byte_order;