You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
Bring that Whole New World to the Old Continent too
Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
This commit is contained in:
@@ -28,11 +28,10 @@
|
||||
/*************************************************************************/
|
||||
#include "sem_osx.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void cgsem_init(cgsem_t *cgsem)
|
||||
{
|
||||
void cgsem_init(cgsem_t *cgsem) {
|
||||
int flags, fd, i;
|
||||
|
||||
pipe(cgsem->pipefd);
|
||||
@@ -47,31 +46,26 @@ void cgsem_init(cgsem_t *cgsem)
|
||||
}
|
||||
}
|
||||
|
||||
void cgsem_post(cgsem_t *cgsem)
|
||||
{
|
||||
void cgsem_post(cgsem_t *cgsem) {
|
||||
const char buf = 1;
|
||||
|
||||
write(cgsem->pipefd[1], &buf, 1);
|
||||
}
|
||||
|
||||
void cgsem_wait(cgsem_t *cgsem)
|
||||
{
|
||||
void cgsem_wait(cgsem_t *cgsem) {
|
||||
char buf;
|
||||
|
||||
read(cgsem->pipefd[0], &buf, 1);
|
||||
}
|
||||
|
||||
void cgsem_destroy(cgsem_t *cgsem)
|
||||
{
|
||||
void cgsem_destroy(cgsem_t *cgsem) {
|
||||
close(cgsem->pipefd[1]);
|
||||
close(cgsem->pipefd[0]);
|
||||
}
|
||||
|
||||
|
||||
#include "os/memory.h"
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
Error SemaphoreOSX::wait() {
|
||||
|
||||
cgsem_wait(&sem);
|
||||
@@ -89,15 +83,14 @@ int SemaphoreOSX::get() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Semaphore *SemaphoreOSX::create_semaphore_osx() {
|
||||
|
||||
return memnew( SemaphoreOSX );
|
||||
return memnew(SemaphoreOSX);
|
||||
}
|
||||
|
||||
void SemaphoreOSX::make_default() {
|
||||
|
||||
create_func=create_semaphore_osx;
|
||||
create_func = create_semaphore_osx;
|
||||
}
|
||||
|
||||
SemaphoreOSX::SemaphoreOSX() {
|
||||
@@ -105,11 +98,7 @@ SemaphoreOSX::SemaphoreOSX() {
|
||||
cgsem_init(&sem);
|
||||
}
|
||||
|
||||
|
||||
SemaphoreOSX::~SemaphoreOSX() {
|
||||
|
||||
cgsem_destroy(&sem);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user