Fix build error for aarch64 54/221054/1 accepted/tizen/unified/20191227.142747 submit/tizen/20191226.234511
authorSemun Lee <semun.lee@samsung.com>
Fri, 27 Dec 2019 00:43:15 +0000 (09:43 +0900)
committerSemun Lee <semun.lee@samsung.com>
Fri, 27 Dec 2019 00:43:15 +0000 (09:43 +0900)
Change-Id: Ia6b141fec48f6c43800c822667232b186bee6d31
Signed-off-by: Semun Lee <semun.lee@samsung.com>
src/entity/mtp_property.c
src/transport/mtp_usb_driver_slp.c
src/util/mtp_support.c

index 3ab46d52a3778bbc92e06ee9a6d9ab691f13a734..c14f61d0ac2a3e45445cd7b77d192ae075ac6495 100644 (file)
@@ -1452,7 +1452,7 @@ mtp_bool _prop_is_valid_integer(prop_info_t *prop_info, mtp_uint64 value)
                mtp_uint32 ii;
                for (ii = 0; ii < prop_info->supp_value_list.nnodes;
                                ii++, node = node->link) {
-                       if (value == (mtp_uint32) node->value)
+                       if (value == GPOINTER_TO_UINT(node->value))
                                return TRUE;
                /* LCOV_EXCL_STOP */
                }
@@ -2421,7 +2421,7 @@ mtp_uint32 _prop_pack_device_prop_desc(device_prop_desc_t *prop,
                                        ii < prop->propinfo.supp_value_list.nnodes;
                                        ii++, node = node->link) {
 
-                               value = (mtp_uint32)node->value;
+                               value = GPOINTER_TO_UINT(node->value);
                                memcpy(temp, &value, prop->propinfo.dts_size);
 #ifdef __BIG_ENDIAN__
                                _util_conv_byte_order(temp, prop->propinfo.dts_size);
@@ -3044,7 +3044,7 @@ mtp_uint32 _prop_pack_obj_prop_desc(obj_prop_desc_t *prop, mtp_uchar *buf,
                                        ii < prop->propinfo.supp_value_list.nnodes;
                                        ii++, node = node->link) {
 
-                               value = (mtp_uint32)node->value;
+                               value = GPOINTER_TO_UINT(node->value);
                                memcpy(temp, &value, prop->propinfo.dts_size);
 #ifdef __BIG_ENDIAN__
                                _util_conv_byte_order(temp, prop->propinfo.dts_size);
@@ -3637,7 +3637,7 @@ mtp_bool _prop_add_supp_integer_val(prop_info_t *prop_info, mtp_uint32 value)
        }
 
        /* Create the node and append it. */
-       _util_add_node(&(prop_info->supp_value_list), (void *)value);
+       _util_add_node(&(prop_info->supp_value_list), GUINT_TO_POINTER(value));
 
        return TRUE;
 }
index 7ae85e35bc87cb51f25fdc9299303e43f307c17d..a19de3d666f1b1e05e667463ffdaeddefc0ba5ac 100644 (file)
@@ -328,8 +328,8 @@ static void __handle_control_request(mtp_int32 request)
                        return;
                }
 
-               memcpy(&(cancelreq_data.io_code), buffer, sizeof(mtp_word));
-               memcpy(&(cancelreq_data.tid), &buffer[2], sizeof(mtp_dword));
+               memcpy(&(cancelreq_data.io_code), buffer, sizeof(mtp_uint16));
+               memcpy(&(cancelreq_data.tid), &buffer[2], sizeof(mtp_uint32));
                DBG("cancel io code [%d], transaction id [%du]\n",
                    cancelreq_data.io_code, cancelreq_data.tid);
                break;
index f9221c2b65c9113728865b9de582474444068d16..fb2b44b4b22243eab48584c6ad18f3ee3e986e57 100644 (file)
@@ -18,6 +18,7 @@
 #include <glib/gprintf.h>
 #include <unistd.h>
 #include <sys/wait.h>
+#include <stdint.h>
 #include "mtp_support.h"
 #include "ptp_datacodes.h"
 #include "mtp_util.h"
@@ -152,7 +153,7 @@ void _util_wchar_cpy(mtp_wchar *dest, const mtp_wchar *src)
        ret_if(src == NULL);
        ret_if(dest == NULL);
 
-       if (!((int)dest & 0x1) && !((int)src & 0x1)) {
+       if (!((uintptr_t)dest & 0x1) && !((uintptr_t)src & 0x1)) {
                /* 2-byte aligned */
                mtp_wchar *temp = dest;
 
@@ -191,7 +192,7 @@ void _util_wchar_ncpy(mtp_wchar *dest, const mtp_wchar *src, unsigned long n)
        ret_if(src == NULL);
        ret_if(dest == NULL);
 
-       if (!((int)dest & 0x1) && !((int)src & 0x1)) {  /* 2-byte aligned */
+       if (!((uintptr_t)dest & 0x1) && !((uintptr_t)src & 0x1)) {      /* 2-byte aligned */
                temp = dest;
 
                while (n && (*temp++ = *src++))
@@ -231,7 +232,7 @@ void _util_wchar_ncpy(mtp_wchar *dest, const mtp_wchar *src, unsigned long n)
  */
 size_t _util_wchar_len(const mtp_wchar *s)
 {
-       if (!((int)s & 0x1)) {  /* 2-byte aligned */
+       if (!((uintptr_t)s & 0x1)) {    /* 2-byte aligned */
                mtp_wchar *temp = (mtp_wchar *)s;
 
                while (*temp++)