1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +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:
Rémi Verschelde
2017-03-19 00:36:26 +01:00
parent 1d418afe86
commit f8db8a3faa
1308 changed files with 147754 additions and 174357 deletions

View File

@@ -36,10 +36,9 @@
Error SemaphorePosix::wait() {
while(sem_wait(&sem)) {
if (errno==EINTR) {
errno=0;
while (sem_wait(&sem)) {
if (errno == EINTR) {
errno = 0;
continue;
} else {
perror("sem waiting");
@@ -51,39 +50,36 @@ Error SemaphorePosix::wait() {
Error SemaphorePosix::post() {
return (sem_post(&sem)==0)?OK:ERR_BUSY;
return (sem_post(&sem) == 0) ? OK : ERR_BUSY;
}
int SemaphorePosix::get() const {
int val;
sem_getvalue(&sem, &val);
return val;
}
return val;
}
Semaphore *SemaphorePosix::create_semaphore_posix() {
return memnew( SemaphorePosix );
return memnew(SemaphorePosix);
}
void SemaphorePosix::make_default() {
create_func=create_semaphore_posix;
create_func = create_semaphore_posix;
}
SemaphorePosix::SemaphorePosix() {
int r = sem_init(&sem,0,0);
int r = sem_init(&sem, 0, 0);
if (r != 0)
perror("sem creating");
}
SemaphorePosix::~SemaphorePosix() {
sem_destroy(&sem);
}
#endif