summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christophe Fergeau2008-12-29 12:35:51 +0100
committerGravatar Matt Colyer2009-01-02 09:55:08 -0800
commitd77ecbe3fbd73418dd72e147a0ac2a89e62b1cd9 (patch)
tree6ef70292982a499e36d4e14c529436f889e42be1
parent0efa3bc3a3519695f288211d720620cc0672f054 (diff)
downloadlibimobiledevice-d77ecbe3fbd73418dd72e147a0ac2a89e62b1cd9.tar.gz
libimobiledevice-d77ecbe3fbd73418dd72e147a0ac2a89e62b1cd9.tar.bz2
Fix function prototypes
Add missing static, const, change function() to function(void)
-rw-r--r--src/AFC.c2
-rw-r--r--src/initconf.c4
-rw-r--r--src/iphone.c2
-rw-r--r--src/lockdown.c6
-rw-r--r--src/lockdown.h4
-rw-r--r--src/plist.c4
-rw-r--r--src/plist.h2
-rw-r--r--src/usbmux.c6
-rw-r--r--src/usbmux.h2
-rw-r--r--src/userpref.c6
-rw-r--r--src/userpref.h2
11 files changed, 20 insertions, 20 deletions
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;
diff --git a/src/initconf.c b/src/initconf.c
index 8aca2a6..205c97a 100644
--- a/src/initconf.c
+++ b/src/initconf.c
@@ -36,7 +36,7 @@
*
* @param key The pointer to the desired location of the new key.
*/
-void generate_key(gpointer key)
+static void generate_key(gpointer key)
{
gnutls_x509_privkey_generate(*((gnutls_x509_privkey_t *) key), GNUTLS_PK_RSA, 2048, 0);
g_thread_exit(0);
@@ -44,7 +44,7 @@ void generate_key(gpointer key)
/** Simple function that generates a spinner until the mutex is released.
*/
-void progress_bar(gpointer mutex)
+static void progress_bar(gpointer mutex)
{
const char *spinner = "|/-\\|/-\\";
int i = 0;
diff --git a/src/iphone.c b/src/iphone.c
index 86226e7..f733219 100644
--- a/src/iphone.c
+++ b/src/iphone.c
@@ -42,7 +42,7 @@
* descriptor on return.
* @return IPHONE_E_SUCCESS if ok, otherwise an error code.
*/
-iphone_error_t iphone_get_specific_device(int bus_n, int dev_n, iphone_device_t * device)
+static iphone_error_t iphone_get_specific_device(unsigned int bus_n, int dev_n, iphone_device_t * device)
{
struct usb_bus *bus, *busses;
struct usb_device *dev;
diff --git a/src/lockdown.c b/src/lockdown.c
index 80d3937..e0cbe78 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -40,7 +40,7 @@ const ASN1_ARRAY_TYPE pkcs1_asn1_tab[] = {
{0, 0, 0}
};
-int get_rand(int min, int max)
+static int get_rand(int min, int max)
{
int retval = (rand() % (max - min)) + min;
return retval;
@@ -50,7 +50,7 @@ int get_rand(int min, int max)
*
* @param A null terminated string containing a valid HostID.
*/
-char *lockdownd_generate_hostid()
+char *lockdownd_generate_hostid(void)
{
char *hostid = (char *) malloc(sizeof(char) * 37); // HostID's are just UUID's, and UUID's are 36 characters long
const char *chars = "ABCDEF0123456789";
@@ -256,7 +256,7 @@ iphone_error_t lockdownd_hello(iphone_lckd_client_t control)
*
* @return IPHONE_E_SUCCESS on success.
*/
-iphone_error_t lockdownd_generic_get_value(iphone_lckd_client_t control, char *req_key, char *req_string, char **value)
+iphone_error_t lockdownd_generic_get_value(iphone_lckd_client_t control, const char *req_key, const char *req_string, char **value)
{
if (!control || !req_key || !value || (value && *value))
return IPHONE_E_INVALID_ARG;
diff --git a/src/lockdown.h b/src/lockdown.h
index 9176524..012ac72 100644
--- a/src/lockdown.h
+++ b/src/lockdown.h
@@ -40,11 +40,11 @@ struct iphone_lckd_client_int {
int gtls_buffer_hack_len;
};
-char *lockdownd_generate_hostid();
+char *lockdownd_generate_hostid(void);
iphone_lckd_client_t new_lockdownd_client(iphone_device_t phone);
iphone_error_t lockdownd_hello(iphone_lckd_client_t control);
-iphone_error_t lockdownd_generic_get_value(iphone_lckd_client_t control, char *req_key, char *req_string, char **value);
+iphone_error_t lockdownd_generic_get_value(iphone_lckd_client_t control, const char *req_key, const char *req_string, char **value);
iphone_error_t lockdownd_get_device_uid(iphone_lckd_client_t control, char **uid);
iphone_error_t lockdownd_get_device_public_key(iphone_lckd_client_t control, char **public_key);
diff --git a/src/plist.c b/src/plist.c
index c4d6bfa..b9d9e6a 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -40,7 +40,7 @@ const char *plist_base = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
*
* @return The formatted string.
*/
-char *format_string(const char *buf, int cols, int depth)
+static char *format_string(const char *buf, int cols, int depth)
{
int colw = depth + cols + 1;
int len = strlen(buf);
@@ -73,7 +73,7 @@ char *format_string(const char *buf, int cols, int depth)
*
* @return The plist XML document.
*/
-xmlDocPtr new_plist()
+xmlDocPtr new_plist(void)
{
char *plist = strdup(plist_base);
xmlDocPtr plist_xml = xmlReadMemory(plist, strlen(plist), NULL, NULL, 0);
diff --git a/src/plist.h b/src/plist.h
index b27a0c5..cd2028e 100644
--- a/src/plist.h
+++ b/src/plist.h
@@ -31,7 +31,7 @@ xmlNode *add_key_data_dict_element(xmlDocPtr plist, xmlNode * dict, const char *
xmlNode *add_child_to_plist(xmlDocPtr plist, const char *name, const char *content, xmlNode * to_node, int depth);
void free_plist(xmlDocPtr plist);
-xmlDocPtr new_plist();
+xmlDocPtr new_plist(void);
char **read_dict_element_strings(xmlNode * dict);
void free_dictionary(char **dictionary);
diff --git a/src/usbmux.c b/src/usbmux.c
index 4512dad..770d0db 100644
--- a/src/usbmux.c
+++ b/src/usbmux.c
@@ -58,7 +58,7 @@ usbmux_tcp_header *new_mux_packet(uint16 s_port, uint16 d_port)
*
* @return A USBMux header
*/
-usbmux_version_header *version_header()
+usbmux_version_header *version_header(void)
{
usbmux_version_header *version = (usbmux_version_header *) malloc(sizeof(usbmux_version_header));
version->type = 0;
@@ -77,7 +77,7 @@ usbmux_version_header *version_header()
*
* @param connection The connection to delete from the tracking list.
*/
-void delete_connection(iphone_umux_client_t connection)
+static void delete_connection(iphone_umux_client_t connection)
{
iphone_umux_client_t *newlist = (iphone_umux_client_t *) malloc(sizeof(iphone_umux_client_t) * (clients - 1));
int i = 0, j = 0;
@@ -106,7 +106,7 @@ void delete_connection(iphone_umux_client_t connection)
* @param connection The connection to add to the global list of connections.
*/
-void add_connection(iphone_umux_client_t connection)
+static void add_connection(iphone_umux_client_t connection)
{
iphone_umux_client_t *newlist =
(iphone_umux_client_t *) realloc(connlist, sizeof(iphone_umux_client_t) * (clients + 1));
diff --git a/src/usbmux.h b/src/usbmux.h
index da8a361..fd5fc78 100644
--- a/src/usbmux.h
+++ b/src/usbmux.h
@@ -56,7 +56,7 @@ typedef struct {
uint32 type, length, major, minor, allnull;
} usbmux_version_header;
-usbmux_version_header *version_header();
+usbmux_version_header *version_header(void);
#endif
diff --git a/src/userpref.c b/src/userpref.c
index 6e2f9d8..5f227b0 100644
--- a/src/userpref.c
+++ b/src/userpref.c
@@ -39,7 +39,7 @@
/** Creates a freedesktop compatible configuration directory for libiphone.
*/
-inline void create_config_dir()
+static void create_config_dir(void)
{
gchar *config_dir = g_build_path(G_DIR_SEPARATOR_S, g_get_user_config_dir(), LIBIPHONE_CONF_DIR, NULL);
@@ -56,7 +56,7 @@ inline void create_config_dir()
*
* @return The string containing the HostID or NULL
*/
-char *get_host_id()
+char *get_host_id(void)
{
char *host_id = NULL;
gchar *config_file;
@@ -144,7 +144,7 @@ int store_device_public_key(char *uid, char *public_key)
*
* @return 1 if the file contents where read successfully and 0 otherwise.
*/
-int read_file_in_confdir(char *file, gnutls_datum_t * data)
+static int read_file_in_confdir(const char *file, gnutls_datum_t * data)
{
gboolean success;
gsize size;
diff --git a/src/userpref.h b/src/userpref.h
index 5171929..e7835d0 100644
--- a/src/userpref.h
+++ b/src/userpref.h
@@ -28,7 +28,7 @@
*
* @return the HostID if exist in config file. Returns NULL otherwise.
*/
-char *get_host_id();
+char *get_host_id(void);
/**
* Determine if we already paired this device.