Skip to content

Commit 9d5c8cb

Browse files
committed
Version bump to 2.5.3
Fixed wrong filesizes under windows platforms. Fixed some warnings. Bumped soname.
1 parent 0b5dd32 commit 9d5c8cb

7 files changed

Lines changed: 24 additions & 16 deletions

File tree

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
vitamtp (2.5.3) unstable; urgency=low
2+
3+
* Fixed wrong size in metadata under windows platforms.
4+
5+
-- codestation <codestation404@gmail.com> Sun, 29 Jun 2014 00:00:00 -0000
6+
17
vitamtp (2.5.2) unstable; urgency=low
28

39
* Added pkg support

configure.ac

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ([2.52])
5-
AC_INIT([vitamtp], [2.5.2], [codestation@gmail.com])
5+
AC_INIT([vitamtp], [2.5.3], [codestation@gmail.com])
66
AC_CONFIG_MACRO_DIR([m4])
77
AM_INIT_AUTOMAKE([foreign])
88
AC_CONFIG_SRCDIR([src/vitamtp.c])
@@ -89,9 +89,7 @@ AC_SUBST(PTHREAD_LIBS)
8989

9090
# Checks for additional headers
9191
AC_CHECK_HEADERS([errno.h fcntl.h iconv.h limits.h memory.h signal.h stdarg.h stddef.h stdlib.h string.h time.h unistd.h], [], [AC_MSG_ERROR([Cannot find required header.])])
92-
if test x"$mingw_compiler" != "xyes" ; then
93-
AC_CHECK_HEADERS([dirent.h ftw.h sys/stat.h sys/statvfs.h], [], [AC_MSG_ERROR([Cannot find required header.])])
94-
else
92+
if test x"$mingw_compiler" == "xyes" ; then
9593
AC_CHECK_HEADERS([windows.h], [], [AC_MSG_ERROR([Cannot find required header.])])
9694
fi
9795

src/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ include_HEADERS=vitamtp.h
2222
# increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed,
2323
# REVISION is set to 0, otherwise REVISION is incremented.
2424
# ---------------------------------------------------------------------------
25-
CURRENT=3
25+
CURRENT=4
2626
AGE=0
2727
REVISION=0
2828
SOVERSION=$(CURRENT):$(REVISION):$(AGE)
@@ -39,7 +39,7 @@ libvitamtp_la_SOURCES=vitamtp.h datautils.c device.c ptp.c usb.c vitamtp.c wirel
3939
if COMPILE_MINGW32
4040
libvitamtp_la_SOURCES += asprintf.c socketpair.c
4141
endif
42-
libvitamtp_la_CFLAGS=-std=gnu99 -fgnu89-inline -Wall $(XML_CFLAGS) $(LIBUSB_CFLAGS) $(DEVICE_CFLAGS) $(PTHREAD_CFLAGS) $(W32_CFLAGS)
42+
libvitamtp_la_CFLAGS=-std=gnu99 -fgnu89-inline -Wall -Wextra -Wno-unused-parameter $(XML_CFLAGS) $(LIBUSB_CFLAGS) $(DEVICE_CFLAGS) $(PTHREAD_CFLAGS) $(W32_CFLAGS)
4343
libvitamtp_la_LDFLAGS=$(XML_LIBS) $(LIBUSB_LIBS) $(PTHREAD_LIBS) -no-undefined -export-symbols-regex "VitaMTP_[0-9A-Za-z_]+" -version-info $(SOVERSION) $(W32_LDFLAGS)
4444
libvitamtp_la_LIBADD=$(LTLIBICONV)
4545

