mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Extract bit operations to buffer_util.h
Move util functions to a reusable separate header.
This commit is contained in:
parent
b1d2c2c640
commit
cb3cf801c8
2 changed files with 29 additions and 22 deletions
18
app/src/buffer_util.h
Normal file
18
app/src/buffer_util.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef BUFFER_UTIL_H
|
||||
#define BUFFER_UTIL_H
|
||||
|
||||
#include <SDL2/SDL_stdinc.h>
|
||||
|
||||
static inline void buffer_write16be(Uint8 *buf, Uint16 value) {
|
||||
buf[0] = value >> 8;
|
||||
buf[1] = value;
|
||||
}
|
||||
|
||||
static inline void buffer_write32be(Uint8 *buf, Uint32 value) {
|
||||
buf[0] = value >> 24;
|
||||
buf[1] = value >> 16;
|
||||
buf[2] = value >> 8;
|
||||
buf[3] = value;
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue