2013-05-01 05:11:56

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 01/16] attrib: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
attrib/gatt-service.c | 2 +-
attrib/gatt.c | 2 +-
attrib/gattrib.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c
index bdb12cd..4b02d39 100644
--- a/attrib/gatt-service.c
+++ b/attrib/gatt-service.c
@@ -168,7 +168,7 @@ static int att_write_req(int authorization, int authentication, uint8_t props)
return ATT_NONE;
}

-static gint find_callback(gconstpointer a, gconstpointer b)
+static int find_callback(gconstpointer a, gconstpointer b)
{
const struct attrib_cb *cb = a;
unsigned int event = GPOINTER_TO_UINT(b);
diff --git a/attrib/gatt.c b/attrib/gatt.c
index 749e820..0f116e8 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
@@ -575,7 +575,7 @@ struct read_long_data {
guint16 size;
guint16 handle;
guint id;
- gint ref;
+ int ref;
};

static void read_long_destroy(gpointer user_data)
diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index 7fb460f..c662ace 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
@@ -45,7 +45,7 @@

struct _GAttrib {
GIOChannel *io;
- gint refs;
+ int refs;
uint8_t *buf;
size_t buflen;
guint read_watch;
@@ -556,7 +556,7 @@ guint g_attrib_send(GAttrib *attrib, guint id, const guint8 *pdu, guint16 len,
return c->id;
}

-static gint command_cmp_by_id(gconstpointer a, gconstpointer b)
+static int command_cmp_by_id(gconstpointer a, gconstpointer b)
{
const struct command *cmd = a;
guint id = GPOINTER_TO_UINT(b);
@@ -692,7 +692,7 @@ guint g_attrib_register(GAttrib *attrib, guint8 opcode, guint16 handle,
return event->id;
}

-static gint event_cmp_by_id(gconstpointer a, gconstpointer b)
+static int event_cmp_by_id(gconstpointer a, gconstpointer b)
{
const struct event *evt = a;
guint id = GPOINTER_TO_UINT(b);
--
1.8.2.2



2013-05-01 05:12:11

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 16/16] unit: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
unit/test-gobex.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/unit/test-gobex.c b/unit/test-gobex.c
index e7af4d8..66307c2 100644
--- a/unit/test-gobex.c
+++ b/unit/test-gobex.c
@@ -229,7 +229,7 @@ static gboolean send_nothing(GIOChannel *io, GIOCondition cond,
}

static void send_req(GObexPacket *req, GObexResponseFunc rsp_func,
- GIOFunc send_rsp_func, gint req_timeout,
+ GIOFunc send_rsp_func, int req_timeout,
int transport_type)
{
GError *gerr = NULL;
@@ -269,7 +269,7 @@ static void send_req(GObexPacket *req, GObexResponseFunc rsp_func,
}

static void send_connect(GObexResponseFunc rsp_func, GIOFunc send_rsp_func,
- gint req_timeout, int transport_type)
+ int req_timeout, int transport_type)
{
GObexPacket *req;
guint8 connect_data[] = { 0x10, 0x00, 0x10, 0x00 };
--
1.8.2.2


2013-05-01 05:12:10

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 15/16] tools: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
tools/btiotest.c | 52 ++++++++++++++++++++++++++--------------------------
1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/tools/btiotest.c b/tools/btiotest.c
index 7a77bb7..5359ace 100644
--- a/tools/btiotest.c
+++ b/tools/btiotest.c
@@ -38,14 +38,14 @@
#include <btio/btio.h>

#define DEFAULT_ACCEPT_TIMEOUT 2
-static gint opt_update_sec = 0;
+static int opt_update_sec = 0;

struct io_data {
guint ref;
GIOChannel *io;
- gint reject;
- gint disconn;
- gint accept;
+ int reject;
+ int disconn;
+ int accept;
};

static void io_data_unref(struct io_data *data)
@@ -67,8 +67,8 @@ static struct io_data *io_data_ref(struct io_data *data)
return data;
}

-static struct io_data *io_data_new(GIOChannel *io, int reject, gint disconn,
- gint accept)
+static struct io_data *io_data_new(GIOChannel *io, int reject, int disconn,
+ int accept)
{
struct io_data *data;

@@ -251,7 +251,7 @@ static void confirm_cb(GIOChannel *io, gpointer user_data)
return;
}
} else {
- gint seconds = (data->reject > 0) ?
+ int seconds = (data->reject > 0) ?
data->reject : data->accept;
g_timeout_add_seconds_full(G_PRIORITY_DEFAULT, seconds,
confirm_timeout, data,
@@ -260,8 +260,8 @@ static void confirm_cb(GIOChannel *io, gpointer user_data)
}

static void l2cap_connect(const char *src, const char *dst, uint8_t addr_type,
- uint16_t psm, uint16_t cid, gint disconn,
- gint sec, gint prio)
+ uint16_t psm, uint16_t cid, int disconn,
+ int sec, int prio)
{
struct io_data *data;
GError *err = NULL;
@@ -301,9 +301,9 @@ static void l2cap_connect(const char *src, const char *dst, uint8_t addr_type,
}
}

-static void l2cap_listen(const char *src, uint16_t psm, gint defer,
- gint reject, gint disconn, gint accept,
- gint sec, gboolean master)
+static void l2cap_listen(const char *src, uint16_t psm, int defer,
+ int reject, int disconn, int accept,
+ int sec, gboolean master)
{
struct io_data *data;
BtIOConnect conn;
@@ -351,7 +351,7 @@ static void l2cap_listen(const char *src, uint16_t psm, gint defer,
}

static void rfcomm_connect(const char *src, const char *dst, uint8_t ch,
- gint disconn, gint sec)
+ int disconn, int sec)
{
struct io_data *data;
GError *err = NULL;
@@ -386,8 +386,8 @@ static void rfcomm_connect(const char *src, const char *dst, uint8_t ch,
}

static void rfcomm_listen(const char *src, uint8_t ch, gboolean defer,
- gint reject, gint disconn, gint accept,
- gint sec, gboolean master)
+ int reject, int disconn, int accept,
+ int sec, gboolean master)
{
struct io_data *data;
BtIOConnect conn;
@@ -436,7 +436,7 @@ static void rfcomm_listen(const char *src, uint8_t ch, gboolean defer,
g_io_channel_unref(rc_srv);
}

-static void sco_connect(const char *src, const char *dst, gint disconn)
+static void sco_connect(const char *src, const char *dst, int disconn)
{
struct io_data *data;
GError *err = NULL;
@@ -466,8 +466,8 @@ static void sco_connect(const char *src, const char *dst, gint disconn)
}
}

-static void sco_listen(const char *src, gboolean defer, gint reject,
- gint disconn, gint accept)
+static void sco_listen(const char *src, gboolean defer, int reject,
+ int disconn, int accept)
{
struct io_data *data;
BtIOConnect conn;
@@ -507,18 +507,18 @@ static void sco_listen(const char *src, gboolean defer, gint reject,
g_io_channel_unref(sco_srv);
}

-static gint opt_channel = -1;
-static gint opt_psm = 0;
+static int opt_channel = -1;
+static int opt_psm = 0;
static gboolean opt_sco = FALSE;
static gboolean opt_defer = FALSE;
static char *opt_dev = NULL;
-static gint opt_reject = -1;
-static gint opt_disconn = -1;
-static gint opt_accept = DEFAULT_ACCEPT_TIMEOUT;
-static gint opt_sec = 0;
+static int opt_reject = -1;
+static int opt_disconn = -1;
+static int opt_accept = DEFAULT_ACCEPT_TIMEOUT;
+static int opt_sec = 0;
static gboolean opt_master = FALSE;
-static gint opt_priority = 0;
-static gint opt_cid = 0;
+static int opt_priority = 0;
+static int opt_cid = 0;
static guint8 opt_addr_type = 0;

static GMainLoop *main_loop;
--
1.8.2.2


2013-05-01 05:12:09

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 14/16] core: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
src/adapter.c | 6 +++---
src/attrib-server.c | 6 +++---
src/device.c | 10 +++++-----
src/device.h | 4 ++--
src/plugin.c | 2 +-
src/sdp-client.c | 2 +-
src/service.c | 2 +-
src/shared/hciemu.c | 2 +-
src/shared/mgmt.c | 4 ++--
9 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 0c0831c..1252e74 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1472,7 +1472,7 @@ static void stop_discovery_complete(uint8_t status, uint16_t length,
}
}