src/datautils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ char *VitaMTP_Data_Add_Size_Header(const char *orig, uint32_t len)
5858
*
5959
* @param time a Unix timestamp
6060
*/
61-
char *VitaMTP_Data_Make_Timestamp(long time)
61+
char *VitaMTP_Data_Make_Timestamp(time_t time)
6262
{
6363
// YYYY-MM-DDThh:mm:ss+hh:mm
6464
time_t tlocal = time; // save local time because gmtime modifies it

src/usb.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ ptp_read_func(
196196
VitaMTP_hex_dump(bytes, xread, 16);
197197

198198
// want to discard extra byte
199-
if (expect_terminator_byte && xread == toread)
199+
if (expect_terminator_byte && xread == (int)toread)
200200
{
201201
VitaMTP_Log(VitaMTP_DEBUG, "<==USB IN\nDiscarding extra byte\n");
202202

@@ -244,7 +244,7 @@ ptp_read_func(
244244
}
245245
}
246246

247-
if (xread < toread) /* short reads are common */
247+
if (xread < (int)toread) /* short reads are common */
248248
break;
249249
}
250250

@@ -313,7 +313,7 @@ ptp_write_func(
313313
else
314314
{
315315
// This magic makes packets the same size that WMP send them.
316-
if (towrite > ptp_usb->outep_maxpacket && towrite % ptp_usb->outep_maxpacket != 0)
316+
if ((int)towrite > ptp_usb->outep_maxpacket && towrite % ptp_usb->outep_maxpacket != 0)
317317
{
318318
towrite -= towrite % ptp_usb->outep_maxpacket;
319319
}
@@ -382,7 +382,7 @@ ptp_write_func(
382382
}
383383
}
384384

385-
if (xwritten < towrite) /* short writes happen */
385+
if (xwritten < (int)towrite) /* short writes happen */
386386
break;
387387
}
388388

@@ -597,7 +597,8 @@ ptp_usb_senddata(PTPParams *params, PTPContainer *ptp,
597597
)
598598
{
599599
uint16_t ret = PTP_RC_OK;
600-
int wlen, datawlen;
600+
int wlen;
601+
unsigned long datawlen;
601602
PTPUSBBulkContainer usbdata;
602603
unsigned long bytes_left_to_transfer, written;
603604
PTPDataHandler memhandler;
@@ -1095,7 +1096,7 @@ ptp_usb_control_cancel_request(PTPParams *params, uint32_t transactionid)
10951096
sizeof(buffer),
10961097
ptp_usb->timeout);
10971098

1098-
if (ret < sizeof(buffer))
1099+
if (ret < (int)sizeof(buffer))
10991100
return PTP_ERROR_IO;
11001101

11011102
return PTP_RC_OK;

src/vitamtp.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ extern "C" {
2525
#endif
2626

2727
#include <stdint.h>
28+
#include <time.h>
2829

2930
/**
3031
* Unopened Vita USB device
@@ -224,8 +225,8 @@ struct metadata
224225
char *name;
225226
char *path;
226227
int type;
227-
unsigned long dateTimeCreated; // unix timestamp
228-
unsigned long size;
228+
time_t dateTimeCreated; // unix timestamp
229+
uint64_t size;
229230
enum DataType dataType;
230231

231232
union
@@ -816,7 +817,7 @@ void VitaMTP_RegisterCancelEventId(uint32_t event_id);
816817
* Functions to parse data
817818
*/
818819
char *VitaMTP_Data_Add_Size_Header(const char *orig, uint32_t len);
819-
char *VitaMTP_Data_Make_Timestamp(long time);
820+
char *VitaMTP_Data_Make_Timestamp(time_t time);
820821
int VitaMTP_Data_Info_From_XML(vita_info_t *vita_info, const char *raw_data, const int len);
821822
int VitaMTP_Data_Initiator_To_XML(const initiator_info_t *p_initiator_info, char **data, int *len);
822823
const initiator_info_t *VitaMTP_Data_Initiator_New(const char *host_name, int protocol_version);

src/wireless.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,8 @@ static int VitaMTP_Get_Wireless_Device(wireless_host_info_t *info, vita_device_t
15141514
else if (strcmp(method, "REGISTER") == 0)
15151515
{
15161516
wireless_vita_info_t info;
1517+
memset(&info, 0, sizeof(info));
1518+
15171519
char *pin_try = NULL;
15181520
VitaMTP_Parse_Device_Headers(data+read, &info, NULL, &pin_try);
15191521

0 commit comments

Comments
 (0)