From: Iain Hibbert <[email protected]>
---
apps/discovery.c | 2 +-
apps/obexftp.c | 16 ++++++++--------
bfb/bfb_io.c | 6 +++---
bfb/bfb_io.h | 4 ++--
obexftp/client.c | 4 ++--
obexftp/client.h | 4 ++--
obexftp/unicode.c | 20 ++++++++++----------
7 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/apps/discovery.c b/apps/discovery.c
index 68f1b00..271d08a 100644
--- a/apps/discovery.c
+++ b/apps/discovery.c
@@ -193,7 +193,7 @@ static int do_at_cmd(fd_t fd, const char *cmd, char
*rspbuf, int rspbuflen)
static struct mobile_info *probe_tty(const char *ttyname)
{
int speed;
- uint8_t rspbuf[200];
+ char rspbuf[200];
struct mobile_info *info;
char *p;
#ifdef _WIN32
diff --git a/apps/obexftp.c b/apps/obexftp.c
index 4538c0f..8d66e00 100644
--- a/apps/obexftp.c
+++ b/apps/obexftp.c
@@ -131,13 +131,13 @@ static void info_cb(int event, const char *msg, int len,
void *UNUSED(data))
}
/* create global uuid buffers */
-static const char *fbs_uuid = (const char *)UUID_FBS;
-static const char *irmc_uuid = (const char *)UUID_IRMC;
-static const char *s45_uuid = (const char *)UUID_S45;
-static const char *pcsoftware_uuid = (const char *)UUID_PCSOFTWARE;
+static const uint8_t *fbs_uuid = UUID_FBS;
+static const uint8_t *irmc_uuid = UUID_IRMC;
+static const uint8_t *s45_uuid = UUID_S45;
+static const uint8_t *pcsoftware_uuid = UUID_PCSOFTWARE;
/* parse UUID string to real bytes */
-static int parse_uuid(char *name, const char **uuid, int *uuid_len)
+static int parse_uuid(char *name, const uint8_t **uuid, int *uuid_len)
{
if (name == NULL || *name == '\0' ||
!strncasecmp(name, "none", 4) ||
@@ -240,7 +240,7 @@ static int transport = OBEX_TRANS_IRDA;
#endif /* HAVE_BLUETOOTH */
/*@only@*/ /*@null@*/ static char *device = NULL;
static int channel = -1;
-static const char *use_uuid = (const char *)UUID_FBS;
+static const uint8_t *use_uuid = UUID_FBS;
static int use_uuid_len = sizeof(UUID_FBS);
static int use_conn=1;
static int use_path=1;
@@ -248,7 +248,7 @@ static int timeout = 20; /* default accept/reject timeout
of 20 seconds */
/* connect with given uuid. re-connect every time */
-static int cli_connect_uuid(const char *uuid, int uuid_len)
+static int cli_connect_uuid(const uint8_t *uuid, int uuid_len)
{
int ret, retry;
#ifdef HAVE_SYS_TIMES_H
@@ -348,7 +348,7 @@ static void cli_disconnect()
}
}
-static void probe_device_uuid(const char *uuid, int uuid_len)
+static void probe_device_uuid(const uint8_t *uuid, int uuid_len)
{
int rsp[10];
diff --git a/bfb/bfb_io.c b/bfb/bfb_io.c
index abe3ad8..61941a6 100644
--- a/bfb/bfb_io.c
+++ b/bfb/bfb_io.c
@@ -51,7 +51,7 @@
#include <common.h>
/* Write out an IO buffer */
-int bfb_io_write(fd_t fd, const uint8_t *buffer, int length)
+int bfb_io_write(fd_t fd, const void *buffer, int length)
{
#ifdef _WIN32
DWORD bytes;
@@ -79,7 +79,7 @@ int bfb_io_write(fd_t fd, const uint8_t *buffer, int length)
}
/* Read an answer to an IO buffer of max length bytes */
-int bfb_io_read(fd_t fd, uint8_t *buffer, int length, int timeout)
+int bfb_io_read(fd_t fd, void *buffer, int length, int timeout)
{
#ifdef _WIN32
DWORD bytes;
@@ -123,7 +123,7 @@ int bfb_io_read(fd_t fd, uint8_t *buffer, int length, int
timeout)
/**
Read (repeatedly) from fd until a timeout or an error is encountered.
*/
-static int bfb_io_read_all(int fd, uint8_t *buffer, int length, int timeout)
+static int bfb_io_read_all(int fd, char *buffer, int length, int timeout)
{
int actual;
int pos = 0;
diff --git a/bfb/bfb_io.h b/bfb/bfb_io.h
index 39f54fd..6039340 100644
--- a/bfb/bfb_io.h
+++ b/bfb/bfb_io.h
@@ -38,10 +38,10 @@ extern "C" {
#endif
/* Write out a BFB buffer */
-int bfb_io_write(fd_t fd, const uint8_t *buffer, int length);
+int bfb_io_write(fd_t fd, const void *buffer, int length);
/* Read in a BFB answer */
-int bfb_io_read(fd_t fd, uint8_t *buffer, int length, int timeout);
+int bfb_io_read(fd_t fd, void *buffer, int length, int timeout);
/* Send an BFB init command an check for a valid answer frame */
int bfb_io_init(fd_t fd);
diff --git a/obexftp/client.c b/obexftp/client.c
index c0b557d..4283ee0 100644
--- a/obexftp/client.c
+++ b/obexftp/client.c
@@ -267,7 +267,7 @@ static void client_done(obex_t *handle, obex_object_t
*object, int UNUSED(obex_c
uint8_t hi;
uint32_t hlen;
const apparam_t *app = NULL;
- uint8_t *p;
+ char *p;
const uint8_t *body_data = NULL;
uint32_t body_len = -1;
@@ -1141,7 +1141,7 @@ int obexftp_put_file(obexftp_client_t *cli, const char
*filename, const char *re
\note A remotename must be given always.
*/
-int obexftp_put_data(obexftp_client_t *cli, const char *data, int size,
+int obexftp_put_data(obexftp_client_t *cli, const uint8_t *data, int size,
const char *remotename)
{
obex_object_t *object;
diff --git a/obexftp/client.h b/obexftp/client.h
index 01098d3..7712e0c 100644
--- a/obexftp/client.h
+++ b/obexftp/client.h
@@ -100,7 +100,7 @@ typedef struct {
/* transfer (get) */
char *target_fn; /* used in get body */
uint32_t buf_size; /* not size but len... */
- uint8_t *buf_data;
+ char *buf_data;
uint32_t apparam_info;
/* persistence */
cache_object_t *cache;
@@ -184,7 +184,7 @@ int obexftp_get_type(obexftp_client_t *cli,
int obexftp_put_file(obexftp_client_t *cli, const char *filename,
const char *remotename);
-int obexftp_put_data(obexftp_client_t *cli, const char *data, int size,
+int obexftp_put_data(obexftp_client_t *cli, const uint8_t *data, int size,
const char *remotename);
int obexftp_del(obexftp_client_t *cli, const char *name);
diff --git a/obexftp/unicode.c b/obexftp/unicode.c
index f2e015b..1237c68 100644
--- a/obexftp/unicode.c
+++ b/obexftp/unicode.c
@@ -82,8 +82,8 @@ int CharToUnicode(uint8_t *uc, const uint8_t *c, int size)
size_t ni, no, nrc;
int ret;
/* avoid type-punned dereferecing (breaks strict aliasing) */
- const char *cc = c;
- char *ucc = uc;
+ const char *cc = (const char *)c;
+ char *ucc = (char *)uc;
return_val_if_fail(uc != NULL, -1);
return_val_if_fail(c != NULL, -1);
@@ -103,8 +103,8 @@ int CharToUnicode(uint8_t *uc, const uint8_t *c, int size)
/* try current locale charset to UTF-16BE */
setlocale(LC_CTYPE, "");
DEBUG(2, "Iconv from locale \"%s\"\n", locale_charset);
- cc = c;
- ucc = uc;
+ cc = (const char *)c;
+ ucc = (char *)uc;
ni = strlen(cc) + 1;
no = size;
utf16 = iconv_open("UTF-16BE", locale_charset);
@@ -117,8 +117,8 @@ int CharToUnicode(uint8_t *uc, const uint8_t *c, int size)
}
/* fallback to ISO-8859-1 to UTF-16BE (every byte is valid here) */
- cc = c;
- ucc = uc;
+ cc = (const char *)c;
+ ucc = (char *)uc;
ni = strlen(cc) + 1;
no = size;
utf16 = iconv_open("UTF-16BE", "ISO-8859-1");
@@ -190,8 +190,8 @@ int UnicodeToChar(uint8_t *c, const uint8_t *uc, int size)
size_t ni, no, nrc;
int ret;
/* avoid type-punned dereferecing (breaks strict aliasing) */
- char *cc = c;
- const char *ucc = uc;
+ char *cc = (char *)c;
+ const char *ucc = (const char *)uc;
return_val_if_fail(uc != NULL, -1);
return_val_if_fail(c != NULL, -1);
@@ -265,8 +265,8 @@ int Utf8ToChar(uint8_t *c, const uint8_t *uc, int size)
size_t ni, no, nrc;
int ret;
/* avoid type-punned dereferecing (breaks strict aliasing) */
- char *cc = c;
- const char *ucc = uc;
+ char *cc = (char *)c;
+ const char *ucc = (const char *)uc;
return_val_if_fail(uc != NULL, -1);
return_val_if_fail(c != NULL, -1);
--
1.7.4.1
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users