Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
545f342a
authored
Mar 10, 2015
by
Bernhard Gatzhammer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved codestyle by obeying max characters per line
EMBB-422
parent
64f0de32
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
base_cpp/src/duration.cc
+14
-7
base_cpp/test/duration_test.cc
+6
-3
No files found.
base_cpp/src/duration.cc
View file @
545f342a
...
@@ -44,11 +44,13 @@ void internal::Tick::CheckExceptions(int status, const char* msg) {
...
@@ -44,11 +44,13 @@ void internal::Tick::CheckExceptions(int status, const char* msg) {
}
}
}
}
int
internal
::
Seconds
::
Set
(
embb_duration_t
&
duration
,
unsigned
long
long
ticks
)
{
int
internal
::
Seconds
::
Set
(
embb_duration_t
&
duration
,
unsigned
long
long
ticks
)
{
return
embb_duration_set_seconds
(
&
duration
,
ticks
);
return
embb_duration_set_seconds
(
&
duration
,
ticks
);
}
}
void
internal
::
Seconds
::
SetAndCheck
(
embb_duration_t
&
duration
,
unsigned
long
long
ticks
)
{
void
internal
::
Seconds
::
SetAndCheck
(
embb_duration_t
&
duration
,
unsigned
long
long
ticks
)
{
int
status
=
Set
(
duration
,
ticks
);
int
status
=
Set
(
duration
,
ticks
);
CheckExceptions
(
status
,
"Setting duration from seconds"
);
CheckExceptions
(
status
,
"Setting duration from seconds"
);
}
}
...
@@ -69,7 +71,8 @@ unsigned long long internal::Seconds::Max() {
...
@@ -69,7 +71,8 @@ unsigned long long internal::Seconds::Max() {
return
EMBB_DURATION_MAX_SECONDS
;
return
EMBB_DURATION_MAX_SECONDS
;
}
}
int
internal
::
Milliseconds
::
Set
(
embb_duration_t
&
duration
,
unsigned
long
long
ticks
)
{
int
internal
::
Milliseconds
::
Set
(
embb_duration_t
&
duration
,
unsigned
long
long
ticks
)
{
return
embb_duration_set_milliseconds
(
&
duration
,
ticks
);
return
embb_duration_set_milliseconds
(
&
duration
,
ticks
);
}
}
...
@@ -79,7 +82,8 @@ void internal::Milliseconds::SetAndCheck(
...
@@ -79,7 +82,8 @@ void internal::Milliseconds::SetAndCheck(
CheckExceptions
(
status
,
"Setting duration from milliseconds"
);
CheckExceptions
(
status
,
"Setting duration from milliseconds"
);
}
}
unsigned
long
long
internal
::
Milliseconds
::
Get
(
const
embb_duration_t
&
duration
)
{
unsigned
long
long
internal
::
Milliseconds
::
Get
(
const
embb_duration_t
&
duration
)
{
unsigned
long
long
ticks
=
0
;
unsigned
long
long
ticks
=
0
;
int
status
=
embb_duration_as_milliseconds
(
&
duration
,
&
ticks
);
int
status
=
embb_duration_as_milliseconds
(
&
duration
,
&
ticks
);
assert
(
status
==
EMBB_SUCCESS
);
assert
(
status
==
EMBB_SUCCESS
);
...
@@ -103,7 +107,8 @@ unsigned long long internal::Milliseconds::Max() {
...
@@ -103,7 +107,8 @@ unsigned long long internal::Milliseconds::Max() {
#endif
#endif
}
}
int
internal
::
Microseconds
::
Set
(
embb_duration_t
&
duration
,
unsigned
long
long
ticks
)
{
int
internal
::
Microseconds
::
Set
(
embb_duration_t
&
duration
,
unsigned
long
long
ticks
)
{
return
embb_duration_set_microseconds
(
&
duration
,
ticks
);
return
embb_duration_set_microseconds
(
&
duration
,
ticks
);
}
}
...
@@ -113,7 +118,8 @@ void internal::Microseconds::SetAndCheck(
...
@@ -113,7 +118,8 @@ void internal::Microseconds::SetAndCheck(
CheckExceptions
(
status
,
"Setting duration from microseconds"
);
CheckExceptions
(
status
,
"Setting duration from microseconds"
);
}
}
unsigned
long
long
internal
::
Microseconds
::
Get
(
const
embb_duration_t
&
duration
)
{
unsigned
long
long
internal
::
Microseconds
::
Get
(
const
embb_duration_t
&
duration
)
{
unsigned
long
long
ticks
=
0
;
unsigned
long
long
ticks
=
0
;
int
status
=
embb_duration_as_microseconds
(
&
duration
,
&
ticks
);
int
status
=
embb_duration_as_microseconds
(
&
duration
,
&
ticks
);
...
@@ -139,7 +145,8 @@ unsigned long long internal::Microseconds::Max() {
...
@@ -139,7 +145,8 @@ unsigned long long internal::Microseconds::Max() {
#endif
#endif
}
}
int
internal
::
Nanoseconds
::
Set
(
embb_duration_t
&
duration
,
unsigned
long
long
ticks
)
{
int
internal
::
Nanoseconds
::
Set
(
embb_duration_t
&
duration
,
unsigned
long
long
ticks
)
{
return
embb_duration_set_nanoseconds
(
&
duration
,
ticks
);
return
embb_duration_set_nanoseconds
(
&
duration
,
ticks
);
}
}
...
...
base_cpp/test/duration_test.cc
View file @
545f342a
...
@@ -32,9 +32,12 @@ namespace test {
...
@@ -32,9 +32,12 @@ namespace test {
DurationTest
::
DurationTest
()
{
DurationTest
::
DurationTest
()
{
CreateUnit
(
"Seconds"
).
Add
(
&
DurationTest
::
Test
<
internal
::
Seconds
>
,
this
);
CreateUnit
(
"Seconds"
).
Add
(
&
DurationTest
::
Test
<
internal
::
Seconds
>
,
this
);
CreateUnit
(
"Milliseconds"
).
Add
(
&
DurationTest
::
Test
<
internal
::
Milliseconds
>
,
this
);
CreateUnit
(
"Milliseconds"
).
Add
(
&
DurationTest
::
Test
<
internal
::
Milliseconds
>
,
CreateUnit
(
"Microseconds"
).
Add
(
&
DurationTest
::
Test
<
internal
::
Microseconds
>
,
this
);
this
);
CreateUnit
(
"Nanoseconds"
).
Add
(
&
DurationTest
::
Test
<
internal
::
Nanoseconds
>
,
this
);
CreateUnit
(
"Microseconds"
).
Add
(
&
DurationTest
::
Test
<
internal
::
Microseconds
>
,
this
);
CreateUnit
(
"Nanoseconds"
).
Add
(
&
DurationTest
::
Test
<
internal
::
Nanoseconds
>
,
this
);
}
}
}
// namespace test
}
// namespace test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment