OSDN Git Service

gobex: Get rid of gint
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 1 May 2013 05:27:56 +0000 (02:27 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 1 May 2013 06:04:21 +0000 (09:04 +0300)
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
gobex/gobex.h

index ce4f284..9be5d39 100644 (file)
@@ -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,
index c42c42c..3ac7b13 100644 (file)
@@ -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,