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:
@@ -73,7 +73,7 @@ end:
|
||||
return ret;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
bool
|
||||
cmd_terminate(pid_t pid) {
|
||||
if (pid <= 0) {
|
||||
LOGC("Requested to kill %d, this is an error. Please report the bug.\n",
|
||||
@@ -83,7 +83,7 @@ cmd_terminate(pid_t pid) {
|
||||
return kill(pid, SIGTERM) != -1;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
bool
|
||||
cmd_simple_wait(pid_t pid, int *exit_code) {
|
||||
int status;
|
||||
int code;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "net.h"
|
||||
|
||||
# include <unistd.h>
|
||||
#include <unistd.h>
|
||||
|
||||
SDL_bool
|
||||
bool
|
||||
net_init(void) {
|
||||
// do nothing
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -13,7 +13,7 @@ net_cleanup(void) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
bool
|
||||
net_close(socket_t socket) {
|
||||
return !close(socket);
|
||||
}
|
||||
|
||||
@@ -57,12 +57,12 @@ cmd_execute(const char *path, const char *const argv[], HANDLE *handle) {
|
||||
return PROCESS_SUCCESS;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
bool
|
||||
cmd_terminate(HANDLE handle) {
|
||||
return TerminateProcess(handle, 1) && CloseHandle(handle);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
bool
|
||||
cmd_simple_wait(HANDLE handle, DWORD *exit_code) {
|
||||
DWORD code;
|
||||
if (WaitForSingleObject(handle, INFINITE) != WAIT_OBJECT_0
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
#include "log.h"
|
||||
|
||||
SDL_bool
|
||||
bool
|
||||
net_init(void) {
|
||||
WSADATA wsa;
|
||||
int res = WSAStartup(MAKEWORD(2, 2), &wsa) < 0;
|
||||
if (res < 0) {
|
||||
LOGC("WSAStartup failed with error %d", res);
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -18,7 +18,7 @@ net_cleanup(void) {
|
||||
WSACleanup();
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
bool
|
||||
net_close(socket_t socket) {
|
||||
return !closesocket(socket);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user