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
# 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)
%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 \
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);
}
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);
}
if (co_list->data == NULL)
continue;
- if (type == (unsigned int)co_list->data) {
+ if (type == GPOINTER_TO_UINT(co_list->data)) {
return tbl_entry;
}
}
/*
* 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;
}
/* 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)
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) {
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);
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);
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)
|| (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
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);
}
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;
}
} 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;
}
if (!pending)
break;
- dbg("pending(0x%x) cancel", (unsigned int)pending);
+ dbg("pending(%p) cancel", pending);
if (queue->hal) {
dbg("hal %p", queue->hal);
if(ur->metainfo)
free(ur->metainfo);
- dbg("user_request(0x%x) free.", (unsigned int)ur);
+ dbg("user_request(%p) free.", ur);
free(ur);
}
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) {