Skip to content

Commit 6c1aa3d

Browse files
committed
Cleanup: Run clang-format
1 parent 379b802 commit 6c1aa3d

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/rtapi/uspace_rtapi_app.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ WithRoot::~WithRoot() {
4141
}
4242
}
4343

44-
void WithRoot::init(uid_t ruid_ini, uid_t euid_ini){
45-
ruid=ruid_ini;
46-
euid=euid_ini;
44+
void WithRoot::init(uid_t ruid_ini, uid_t euid_ini) {
45+
ruid = ruid_ini;
46+
euid = euid_ini;
4747
}
4848

4949
rtapi_task::rtapi_task()

src/rtapi/uspace_rtapi_app.hh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@ struct WithRoot {
4747
WithRoot();
4848
~WithRoot();
4949
static void init(uid_t ruid_ini, uid_t euid_ini);
50-
static uid_t getRuid(){
50+
static uid_t getRuid() {
5151
return ruid;
5252
}
53-
static uid_t getEuid(){
53+
static uid_t getEuid() {
5454
return euid;
5555
}
56-
private:
56+
57+
private:
5758
static std::atomic_int level;
5859
static uid_t ruid, euid;
5960
};

src/rtapi/uspace_rtapi_main.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,13 @@ static bool get_fifo_path_to_addr(struct sockaddr_un *addr) {
513513
}
514514
//See: https://www.man7.org/linux/man-pages/man7/unix.7.html abstract
515515
//sun_path[0] is a null byte ('\0')
516-
addr->sun_path[0]=0;
516+
addr->sun_path[0] = 0;
517517
strncpy(addr->sun_path + 1, s.c_str(), sizeof(addr->sun_path) - 2);
518518
return true;
519519
}
520520

521521
static double diff_timespec(const struct timespec *time1, const struct timespec *time0) {
522-
return (time1->tv_sec - time0->tv_sec) + (time1->tv_nsec - time0->tv_nsec) / 1000000000.0;
522+
return (time1->tv_sec - time0->tv_sec) + (time1->tv_nsec - time0->tv_nsec) / 1000000000.0;
523523
}
524524

525525
int main(int argc, char **argv) {
@@ -597,11 +597,11 @@ int main(int argc, char **argv) {
597597
clock_gettime(CLOCK_MONOTONIC, &start);
598598
clock_gettime(CLOCK_MONOTONIC, &now);
599599
srand48(start.tv_sec ^ start.tv_nsec);
600-
while(diff_timespec(&now, &start) < 3.0) {
600+
while (diff_timespec(&now, &start) < 3.0) {
601601
result = connect(fd, (sockaddr *)&addr, sizeof(addr));
602602
if (result == 0)
603603
break;
604-
604+
605605
usleep(lrand48() % 100000 + 100); //Random sleep min 100us max 100100us
606606
clock_gettime(CLOCK_MONOTONIC, &now);
607607
}

0 commit comments

Comments
 (0)