2013-05-01 04:51:56

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 1/6] attrib: Get rid of gchar

From: Lucas De Marchi <[email protected]>

Use plain char instead of gchar.
---
attrib/gattrib.c | 4 ++--
attrib/gatttool.c | 12 ++++++------
attrib/gatttool.h | 6 +++---
attrib/interactive.c | 14 +++++++-------
attrib/utils.c | 4 ++--
5 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index 636e09d..7fb460f 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
@@ -319,7 +319,7 @@ static gboolean can_write_data(GIOChannel *io, GIOCondition cond,
if (cmd->sent)
return FALSE;

- iostat = g_io_channel_write_chars(io, (gchar *) cmd->pdu, cmd->len,
+ iostat = g_io_channel_write_chars(io, (char *) cmd->pdu, cmd->len,
&len, &gerr);
if (iostat != G_IO_STATUS_NORMAL) {
if (gerr) {
@@ -408,7 +408,7 @@ static gboolean received_data(GIOChannel *io, GIOCondition cond, gpointer data)

memset(buf, 0, sizeof(buf));

- iostat = g_io_channel_read_chars(io, (gchar *) buf, sizeof(buf),
+ iostat = g_io_channel_read_chars(io, (char *) buf, sizeof(buf),
&len, NULL);
if (iostat != G_IO_STATUS_NORMAL) {
status = ATT_ECODE_IO;
diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index dd0f1e2..2c11562 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -42,11 +42,11 @@
#include "gatt.h"
#include "gatttool.h"

-static gchar *opt_src = NULL;
-static gchar *opt_dst = NULL;
-static gchar *opt_dst_type = NULL;
-static gchar *opt_value = NULL;
-static gchar *opt_sec_level = NULL;
+static char *opt_src = NULL;
+static char *opt_dst = NULL;
+static char *opt_dst_type = NULL;
+static char *opt_value = NULL;
+static char *opt_sec_level = NULL;
static bt_uuid_t *opt_uuid = NULL;
static int opt_start = 0x0001;
static int opt_end = 0xffff;
@@ -596,7 +596,7 @@ int main(int argc, char *argv[])
else if (opt_char_desc)
operation = characteristics_desc;
else {
- gchar *help = g_option_context_get_help(context, TRUE, NULL);
+ char *help = g_option_context_get_help(context, TRUE, NULL);
g_print("%s\n", help);
g_free(help);
got_error = TRUE;
diff --git a/attrib/gatttool.h b/attrib/gatttool.h
index 184a7f8..8f0913c 100644
--- a/attrib/gatttool.h
+++ b/attrib/gatttool.h
@@ -21,10 +21,10 @@
*
*/

-int interactive(const gchar *src, const gchar *dst, const gchar *dst_type,
+int interactive(const char *src, const char *dst, const char *dst_type,
int psm);
-GIOChannel *gatt_connect(const gchar *src, const gchar *dst,
- const gchar *dst_type, const gchar *sec_level,
+GIOChannel *gatt_connect(const char *src, const char *dst,
+ const char *dst_type, const char *sec_level,
int psm, int mtu, BtIOConnect connect_cb,
GError **gerr);
size_t gatt_attr_data_from_string(const char *str, uint8_t **data);
diff --git a/attrib/interactive.c b/attrib/interactive.c
index a819acf..f28dc22 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -51,10 +51,10 @@ static GAttrib *attrib = NULL;
static GMainLoop *event_loop;
static GString *prompt;

-static gchar *opt_src = NULL;
-static gchar *opt_dst = NULL;
-static gchar *opt_dst_type = NULL;
-static gchar *opt_sec_level = NULL;
+static char *opt_src = NULL;
+static char *opt_dst = NULL;
+static char *opt_dst_type = NULL;
+static char *opt_sec_level = NULL;
static int opt_psm = 0;
static int opt_mtu = 0;
static int start;
@@ -850,7 +850,7 @@ static void cmd_help(int argcp, char **argvp)

static void parse_line(char *line_read)
{
- gchar **argvp;
+ char **argvp;
int argcp;
int i;

@@ -1017,8 +1017,8 @@ static guint setup_signalfd(void)
return source;
}

-int interactive(const gchar *src, const gchar *dst,
- const gchar *dst_type, int psm)
+int interactive(const char *src, const char *dst,
+ const char *dst_type, int psm)
{
guint input;
guint signal;
diff --git a/attrib/utils.c b/attrib/utils.c
index e263bcb..6ef89d4 100644
--- a/attrib/utils.c
+++ b/attrib/utils.c
@@ -40,8 +40,8 @@
#include "gatt.h"
#include "gatttool.h"

-GIOChannel *gatt_connect(const gchar *src, const gchar *dst,
- const gchar *dst_type, const gchar *sec_level,
+GIOChannel *gatt_connect(const char *src, const char *dst,
+ const char *dst_type, const char *sec_level,
int psm, int mtu, BtIOConnect connect_cb,
GError **gerr)
{
--
1.8.2.2



2013-05-01 04:52:00

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 5/6] core: Get rid of gchar

From: Lucas De Marchi <[email protected]>

Use plain char instead of gchar.
---
src/log.c | 2 +-
src/main.c | 6 +++---
src/plugin.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/log.c b/src/log.c
index 75a98a9..ca783f3 100644
--- a/src/log.c
+++ b/src/log.c
@@ -80,7 +80,7 @@ void btd_debug(const char *format, ...)
extern struct btd_debug_desc __start___debug[];
extern struct btd_debug_desc __stop___debug[];

-static gchar **enabled = NULL;
+static char **enabled = NULL;

static gboolean is_enabled(struct btd_debug_desc *desc)
{
diff --git a/src/main.c b/src/main.c
index 1e40ebc..dc0478e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -378,9 +378,9 @@ static guint setup_signalfd(void)
return source;
}

-static gchar *option_debug = NULL;
-static gchar *option_plugin = NULL;
-static gchar *option_noplugin = NULL;
+static char *option_debug = NULL;
+static char *option_plugin = NULL;
+static char *option_noplugin = NULL;
static gboolean option_compat = FALSE;
static gboolean option_detach = TRUE;
static gboolean option_version = FALSE;
diff --git a/src/plugin.c b/src/plugin.c
index f231f34..a23e533 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -116,7 +116,7 @@ gboolean plugin_init(const char *enable, const char *disable)
{
GSList *list;
GDir *dir;
- const gchar *file;
+ const char *file;
char **cli_disabled, **cli_enabled;
unsigned int i;

@@ -156,7 +156,7 @@ gboolean plugin_init(const char *enable, const char *disable)
while ((file = g_dir_read_name(dir)) != NULL) {
struct bluetooth_plugin_desc *desc;
void *handle;
- gchar *filename;
+ char *filename;

if (g_str_has_prefix(file, "lib") == TRUE ||
g_str_has_suffix(file, ".so") == FALSE)
--
1.8.2.2


2013-05-01 04:51:57

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 2/6] client: Get rid of gchar

From: Lucas De Marchi <[email protected]>

Use plain char instead of gchar.
---
client/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/main.c b/client/main.c
index dabb836..b0a66d8 100644
--- a/client/main.c
+++ b/client/main.c
@@ -53,7 +53,7 @@ static GMainLoop *main_loop;
static DBusConnection *dbus_conn;

static GDBusProxy *agent_manager;
-static gchar *auto_register_agent = NULL;
+static char *auto_register_agent = NULL;

static GDBusProxy *default_ctrl;
static GList *ctrl_list;
--
1.8.2.2


2013-05-01 04:51:58

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 3/6] gobex: Get rid of gchar

From: Lucas De Marchi <[email protected]>

Use plain char instead of gchar.
---
gobex/gobex.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/gobex/gobex.c b/gobex/gobex.c
index ce4f284..6badfeb 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -260,9 +260,9 @@ static gboolean write_stream(GObex *obex, GError **err)
{
GIOStatus status;
gsize bytes_written;
- gchar *buf;
+ char *buf;

- buf = (gchar *) &obex->tx_buf[obex->tx_sent];
+ buf = (char *) &obex->tx_buf[obex->tx_sent];
status = g_io_channel_write_chars(obex->io, buf, obex->tx_data,
&bytes_written, err);
if (status != G_IO_STATUS_NORMAL)
@@ -280,9 +280,9 @@ static gboolean write_packet(GObex *obex, GError **err)
{
GIOStatus status;
gsize bytes_written;
- gchar *buf;
+ char *buf;

- buf = (gchar *) &obex->tx_buf[obex->tx_sent];
+ buf = (char *) &obex->tx_buf[obex->tx_sent];
status = g_io_channel_write_chars(obex->io, buf, obex->tx_data,
&bytes_written, err);
if (status != G_IO_STATUS_NORMAL)
@@ -1036,14 +1036,14 @@ static gboolean read_stream(GObex *obex, GError **err)
GIOStatus status;
gsize rbytes, toread;
guint16 u16;
- gchar *buf;
+ char *buf;

if (obex->rx_data >= 3)
goto read_body;

rbytes = 0;
toread = 3 - obex->rx_data;
- buf = (gchar *) &obex->rx_buf[obex->rx_data];
+ buf = (char *) &obex->rx_buf[obex->rx_data];

status = g_io_channel_read_chars(io, buf, toread, &rbytes, NULL);
if (status != G_IO_STATUS_NORMAL)
@@ -1069,7 +1069,7 @@ read_body:

do {
toread = obex->rx_pkt_len - obex->rx_data;
- buf = (gchar *) &obex->rx_buf[obex->rx_data];
+ buf = (char *) &obex->rx_buf[obex->rx_data];

status = g_io_channel_read_chars(io, buf, toread, &rbytes, NULL);
if (status != G_IO_STATUS_NORMAL)
@@ -1098,7 +1098,7 @@ static gboolean read_packet(GObex *obex, GError **err)
goto fail;
}

- status = g_io_channel_read_chars(io, (gchar *) obex->rx_buf,
+ status = g_io_channel_read_chars(io, (char *) obex->rx_buf,
obex->rx_mtu, &rbytes, &read_err);
if (status != G_IO_STATUS_NORMAL) {
g_set_error(err, G_OBEX_ERROR, G_OBEX_ERROR_PARSE_ERROR,
--
1.8.2.2


2013-05-01 04:52:01

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 6/6] unit: Get rid of gchar

From: Lucas De Marchi <[email protected]>

Use plain char instead of gchar.
---
unit/test-gobex.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/unit/test-gobex.c b/unit/test-gobex.c
index 74e7759..e7af4d8 100644
--- a/unit/test-gobex.c
+++ b/unit/test-gobex.c
@@ -402,7 +402,7 @@ static gboolean cancel_server(GIOChannel *io, GIOCondition cond,
goto failed;
}

- g_io_channel_write_chars(io, (gchar *) pkt_abort_rsp,
+ g_io_channel_write_chars(io, (char *) pkt_abort_rsp,
sizeof(pkt_abort_rsp), &bytes_written, NULL);
if (bytes_written != sizeof(pkt_abort_rsp)) {
g_set_error(&r->err, TEST_ERROR, TEST_ERROR_UNEXPECTED,
@@ -592,7 +592,7 @@ static void test_recv_unexpected(void)
g_obex_packet_free(req);
g_assert_cmpint(len, >=, 0);

- g_io_channel_write_chars(io, (gchar *) buf, len, NULL, &err);
+ g_io_channel_write_chars(io, (char *) buf, len, NULL, &err);
g_assert_no_error(err);

mainloop = g_main_loop_new(NULL, FALSE);
@@ -727,7 +727,7 @@ static void recv_connect(int transport_type)
handle_connect_req, &gerr);
g_obex_set_disconnect_function(obex, handle_connect_err, &gerr);

- status = g_io_channel_write_chars(io, (gchar *) pkt_connect_req,
+ status = g_io_channel_write_chars(io, (char *) pkt_connect_req,
sizeof(pkt_connect_req),
&bytes_written, NULL);
g_assert_cmpint(status, ==, G_IO_STATUS_NORMAL);
--
1.8.2.2


2013-05-01 04:51:59

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 4/6] obexd: Get rid of gchar

From: Lucas De Marchi <[email protected]>

Use plain char instead of gchar.
---
obexd/client/mns.c | 6 +++---
obexd/src/log.c | 2 +-
obexd/src/plugin.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/obexd/client/mns.c b/obexd/client/mns.c
index 752452c..9a86462 100644
--- a/obexd/client/mns.c
+++ b/obexd/client/mns.c
@@ -214,12 +214,12 @@ static struct map_event_report_parser {
};

static void event_report_element(GMarkupParseContext *ctxt,
- const gchar *element, const gchar **names,
- const gchar **values, gpointer user_data,
+ const char *element, const char **names,
+ const char **values, gpointer user_data,
GError **gerr)
{
struct map_event *event = user_data;
- const gchar *key;
+ const char *key;
gint i;

if (strcasecmp("event", element) != 0)
diff --git a/obexd/src/log.c b/obexd/src/log.c
index a96b07b..ace7ab6 100644
--- a/obexd/src/log.c
+++ b/obexd/src/log.c
@@ -69,7 +69,7 @@ void obex_debug(const char *format, ...)
extern struct obex_debug_desc __start___debug[];
extern struct obex_debug_desc __stop___debug[];

-static gchar **enabled = NULL;
+static char **enabled = NULL;

static gboolean is_enabled(struct obex_debug_desc *desc)
{
diff --git a/obexd/src/plugin.c b/obexd/src/plugin.c
index c8ec642..7d971b6 100644
--- a/obexd/src/plugin.c
+++ b/obexd/src/plugin.c
@@ -110,8 +110,8 @@ static gboolean check_plugin(struct obex_plugin_desc *desc,

gboolean plugin_init(const char *pattern, const char *exclude)
{
- gchar **patterns = NULL;
- gchar **excludes = NULL;
+ char **patterns = NULL;
+ char **excludes = NULL;
GDir *dir;
const char *file;
unsigned int i;
--
1.8.2.2