Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

Commit

Permalink
Updated vitamtp protocol version.
Browse files Browse the repository at this point in the history
Changed deprecated _BSD_SOURCE to _DEFAULT_SOURCE.
Fixed sign warnings.
  • Loading branch information
codestation committed Oct 3, 2014
1 parent 8b3539d commit 07c5d4f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ m4
aclocal.m4
autom4te.cache
config.guess
config.h
config.h.in
config.log
config.sub
config.status
depcomp
configure
compile
Expand All @@ -32,3 +35,4 @@ VitaMTP.xcodeproj/xcuserdata
.deps
.libs
opencma
Makefile.am.user
2 changes: 1 addition & 1 deletion src/datautils.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const initiator_info_t *VitaMTP_Data_Initiator_New(const char *host_name, int pr
init_info->version = version_str;
init_info->protocolVersion = protocol_version;
init_info->name = host_name == NULL ? strdup("VitaMTP Library") : strdup(host_name);
init_info->applicationType = 5;
init_info->applicationType = 4;
return init_info;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Boston, MA 02110-1301 USA
*/

#define _BSD_SOURCE
#define _DEFAULT_SOURCE
#include "config.h"
#include "ptp.h"
#include "gphoto2-endian.h"
Expand Down
3 changes: 2 additions & 1 deletion src/vitamtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,13 @@ typedef int (* VitaMTP_progressfunc_t)(uint64_t const sent, uint64_t const total
*/
#define VITAMTP_VERSION_MAJOR 2
#define VITAMTP_VERSION_MINOR 5
#define VITAMTP_PROTOCOL_FW_3_30 1900010
#define VITAMTP_PROTOCOL_FW_3_10 1800010
#define VITAMTP_PROTOCOL_FW_3_00 1700010
#define VITAMTP_PROTOCOL_FW_2_60 1600010
#define VITAMTP_PROTOCOL_FW_2_10 1500010
#define VITAMTP_PROTOCOL_FW_2_00 1400010
#define VITAMTP_PROTOCOL_MAX_VERSION VITAMTP_PROTOCOL_FW_3_10
#define VITAMTP_PROTOCOL_MAX_VERSION VITAMTP_PROTOCOL_FW_3_30
#define VITAMTP_WIRELESS_FW_2_00 1000000
#define VITAMTP_WIRELESS_MAX_VERSION VITAMTP_WIRELESS_FW_2_00

Expand Down
10 changes: 5 additions & 5 deletions src/wireless.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ static int VitaMTP_Sock_Read_All(int sockfd, unsigned char **p_data, size_t *p_l
return 0;
}

static int VitaMTP_Sock_Write_All(int sockfd, const unsigned char *data, size_t len, const struct sockaddr *dest_addr,
static int VitaMTP_Sock_Write_All(int sockfd, const unsigned char *data, ssize_t len, const struct sockaddr *dest_addr,
socklen_t addrlen)
{
while (1)
Expand Down Expand Up @@ -1191,7 +1191,7 @@ int VitaMTP_Broadcast_Host(wireless_host_info_t *info, unsigned int host_addr)

if (FD_ISSET(g_broadcast_command_fds[0], &fd))
{
if (recv(g_broadcast_command_fds[0], (char *)&cmd, sizeof(enum broadcast_command), 0) < sizeof(enum broadcast_command))
if (recv(g_broadcast_command_fds[0], (char *)&cmd, sizeof(enum broadcast_command), 0) < (ssize_t)sizeof(enum broadcast_command))
{
VitaMTP_Log(VitaMTP_ERROR, "Error recieving broadcast command. Stopping broadcast.\n");
cmd = BroadcastStop;
Expand Down Expand Up @@ -1278,7 +1278,7 @@ void VitaMTP_Stop_Broadcast(void)
return;
}

if (send(g_broadcast_command_fds[1], (char *)&cmd, sizeof(cmd), 0) < sizeof(cmd))
if (send(g_broadcast_command_fds[1], (char *)&cmd, sizeof(cmd), 0) < (ssize_t)sizeof(cmd))
{
VitaMTP_Log(VitaMTP_ERROR, "failed to send command to broadcast\n");
}
Expand Down Expand Up @@ -1414,7 +1414,7 @@ static int VitaMTP_Get_Wireless_Device(wireless_host_info_t *info, vita_device_t
if (FD_ISSET(g_cancel_fds[0], &fd))
{
int cancel_flag = 0;
if (recv(g_cancel_fds[0], (char *)&cancel_flag, sizeof(cancel_flag), 0) < sizeof(cancel_flag))
if (recv(g_cancel_fds[0], (char *)&cancel_flag, sizeof(cancel_flag), 0) < (ssize_t)sizeof(cancel_flag))
{
VitaMTP_Log(VitaMTP_ERROR, "Error recieving cancel flag. Stopping connection.\n");
cancel_flag = 1;
Expand Down Expand Up @@ -1685,7 +1685,7 @@ void VitaMTP_Cancel_Get_Wireless_Vita(void)
int cancel_flag = 1;

VitaMTP_Log(VitaMTP_VERBOSE, "Sending cancel packet to wireless thread\n");
if (send(g_cancel_fds[1], (char *)&cancel_flag, sizeof(cancel_flag), 0) < sizeof(cancel_flag))
if (send(g_cancel_fds[1], (char *)&cancel_flag, sizeof(cancel_flag), 0) < (ssize_t)sizeof(cancel_flag))
{
VitaMTP_Log(VitaMTP_ERROR, "failed to send command to stop wireless search\n");
}
Expand Down

0 comments on commit 07c5d4f

Please sign in to comment.