Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
9517a0db
Commit
9517a0db
authored
5 years ago
by
Markus Frank
Committed by
MarkusFrankATcernch
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add unsigned long type to grammars
parent
28750de6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DDCore/src/IOV.cpp
+11
-8
11 additions, 8 deletions
DDCore/src/IOV.cpp
with
11 additions
and
8 deletions
DDCore/src/IOV.cpp
+
11
−
8
View file @
9517a0db
...
...
@@ -137,34 +137,37 @@ void IOV::move(IOV& from) {
string
IOV
::
str
()
const
{
char
text
[
256
];
if
(
iovType
)
{
/// Need the long(x) casts for compatibility with Apple MAC
if
(
iovType
->
name
[
0
]
!=
'e'
)
{
::
snprintf
(
text
,
sizeof
(
text
),
"%s(%u):[%ld-%ld]"
,
iovType
->
name
.
c_str
(),
iovType
->
type
,
keyData
.
first
,
keyData
.
second
);
iovType
->
name
.
c_str
(),
iovType
->
type
,
long
(
keyData
.
first
)
,
long
(
keyData
.
second
)
)
;
}
else
if
(
iovType
->
name
==
"epoch"
)
{
struct
tm
time_buff
;
char
c_since
[
64
],
c_until
[
64
];
static
constexpr
const
Key_value_type
nil
=
0
;
static
const
Key_value_type
max_time
=
detail
::
makeTime
(
2099
,
12
,
31
,
24
,
59
,
59
);
time_t
since
=
std
::
min
(
std
::
max
(
keyData
.
first
,
0L
),
max_time
);
time_t
until
=
std
::
min
(
std
::
max
(
keyData
.
second
,
0L
),
max_time
);
time_t
since
=
std
::
min
(
std
::
max
(
keyData
.
first
,
nil
),
max_time
);
time_t
until
=
std
::
min
(
std
::
max
(
keyData
.
second
,
nil
),
max_time
);
struct
tm
*
tm_since
=
::
gmtime_r
(
&
since
,
&
time_buff
);
struct
tm
*
tm_until
=
::
gmtime_r
(
&
until
,
&
time_buff
);
if
(
nullptr
==
tm_since
||
nullptr
==
tm_until
)
{
except
(
"IOV::str"
,
" Invalid epoch time stamp: %d:[%ld-%ld]"
,
type
,
keyData
.
first
,
keyData
.
second
);
except
(
"IOV::str"
,
" Invalid epoch time stamp: %d:[%ld-%ld]"
,
type
,
long
(
keyData
.
first
),
long
(
keyData
.
second
));
}
::
strftime
(
c_since
,
sizeof
(
c_since
),
"%d-%m-%Y %H:%M:%S"
,
tm_since
);
::
strftime
(
c_until
,
sizeof
(
c_until
),
"%d-%m-%Y %H:%M:%S"
,
tm_until
);
::
snprintf
(
text
,
sizeof
(
text
),
"%s(%
d
):[%s - %s]"
,
iovType
->
name
.
c_str
(),
iovType
->
type
,
::
snprintf
(
text
,
sizeof
(
text
),
"%s(%
u
):[%s - %s]"
,
iovType
->
name
.
c_str
(),
iovType
->
type
,
c_since
,
c_until
);
}
else
{
::
snprintf
(
text
,
sizeof
(
text
),
"%s(%u):[%ld-%ld]"
,
iovType
->
name
.
c_str
(),
iovType
->
type
,
keyData
.
first
,
keyData
.
second
);
iovType
->
name
.
c_str
(),
iovType
->
type
,
long
(
keyData
.
first
)
,
long
(
keyData
.
second
)
)
;
}
}
else
{
::
snprintf
(
text
,
sizeof
(
text
),
"%u:[%ld-%ld]"
,
type
,
keyData
.
first
,
keyData
.
second
);
::
snprintf
(
text
,
sizeof
(
text
),
"%u:[%ld-%ld]"
,
type
,
long
(
keyData
.
first
)
,
long
(
keyData
.
second
)
)
;
}
return
text
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment