fix build warnings 54/64654/1 accepted/tizen/common/20160405.132603 accepted/tizen/ivi/20160405.083025 accepted/tizen/mobile/20160405.082934 accepted/tizen/tv/20160405.082951 accepted/tizen/wearable/20160405.083006 submit/tizen/20160405.021911
authorHyihong Chae <hh.chae@samsung.com>
Mon, 4 Apr 2016 11:27:29 +0000 (20:27 +0900)
committerHyihong Chae <hh.chae@samsung.com>
Mon, 4 Apr 2016 11:32:11 +0000 (20:32 +0900)
Change-Id: I1056a7934c704812e4cee1cb1f61d46ef6373697
Signed-off-by: HyiHong Chae <hh.chae@samsung.com>
examples/albumart.c
examples/detect.c
examples/thumb.c
packaging/libmtp.spec
src/libmtp.c
src/libusb1-glue.c
src/ptp.c

index c98b305..6536ea4 100755 (executable)
@@ -124,8 +124,19 @@ int main (int argc, char **argv) {
     return 1;
   }
   else {
+#ifdef TIZEN_EXT
+    int rv;
+    rv = read(fd, imagedata, filesize);
+    close(fd);
+
+    if (rv < 0) {
+      printf("Read fail.\n");
+      return 0;
+    }
+#else /* TIZEN_EXT */
     read(fd, imagedata, filesize);
     close(fd);
+#endif /* TIZEN_EXT */
   }
 
   LIBMTP_Init();
index 92e43b8..e155708 100755 (executable)
@@ -134,7 +134,9 @@ int main (int argc, char **argv)
     char *friendlyname;
     char *syncpartner;
     char *sectime;
+#ifndef TIZEN_EXT
     char *devcert;
+#endif /* TIZEN_EXT */
     uint16_t *filetypes;
     uint16_t filetypes_len;
     uint8_t maxbattlevel;
index 2718a0c..03f8983 100755 (executable)
@@ -93,8 +93,19 @@ int main (int argc, char **argv) {
     return 1;
   }
   else {
+#ifdef TIZEN_EXT
+    int rv;
+    rv = read(fd, imagedata, filesize);
+    close(fd);
+
+    if (rv < 0) {
+      printf("Read fail.\n");
+      return 0;
+    }
+#else /* TIZEN_EXT */
     read(fd, imagedata, filesize);
     close(fd);
+#endif /* TIZEN_EXT */
   }
 
   LIBMTP_Init();
index 9deaef7..a28e197 100755 (executable)
@@ -3,7 +3,7 @@
 Name:       libmtp
 Summary:    Library for media transfer protocol (mtp)
 Version:    1.1.9
-Release:    11
+Release:    12
 Group:      Network & Connectivity/Other
 License:    LGPL-2.1
 Source0:    libmtp-%{version}.tar.gz
index ab6797a..10bd30f 100755 (executable)
@@ -214,6 +214,10 @@ static int set_object_filename(LIBMTP_mtpdevice_t *device,
 static char *generate_unique_filename(PTPParams* params, char const * const filename);
 static int check_filename_exists(PTPParams* params, char const * const filename);
 
+#ifdef TIZEN_EXT
+int _is_exist_handler(uint32_t **object_list, int size, int current_handler);
+#endif /* TIZEN_EXT */
+
 /**
  * These are to wrap the get/put handlers to convert from the MTP types to PTP types
  * in a reliable way
@@ -9234,7 +9238,7 @@ static void update_metadata_cache(LIBMTP_mtpdevice_t *device, uint32_t object_id
 }
 
 #ifdef TIZEN_EXT
-int _is_exist_handler(int **object_list, int size, int current_handler)
+int _is_exist_handler(uint32_t **object_list, int size, int current_handler)
 {
        int i;
 
index e187420..e2fd45b 100755 (executable)
@@ -865,8 +865,8 @@ ptp_read_func (
   unsigned char *bytes;
   int expect_terminator_byte = 0;
   unsigned long usb_inep_maxpacket_size;
-  unsigned long context_block_size_1;
-  unsigned long context_block_size_2;
+  unsigned long context_block_size_1 = 0;
+  unsigned long context_block_size_2 = 0;
   uint16_t ptp_dev_vendor_id = ptp_usb->rawdevice.device_entry.vendor_id;
 
   //"iRiver" device special handling
@@ -2100,6 +2100,9 @@ LIBMTP_error_number_t configure_usb_device(LIBMTP_raw_device_t *device,
 
   if (err) {
     libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+    free (ptp_usb);
+#endif /* TIZEN_EXT */
     LIBMTP_ERROR("LIBMTP PANIC: Unable to find interface & endpoints of device\n");
     return LIBMTP_ERROR_CONNECTING;
   }
@@ -2111,6 +2114,9 @@ LIBMTP_error_number_t configure_usb_device(LIBMTP_raw_device_t *device,
   if (init_ptp_usb(params, ptp_usb, ldevice) < 0) {
     LIBMTP_ERROR("LIBMTP PANIC: Unable to initialize device\n");
     libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+    free (ptp_usb);
+#endif /* TIZEN_EXT */
     return LIBMTP_ERROR_CONNECTING;
   }
 
@@ -2127,6 +2133,9 @@ LIBMTP_error_number_t configure_usb_device(LIBMTP_raw_device_t *device,
     if(init_ptp_usb(params, ptp_usb, ldevice) <0) {
       LIBMTP_ERROR("LIBMTP PANIC: Could not init USB on second attempt\n");
       libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+      free (ptp_usb);
+#endif /* TIZEN_EXT */
       return LIBMTP_ERROR_CONNECTING;
     }
 
@@ -2134,6 +2143,9 @@ LIBMTP_error_number_t configure_usb_device(LIBMTP_raw_device_t *device,
     if ((ret = ptp_opensession(params, 1)) == PTP_ERROR_IO) {
       LIBMTP_ERROR("LIBMTP PANIC: failed to open session on second attempt\n");
       libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+      free (ptp_usb);
+#endif /* TIZEN_EXT */
       return LIBMTP_ERROR_CONNECTING;
     }
   }
@@ -2151,6 +2163,9 @@ LIBMTP_error_number_t configure_usb_device(LIBMTP_raw_device_t *device,
            ret);
     libusb_release_interface(ptp_usb->handle, ptp_usb->interface);
     libusb_free_device_list (devs, 0);
+#ifdef TIZEN_EXT
+    free (ptp_usb);
+#endif /* TIZEN_EXT */
     return LIBMTP_ERROR_CONNECTING;
   }
 
index 159b243..0f904a9 100755 (executable)
--- a/src/ptp.c
+++ b/src/ptp.c
  * Boston, MA  02110-1301  USA
  */
 
+#ifndef TIZEN_EXT
 #define _BSD_SOURCE
+#endif /* TIZEN_EXT */
+
 #include "config.h"
 #include "ptp.h"