From c2531f3f54e08dcd2828a6c82778aca2f47f0c5a Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 29 Dec 2008 12:05:52 +0100 Subject: Add missing #include "utils.h" --- src/AFC.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/AFC.c') diff --git a/src/AFC.c b/src/AFC.c index 54ea1bb..99c1849 100644 --- a/src/AFC.c +++ b/src/AFC.c @@ -22,6 +22,7 @@ #include #include "AFC.h" #include "plist.h" +#include "utils.h" // This is the maximum size an AFC data packet can be -- cgit v1.1-32-gdbae From d77ecbe3fbd73418dd72e147a0ac2a89e62b1cd9 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 29 Dec 2008 12:35:51 +0100 Subject: Fix function prototypes Add missing static, const, change function() to function(void) --- src/AFC.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/AFC.c') diff --git a/src/AFC.c b/src/AFC.c index 99c1849..b665f8e 100644 --- a/src/AFC.c +++ b/src/AFC.c @@ -557,7 +557,7 @@ iphone_error_t iphone_afc_mkdir(iphone_afc_client_t client, const char *dir) * @return A pointer to an AFCFile struct containing the information received, * or NULL on failure. */ -iphone_afc_file_t afc_get_file_info(iphone_afc_client_t client, const char *path) +static iphone_afc_file_t afc_get_file_info(iphone_afc_client_t client, const char *path) { char *received, **list; iphone_afc_file_t my_file; -- cgit v1.1-32-gdbae From b30cd1dc05640ee6468b19e479162946a3722ac1 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 29 Dec 2008 12:37:18 +0100 Subject: Some variables were unsigned while they should be dispatch_AFC_packet returns an int, but it was sometimes incorrectly assigned to a variable of type uint32_t which was then compared for being less or more than 0. --- src/AFC.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/AFC.c') diff --git a/src/AFC.c b/src/AFC.c index b665f8e..0c43d0d 100644 --- a/src/AFC.c +++ b/src/AFC.c @@ -796,7 +796,9 @@ iphone_afc_write_file(iphone_afc_client_t client, iphone_afc_file_t file, { char *acknowledgement = NULL; const int MAXIMUM_WRITE_SIZE = 1 << 15; - uint32 zero = 0, bytes_loc = 0, segments = (length / MAXIMUM_WRITE_SIZE), current_count = 0, i = 0; + uint32 zero = 0, current_count = 0, i = 0; + uint32 segments = (length / MAXIMUM_WRITE_SIZE); + int bytes_loc = 0; char *out_buffer = NULL; if (!client || !client->afc_packet || !client->connection || !file || !bytes) @@ -927,7 +929,8 @@ iphone_error_t iphone_afc_close_file(iphone_afc_client_t client, iphone_afc_file iphone_error_t iphone_afc_seek_file(iphone_afc_client_t client, iphone_afc_file_t file, int seekpos) { char *buffer = (char *) malloc(sizeof(char) * 24); - uint32 seekto = 0, bytes = 0, zero = 0; + uint32 seekto = 0, zero = 0; + int bytes = 0; if (seekpos < 0) seekpos = file->size - abs(seekpos); @@ -980,7 +983,8 @@ iphone_error_t iphone_afc_seek_file(iphone_afc_client_t client, iphone_afc_file_ iphone_error_t iphone_afc_truncate_file(iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize) { char *buffer = (char *) malloc(sizeof(char) * 16); - uint32 bytes = 0, zero = 0; + int bytes = 0; + uint32 zero = 0; afc_lock(client); -- cgit v1.1-32-gdbae From 5cde55426112a8cb79d809dae5f61e347c007212 Mon Sep 17 00:00:00 2001 From: Matt Colyer Date: Fri, 2 Jan 2009 09:56:18 -0800 Subject: Fix indent issues. --- src/AFC.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/AFC.c') diff --git a/src/AFC.c b/src/AFC.c index 0c43d0d..6027ed2 100644 --- a/src/AFC.c +++ b/src/AFC.c @@ -983,7 +983,7 @@ iphone_error_t iphone_afc_seek_file(iphone_afc_client_t client, iphone_afc_file_ iphone_error_t iphone_afc_truncate_file(iphone_afc_client_t client, iphone_afc_file_t file, uint32_t newsize) { char *buffer = (char *) malloc(sizeof(char) * 16); - int bytes = 0; + int bytes = 0; uint32 zero = 0; afc_lock(client); -- cgit v1.1-32-gdbae