mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Replace SDL types by C99 standard types
Scrcpy is a C11 project. Use the C99 standard types instead of the
SDL-specific types:
SDL_bool -> bool
SintXX -> intXX_t
UintXX -> uintXX_t
This commit is contained in:
parent
8655ba7197
commit
dfed1b250e
40 changed files with 456 additions and 438 deletions
|
|
@ -1,13 +1,13 @@
|
|||
#include "device.h"
|
||||
#include "log.h"
|
||||
|
||||
SDL_bool
|
||||
bool
|
||||
device_read_info(socket_t device_socket, char *device_name, struct size *size) {
|
||||
unsigned char buf[DEVICE_NAME_FIELD_LENGTH + 4];
|
||||
int r = net_recv_all(device_socket, buf, sizeof(buf));
|
||||
if (r < DEVICE_NAME_FIELD_LENGTH + 4) {
|
||||
LOGE("Could not retrieve device information");
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
// in case the client sends garbage
|
||||
buf[DEVICE_NAME_FIELD_LENGTH - 1] = '\0';
|
||||
|
|
@ -18,5 +18,5 @@ device_read_info(socket_t device_socket, char *device_name, struct size *size) {
|
|||
| buf[DEVICE_NAME_FIELD_LENGTH + 1];
|
||||
size->height = (buf[DEVICE_NAME_FIELD_LENGTH + 2] << 8)
|
||||
| buf[DEVICE_NAME_FIELD_LENGTH + 3];
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue