[PATCH] broadband-modem-qmi: fix incorrect conversions from double to gint32
Ben Chan
benchan at chromium.org
Wed Jul 10 20:37:07 PDT 2013
This patch fixes the following incorrect conversions from double to gint32:
mm-broadband-modem-qmi.c:4785:27: error: implicit conversion from 'double' to 'gint32' (aka 'int')
changes value from 2.225073858507201E-308 to 0 [-Werror,-Wliteral-conversion]
gint32 bs_longitude = MM_LOCATION_LONGITUDE_UNKNOWN;
~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm-broadband-modem-qmi.c:4786:26: error: implicit conversion from 'double' to 'gint32' (aka 'int')
changes value from 2.225073858507201E-308 to 0 [-Werror,-Wliteral-conversion]
gint32 bs_latitude = MM_LOCATION_LATITUDE_UNKNOWN;
~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
src/mm-broadband-modem-qmi.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index efaefb3..4c412d1 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -4772,6 +4772,11 @@ common_process_serving_system_cdma (MMBroadbandModemQmi *self,
QmiMessageNasGetServingSystemOutput *response_output,
QmiIndicationNasServingSystemOutput *indication_output)
{
+ /* Identifier for an unknown base station longitude value. */
+#define BS_LONGITUDE_UNKNOWN G_MININT32
+ /* Identifier for an unknown base station latitude value. */
+#define BS_LATITUDE_UNKNOWN G_MININT32
+
QmiNasRegistrationState registration_state;
QmiNasNetworkType selected_network;
GArray *radio_interfaces;
@@ -4782,8 +4787,8 @@ common_process_serving_system_cdma (MMBroadbandModemQmi *self,
guint16 sid = 0;
guint16 nid = 0;
guint16 bs_id = 0;
- gint32 bs_longitude = MM_LOCATION_LONGITUDE_UNKNOWN;
- gint32 bs_latitude = MM_LOCATION_LATITUDE_UNKNOWN;
+ gint32 bs_longitude = BS_LONGITUDE_UNKNOWN;
+ gint32 bs_latitude = BS_LATITUDE_UNKNOWN;
if (response_output)
qmi_message_nas_get_serving_system_output_get_serving_system (
@@ -4933,11 +4938,11 @@ common_process_serving_system_cdma (MMBroadbandModemQmi *self,
/* Longitude and latitude given in units of 0.25 secs
* Note that multiplying by 0.25 is like dividing by 4, so 60*60*4=14400 */
#define QMI_LONGITUDE_TO_DEGREES(longitude) \
- (longitude != MM_LOCATION_LONGITUDE_UNKNOWN ? \
+ (longitude != BS_LONGITUDE_UNKNOWN ? \
(((gdouble)longitude) / 14400.0) : \
MM_LOCATION_LONGITUDE_UNKNOWN)
#define QMI_LATITUDE_TO_DEGREES(latitude) \
- (latitude != MM_LOCATION_LATITUDE_UNKNOWN ? \
+ (latitude != BS_LATITUDE_UNKNOWN ? \
(((gdouble)latitude) / 14400.0) : \
MM_LOCATION_LATITUDE_UNKNOWN)
--
1.8.3
More information about the ModemManager-devel
mailing list