Fix pointer cast incompatible with 64 bit architectures
Tizen toolchain team in Samsung company is planning to build Tizen
for new arm 64 bit architecture - Aarch64. But package
"org.tizen.data-provider-slave" cannot be built for this architecture
because of the following build error:
error: cast from pointer to integer of different size
The reason that there is cast from type (int*) to type (int) in the
current implementation of function util_get_current_module. This cast
is correct for 32-bit architectures, since on them both (int*) and
(int) have the same size - 32 bits. But on 64-bit architectures
(int*) has size 64 bit and (int) has size 32 bit, and cast from one
to another can provide incorrect results.
This problem can be fixed just by simple replacement of (int)
variables with (size_t) variables, since it does not change the logic
of code and provide additional compatibility with 64-bit
architectures. This fix does not affect other functions, since only
types of local variables are changed.
The patch has been checked for build compatibility under armv7l, i586
and aarch64 architectures and build results are available at
https://build.tizen.org/package/show?package=org.tizen.data-provider-slave&project=devel%3Aarm_toolchain%3AMobile%3AMain
Change-Id: I21c47349f7d41f5b10a33f3772775cc208a43f75
Signed-off-by: Ilya Palachev <i.palachev@samsung.com>