-static gint compare_discovery_sender(gconstpointer a, gconstpointer b)
+static int compare_discovery_sender(gconstpointer a, gconstpointer b)
{
const struct discovery_client *client = a;
const char *sender = b;
@@ -2098,7 +2098,7 @@ static gboolean property_get_modalias(const GDBusPropertyTable *property,
return TRUE;
}

-static gint device_path_cmp(gconstpointer a, gconstpointer b)
+static int device_path_cmp(gconstpointer a, gconstpointer b)
{
const struct btd_device *device = a;
const char *path = b;
@@ -3099,7 +3099,7 @@ static void convert_did_entry(GKeyFile *key_file, void *value)
static void convert_linkkey_entry(GKeyFile *key_file, void *value)
{
char *type_str, *length_str, *str;
- gint val;
+ int val;

type_str = strchr(value, ' ');
if (!type_str)
diff --git a/src/attrib-server.c b/src/attrib-server.c
index 61bc01d..3610e60 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -150,7 +150,7 @@ static void gatt_server_free(struct gatt_server *server)
g_free(server);
}

-static gint adapter_cmp_addr(gconstpointer a, gconstpointer b)
+static int adapter_cmp_addr(gconstpointer a, gconstpointer b)
{
const struct gatt_server *server = a;
const bdaddr_t *bdaddr = b;
@@ -158,7 +158,7 @@ static gint adapter_cmp_addr(gconstpointer a, gconstpointer b)
return bacmp(adapter_get_address(server->adapter), bdaddr);
}

-static gint adapter_cmp(gconstpointer a, gconstpointer b)
+static int adapter_cmp(gconstpointer a, gconstpointer b)
{
const struct gatt_server *server = a;
const struct btd_adapter *adapter = b;
@@ -1176,7 +1176,7 @@ guint attrib_channel_attach(GAttrib *attrib)
return channel->id;
}

-static gint channel_id_cmp(gconstpointer data, gconstpointer user_data)
+static int channel_id_cmp(gconstpointer data, gconstpointer user_data)
{
const struct gatt_channel *channel = data;
guint id = GPOINTER_TO_UINT(user_data);
diff --git a/src/device.c b/src/device.c
index 85610c4..ff4c553 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1242,7 +1242,7 @@ static struct btd_service *find_connectable_service(struct btd_device *dev,
return NULL;
}

-static gint service_prio_cmp(gconstpointer a, gconstpointer b)
+static int service_prio_cmp(gconstpointer a, gconstpointer b)
{
struct btd_profile *p1 = btd_service_get_profile(a);
struct btd_profile *p2 = btd_service_get_profile(b);
@@ -1978,7 +1978,7 @@ static void load_att_info(struct btd_device *device, const char *local,

for (handle = groups; *handle; handle++) {
gboolean uuid_ok;
- gint end;
+ int end;

str = g_key_file_get_string(key_file, *handle, "UUID", NULL);
if (!str)
@@ -2334,7 +2334,7 @@ void device_remove(struct btd_device *device, gboolean remove_stored)
btd_device_unref(device);
}

-gint device_address_cmp(gconstpointer a, gconstpointer b)
+int device_address_cmp(gconstpointer a, gconstpointer b)
{
const struct btd_device *device = a;
const char *address = b;
@@ -2344,7 +2344,7 @@ gint device_address_cmp(gconstpointer a, gconstpointer b)
return strcasecmp(addr, address);
}

-gint device_bdaddr_cmp(gconstpointer a, gconstpointer b)
+int device_bdaddr_cmp(gconstpointer a, gconstpointer b)
{
const struct btd_device *device = a;
const bdaddr_t *bdaddr = b;
@@ -2740,7 +2740,7 @@ static void update_bredr_services(struct browse_req *req, sdp_list_t *recs)
}
}

-static gint primary_cmp(gconstpointer a, gconstpointer b)
+static int primary_cmp(gconstpointer a, gconstpointer b)
{
return memcmp(a, b, sizeof(struct gatt_primary));
}
diff --git a/src/device.h b/src/device.h
index f4db3b9..7cd11af 100644
--- a/src/device.h
+++ b/src/device.h
@@ -43,8 +43,8 @@ uint16_t btd_device_get_vendor_src(struct btd_device *device);
uint16_t btd_device_get_product(struct btd_device *device);
uint16_t btd_device_get_version(struct btd_device *device);
void device_remove(struct btd_device *device, gboolean remove_stored);
-gint device_address_cmp(gconstpointer a, gconstpointer b);
-gint device_bdaddr_cmp(gconstpointer a, gconstpointer b);
+int device_address_cmp(gconstpointer a, gconstpointer b);
+int device_bdaddr_cmp(gconstpointer a, gconstpointer b);
GSList *device_get_uuids(struct btd_device *device);
void device_probe_profiles(struct btd_device *device, GSList *profiles);
const sdp_record_t *btd_device_get_record(struct btd_device *device,
diff --git a/src/plugin.c b/src/plugin.c
index a23e533..51c98bc 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -47,7 +47,7 @@ struct bluetooth_plugin {
struct bluetooth_plugin_desc *desc;
};

-static gint compare_priority(gconstpointer a, gconstpointer b)
+static int compare_priority(gconstpointer a, gconstpointer b)
{
const struct bluetooth_plugin *plugin1 = a;
const struct bluetooth_plugin *plugin2 = b;
diff --git a/src/sdp-client.c b/src/sdp-client.c
index 106344a..fdf2b01 100644
--- a/src/sdp-client.c
+++ b/src/sdp-client.c
@@ -336,7 +336,7 @@ int bt_search_service(const bdaddr_t *src, const bdaddr_t *dst,
return 0;
}

-static gint find_by_bdaddr(gconstpointer data, gconstpointer user_data)
+static int find_by_bdaddr(gconstpointer data, gconstpointer user_data)
{
const struct search_context *ctxt = data, *search = user_data;
int ret;
diff --git a/src/service.c b/src/service.c
index 98fcbfe..aef9502 100644
--- a/src/service.c
+++ b/src/service.c
@@ -47,7 +47,7 @@
#include "service.h"

struct btd_service {
- gint ref;
+ int ref;
struct btd_device *device;
struct btd_profile *profile;
void *user_data;
diff --git a/src/shared/hciemu.c b/src/shared/hciemu.c
index 133f16f..463ef52 100644
--- a/src/shared/hciemu.c
+++ b/src/shared/hciemu.c
@@ -41,7 +41,7 @@
#include "hciemu.h"

struct hciemu {
- gint ref_count;
+ int ref_count;
enum btdev_type btdev_type;
struct bthost *host_stack;
struct btdev *master_dev;
diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c
index ca4b05f..2c79886 100644
--- a/src/shared/mgmt.c
+++ b/src/shared/mgmt.c
@@ -94,7 +94,7 @@ static void destroy_request(gpointer data, gpointer user_data)
g_free(request);
}

-static gint compare_request_id(gconstpointer a, gconstpointer b)
+static int compare_request_id(gconstpointer a, gconstpointer b)
{
const struct mgmt_request *request = a;
unsigned int id = GPOINTER_TO_UINT(b);
@@ -112,7 +112,7 @@ static void destroy_notify(gpointer data, gpointer user_data)
g_free(notify);
}

-static gint compare_notify_id(gconstpointer a, gconstpointer b)
+static int compare_notify_id(gconstpointer a, gconstpointer b)
{
const struct mgmt_notify *notify = a;
unsigned int id = GPOINTER_TO_UINT(b);
--
1.8.2.2


2013-05-01 05:12:08

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 13/16] thermometer: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
profiles/thermometer/thermometer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/profiles/thermometer/thermometer.c b/profiles/thermometer/thermometer.c
index 3757b25..c2ca251 100644
--- a/profiles/thermometer/thermometer.c
+++ b/profiles/thermometer/thermometer.c
@@ -190,7 +190,7 @@ static void destroy_thermometer_adapter(gpointer user_data)
g_free(tadapter);
}

-static gint cmp_adapter(gconstpointer a, gconstpointer b)
+static int cmp_adapter(gconstpointer a, gconstpointer b)
{
const struct thermometer_adapter *tadapter = a;
const struct btd_adapter *adapter = b;
@@ -201,7 +201,7 @@ static gint cmp_adapter(gconstpointer a, gconstpointer b)
return -1;
}

-static gint cmp_device(gconstpointer a, gconstpointer b)
+static int cmp_device(gconstpointer a, gconstpointer b)
{
const struct thermometer *t = a;
const struct btd_device *dev = b;
@@ -212,7 +212,7 @@ static gint cmp_device(gconstpointer a, gconstpointer b)
return -1;
}

-static gint cmp_watcher(gconstpointer a, gconstpointer b)
+static int cmp_watcher(gconstpointer a, gconstpointer b)
{
const struct watcher *watcher = a;
const struct watcher *match = b;
--
1.8.2.2


2013-05-01 05:12:07

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 12/16] scanparam: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
profiles/scanparam/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/scanparam/scan.c b/profiles/scanparam/scan.c
index dbbb4ea..a9baec8 100644
--- a/profiles/scanparam/scan.c
+++ b/profiles/scanparam/scan.c
@@ -66,7 +66,7 @@ struct scan {

static GSList *servers = NULL;

-static gint scan_device_cmp(gconstpointer a, gconstpointer b)
+static int scan_device_cmp(gconstpointer a, gconstpointer b)
{
const struct scan *scan = a;
const struct btd_device *device = b;
--
1.8.2.2


2013-05-01 05:12:06

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 11/16] input: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
profiles/input/hog.c | 2 +-
profiles/input/server.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index c092875..3ce9480 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -539,7 +539,7 @@ static void output_written_cb(guint8 status, const guint8 *pdu,
}
}

-static gint report_type_cmp(gconstpointer a, gconstpointer b)
+static int report_type_cmp(gconstpointer a, gconstpointer b)
{
const struct report *report = a;
uint8_t type = GPOINTER_TO_UINT(b);
diff --git a/profiles/input/server.c b/profiles/input/server.c
index e15ae88..5c98573 100644
--- a/profiles/input/server.c
+++ b/profiles/input/server.c
@@ -55,7 +55,7 @@ struct input_server {
GIOChannel *confirm;
};

-static gint server_cmp(gconstpointer s, gconstpointer user_data)
+static int server_cmp(gconstpointer s, gconstpointer user_data)
{
const struct input_server *server = s;
const bdaddr_t *src = user_data;
--
1.8.2.2


2013-05-01 05:12:05

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 10/16] heartrate: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
profiles/heartrate/heartrate.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c
index 3a2d419..8de81bb 100644
--- a/profiles/heartrate/heartrate.c
+++ b/profiles/heartrate/heartrate.c
@@ -115,7 +115,7 @@ static const char *location2str(uint8_t value)
return NULL;
}

-static gint cmp_adapter(gconstpointer a, gconstpointer b)
+static int cmp_adapter(gconstpointer a, gconstpointer b)
{
const struct heartrate_adapter *hradapter = a;
const struct btd_adapter *adapter = b;
@@ -126,7 +126,7 @@ static gint cmp_adapter(gconstpointer a, gconstpointer b)
return -1;
}

-static gint cmp_device(gconstpointer a, gconstpointer b)
+static int cmp_device(gconstpointer a, gconstpointer b)
{
const struct heartrate *hr = a;
const struct btd_device *dev = b;
@@ -137,7 +137,7 @@ static gint cmp_device(gconstpointer a, gconstpointer b)
return -1;
}

-static gint cmp_watcher(gconstpointer a, gconstpointer b)
+static int cmp_watcher(gconstpointer a, gconstpointer b)
{
const struct watcher *watcher = a;
const struct watcher *match = b;
--
1.8.2.2


2013-05-01 05:12:04

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 09/16] health: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
profiles/health/hdp.c | 10 +++++-----
profiles/health/hdp_types.h | 6 +++---
profiles/health/mcap.c | 6 +++---
profiles/health/mcap_internal.h | 6 +++---
4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/profiles/health/hdp.c b/profiles/health/hdp.c
index e351219..7f24756 100644
--- a/profiles/health/hdp.c
+++ b/profiles/health/hdp.c
@@ -211,14 +211,14 @@ static int cmp_device(gconstpointer a, gconstpointer b)
return -1;
}

-static gint cmp_dev_addr(gconstpointer a, gconstpointer dst)
+static int cmp_dev_addr(gconstpointer a, gconstpointer dst)
{
const struct hdp_device *device = a;

return bacmp(device_get_address(device->dev), dst);
}

-static gint cmp_dev_mcl(gconstpointer a, gconstpointer mcl)
+static int cmp_dev_mcl(gconstpointer a, gconstpointer mcl)
{
const struct hdp_device *device = a;

@@ -227,7 +227,7 @@ static gint cmp_dev_mcl(gconstpointer a, gconstpointer mcl)
return -1;
}

-static gint cmp_chan_mdlid(gconstpointer a, gconstpointer b)
+static int cmp_chan_mdlid(gconstpointer a, gconstpointer b)
{
const struct hdp_channel *chan = a;
const uint16_t *mdlid = b;
@@ -235,7 +235,7 @@ static gint cmp_chan_mdlid(gconstpointer a, gconstpointer b)
return chan->mdlid - *mdlid;
}

-static gint cmp_chan_path(gconstpointer a, gconstpointer b)
+static int cmp_chan_path(gconstpointer a, gconstpointer b)
{
const struct hdp_channel *chan = a;
const char *path = b;
@@ -243,7 +243,7 @@ static gint cmp_chan_path(gconstpointer a, gconstpointer b)
return g_ascii_strcasecmp(chan->path, path);
}

-static gint cmp_chan_mdl(gconstpointer a, gconstpointer mdl)
+static int cmp_chan_mdl(gconstpointer a, gconstpointer mdl)
{
const struct hdp_channel *chan = a;

diff --git a/profiles/health/hdp_types.h b/profiles/health/hdp_types.h
index aff16df..b34b5e0 100644
--- a/profiles/health/hdp_types.h
+++ b/profiles/health/hdp_types.h
@@ -77,7 +77,7 @@ struct hdp_application {
uint8_t id; /* The identification is also the mdepid */
char *oname; /* Name of the owner application */
guint dbus_watcher; /* Watch for clients disconnection */
- gint ref; /* Reference counter */
+ int ref; /* Reference counter */
};

struct hdp_adapter {
@@ -98,7 +98,7 @@ struct hdp_device {
GSList *channels; /* Data Channel list */
struct hdp_channel *ndc; /* Data channel being negotiated */
struct hdp_channel *fr; /* First reliable data channel */
- gint ref; /* Reference counting */
+ int ref; /* Reference counting */
};

struct hdp_echo_data;
@@ -114,7 +114,7 @@ struct hdp_channel {
uint16_t imtu; /* Channel incoming MTU */
uint16_t omtu; /* Channel outgoing MTU */
struct hdp_echo_data *edata; /* private data used by echo channels */
- gint ref; /* Reference counter */
+ int ref; /* Reference counter */
};

#endif /* __HDP_TYPES_H__ */
diff --git a/profiles/health/mcap.c b/profiles/health/mcap.c
index f08a7fa..6d821f3 100644
--- a/profiles/health/mcap.c
+++ b/profiles/health/mcap.c
@@ -253,7 +253,7 @@ static void free_mdl(struct mcap_mdl *mdl)
g_free(mdl);
}

-static gint cmp_mdl_state(gconstpointer a, gconstpointer b)
+static int cmp_mdl_state(gconstpointer a, gconstpointer b)
{
const struct mcap_mdl *mdl = a;
const MDLState *st = b;
@@ -433,7 +433,7 @@ static mcap_md_create_mdl_req *create_mdl_req(uint16_t mdl_id, uint8_t mdep,
return req_mdl;
}

-static gint compare_mdl(gconstpointer a, gconstpointer b)
+static int compare_mdl(gconstpointer a, gconstpointer b)
{
const struct mcap_mdl *mdla = a;
const struct mcap_mdl *mdlb = b;
@@ -1274,7 +1274,7 @@ static gboolean check_err_rsp(struct mcap_mcl *mcl, mcap_rsp *rsp,
uint32_t rlen, uint32_t len, GError **gerr)
{
mcap_md_req *cmdlast = (mcap_md_req *) mcl->lcmd;
- gint err = MCAP_ERROR_FAILED;
+ int err = MCAP_ERROR_FAILED;
gboolean close = FALSE;
char *msg;

diff --git a/profiles/health/mcap_internal.h b/profiles/health/mcap_internal.h
index 7b044ef..7191b23 100644
--- a/profiles/health/mcap_internal.h
+++ b/profiles/health/mcap_internal.h
@@ -74,7 +74,7 @@ struct mcap_instance {
mcap_mcl_event_cb mcl_uncached_cb; /* MCL has been removed from MCAP cache */
mcap_info_ind_event_cb mcl_sync_infoind_cb; /* (CSP Master) Received info indication */
gpointer user_data; /* Data to be provided in callbacks */
- gint ref; /* Reference counter */
+ int ref; /* Reference counter */

gboolean csp_enabled; /* CSP: functionality enabled */
};
@@ -95,7 +95,7 @@ struct mcap_mcl {
struct mcap_mdl_cb *cb; /* MDL callbacks */
guint tid; /* Timer id for waiting for a response */
uint8_t *lcmd; /* Last command sent */
- gint ref; /* References counter */
+ int ref; /* References counter */
uint8_t ctrl; /* MCL control flag */
uint16_t next_mdl; /* id used to create next MDL */
struct mcap_csp *csp; /* CSP control structure */
@@ -115,7 +115,7 @@ struct mcap_mdl {
uint16_t mdlid; /* MDL id */
uint8_t mdep_id; /* MCAP Data End Point */
MDLState state; /* MDL state */
- gint ref; /* References counter */
+ int ref; /* References counter */
};

struct sync_info_ind_data {
--
1.8.2.2


2013-05-01 05:12:03

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 08/16] gatt: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
profiles/gatt/gas.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/gatt/gas.c b/profiles/gatt/gas.c
index 39e9421..2ed837f 100644
--- a/profiles/gatt/gas.c
+++ b/profiles/gatt/gas.c
@@ -71,7 +71,7 @@ static void gas_free(struct gas *gas)
g_free(gas);
}

-static gint cmp_device(gconstpointer a, gconstpointer b)
+static int cmp_device(gconstpointer a, gconstpointer b)
{
const struct gas *gas = a;
const struct btd_device *device = b;
--
1.8.2.2


2013-05-01 05:12:02

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 07/16] deviceinfo: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
profiles/deviceinfo/deviceinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/deviceinfo/deviceinfo.c b/profiles/deviceinfo/deviceinfo.c
index fc8babd..e8cb5f7 100644
--- a/profiles/deviceinfo/deviceinfo.c
+++ b/profiles/deviceinfo/deviceinfo.c
@@ -75,7 +75,7 @@ static void deviceinfo_free(gpointer user_data)
g_free(d);
}

-static gint cmp_device(gconstpointer a, gconstpointer b)
+static int cmp_device(gconstpointer a, gconstpointer b)
{
const struct deviceinfo *d = a;
const struct btd_device *dev = b;
--
1.8.2.2


2013-05-01 05:12:01

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 06/16] cyclingspeed: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
profiles/cyclingspeed/cyclingspeed.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/profiles/cyclingspeed/cyclingspeed.c b/profiles/cyclingspeed/cyclingspeed.c
index 6080f09..76be234 100644
--- a/profiles/cyclingspeed/cyclingspeed.c
+++ b/profiles/cyclingspeed/cyclingspeed.c
@@ -166,7 +166,7 @@ static int str2location(const char *location)
return -1;
}

-static gint cmp_adapter(gconstpointer a, gconstpointer b)
+static int cmp_adapter(gconstpointer a, gconstpointer b)
{
const struct csc_adapter *cadapter = a;
const struct btd_adapter *adapter = b;
@@ -177,7 +177,7 @@ static gint cmp_adapter(gconstpointer a, gconstpointer b)
return -1;
}

-static gint cmp_device(gconstpointer a, gconstpointer b)
+static int cmp_device(gconstpointer a, gconstpointer b)
{
const struct csc *csc = a;
const struct btd_device *dev = b;
@@ -188,7 +188,7 @@ static gint cmp_device(gconstpointer a, gconstpointer b)
return -1;
}

-static gint cmp_watcher(gconstpointer a, gconstpointer b)
+static int cmp_watcher(gconstpointer a, gconstpointer b)
{
const struct watcher *watcher = a;
const struct watcher *match = b;
--
1.8.2.2


2013-05-01 05:12:00

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 05/16] audio: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
profiles/audio/media.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 59fc840..4c23960 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -368,7 +368,7 @@ static gboolean select_configuration(struct media_endpoint *endpoint,
return media_endpoint_async_call(msg, endpoint, cb, user_data, destroy);
}

-static gint transport_device_cmp(gconstpointer data, gconstpointer user_data)
+static int transport_device_cmp(gconstpointer data, gconstpointer user_data)
{
struct media_transport *transport = (struct media_transport *) data;
const struct audio_device *device = user_data;
--
1.8.2.2


2013-05-01 05:11:59

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 04/16] plugins: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
plugins/gatt-example.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/gatt-example.c b/plugins/gatt-example.c
index bd0fbff..37972e8 100644
--- a/plugins/gatt-example.c
+++ b/plugins/gatt-example.c
@@ -83,7 +83,7 @@ static void gatt_example_adapter_free(struct gatt_example_adapter *gadapter)
g_free(gadapter);
}

-static gint adapter_cmp(gconstpointer a, gconstpointer b)
+static int adapter_cmp(gconstpointer a, gconstpointer b)
{
const struct gatt_example_adapter *gatt_adapter = a;
const struct btd_adapter *adapter = b;
--
1.8.2.2


2013-05-01 05:11:58

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 03/16] obexd: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
obexd/client/ftp.c | 2 +-
obexd/client/map.c | 10 +++++-----
obexd/client/mns.c | 2 +-
obexd/client/pbap.c | 6 +++---
obexd/client/session.c | 4 ++--
obexd/client/transfer.c | 2 +-
obexd/plugins/messages-dummy.c | 2 +-
7 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/obexd/client/ftp.c b/obexd/client/ftp.c
index a4cf3fc..fa85708 100644
--- a/obexd/client/ftp.c
+++ b/obexd/client/ftp.c
@@ -106,7 +106,7 @@ static void xml_element(GMarkupParseContext *ctxt,
{
DBusMessageIter dict, *iter = user_data;
char *key;
- gint i;
+ int i;

if (strcasecmp("folder", element) != 0 && strcasecmp("file", element) != 0)
return;
diff --git a/obexd/client/map.c b/obexd/client/map.c
index 2e09030..0285286 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -184,7 +184,7 @@ static void folder_element(GMarkupParseContext *ctxt, const char *element,
{
DBusMessageIter dict, *iter = user_data;
const char *key;
- gint i;
+ int i;

if (strcasecmp("folder", element) != 0)
return;
@@ -976,7 +976,7 @@ static void msg_element(GMarkupParseContext *ctxt, const char *element,
DBusMessageIter entry, dict, *iter = parser->iter;
struct map_msg *msg;
const char *key;
- gint i;
+ int i;

if (strcasecmp("msg", element) != 0)
return;
@@ -1411,10 +1411,10 @@ static DBusMessage *map_list_messages(DBusConnection *connection,
return get_message_listing(map, message, folder, apparam);
}

-static char **get_filter_strs(uint64_t filter, gint *size)
+static char **get_filter_strs(uint64_t filter, int *size)
{
char **list, **item;
- gint i;
+ int i;

list = g_malloc0(sizeof(char **) * (FILTER_BIT_MAX + 2));

@@ -1433,7 +1433,7 @@ static DBusMessage *map_list_filter_fields(DBusConnection *connection,
DBusMessage *message, void *user_data)
{
char **filters = NULL;
- gint size;
+ int size;
DBusMessage *reply;

filters = get_filter_strs(FILTER_ALL, &size);
diff --git a/obexd/client/mns.c b/obexd/client/mns.c
index 9a86462..8095b9e 100644
--- a/obexd/client/mns.c
+++ b/obexd/client/mns.c
@@ -220,7 +220,7 @@ static void event_report_element(GMarkupParseContext *ctxt,
{
struct map_event *event = user_data;
const char *key;
- gint i;
+ int i;

if (strcasecmp("event", element) != 0)
return;
diff --git a/obexd/client/pbap.c b/obexd/client/pbap.c
index 25cc17c..2089860 100644
--- a/obexd/client/pbap.c
+++ b/obexd/client/pbap.c
@@ -876,10 +876,10 @@ static DBusMessage *pbap_get_size(DBusConnection *connection,
return pull_phonebook(pbap, message, GETPHONEBOOKSIZE, NULL, apparam);
}

-static char **get_filter_strs(uint64_t filter, gint *size)
+static char **get_filter_strs(uint64_t filter, int *size)
{
char **list, **item;
- gint i;
+ int i;

list = g_malloc0(sizeof(char **) * (FILTER_BIT_MAX + 2));

@@ -902,7 +902,7 @@ static DBusMessage *pbap_list_filter_fields(DBusConnection *connection,
DBusMessage *message, void *user_data)
{
char **filters = NULL;
- gint size;
+ int size;
DBusMessage *reply;

filters = get_filter_strs(FILTER_ALL, &size);
diff --git a/obexd/client/session.c b/obexd/client/session.c
index 32c847c..0fbfe41 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -83,7 +83,7 @@ struct setpath_data {

struct obc_session {
guint id;
- gint refcount;
+ int refcount;
char *source;
char *destination;
uint8_t channel;
@@ -721,7 +721,7 @@ static void session_process_queue(struct obc_session *session)
obc_session_unref(session);
}

-static gint pending_transfer_cmptransfer(gconstpointer a, gconstpointer b)
+static int pending_transfer_cmptransfer(gconstpointer a, gconstpointer b)
{
const struct pending_request *p = a;
const struct obc_transfer *transfer = b;
diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c
index 427eab7..4b1def3 100644
--- a/obexd/client/transfer.c
+++ b/obexd/client/transfer.c
@@ -536,7 +536,7 @@ static gboolean get_xfer_progress(const void *buf, gsize len,
struct obc_transfer *transfer = user_data;

if (transfer->fd > 0) {
- gint w;
+ int w;

w = write(transfer->fd, buf, len);
if (w < 0)
diff --git a/obexd/plugins/messages-dummy.c b/obexd/plugins/messages-dummy.c
index 4c66f51..bb0627f 100644
--- a/obexd/plugins/messages-dummy.c
+++ b/obexd/plugins/messages-dummy.c
@@ -57,7 +57,7 @@ struct folder_listing_data {
* seem to follow the fig. 3-2 from MAP specification v1.0, and I've seen a
* test suite requiring folder listing to be in that order.
*/
-static gint folder_names_cmp(gconstpointer a, gconstpointer b,
+static int folder_names_cmp(gconstpointer a, gconstpointer b,
gpointer user_data)
{
static const char *order[] = {
--
1.8.2.2


2013-05-01 05:11:57

by Lucas De Marchi

[permalink] [raw]
Subject: [PATCH BlueZ 02/16] gobex: Get rid of gint

From: Lucas De Marchi <[email protected]>

Use plain int instead of gint. In glib gint is always a typedef to int, so it's safe to use it even for callbacks with glib.
---
gobex/gobex.c | 14 +++++++-------
gobex/gobex.h | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gobex/gobex.c b/gobex/gobex.c
index 6badfeb..deeab40 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -55,7 +55,7 @@ struct srm_config {
};

struct _GObex {
- gint ref_count;
+ int ref_count;
GIOChannel *io;
guint io_source;

@@ -623,7 +623,7 @@ static void prepare_srm_req(GObex *obex, GObexPacket *pkt)
g_obex_packet_prepend_header(pkt, hdr);
}

-guint g_obex_send_req(GObex *obex, GObexPacket *req, gint timeout,
+guint g_obex_send_req(GObex *obex, GObexPacket *req, int timeout,
GObexResponseFunc func, gpointer user_data,
GError **err)
{
@@ -677,7 +677,7 @@ create_pending:
return p->id;
}

-static gint pending_pkt_cmp(gconstpointer a, gconstpointer b)
+static int pending_pkt_cmp(gconstpointer a, gconstpointer b)
{
const struct pending_pkt *p = a;
guint id = GPOINTER_TO_UINT(b);
@@ -782,20 +782,20 @@ void g_obex_set_disconnect_function(GObex *obex, GObexFunc func,
obex->disconn_func_data = user_data;
}

-static gint req_handler_cmpop(gconstpointer a, gconstpointer b)
+static int req_handler_cmpop(gconstpointer a, gconstpointer b)
{
const struct req_handler *handler = a;
guint opcode = GPOINTER_TO_UINT(b);

- return (gint) handler->opcode - (gint) opcode;
+ return (int) handler->opcode - (int) opcode;
}

-static gint req_handler_cmpid(gconstpointer a, gconstpointer b)
+static int req_handler_cmpid(gconstpointer a, gconstpointer b)
{
const struct req_handler *handler = a;
guint id = GPOINTER_TO_UINT(b);

- return (gint) handler->id - (gint) id;
+ return (int) handler->id - (int) id;
}

guint g_obex_add_request_function(GObex *obex, guint8 opcode,
diff --git a/gobex/gobex.h b/gobex/gobex.h
index c42c42c..3ac7b13 100644
--- a/gobex/gobex.h
+++ b/gobex/gobex.h
@@ -44,7 +44,7 @@ typedef void (*GObexResponseFunc) (GObex *obex, GError *err, GObexPacket *rsp,

gboolean g_obex_send(GObex *obex, GObexPacket *pkt, GError **err);

-guint g_obex_send_req(GObex *obex, GObexPacket *req, gint timeout,
+guint g_obex_send_req(GObex *obex, GObexPacket *req, int timeout,
GObexResponseFunc func, gpointer user_data,
GError **err);
gboolean g_obex_cancel_req(GObex *obex, guint req_id,
--
1.8.2.2