Fix for 64-bit build compatibility 19/37319/3 tizen_3.0.2015.q2_common accepted/tizen/common/20150408.103106 accepted/tizen/mobile/20150403.075053 accepted/tizen/tv/20150402.122905 accepted/tizen/wearable/20150402.065349 submit/tizen_common/20150406.051135 submit/tizen_mobile/20150326.074553 submit/tizen_mobile/20150402.005016 submit/tizen_tv/20150401.081735 submit/tizen_wearable/20150401.070435
authorJiwan Kim <ji-wan.kim@samsung.com>
Tue, 24 Mar 2015 11:17:13 +0000 (20:17 +0900)
committerJiwan Kim <ji-wan.kim@samsung.com>
Thu, 26 Mar 2015 01:04:23 +0000 (10:04 +0900)
Change-Id: I111832b294df7e6756dedff2c5b01f75a92493bb
Signed-off-by: Jiwan Kim <ji-wan.kim@samsung.com>
CMakeLists.txt
packaging/libtcore.spec
src/co_call.c
src/communicator.c
src/core_object.c
src/mux.c
src/queue.c
src/user_request.c
src/util.c

index 808ee40..1da7e47 100755 (executable)
@@ -5,7 +5,7 @@ PROJECT(libtcore C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "\${prefix}")
-SET(LIBDIR "\${prefix}/lib")
+SET(LIBDIR ${LIB_INSTALL_DIR})
 SET(INCLUDEDIR "\${prefix}/include")
 
 # Set required packages
@@ -72,8 +72,8 @@ CONFIGURE_FILE(tcore.pc.in tcore.pc @ONLY)
 # install
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include/tcore)
 INSTALL(TARGETS tcore
-               LIBRARY DESTINATION lib)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tcore.pc DESTINATION lib/pkgconfig)
+               LIBRARY DESTINATION ${LIBDIR})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tcore.pc DESTINATION ${LIBDIR}/pkgconfig)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME libtcore)
 
 ADD_SUBDIRECTORY(unit-test)
index 1208073..8b7ec53 100755 (executable)
@@ -30,7 +30,9 @@ Telephony-core library (Development)
 %setup -q
 
 %build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DVERSION=%{version} \
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+       -DLIB_INSTALL_DIR=%{_libdir} \
+       -DVERSION=%{version} \
 %ifarch %{arm}
 %else
        -DARCH_EMUL=1 \
index fdfdcd0..7151ad5 100644 (file)
@@ -781,7 +781,7 @@ GSList *tcore_call_object_get_all_session_ids(CoreObject *o)
        while (call_list) {
                call_obj = call_list->data;
                if (call_obj->is_volte_call == TRUE)
-                       session_ids = g_slist_append(session_ids, (gpointer)call_obj->session_id);
+                       session_ids = g_slist_append(session_ids, GINT_TO_POINTER(call_obj->session_id));
 
                call_list = g_slist_next(call_list);
        }
index f2534d2..e93713b 100644 (file)
@@ -123,7 +123,7 @@ TReturn tcore_communicator_send_response(Communicator *comm, UserRequest *ur,
        if (!comm || !comm->ops || !comm->ops->send_response)
                return TCORE_RETURN_EINVAL;
 
-       dbg("ur = 0x%x", (unsigned int)ur);
+       dbg("ur = %p", ur);
 
        return comm->ops->send_response(comm, ur, command, data_len, data);
 }
