Skip to content

Commit 8b68e9f

Browse files
committed
Applying Google C++ Style Guide
1 parent 8e2717f commit 8b68e9f

File tree

179 files changed

+291
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+291
-231
lines changed

common/include/common/firmware/jamstapl/handleroled.h

100755100644
File mode changed.

common/include/common/firmware/pixeldmx/show.h

100755100644
File mode changed.

common/include/common/utils/utils_array.h

100755100644
File mode changed.

common/make/DmxNodeNodeType.mk

100755100644
File mode changed.

common/make/DmxNodeOutputType.mk

100755100644
File mode changed.

common/make/Extra.mk

100755100644
File mode changed.

lib-clib/src/atexit.cpp

100755100644
File mode changed.

lib-clib/src/malloc.cpp

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
namespace console
4747
{
48-
void ConsoleError(const char*);
48+
void Error(const char*);
4949
}
5050

5151
void debug_heap();
@@ -150,7 +150,7 @@ extern "C"
150150

151151
if (next > block_limit)
152152
{
153-
console::ConsoleError("malloc: out of memory\n");
153+
console::Error("malloc: out of memory\n");
154154
#ifdef DEBUG_HEAP
155155
debug_heap();
156156
#endif

lib-clib/src/perror.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
namespace console
3030
{
31-
void ConsoleError(const char*);
31+
void Error(const char*);
3232
int Putc(int);
3333
int Puts(const char*);
3434
} // namespace console
@@ -106,11 +106,11 @@ extern "C"
106106

107107
if (s && *s)
108108
{
109-
console::ConsoleError(s);
109+
console::Error(s);
110110
console::Puts(": ");
111111
}
112112

113-
console::ConsoleError(ptr);
113+
console::Error(ptr);
114114
console::Putc('\n');
115115
}
116116
}

lib-clib/src/time.cpp

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*/
2525

2626
#include <cstdio>
27-
2827
#include <cstddef>
2928
#include <cstdint>
3029
#include <time.h>
@@ -33,22 +32,22 @@ namespace global {
3332
int32_t g_nUtcOffset = 0;
3433
} // namespace global
3534

36-
static constexpr int DAYS_OF_MONTH[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
35+
static constexpr int kDaysOfMonth[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
3736

38-
static int isleapyear(const int year) {
37+
static int Isleapyear(int year) {
3938
if (year % 100 == 0) {
4039
return year % 400 == 0;
4140
}
4241

4342
return year % 4 == 0;
4443
}
4544

46-
static int getdaysofmonth(const int month, const int year) {
47-
if ((month == 1) && isleapyear(year)) {
45+
static int Getdaysofmonth(int month, int year) {
46+
if ((month == 1) && Isleapyear(year)) {
4847
return 29;
4948
}
5049

51-
return DAYS_OF_MONTH[month];
50+
return kDaysOfMonth[month];
5251
}
5352

5453
static struct tm Tm;
@@ -80,41 +79,41 @@ struct tm *gmtime(const time_t *pTime) {
8079

8180
Tm.tm_wday = (nTime + 4) % 7;
8281

83-
int nYear = 1970;
82+
int year = 1970;
8483

8584
while (1) {
86-
const time_t nDaysOfYear = isleapyear(nYear) ? 366 : 365;
85+
const time_t nDaysOfYear = Isleapyear(year) ? 366 : 365;
8786
if (nTime < nDaysOfYear) {
8887
break;
8988
}
9089

9190
nTime -= nDaysOfYear;
92-
nYear++;
91+
year++;
9392
}
9493

95-
Tm.tm_year = nYear - 1900;
94+
Tm.tm_year = year - 1900;
9695
Tm.tm_yday = nTime;
9796

98-
int nMonth = 0;
97+
int month = 0;
9998

10099
while (1) {
101-
const time_t nDaysOfMonth = getdaysofmonth(nMonth, nYear);
100+
const time_t nDaysOfMonth = Getdaysofmonth(month, year);
102101
if (nTime < nDaysOfMonth) {
103102
break;
104103
}
105104

106105
nTime -= nDaysOfMonth;
107-
nMonth++;
106+
month++;
108107
}
109108

110-
Tm.tm_mon = nMonth;
109+
Tm.tm_mon = month;
111110
Tm.tm_mday = nTime + 1;
112111

113112
return &Tm;
114113
}
115114

116115
time_t mktime(struct tm *pTm) {
117-
time_t nResult = 0;
116+
time_t result = 0;
118117

119118
if (pTm == nullptr) {
120119
return -1;
@@ -124,49 +123,49 @@ time_t mktime(struct tm *pTm) {
124123
return -1;
125124
}
126125

127-
int nYear;
126+
int year;
128127

129-
for (nYear = 1970; nYear < 1900 + pTm->tm_year; nYear++) {
130-
nResult += isleapyear(nYear) ? 366 : 365;
128+
for (year = 1970; year < 1900 + pTm->tm_year; year++) {
129+
result += Isleapyear(year) ? 366 : 365;
131130
}
132131

133132
if (pTm->tm_mon < 0 || pTm->tm_mon > 11) {
134133
return -1;
135134
}
136135

137-
int nMonth;
136+
int month;
138137

139-
for (nMonth = 0; nMonth < pTm->tm_mon; nMonth++) {
140-
nResult += getdaysofmonth(nMonth, pTm->tm_year);
138+
for (month = 0; month < pTm->tm_mon; month++) {
139+
result += Getdaysofmonth(month, pTm->tm_year);
141140
}
142141

143-
if (pTm->tm_mday < 1 || pTm->tm_mday > getdaysofmonth(pTm->tm_mon, pTm->tm_year)) {
142+
if (pTm->tm_mday < 1 || pTm->tm_mday > Getdaysofmonth(pTm->tm_mon, pTm->tm_year)) {
144143
return -1;
145144
}
146145

147-
nResult += pTm->tm_mday - 1;
148-
nResult *= 24;
146+
result += pTm->tm_mday - 1;
147+
result *= 24;
149148

150149
if (pTm->tm_hour < 0 || pTm->tm_hour > 23) {
151150
return -1;
152151
}
153152

154-
nResult += pTm->tm_hour;
155-
nResult *= 60;
153+
result += pTm->tm_hour;
154+
result *= 60;
156155

157156
if (pTm->tm_min < 0 || pTm->tm_min > 59) {
158157
return -1;
159158
}
160159

161-
nResult += pTm->tm_min;
162-
nResult *= 60;
160+
result += pTm->tm_min;
161+
result *= 60;
163162

164163
if (pTm->tm_sec < 0 || pTm->tm_sec > 59) {
165164
return -1;
166165
}
167166

168-
nResult += pTm->tm_sec;
167+
result += pTm->tm_sec;
169168

170-
return nResult;
169+
return result;
171170
}
172171
}

0 commit comments

Comments
 (0)