From 3e6597a23416c149afb39550bc2a51349f2a0122 Mon Sep 17 00:00:00 2001 From: chanywa Date: Thu, 24 Nov 2016 17:39:26 +0900 Subject: [PATCH] changed how to count length of maps_item_list Change-Id: I26132462c445da42550e8a353f425fa4f3ab5119 --- inc/here_utils.h | 8 ++++---- maps-plugin-here.changes | 5 +++++ packaging/maps-plugin-here.spec | 2 +- src/here_place.cpp | 14 +++++++------- src/here_route.cpp | 8 ++++---- src/here_utils.cpp | 7 +++++++ 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/inc/here_utils.h b/inc/here_utils.h index d016639..f1a5af8 100644 --- a/inc/here_utils.h +++ b/inc/here_utils.h @@ -31,6 +31,7 @@ #include #include #include +#include //plug-in header #include "here_types.h" @@ -84,9 +85,9 @@ MAPS_CHECK_CONDITION(arg != NULL, MAPS_ERROR_INVALID_PARAMETER, "MAPS_ERROR_INVALID_PARAMETER") #define MAPS_PRINT_ERROR_CODE_RETURN(code) \ - do{ \ + do { \ MAPS_LOGE("%s(0x%08x)", #code, code); \ - return code; \ + return code; \ } while (0) #ifndef TIZEN_MIGRATION @@ -95,14 +96,13 @@ typedef std::string Uri; typedef std::wstring WString; #endif -#define maps_item_list_items(item_list) g_list_length((GList*)(*(unsigned long*)item_list) ) - extern "C" { int ConvertToMapsError(int nRet); int ConvertToHereError(int nRet); const char* ConverHereErrorToString(int nErr); const char* ConvertMapsErrorToChar(int nErr); + int GetMapsItemListLength(maps_item_list_h list); } HERE_PLUGIN_BEGIN_NAMESPACE diff --git a/maps-plugin-here.changes b/maps-plugin-here.changes index e6b233f..1a0b97e 100644 --- a/maps-plugin-here.changes +++ b/maps-plugin-here.changes @@ -1,3 +1,8 @@ +[Version] maps-plugin-here_0.3.11 +[Date] 24 Nov 2016 +[Title] fixed some problems to support 64bit OS +[Developer] Seechan Kim + [Version] maps-plugin-here_0.3.10 [Date] 14 Nov 2016 [Title] changed connection timeout from 20 seconds to 120 seconds diff --git a/packaging/maps-plugin-here.spec b/packaging/maps-plugin-here.spec index 45c9a9c..985222d 100644 --- a/packaging/maps-plugin-here.spec +++ b/packaging/maps-plugin-here.spec @@ -1,6 +1,6 @@ Name: maps-plugin-here Summary: Tizen HERE Maps Plug-in Library -Version: 0.3.10 +Version: 0.3.11 Release: 1 Group: Location/Libraries License: Apache-2.0 and HERE diff --git a/src/here_place.cpp b/src/here_place.cpp index d87e806..02c7bda 100644 --- a/src/here_place.cpp +++ b/src/here_place.cpp @@ -798,7 +798,7 @@ void HerePlace::ProcessPlaceContacts(PlaceDetails herePlace, maps_place_h mapsPl maps_place_contact_destroy(mapsCont); } - if (maps_item_list_items(mapsContList)) { + if (GetMapsItemListLength(mapsContList)) { maps_place_set_contacts(mapsPlace, mapsContList); maps_item_list_remove_all(mapsContList, maps_place_contact_destroy); } @@ -847,7 +847,7 @@ void HerePlace::ProcessPlaceCategories(PlaceDetails herePlace, maps_place_h maps maps_place_category_destroy(mapsCate); } - if (maps_item_list_items(mapsCateList)) { + if (GetMapsItemListLength(mapsCateList)) { maps_place_set_categories(mapsPlace, mapsCateList); maps_item_list_remove_all(mapsCateList, maps_place_category_destroy); } @@ -911,7 +911,7 @@ void HerePlace::ProcessPlaceImages(PlaceDetails herePlace, maps_place_h mapsPlac maps_place_image_destroy(mapsImage); } - if (maps_item_list_items(mapsImageList)) { + if (GetMapsItemListLength(mapsImageList)) { maps_place_set_images(mapsPlace, mapsImageList); maps_item_list_remove_all(mapsImageList, maps_place_image_destroy); } @@ -956,7 +956,7 @@ void HerePlace::ProcessPlaceDetails(PlaceDetails herePlace, maps_place_h mapsPla maps_place_editorial_destroy(mapsEdit); } - if (maps_item_list_items(mapsEditList)) { + if (GetMapsItemListLength(mapsEditList)) { maps_place_set_editorials(mapsPlace, mapsEditList); maps_item_list_remove_all(mapsEditList, maps_place_editorial_destroy); } @@ -1032,7 +1032,7 @@ void HerePlace::ProcessPlaceReviews(PlaceDetails herePlace, maps_place_h mapsPla maps_place_review_destroy(mapsReview); } - if (maps_item_list_items(mapsReviewList)) { + if (GetMapsItemListLength(mapsReviewList)) { maps_place_set_reviews(mapsPlace, mapsReviewList); maps_item_list_remove_all(mapsReviewList, maps_place_review_destroy); } @@ -1129,7 +1129,7 @@ void HerePlace::ProcessPlaceAttributes(PlaceDetails herePlace, maps_place_h maps maps_place_attribute_destroy(mapsAttribute); } - if (maps_item_list_items(mapsAttributeList)) { + if (GetMapsItemListLength(mapsAttributeList)) { maps_place_set_attributes(mapsPlace, mapsAttributeList); maps_item_list_remove_all(mapsAttributeList, maps_place_attribute_destroy); } @@ -1246,7 +1246,7 @@ void HerePlace::__flushReplies(int error) } if (!m_bCanceled) - ((maps_service_search_place_list_cb)m_pCbFunc)((maps_error_e)error, m_nReqId, maps_item_list_items(placeList), placeList, m_pUserData); + ((maps_service_search_place_list_cb)m_pCbFunc)((maps_error_e)error, m_nReqId, GetMapsItemListLength(placeList), placeList, m_pUserData); else maps_place_list_destroy(placeList); } else { diff --git a/src/here_route.cpp b/src/here_route.cpp index 7b3e2b5..b547068 100644 --- a/src/here_route.cpp +++ b/src/here_route.cpp @@ -283,7 +283,7 @@ void HereRoute::OnRouteReply(const GeoRouteReply& Reply) } } - if (maps_item_list_items(mapsPathList)) { + if (GetMapsItemListLength(mapsPathList)) { maps_route_set_path(mapsRoute, mapsPathList); maps_item_list_remove_all(mapsPathList, maps_coordinates_destroy); } @@ -359,7 +359,7 @@ maps_error_e HereRoute::ProcessSegments(maps_route_h mapsRoute, const RouteSegme maps_route_segment_destroy(mapsSegm); } - if (maps_item_list_items(mapsSegmList)) { + if (GetMapsItemListLength(mapsSegmList)) { maps_route_set_segments(mapsRoute, mapsSegmList); maps_item_list_remove_all(mapsSegmList, maps_route_segment_destroy); } @@ -393,7 +393,7 @@ maps_error_e HereRoute::ProcessSegmentsPath(maps_route_segment_h mapsSegm, const } } - if (maps_item_list_items(mapsPathList)) { + if (GetMapsItemListLength(mapsPathList)) { maps_route_segment_set_path(mapsSegm, mapsPathList); maps_item_list_remove_all(mapsPathList, maps_coordinates_destroy); } @@ -446,7 +446,7 @@ maps_error_e HereRoute::ProcessManeuver(maps_route_segment_h mapsSegm, const Man maps_route_maneuver_destroy(mapsManeuver); } - if (maps_item_list_items(mapsManeList)) { + if (GetMapsItemListLength(mapsManeList)) { maps_route_segment_set_maneuvers(mapsSegm, mapsManeList); maps_item_list_remove_all(mapsManeList, maps_route_maneuver_destroy); } diff --git a/src/here_utils.cpp b/src/here_utils.cpp index 8e9275e..e209fb8 100644 --- a/src/here_utils.cpp +++ b/src/here_utils.cpp @@ -111,6 +111,13 @@ const char* ConvertMapsErrorToChar(int nErr) } return "MAPS_ERROR_UNKNOWN"; } + +int GetMapsItemListLength(maps_item_list_h list) +{ + int length = 0; + maps_item_list_get_length(list, &length); + return length; +} } -- 2.34.1