OSDN Git Service

attrib: Get rid of gchar
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 1 May 2013 04:51:56 +0000 (01:51 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 2 May 2013 06:02:25 +0000 (09:02 +0300)
Use plain char instead of gchar.

attrib/gattrib.c
attrib/gatttool.c
attrib/gatttool.h
attrib/interactive.c
attrib/utils.c

index ea84bd6..c662ace 100644 (file)
@@ -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;
index dd0f1e2..2c11562 100644 (file)
 #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;
index 184a7f8..8f0913c 100644 (file)
  *
  */
 
-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);
index a819acf..f28dc22 100644 (file)
@@ -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;
index e263bcb..6ef89d4 100644 (file)
@@ -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)
 {