]> granicus.if.org Git - transmission/commitdiff
function pointer type correctness. mikedld
authorJordan Lee <jordan@transmissionbt.com>
Sun, 8 Sep 2013 17:08:18 +0000 (17:08 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 8 Sep 2013 17:08:18 +0000 (17:08 +0000)
15 files changed:
gtk/file-list.c
libtransmission/announcer-common.h
libtransmission/announcer-http.c
libtransmission/announcer-udp.c
libtransmission/announcer.h
libtransmission/peer-common.h
libtransmission/peer-msgs.h
libtransmission/session.h
libtransmission/torrent.c
libtransmission/torrent.h
libtransmission/transmission.h
libtransmission/web.c
libtransmission/web.h
libtransmission/webseed.c
libtransmission/webseed.h

index 3e80d799ead567ec56c4532cf44fe023526bd68b..a8ef580e1c77e35de08ca422615da3756696d40c 100644 (file)
@@ -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);
index f5a66f89e8fa19b595fb94e4727cacb1e025107c..694b743dff96405fb1de0bb85e599909cb197ea9 100644 (file)
@@ -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,
index f0c46dc4f4f3391af40e34bfd5b4d5fce06a1103..556f3b29aa4f0bc380fc15322b8632504c25ef16 100644 (file)
@@ -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];
 };
index 15ef0503cf7c071369bbd7c935b708fa872f8bfa..b5bfea66a8f4d0b4dfa15ca74ebca62b5d79dda7 100644 (file)
@@ -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;
 };
 
index c7078d7c450b4ffc09e6cd055c2cadbc9c8566d6..4ffbeb1faded89b56a15d25a1d98f0fcf92c36fe 100644 (file)
@@ -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 *);
index 64a0fda83c4be671db152c59e7aa8d53bebe627a..0075cb91d2aa5a5e2c09cb4baa78ea569fe1ff31 100644 (file)
@@ -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);
 
 /***
 ****
index 8ebff953f49f246e40d3232a815311f80010fa2a..7ec15aebd97deac4606d8eb6171ce17ecedfa6f8 100644 (file)
@@ -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);
index 6a08ebe5f293d423bc2d0bf7355cd40c7d48409b..c887d0ce50aac36c11a040aeb85ba5109b39cf0b 100644 (file)
@@ -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;
index 4b73e6228d6722c809be2242562bb7bda69c9785..ab92da161938675375489e84591e70cf577c42a6 100644 (file)
@@ -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;
 };
 
index 8ffa355cb8df767ad8fe5652bf3896111a0ca932..b9035e014fbdf80d2f9d058eab65203d6b4b66b9 100644 (file)
@@ -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;
index 051f410e613c3b44c9882b9ce4c94e7ab3f7792d..1e805d1729c6f874ec18780afe087fdabe83ff69 100644 (file)
@@ -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.
index 39c86516d9d4ee82c5a81a8339c8b32ea48df4ec..5d8ecab8ae48c89835d9c8c0e9ad50839517281e 100644 (file)
@@ -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;
index dc45a59c49778d4c8c9e5d919b13ba8c04daec91..935e65327b749ea48f7207193029e0af80f00a7d 100644 (file)
@@ -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);
 
index dd17cd66e2d422847a5b281834b799ad1121aa2a..11a6c92daab021cd7e5aa34bd4811fa031ead020 100644 (file)
@@ -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);
index 9099fb64fcdc8626b49e3e44478a25774e646ad9..13f8a1ac953bc3b295f54b42545b0fcef0808f93 100644 (file)
@@ -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