From: Jordan Lee Date: Sun, 8 Sep 2013 17:08:18 +0000 (+0000) Subject: function pointer type correctness. mikedld X-Git-Tag: 2.83~92 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c8bda880500e6de7fb9c00cb47687a0b6ba217f;p=transmission function pointer type correctness. mikedld --- diff --git a/gtk/file-list.c b/gtk/file-list.c index 3e80d799e..a8ef580e1 100644 --- a/gtk/file-list.c +++ b/gtk/file-list.c @@ -881,7 +881,7 @@ cell_edited_callback (GtkCellRendererText * cell G_GNUC_UNUSED, rename_data->newname = g_strdup (newname); rename_data->file_data = data; rename_data->path_string = g_strdup (path_string); - tr_torrentRenamePath (tor, oldpath->str, newname, (tr_torrent_rename_done_func*)on_rename_done, rename_data); + tr_torrentRenamePath (tor, oldpath->str, newname, (tr_torrent_rename_done_func)on_rename_done, rename_data); /* cleanup */ g_string_free (oldpath, TRUE); diff --git a/libtransmission/announcer-common.h b/libtransmission/announcer-common.h index f5a66f89e..694b743df 100644 --- a/libtransmission/announcer-common.h +++ b/libtransmission/announcer-common.h @@ -96,8 +96,8 @@ typedef struct } tr_scrape_response; -typedef void tr_scrape_response_func (const tr_scrape_response * response, - void * user_data); +typedef void (*tr_scrape_response_func) (const tr_scrape_response * response, + void * user_data); void tr_tracker_http_scrape (tr_session * session, const tr_scrape_request * req, @@ -223,8 +223,8 @@ typedef struct } tr_announce_response; -typedef void tr_announce_response_func (const tr_announce_response * response, - void * userdata); +typedef void (*tr_announce_response_func) (const tr_announce_response * response, + void * userdata); void tr_tracker_http_announce (tr_session * session, const tr_announce_request * req, diff --git a/libtransmission/announcer-http.c b/libtransmission/announcer-http.c index f0c46dc4f..556f3b29a 100644 --- a/libtransmission/announcer-http.c +++ b/libtransmission/announcer-http.c @@ -164,7 +164,7 @@ listToPex (tr_variant * peerList, size_t * setme_len) struct announce_data { tr_announce_response response; - tr_announce_response_func * response_func; + tr_announce_response_func response_func; void * response_func_user_data; char log_name[128]; }; @@ -318,7 +318,7 @@ tr_tracker_http_announce (tr_session * session, struct scrape_data { tr_scrape_response response; - tr_scrape_response_func * response_func; + tr_scrape_response_func response_func; void * response_func_user_data; char log_name[128]; }; diff --git a/libtransmission/announcer-udp.c b/libtransmission/announcer-udp.c index 15ef0503c..b5bfea66a 100644 --- a/libtransmission/announcer-udp.c +++ b/libtransmission/announcer-udp.c @@ -156,7 +156,7 @@ struct tau_scrape_request tau_transaction_t transaction_id; tr_scrape_response response; - tr_scrape_response_func * callback; + tr_scrape_response_func callback; void * user_data; }; @@ -286,7 +286,7 @@ struct tau_announce_request tau_transaction_t transaction_id; tr_announce_response response; - tr_announce_response_func * callback; + tr_announce_response_func callback; void * user_data; }; diff --git a/libtransmission/announcer.h b/libtransmission/announcer.h index c7078d7c4..4ffbeb1fa 100644 --- a/libtransmission/announcer.h +++ b/libtransmission/announcer.h @@ -56,9 +56,9 @@ typedef struct } tr_tracker_event; -typedef void tr_tracker_callback (tr_torrent * tor, - const tr_tracker_event * event, - void * client_data); +typedef void (*tr_tracker_callback) (tr_torrent * tor, + const tr_tracker_event * event, + void * client_data); /** *** Session ctor/dtor @@ -73,7 +73,7 @@ void tr_announcerClose (tr_session *); **/ struct tr_torrent_tiers * tr_announcerAddTorrent (tr_torrent * torrent, - tr_tracker_callback * cb, + tr_tracker_callback cb, void * cbdata); bool tr_announcerHasBacklog (const struct tr_announcer *); diff --git a/libtransmission/peer-common.h b/libtransmission/peer-common.h index 64a0fda83..0075cb91d 100644 --- a/libtransmission/peer-common.h +++ b/libtransmission/peer-common.h @@ -75,9 +75,9 @@ tr_peer_event; extern const tr_peer_event TR_PEER_EVENT_INIT; -typedef void tr_peer_callback (struct tr_peer * peer, - const tr_peer_event * event, - void * client_data); +typedef void (*tr_peer_callback) (struct tr_peer * peer, + const tr_peer_event * event, + void * client_data); /*** **** diff --git a/libtransmission/peer-msgs.h b/libtransmission/peer-msgs.h index 8ebff953f..7ec15aebd 100644 --- a/libtransmission/peer-msgs.h +++ b/libtransmission/peer-msgs.h @@ -41,7 +41,7 @@ tr_peerMsgs* tr_peerMsgsCast (void * msgs); tr_peerMsgs* tr_peerMsgsNew (struct tr_torrent * torrent, struct tr_peerIo * io, - tr_peer_callback * callback, + tr_peer_callback callback, void * callback_data); bool tr_peerMsgsIsPeerChoked (const tr_peerMsgs * msgs); diff --git a/libtransmission/session.h b/libtransmission/session.h index 6a08ebe5f..c887d0ce5 100644 --- a/libtransmission/session.h +++ b/libtransmission/session.h @@ -58,8 +58,6 @@ struct tr_cache; struct tr_fdInfo; struct tr_device_info; -typedef void (tr_web_config_func)(tr_session * session, void * curl_pointer, const char * url, void * user_data); - struct tr_turtle_info { /* TR_UP and TR_DOWN speed limits */ @@ -81,7 +79,7 @@ struct tr_turtle_info tr_sched_day days; /* called when isEnabled changes */ - tr_altSpeedFunc * callback; + tr_altSpeedFunc callback; /* the callback's user_data argument */ void * callbackUserData; diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 4b73e6228..ab92da161 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -1939,9 +1939,9 @@ tr_torrentFree (tr_torrent * tor) struct remove_data { - tr_torrent * tor; - bool deleteFlag; - tr_fileFunc * deleteFunc; + tr_torrent * tor; + bool deleteFlag; + tr_fileFunc deleteFunc; }; static void tr_torrentDeleteLocalData (tr_torrent *, tr_fileFunc); @@ -3696,7 +3696,7 @@ struct rename_data tr_torrent * tor; char * oldpath; char * newname; - tr_torrent_rename_done_func * callback; + tr_torrent_rename_done_func callback; void * callback_user_data; }; diff --git a/libtransmission/torrent.h b/libtransmission/torrent.h index 8ffa355cb..b9035e014 100644 --- a/libtransmission/torrent.h +++ b/libtransmission/torrent.h @@ -228,16 +228,16 @@ struct tr_torrent int queuePosition; - tr_torrent_metadata_func * metadata_func; + tr_torrent_metadata_func metadata_func; void * metadata_func_user_data; - tr_torrent_completeness_func * completeness_func; - void * completeness_func_user_data; + tr_torrent_completeness_func completeness_func; + void * completeness_func_user_data; - tr_torrent_ratio_limit_hit_func * ratio_limit_hit_func; + tr_torrent_ratio_limit_hit_func ratio_limit_hit_func; void * ratio_limit_hit_func_user_data; - tr_torrent_idle_limit_hit_func * idle_limit_hit_func; + tr_torrent_idle_limit_hit_func idle_limit_hit_func; void * idle_limit_hit_func_user_data; void * queue_started_user_data; diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 051f410e6..1e805d172 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -651,13 +651,13 @@ tr_sched_day; void tr_sessionSetAltSpeedDay (tr_session *, tr_sched_day day); tr_sched_day tr_sessionGetAltSpeedDay (const tr_session *); -typedef void (tr_altSpeedFunc)(tr_session *, +typedef void (*tr_altSpeedFunc)(tr_session *, bool active, bool userDriven, void *); void tr_sessionClearAltSpeedFunc (tr_session *); -void tr_sessionSetAltSpeedFunc (tr_session *, tr_altSpeedFunc *, void *); +void tr_sessionSetAltSpeedFunc (tr_session *, tr_altSpeedFunc, void *); bool tr_sessionGetActiveSpeedLimit_KBps (const tr_session * session, @@ -1106,7 +1106,7 @@ tr_torrent * tr_torrentNew (const tr_ctor * ctor, /** @addtogroup tr_torrent Torrents @{ */ -typedef int tr_fileFunc (const char * filename); +typedef int (*tr_fileFunc) (const char * filename); /** @brief Removes our .torrent and .resume files for this torrent */ void tr_torrentRemove (tr_torrent * torrent, @@ -1120,11 +1120,11 @@ void tr_torrentStart (tr_torrent * torrent); void tr_torrentStop (tr_torrent * torrent); -typedef void (tr_torrent_rename_done_func)(tr_torrent * torrent, - const char * oldpath, - const char * newname, - int error, - void * user_data); +typedef void (*tr_torrent_rename_done_func)(tr_torrent * torrent, + const char * oldpath, + const char * newname, + int error, + void * user_data); /** * @brief Rename a file or directory in a torrent. @@ -1432,16 +1432,16 @@ tr_completeness; * @param wasRunning whether or not the torrent was running when * it changed its completeness state */ -typedef void (tr_torrent_completeness_func)(tr_torrent * torrent, - tr_completeness completeness, - bool wasRunning, - void * user_data); +typedef void (*tr_torrent_completeness_func)(tr_torrent * torrent, + tr_completeness completeness, + bool wasRunning, + void * user_data); -typedef void (tr_torrent_ratio_limit_hit_func)(tr_torrent * torrent, - void * user_data); +typedef void (*tr_torrent_ratio_limit_hit_func)(tr_torrent * torrent, + void * user_data); -typedef void (tr_torrent_idle_limit_hit_func)(tr_torrent * torrent, - void * user_data); +typedef void (*tr_torrent_idle_limit_hit_func)(tr_torrent * torrent, + void * user_data); /** @@ -1466,8 +1466,8 @@ void tr_torrentClearCompletenessCallback (tr_torrent * torrent); -typedef void (tr_torrent_metadata_func)(tr_torrent * torrent, - void * user_data); +typedef void (*tr_torrent_metadata_func)(tr_torrent * torrent, + void * user_data); /** * Register to be notified whenever a torrent changes from * having incomplete metadata to having complete metadata. diff --git a/libtransmission/web.c b/libtransmission/web.c index 39c86516d..5d8ecab8a 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -76,7 +76,7 @@ struct tr_web_task char * range; char * cookies; tr_session * session; - tr_web_done_func * done_func; + tr_web_done_func done_func; void * done_func_user_data; CURL * curl_easy; struct tr_web_task * next; diff --git a/libtransmission/web.h b/libtransmission/web.h index dc45a59c4..935e65327 100644 --- a/libtransmission/web.h +++ b/libtransmission/web.h @@ -39,13 +39,13 @@ tr_web_close_mode; void tr_webClose (tr_session * session, tr_web_close_mode close_mode); -typedef void (tr_web_done_func)(tr_session * session, - bool timeout_flag, - bool did_connect_flag, - long response_code, - const void * response, - size_t response_byte_count, - void * user_data); +typedef void (*tr_web_done_func)(tr_session * session, + bool timeout_flag, + bool did_connect_flag, + long response_code, + const void * response, + size_t response_byte_count, + void * user_data); const char * tr_webGetResponseStr (long response_code); diff --git a/libtransmission/webseed.c b/libtransmission/webseed.c index dd17cd66e..11a6c92da 100644 --- a/libtransmission/webseed.c +++ b/libtransmission/webseed.c @@ -48,7 +48,7 @@ struct tr_webseed tr_peer parent; tr_bandwidth bandwidth; tr_session * session; - tr_peer_callback * callback; + tr_peer_callback callback; void * callback_data; tr_list * tasks; struct event * timer; @@ -595,7 +595,7 @@ static const struct tr_peer_virtual_funcs my_funcs = tr_webseed* tr_webseedNew (struct tr_torrent * tor, const char * url, - tr_peer_callback * callback, + tr_peer_callback callback, void * callback_data) { tr_webseed * w = tr_new0 (tr_webseed, 1); diff --git a/libtransmission/webseed.h b/libtransmission/webseed.h index 9099fb64f..13f8a1ac9 100644 --- a/libtransmission/webseed.h +++ b/libtransmission/webseed.h @@ -23,7 +23,7 @@ typedef struct tr_webseed tr_webseed; tr_webseed* tr_webseedNew (struct tr_torrent * torrent, const char * url, - tr_peer_callback * callback, + tr_peer_callback callback, void * callback_data); #endif