mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 11:08:12 +02:00
trace: Fix trace endianness
Trace files were using host-endian to represent the length of compressed data, making the trace format not portable. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
35f19bc084
commit
4f617eaf77
1 changed files with 15 additions and 0 deletions
|
|
@ -71,6 +71,20 @@
|
|||
((((uint32_t)(p))) >> 24))
|
||||
#endif
|
||||
|
||||
#if WORDS_BIGENDIAN
|
||||
#define le16(x) bswap_16 (x)
|
||||
#define le32(x) bswap_32 (x)
|
||||
#define be16(x) x
|
||||
#define be32(x) x
|
||||
#define to_be32(x) x
|
||||
#else
|
||||
#define le16(x) x
|
||||
#define le32(x) x
|
||||
#define be16(x) bswap_16 (x)
|
||||
#define be32(x) bswap_32 (x)
|
||||
#define to_be32(x) bswap_32 (x)
|
||||
#endif
|
||||
|
||||
#if CAIRO_HAS_SYMBOL_LOOKUP
|
||||
#include "lookup-symbol.h"
|
||||
#endif
|
||||
|
|
@ -1366,6 +1380,7 @@ _write_data_start (struct _data_stream *stream, uint32_t len)
|
|||
_write_base85_data_start (stream);
|
||||
|
||||
_trace_printf ("<|");
|
||||
len = to_be32 (len);
|
||||
_write_base85_data (stream, (unsigned char *) &len, sizeof (len));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue