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
70602f40
Commit
70602f40
authored
Sep 12, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed broken if statements: unsigned < 0?
parent
e027861c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
73 additions
and
53 deletions
+73
-53
otherio/lib/rt/src/os_linux/rt_io_m_mb_rtu_server.c
otherio/lib/rt/src/os_linux/rt_io_m_mb_rtu_server.c
+4
-2
otherio/lib/rt/src/os_linux/rt_io_m_mb_tcp_server.c
otherio/lib/rt/src/os_linux/rt_io_m_mb_tcp_server.c
+4
-2
otherio/lib/rt/src/os_linux/rt_io_m_usb_joystick.c
otherio/lib/rt/src/os_linux/rt_io_m_usb_joystick.c
+5
-1
sev/lib/sev/src/sev_dbhdf5.cpp
sev/lib/sev/src/sev_dbhdf5.cpp
+8
-4
sev/lib/sev/src/sev_dbms.cpp
sev/lib/sev/src/sev_dbms.cpp
+24
-20
sev/lib/sev/src/sev_dbsqlite.cpp
sev/lib/sev/src/sev_dbsqlite.cpp
+24
-20
src/lib/co/src/co_xdr.c
src/lib/co/src/co_xdr.c
+3
-3
xtt/lib/xtt/src/xtt_xnav_command.cpp
xtt/lib/xtt/src/xtt_xnav_command.cpp
+1
-1
No files found.
otherio/lib/rt/src/os_linux/rt_io_m_mb_rtu_server.c
View file @
70602f40
...
@@ -1137,7 +1137,8 @@ static void mb_shift_write(
...
@@ -1137,7 +1137,8 @@ static void mb_shift_write(
for
(
i
=
0
;
i
<
(
quant
+
sh
)
/
8
;
i
++
)
{
for
(
i
=
0
;
i
<
(
quant
+
sh
)
/
8
;
i
++
)
{
if
(
i
==
0
)
{
if
(
i
==
0
)
{
unsigned
char
mask
=
~
0
<<
sh
;
unsigned
char
mask
=
~
0
;
mask
=
mask
<<
sh
;
out
[
0
]
&=
~
mask
;
out
[
0
]
&=
~
mask
;
out
[
0
]
|=
mask
&
(
in
[
0
]
<<
sh
);
out
[
0
]
|=
mask
&
(
in
[
0
]
<<
sh
);
...
@@ -1147,7 +1148,8 @@ static void mb_shift_write(
...
@@ -1147,7 +1148,8 @@ static void mb_shift_write(
}
}
}
}
if
((
quant
+
sh
)
%
8
!=
0
)
{
if
((
quant
+
sh
)
%
8
!=
0
)
{
unsigned
char
mask
=
~
0
<<
((
quant
+
sh
)
%
8
);
unsigned
char
mask
=
~
0
;
mask
=
mask
<<
((
quant
+
sh
)
%
8
);
mask
=
~
mask
;
mask
=
~
mask
;
out
[
i
]
&=
~
mask
;
out
[
i
]
&=
~
mask
;
...
...
otherio/lib/rt/src/os_linux/rt_io_m_mb_tcp_server.c
View file @
70602f40
...
@@ -986,7 +986,8 @@ static void mb_shift_write(
...
@@ -986,7 +986,8 @@ static void mb_shift_write(
for
(
i
=
0
;
i
<
(
quant
+
sh
)
/
8
;
i
++
)
{
for
(
i
=
0
;
i
<
(
quant
+
sh
)
/
8
;
i
++
)
{
if
(
i
==
0
)
{
if
(
i
==
0
)
{
unsigned
char
mask
=
~
0
<<
sh
;
unsigned
char
mask
=
~
0
;
mask
=
mask
<<
sh
;
out
[
0
]
&=
~
mask
;
out
[
0
]
&=
~
mask
;
out
[
0
]
|=
mask
&
(
in
[
0
]
<<
sh
);
out
[
0
]
|=
mask
&
(
in
[
0
]
<<
sh
);
...
@@ -996,7 +997,8 @@ static void mb_shift_write(
...
@@ -996,7 +997,8 @@ static void mb_shift_write(
}
}
}
}
if
((
quant
+
sh
)
%
8
!=
0
)
{
if
((
quant
+
sh
)
%
8
!=
0
)
{
unsigned
char
mask
=
~
0
<<
((
quant
+
sh
)
%
8
);
unsigned
char
mask
=
~
0
;
mask
=
mask
<<
((
quant
+
sh
)
%
8
);
mask
=
~
mask
;
mask
=
~
mask
;
out
[
i
]
&=
~
mask
;
out
[
i
]
&=
~
mask
;
...
...
otherio/lib/rt/src/os_linux/rt_io_m_usb_joystick.c
View file @
70602f40
...
@@ -273,9 +273,13 @@ static pwr_tStatus IoCardRead(
...
@@ -273,9 +273,13 @@ static pwr_tStatus IoCardRead(
/* Buttons */
/* Buttons */
idx
=
js
.
number
;
idx
=
js
.
number
;
/*
// TODO:
// js.number is an unsigned 8-bit, which has a maximum value of 256.
// KEY_MAX - BTN_MISC = 511, so this is always false.
if (js.number < KEY_MAX - BTN_MISC)
if (js.number < KEY_MAX - BTN_MISC)
idx = local->button_map[js.number];
idx = local->button_map[js.number];
else
else
*/
break
;
break
;
*
(
pwr_tBoolean
*
)
cp
->
chanlist
[
idx
].
vbp
=
(
js
.
value
!=
0
);
*
(
pwr_tBoolean
*
)
cp
->
chanlist
[
idx
].
vbp
=
(
js
.
value
!=
0
);
...
...
sev/lib/sev/src/sev_dbhdf5.cpp
View file @
70602f40
...
@@ -4595,23 +4595,27 @@ int sev_dbhdf5::check_deadband(pwr_eType type, unsigned int size,
...
@@ -4595,23 +4595,27 @@ int sev_dbhdf5::check_deadband(pwr_eType type, unsigned int size,
}
}
break
;
break
;
case
pwr_eType_UInt64
:
case
pwr_eType_UInt64
:
if
(
ABS
(
*
(
pwr_tUInt64
*
)
value
-
*
(
pwr_tUInt64
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt64
)(
*
(
pwr_tUInt64
*
)
value
-
*
(
pwr_tUInt64
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
case
pwr_eType_UInt32
:
case
pwr_eType_UInt32
:
case
pwr_eType_Boolean
:
case
pwr_eType_Boolean
:
if
(
ABS
(
*
(
pwr_tUInt32
*
)
value
-
*
(
pwr_tUInt32
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt32
)(
*
(
pwr_tUInt32
*
)
value
-
*
(
pwr_tUInt32
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
case
pwr_eType_UInt16
:
case
pwr_eType_UInt16
:
if
(
ABS
(
*
(
pwr_tUInt16
*
)
value
-
*
(
pwr_tUInt16
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt16
)(
*
(
pwr_tUInt16
*
)
value
-
*
(
pwr_tUInt16
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
case
pwr_eType_UInt8
:
case
pwr_eType_UInt8
:
if
(
ABS
(
*
(
pwr_tUInt8
*
)
value
-
*
(
pwr_tUInt8
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt8
)(
*
(
pwr_tUInt8
*
)
value
-
*
(
pwr_tUInt8
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
...
...
sev/lib/sev/src/sev_dbms.cpp
View file @
70602f40
...
@@ -1323,8 +1323,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
...
@@ -1323,8 +1323,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt64
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt64
)))
||
(
ABS
(
*
(
pwr_tUInt64
*
)
buf
||
(
ABS
(
((
pwr_tInt64
)(
*
(
pwr_tUInt64
*
)
buf
-
*
(
pwr_tUInt64
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt64
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
update_time_only
=
1
;
update_time_only
=
1
;
}
else
{
}
else
{
...
@@ -1337,8 +1337,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
...
@@ -1337,8 +1337,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt32
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt32
)))
||
(
ABS
(
*
(
pwr_tUInt32
*
)
buf
||
(
ABS
(
((
pwr_tInt32
)(
*
(
pwr_tUInt32
*
)
buf
-
*
(
pwr_tUInt32
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt32
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
update_time_only
=
1
;
update_time_only
=
1
;
}
else
{
}
else
{
...
@@ -1350,8 +1350,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
...
@@ -1350,8 +1350,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt16
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt16
)))
||
(
ABS
(
*
(
pwr_tUInt16
*
)
buf
||
(
ABS
(
((
pwr_tInt16
)(
*
(
pwr_tUInt16
*
)
buf
-
*
(
pwr_tUInt16
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt16
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
update_time_only
=
1
;
update_time_only
=
1
;
}
else
{
}
else
{
...
@@ -1363,8 +1363,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
...
@@ -1363,8 +1363,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt8
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt8
)))
||
(
ABS
(
*
(
pwr_tUInt8
*
)
buf
||
(
ABS
(
((
pwr_tInt8
)(
*
(
pwr_tUInt8
*
)
buf
-
*
(
pwr_tUInt8
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt8
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
update_time_only
=
1
;
update_time_only
=
1
;
}
else
{
}
else
{
...
@@ -1464,8 +1464,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
...
@@ -1464,8 +1464,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt64
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt64
)))
||
(
ABS
(
*
(
pwr_tUInt64
*
)
buf
||
(
ABS
(
((
pwr_tInt64
)(
*
(
pwr_tUInt64
*
)
buf
-
*
(
pwr_tUInt64
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt64
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
m_items
[
item_idx
].
deadband_active
=
1
;
m_items
[
item_idx
].
deadband_active
=
1
;
set_jump
=
1
;
set_jump
=
1
;
...
@@ -1477,8 +1477,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
...
@@ -1477,8 +1477,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt32
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt32
)))
||
(
ABS
(
*
(
pwr_tUInt32
*
)
buf
||
(
ABS
(
((
pwr_tInt32
)(
*
(
pwr_tUInt32
*
)
buf
-
*
(
pwr_tUInt32
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt32
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
m_items
[
item_idx
].
deadband_active
=
1
;
m_items
[
item_idx
].
deadband_active
=
1
;
set_jump
=
1
;
set_jump
=
1
;
...
@@ -1489,8 +1489,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
...
@@ -1489,8 +1489,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt16
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt16
)))
||
(
ABS
(
*
(
pwr_tUInt16
*
)
buf
||
(
ABS
(
((
pwr_tInt16
)(
*
(
pwr_tUInt16
*
)
buf
-
*
(
pwr_tUInt16
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt16
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
m_items
[
item_idx
].
deadband_active
=
1
;
m_items
[
item_idx
].
deadband_active
=
1
;
set_jump
=
1
;
set_jump
=
1
;
...
@@ -1501,8 +1501,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
...
@@ -1501,8 +1501,8 @@ int sev_dbms::write_value(pwr_tStatus* sts, int item_idx, int attr_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt8
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt8
)))
||
(
ABS
(
*
(
pwr_tUInt8
*
)
buf
||
(
ABS
(
((
pwr_tInt8
)(
*
(
pwr_tUInt8
*
)
buf
-
*
(
pwr_tUInt8
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt8
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
m_items
[
item_idx
].
deadband_active
=
1
;
m_items
[
item_idx
].
deadband_active
=
1
;
set_jump
=
1
;
set_jump
=
1
;
...
@@ -3893,23 +3893,27 @@ int sev_dbms::check_deadband(pwr_eType type, unsigned int size,
...
@@ -3893,23 +3893,27 @@ int sev_dbms::check_deadband(pwr_eType type, unsigned int size,
}
}
break
;
break
;
case
pwr_eType_UInt64
:
case
pwr_eType_UInt64
:
if
(
ABS
(
*
(
pwr_tUInt64
*
)
value
-
*
(
pwr_tUInt64
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt64
)(
*
(
pwr_tUInt64
*
)
value
-
*
(
pwr_tUInt64
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
case
pwr_eType_UInt32
:
case
pwr_eType_UInt32
:
case
pwr_eType_Boolean
:
case
pwr_eType_Boolean
:
if
(
ABS
(
*
(
pwr_tUInt32
*
)
value
-
*
(
pwr_tUInt32
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt32
)(
*
(
pwr_tUInt32
*
)
value
-
*
(
pwr_tUInt32
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
case
pwr_eType_UInt16
:
case
pwr_eType_UInt16
:
if
(
ABS
(
*
(
pwr_tUInt16
*
)
value
-
*
(
pwr_tUInt16
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt16
)(
*
(
pwr_tUInt16
*
)
value
-
*
(
pwr_tUInt16
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
case
pwr_eType_UInt8
:
case
pwr_eType_UInt8
:
if
(
ABS
(
*
(
pwr_tUInt8
*
)
value
-
*
(
pwr_tUInt8
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt8
)(
*
(
pwr_tUInt8
*
)
value
-
*
(
pwr_tUInt8
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
...
...
sev/lib/sev/src/sev_dbsqlite.cpp
View file @
70602f40
...
@@ -703,8 +703,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
...
@@ -703,8 +703,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt64
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt64
)))
||
(
ABS
(
*
(
pwr_tUInt64
*
)
buf
||
(
ABS
(
((
pwr_tInt64
)(
*
(
pwr_tUInt64
*
)
buf
-
*
(
pwr_tUInt64
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt64
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
update_time_only
=
1
;
update_time_only
=
1
;
}
else
{
}
else
{
...
@@ -717,8 +717,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
...
@@ -717,8 +717,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt32
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt32
)))
||
(
ABS
(
*
(
pwr_tUInt32
*
)
buf
||
(
ABS
(
((
pwr_tInt32
)(
*
(
pwr_tUInt32
*
)
buf
-
*
(
pwr_tUInt32
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt32
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
update_time_only
=
1
;
update_time_only
=
1
;
}
else
{
}
else
{
...
@@ -730,8 +730,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
...
@@ -730,8 +730,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt16
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt16
)))
||
(
ABS
(
*
(
pwr_tUInt16
*
)
buf
||
(
ABS
(
((
pwr_tInt16
)(
*
(
pwr_tUInt16
*
)
buf
-
*
(
pwr_tUInt16
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt16
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
update_time_only
=
1
;
update_time_only
=
1
;
}
else
{
}
else
{
...
@@ -743,8 +743,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
...
@@ -743,8 +743,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt8
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt8
)))
||
(
ABS
(
*
(
pwr_tUInt8
*
)
buf
||
(
ABS
(
((
pwr_tInt8
)(
*
(
pwr_tUInt8
*
)
buf
-
*
(
pwr_tUInt8
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt8
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
update_time_only
=
1
;
update_time_only
=
1
;
}
else
{
}
else
{
...
@@ -844,8 +844,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
...
@@ -844,8 +844,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt64
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt64
)))
||
(
ABS
(
*
(
pwr_tUInt64
*
)
buf
||
(
ABS
(
((
pwr_tInt64
)(
*
(
pwr_tUInt64
*
)
buf
-
*
(
pwr_tUInt64
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt64
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
m_items
[
item_idx
].
deadband_active
=
1
;
m_items
[
item_idx
].
deadband_active
=
1
;
set_jump
=
1
;
set_jump
=
1
;
...
@@ -857,8 +857,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
...
@@ -857,8 +857,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt32
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt32
)))
||
(
ABS
(
*
(
pwr_tUInt32
*
)
buf
||
(
ABS
(
((
pwr_tInt32
)(
*
(
pwr_tUInt32
*
)
buf
-
*
(
pwr_tUInt32
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt32
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
m_items
[
item_idx
].
deadband_active
=
1
;
m_items
[
item_idx
].
deadband_active
=
1
;
set_jump
=
1
;
set_jump
=
1
;
...
@@ -869,8 +869,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
...
@@ -869,8 +869,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt16
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt16
)))
||
(
ABS
(
*
(
pwr_tUInt16
*
)
buf
||
(
ABS
(
((
pwr_tInt16
)(
*
(
pwr_tUInt16
*
)
buf
-
*
(
pwr_tUInt16
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt16
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
m_items
[
item_idx
].
deadband_active
=
1
;
m_items
[
item_idx
].
deadband_active
=
1
;
set_jump
=
1
;
set_jump
=
1
;
...
@@ -881,8 +881,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
...
@@ -881,8 +881,8 @@ int sev_dbsqlite::store_value(pwr_tStatus* sts, void* thread, int item_idx,
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
if
((
feqf
(
m_items
[
item_idx
].
deadband
,
0.0
f
)
&&
!
memcmp
(
&&
!
memcmp
(
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt8
)))
buf
,
m_items
[
item_idx
].
old_value
,
sizeof
(
pwr_tUInt8
)))
||
(
ABS
(
*
(
pwr_tUInt8
*
)
buf
||
(
ABS
(
((
pwr_tInt8
)(
*
(
pwr_tUInt8
*
)
buf
-
*
(
pwr_tUInt8
*
)
m_items
[
item_idx
].
old_value
)
-
*
(
pwr_tUInt8
*
)
m_items
[
item_idx
].
old_value
)
))
<
m_items
[
item_idx
].
deadband
))
{
<
m_items
[
item_idx
].
deadband
))
{
m_items
[
item_idx
].
deadband_active
=
1
;
m_items
[
item_idx
].
deadband_active
=
1
;
set_jump
=
1
;
set_jump
=
1
;
...
@@ -2812,23 +2812,27 @@ int sev_dbsqlite::check_deadband(pwr_eType type, unsigned int size,
...
@@ -2812,23 +2812,27 @@ int sev_dbsqlite::check_deadband(pwr_eType type, unsigned int size,
}
}
break
;
break
;
case
pwr_eType_UInt64
:
case
pwr_eType_UInt64
:
if
(
ABS
(
*
(
pwr_tUInt64
*
)
value
-
*
(
pwr_tUInt64
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt64
)(
*
(
pwr_tUInt64
*
)
value
-
*
(
pwr_tUInt64
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
case
pwr_eType_UInt32
:
case
pwr_eType_UInt32
:
case
pwr_eType_Boolean
:
case
pwr_eType_Boolean
:
if
(
ABS
(
*
(
pwr_tUInt32
*
)
value
-
*
(
pwr_tUInt32
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt32
)(
*
(
pwr_tUInt32
*
)
value
-
*
(
pwr_tUInt32
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
case
pwr_eType_UInt16
:
case
pwr_eType_UInt16
:
if
(
ABS
(
*
(
pwr_tUInt16
*
)
value
-
*
(
pwr_tUInt16
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt16
)(
*
(
pwr_tUInt16
*
)
value
-
*
(
pwr_tUInt16
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
case
pwr_eType_UInt8
:
case
pwr_eType_UInt8
:
if
(
ABS
(
*
(
pwr_tUInt8
*
)
value
-
*
(
pwr_tUInt8
*
)
oldvalue
)
<
deadband
)
{
if
(
ABS
(((
pwr_tInt8
)(
*
(
pwr_tUInt8
*
)
value
-
*
(
pwr_tUInt8
*
)
oldvalue
)))
<
deadband
)
{
deadband_active
=
1
;
deadband_active
=
1
;
}
}
break
;
break
;
...
...
src/lib/co/src/co_xdr.c
View file @
70602f40
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
*/
*/
#define PWR_XDR_BYTES(xdrs, addr, len) \
#define PWR_XDR_BYTES(xdrs, addr, len) \
{ \
{ \
if (((
xdrs)->x_handy -= len) < 0)
\
if (((
int) ((xdrs)->x_handy -= len)) < 0)
\
return (FALSE); \
return (FALSE); \
\
\
if ((xdrs)->x_op == XDR_DECODE) \
if ((xdrs)->x_op == XDR_DECODE) \
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
*/
*/
#define PWR_XDR_STRING(xdrs, addr, len) \
#define PWR_XDR_STRING(xdrs, addr, len) \
{ \
{ \
if (((
xdrs)->x_handy -= len) < 0)
\
if (((
int) ((xdrs)->x_handy -= len)) < 0)
\
return (FALSE); \
return (FALSE); \
\
\
if ((xdrs)->x_op == XDR_DECODE) \
if ((xdrs)->x_op == XDR_DECODE) \
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
*/
*/
#define PWR_XDR_INT(xdrs, objp, objtype) \
#define PWR_XDR_INT(xdrs, objp, objtype) \
{ \
{ \
if (((
xdrs)->x_handy -= sizeof(int)) < 0)
\
if (((
int) ((xdrs)->x_handy -= sizeof(int))) < 0)
\
return (FALSE); \
return (FALSE); \
\
\
if ((xdrs)->x_op == XDR_DECODE) \
if ((xdrs)->x_op == XDR_DECODE) \
...
...
xtt/lib/xtt/src/xtt_xnav_command.cpp
View file @
70602f40
...
@@ -4991,7 +4991,7 @@ static int xnav_open_func(void* client_data, void* client_flag)
...
@@ -4991,7 +4991,7 @@ static int xnav_open_func(void* client_data, void* client_flag)
xao
->
pop
();
xao
->
pop
();
}
else
{
}
else
{
xao
=
xnav
->
xattone_new
(
xao
=
xnav
->
xattone_new
(
&
aref
,
title_str
,
bypass
?
pwr_mPrv_RtWrite
:
xnav
->
priv
,
&
sts
);
&
aref
,
title_str
,
bypass
?
pwr_mPrv_RtWrite
:
((
pwr_mPrv
)
xnav
->
priv
)
,
&
sts
);
if
(
EVEN
(
sts
))
if
(
EVEN
(
sts
))
xnav
->
message
(
'E'
,
"Unable to open attribute"
);
xnav
->
message
(
'E'
,
"Unable to open attribute"
);
else
{
else
{
...
...
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