projects
/
platform
/
core
/
system
/
sensord.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0228a68
)
Removed compiler warning - dereferencing type-punned pointer will break strict-aliasi...
21/32821/1
author
Ankur
<ankur29.garg@samsung.com>
Wed, 24 Dec 2014 12:01:20 +0000
(17:31 +0530)
committer
Ankur
<ankur29.garg@samsung.com>
Wed, 24 Dec 2014 12:01:52 +0000
(17:31 +0530)
-Tested the change. Works fine.
Change-Id: Ib2dfbd9fb67fe1c634df84ef833953db471fbd74
src/shared/sensor_info.cpp
patch
|
blob
|
history
diff --git
a/src/shared/sensor_info.cpp
b/src/shared/sensor_info.cpp
index
0521aea
..
fe8303c
100755
(executable)
--- a/
src/shared/sensor_info.cpp
+++ b/
src/shared/sensor_info.cpp
@@
-237,7
+237,8
@@
void sensor_info::put(raw_data_t &data, int value)
{
char buffer[sizeof(value)];
- (*(int *) buffer) = value;
+ int *temp = (int *) buffer;
+ *temp = value;
copy(&buffer[0], &buffer[sizeof(buffer)], back_inserter(data));
}
@@
-246,7
+247,8
@@
void sensor_info::put(raw_data_t &data, float value)
{
char buffer[sizeof(value)];
- (*(float *) buffer) = value;
+ float *temp = (float *) buffer;
+ *temp = value;
copy(&buffer[0], &buffer[sizeof(buffer)], back_inserter(data));
}