index af929cc..4b19598 100644 (file)
@@ -186,7 +186,7 @@ static object_mapping_table_t *_object_search_mapping_tbl_entry_by_type(
                        if (co_list->data == NULL)
                                continue;
 
-                       if (type == (unsigned int)co_list->data) {
+                       if (type == GPOINTER_TO_UINT(co_list->data)) {
                                return tbl_entry;
                        }
                }
@@ -1047,7 +1047,7 @@ void *tcore_object_add_mapping_tbl_entry(void *mapping_tbl,
        /*
         * Appending the Core Object type to the list of Core Objects types
         */
-       tbl_entry->object_type = g_slist_append(tbl_entry->object_type, (gpointer)object_type);
+       tbl_entry->object_type = g_slist_append(tbl_entry->object_type, GUINT_TO_POINTER(object_type));
        dbg("Added Mapping Table entry - HAL: [0x%x] Object type: [0x%x]", hal, object_type);
 
        return mapping_tbl_list;
@@ -1118,7 +1118,7 @@ void tcore_object_remove_mapping_tbl_entry_by_type(void *mapping_tbl,
        }
 
        /* Remove the Core Object type from the list */
-       tbl_entry->object_type = g_slist_remove(tbl_entry->object_type, (gconstpointer)co_type);
+       tbl_entry->object_type = g_slist_remove(tbl_entry->object_type, (gconstpointer)GUINT_TO_POINTER(co_type));
 }
 
 void tcore_object_print_mapping_tbl(void *mapping_tbl)
@@ -1174,7 +1174,7 @@ TReturn tcore_object_init_objects(TcorePlugin *plugin,
 
                                object_type_list = tbl_entry->object_type;
                                for ( ; object_type_list ; object_type_list = object_type_list->next) {
-                                       type = (guint)object_type_list->data;
+                                       type = GPOINTER_TO_UINT(object_type_list->data);
 
                                        co = _create_core_object_by_type(type, plugin, tbl_entry->hal);
                                        if (co == NULL) {
@@ -1198,7 +1198,7 @@ TReturn tcore_object_init_objects(TcorePlugin *plugin,
                                object_type_list = tbl_entry->object_type;
 
                                for ( ; object_type_list ; object_type_list = object_type_list->next) {
-                                       type = (unsigned int)object_type_list->data;
+                                       type = GPOINTER_TO_UINT(object_type_list->data);
                                        dbg("Core Object type: [0x%x]", type);
 
                                        ret = _init_core_object_by_type(type, plugin, initializer_list);
@@ -1252,7 +1252,7 @@ void tcore_object_deinit_objects(TcorePlugin *plugin,
                        object_type_list = tbl_entry->object_type;
 
                        for ( ; object_type_list ; object_type_list = object_type_list->next) {
-                               type = (unsigned int)object_type_list->data;
+                               type = GPOINTER_TO_UINT(object_type_list->data);
                                dbg("Core Object type: [0x%x]", type);
 
                                _deinit_core_object_by_type(type, plugin, deinitializer_list);
index d75b88e..1eefde6 100644 (file)
--- a/src/mux.c
+++ b/src/mux.c
@@ -767,7 +767,7 @@ static gboolean _cmux_recv_cmux_data(tcore_cmux_object *cmux_obj,
                return FALSE;
        }
 
-       dbg("Dispatching to logical HAL - hal: [0x%x]", (unsigned int)hal);
+       dbg("Dispatching to logical HAL - hal: [%p]", hal);
        if (tcore_hal_dispatch_response_data(hal, 0,
                        cmux_obj->internal_mux.info_field_len,
                        cmux_obj->internal_mux.info_field)
@@ -1328,13 +1328,13 @@ TReturn tcore_cmux_setup_internal_mux(tcore_cmux_mode mode,
                        || (phy_hal == NULL)
                        || (channel_setup_cb == NULL)
                        || (setup_complete_cb == NULL)) {
-               err("CMUX Buffer size: [%d] Physical HAL: [0x%x] setup_complete_cb: [0x%x]",
-                       cmux_buf_size, (unsigned int)phy_hal, setup_complete_cb);
+               err("CMUX Buffer size: [%d] Physical HAL: [%p] setup_complete_cb: [%p]",
+                       cmux_buf_size, phy_hal, setup_complete_cb);
                return TCORE_RETURN_EINVAL;
        }
 
-       dbg("Physical HAL: [0x%x] cmux_buf_size: [%d]",
-                                                               (unsigned int)phy_hal, cmux_buf_size);
+       dbg("Physical HAL: [%p] cmux_buf_size: [%d]",
+                       phy_hal, cmux_buf_size);
 
        /*
         * Max Channels
index 0f115b5..421940c 100644 (file)
@@ -129,7 +129,7 @@ void tcore_pending_free(TcorePending *pending)
        if (!pending)
                return;
 
-       dbg("pending(0x%x) free, id=0x%x", (unsigned int)pending, pending->id);
+       dbg("pending(%p) free, id=0x%x", pending, pending->id);
 
        if (pending->queue) {
                enum tcore_hal_mode mode = tcore_hal_get_mode(pending->queue->hal);
@@ -465,7 +465,7 @@ TReturn tcore_queue_push(TcoreQueue *queue, TcorePending *pending)
        }
 
        dbg("pending(%p) push to queue(%p). queue length=%d",
-                       (unsigned int)pending, queue, g_queue_get_length(queue->gq));
+                       pending, queue, g_queue_get_length(queue->gq));
 
        return TCORE_RETURN_SUCCESS;
 }
@@ -651,7 +651,7 @@ TcorePending *tcore_queue_ref_next_pending(TcoreQueue *queue)
        } while (pending != NULL);
 
        if (pending->flag_sent == TRUE) {
-               dbg("pending(0x%x) is waiting state.", (unsigned int)pending);
+               dbg("pending(%p) is waiting state.", pending);
                return NULL;
        }
 
@@ -711,7 +711,7 @@ TReturn tcore_queue_cancel_pending_by_command(TcoreQueue *queue, enum tcore_requ
                if (!pending)
                        break;
 
-               dbg("pending(0x%x) cancel", (unsigned int)pending);
+               dbg("pending(%p) cancel", pending);
 
                if (queue->hal) {
                        dbg("hal %p", queue->hal);
index 5d7f27c..a44dc5a 100644 (file)
@@ -96,7 +96,7 @@ void tcore_user_request_free(UserRequest *ur)
        if(ur->metainfo)
                free(ur->metainfo);
 
-       dbg("user_request(0x%x) free.", (unsigned int)ur);
+       dbg("user_request(%p) free.", ur);
 
        free(ur);
 }
index ee86eba..7f31aec 100644 (file)
@@ -1192,7 +1192,7 @@ TReturn tcore_util_netif_set_mtu(const char *name, unsigned int mtu)
        memset(&ifr, 0, sizeof(struct ifreq));
        strncpy(ifr.ifr_name, name, IFNAMSIZ);
        ifr.ifr_name[IFNAMSIZ - 1] = '\0';
-       ifr.ifr_data = (void*)mtu;
+       ifr.ifr_data = GUINT_TO_POINTER(mtu);
 
        ret = ioctl(fd, SIOCSIFMTU, &ifr);
        if (ret < 0) {