Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
da186818
Commit
da186818
authored
Sep 19, 2019
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed compilation warning in sev_dbms.
parent
c9ee7d02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
32 deletions
+32
-32
sev/lib/sev/src/sev_dbms.cpp
sev/lib/sev/src/sev_dbms.cpp
+32
-32
No files found.
sev/lib/sev/src/sev_dbms.cpp
View file @
da186818
...
...
@@ -2020,11 +2020,11 @@ int sev_dbms::get_values(pwr_tStatus* sts, void* thread, pwr_tOid oid,
thread
,
item
.
tablename
,
item
.
options
,
starttime
,
1
,
&
startid
);
if
(
*
sts
==
SEV__NOROWS
)
get_id_range
(
sts
,
thread
,
&
item
,
item
.
options
,
&
startid
,
0
);
get_id_value
(
thread
,
item
.
tablename
,
startid
,
type
,
size
,
get_id_value
(
thread
,
item
.
tablename
,
startid
,
type
,
size
,
startval
);
startvalue
=
startval
;
}
else
{
}
else
{
// Get id for starttime
*
sts
=
get_closest_time
(
thread
,
item
.
tablename
,
item
.
options
,
starttime
,
1
,
&
startid
);
...
...
@@ -4043,7 +4043,7 @@ int sev_dbms::get_closest_time(void* thread, char* tablename,
}
int
sev_dbms
::
get_id_value
(
void
*
thread
,
char
*
tablename
,
unsigned
int
id
,
pwr_eType
type
,
int
size
,
unsigned
int
id
,
pwr_eType
type
,
int
size
,
void
*
value
)
{
char
query
[
200
];
...
...
@@ -4717,9 +4717,9 @@ int sev_dbms::handle_objectchange(
}
int
sev_dbms
::
get_events
(
pwr_tStatus
*
sts
,
void
*
thread
,
pwr_tOid
oid
,
pwr_tMask
options
,
pwr_tMask
eventtypemask
,
pwr_tMask
options
,
pwr_tMask
eventtypemask
,
pwr_tMask
eventpriomask
,
char
*
eventtext
,
char
*
eventname
,
pwr_tTime
*
starttime
,
pwr_tTime
*
endtime
,
unsigned
int
numevents
,
pwr_tTime
*
starttime
,
pwr_tTime
*
endtime
,
unsigned
int
numevents
,
std
::
vector
<
sev_event
>
&
list
)
{
sev_item
item
;
...
...
@@ -4728,7 +4728,7 @@ int sev_dbms::get_events(pwr_tStatus *sts, void *thread, pwr_tOid oid,
return
0
;
}
char
query
[
7
00
];
char
query
[
13
00
];
char
starttimstr
[
40
];
char
endtimstr
[
40
];
pwr_tTime
stime
,
etime
;
...
...
@@ -4839,140 +4839,140 @@ int sev_dbms::get_events(pwr_tStatus *sts, void *thread, pwr_tOid oid,
if
(
eventtypemask
)
{
bool
first
=
true
;
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" and ("
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" and ("
);
if
(
eventtypemask
&
sev_mEventType_Ack
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_Ack
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_Block
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_Block
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_Cancel
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_Cancel
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_CancelBlock
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_CancelBlock
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_Missing
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_Missing
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_Reblock
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_Reblock
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_Return
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_Return
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_Unblock
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_Unblock
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_InfoSuccess
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_InfoSuccess
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_Alarm
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_Alarm
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_MaintenanceAlarm
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_MaintenanceAlarm
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_SystemAlarm
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_SystemAlarm
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_UserAlarm1
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_UserAlarm1
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_UserAlarm2
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_UserAlarm2
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_UserAlarm3
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_UserAlarm3
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_UserAlarm4
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_UserAlarm4
);
first
=
false
;
}
if
(
eventtypemask
&
sev_mEventType_Info
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventtype = %d"
,
mh_eEvent_Info
);
first
=
false
;
}
sprintf
(
&
where_part
[
strlen
(
where_part
)],
")"
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
")"
);
}
if
(
eventpriomask
)
{
bool
first
=
true
;
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" and ("
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" and ("
);
if
(
eventpriomask
&
sev_mEventPrio_A
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventprio = %d"
,
mh_eEventPrio_A
);
first
=
false
;
}
if
(
eventpriomask
&
sev_mEventPrio_B
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventprio = %d"
,
mh_eEventPrio_B
);
first
=
false
;
}
if
(
eventpriomask
&
sev_mEventPrio_C
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventprio = %d"
,
mh_eEventPrio_C
);
first
=
false
;
}
if
(
eventpriomask
&
sev_mEventPrio_D
)
{
if
(
!
first
)
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
" or "
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
"eventprio = %d"
,
mh_eEventPrio_C
);
first
=
false
;
}
sprintf
(
&
where_part
[
strlen
(
where_part
)],
")"
);
sprintf
(
&
where_part
[
strlen
(
where_part
)],
")"
);
}
if
(
!
streq
(
eventtext
,
""
))
...
...
@@ -5045,7 +5045,7 @@ int sev_dbms::get_events(pwr_tStatus *sts, void *thread, pwr_tOid oid,
strncpy
(
e
.
eventname
,
row
[
j
++
],
sizeof
(
e
.
eventname
));
list
.
push_back
(
e
);
}
printf
(
"ecnt %d
\n
"
,
list
.
size
());
printf
(
"ecnt %
l
d
\n
"
,
list
.
size
());
mysql_free_result
(
result
);
*
sts
=
SEV__SUCCESS
;
...
...
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