mirror of
https://github.com/transmission/transmission
synced 2025-01-30 19:03:04 +00:00
Switch from UNUSED macro to TR_UNUSED macro
Since there is no way to mark parameters as [potentially] unused in standard C and when using MSVC compiler, use the widely accepted cast-to-void approach instead.
This commit is contained in:
parent
077f4d8d2b
commit
ff8d0dbf3b
56 changed files with 755 additions and 242 deletions
|
@ -135,9 +135,14 @@ static char* tr_strlratio(char* buf, double ratio, size_t buflen)
|
|||
|
||||
static bool waitingOnWeb;
|
||||
|
||||
static void onTorrentFileDownloaded(tr_session* session UNUSED, bool did_connect UNUSED, bool did_timeout UNUSED,
|
||||
long response_code UNUSED, void const* response, size_t response_byte_count, void* ctor)
|
||||
static void onTorrentFileDownloaded(tr_session* session, bool did_connect, bool did_timeout,
|
||||
long response_code, void const* response, size_t response_byte_count, void* ctor)
|
||||
{
|
||||
TR_UNUSED(session);
|
||||
TR_UNUSED(did_connect);
|
||||
TR_UNUSED(did_timeout);
|
||||
TR_UNUSED(response_code);
|
||||
|
||||
tr_ctorSetMetainfo(ctor, response, response_byte_count);
|
||||
waitingOnWeb = false;
|
||||
}
|
||||
|
|
|
@ -72,8 +72,10 @@ static void send_signal_to_pipe(int sig)
|
|||
errno = old_errno;
|
||||
}
|
||||
|
||||
static void* signal_handler_thread_main(void* arg UNUSED)
|
||||
static void* signal_handler_thread_main(void* arg)
|
||||
{
|
||||
TR_UNUSED(arg);
|
||||
|
||||
int sig;
|
||||
|
||||
while (read(signal_pipe[0], &sig, sizeof(sig)) == sizeof(sig) && sig != 0)
|
||||
|
|
|
@ -38,12 +38,16 @@
|
|||
|
||||
#else
|
||||
|
||||
static void sd_notify(int status UNUSED, char const* str UNUSED)
|
||||
static void sd_notify(int status, char const* str)
|
||||
{
|
||||
TR_UNUSED(status);
|
||||
TR_UNUSED(str);
|
||||
}
|
||||
|
||||
static void sd_notifyf(int status UNUSED, char const* fmt UNUSED, ...)
|
||||
static void sd_notifyf(int status, char const* fmt, ...)
|
||||
{
|
||||
TR_UNUSED(status);
|
||||
TR_UNUSED(fmt);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -344,15 +348,23 @@ static void reportStatus(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void periodicUpdate(evutil_socket_t fd UNUSED, short what UNUSED, void* context UNUSED)
|
||||
static void periodicUpdate(evutil_socket_t fd, short what, void* context)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
TR_UNUSED(context);
|
||||
|
||||
pumpLogMessages(logfile);
|
||||
reportStatus();
|
||||
}
|
||||
|
||||
static tr_rpc_callback_status on_rpc_callback(tr_session* session UNUSED, tr_rpc_callback_type type,
|
||||
struct tr_torrent* tor UNUSED, void* user_data UNUSED)
|
||||
static tr_rpc_callback_status on_rpc_callback(tr_session* session, tr_rpc_callback_type type,
|
||||
struct tr_torrent* tor, void* user_data)
|
||||
{
|
||||
TR_UNUSED(session);
|
||||
TR_UNUSED(tor);
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
if (type == TR_RPC_SESSION_CLOSE)
|
||||
{
|
||||
event_base_loopexit(ev_base, NULL);
|
||||
|
@ -570,8 +582,10 @@ struct daemon_data
|
|||
bool paused;
|
||||
};
|
||||
|
||||
static void daemon_reconfigure(void* arg UNUSED)
|
||||
static void daemon_reconfigure(void* arg)
|
||||
{
|
||||
TR_UNUSED(arg);
|
||||
|
||||
if (mySession == NULL)
|
||||
{
|
||||
tr_logAddInfo("Deferring reload until session is fully started.");
|
||||
|
@ -599,8 +613,10 @@ static void daemon_reconfigure(void* arg UNUSED)
|
|||
}
|
||||
}
|
||||
|
||||
static void daemon_stop(void* arg UNUSED)
|
||||
static void daemon_stop(void* arg)
|
||||
{
|
||||
TR_UNUSED(arg);
|
||||
|
||||
event_base_loopexit(ev_base, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,8 +39,11 @@ static GtkRadioActionEntry sort_radio_entries[] =
|
|||
{ "sort-by-size", NULL, N_("Sort by Si_ze"), NULL, NULL, 8 }
|
||||
};
|
||||
|
||||
static void sort_changed_cb(GtkAction* action UNUSED, GtkRadioAction* current, gpointer user_data UNUSED)
|
||||
static void sort_changed_cb(GtkAction* action, GtkRadioAction* current, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(action);
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
tr_quark const key = TR_KEY_sort_mode;
|
||||
int const i = gtk_radio_action_get_current_value(current);
|
||||
char const* val = sort_radio_entries[i].name;
|
||||
|
@ -54,8 +57,10 @@ static GtkToggleActionEntry show_toggle_entries[] =
|
|||
{ "toggle-message-log", NULL, N_("Message _Log"), NULL, NULL, G_CALLBACK(action_cb), FALSE }
|
||||
};
|
||||
|
||||
static void toggle_pref_cb(GtkToggleAction* action, gpointer user_data UNUSED)
|
||||
static void toggle_pref_cb(GtkToggleAction* action, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
char const* key = gtk_action_get_name(GTK_ACTION(action));
|
||||
gboolean const val = gtk_toggle_action_get_active(action);
|
||||
|
||||
|
|
|
@ -2697,8 +2697,10 @@ static void on_add_tracker_response(GtkDialog* dialog, int response, gpointer gd
|
|||
}
|
||||
}
|
||||
|
||||
static void on_tracker_list_add_button_clicked(GtkButton* button UNUSED, gpointer gdi)
|
||||
static void on_tracker_list_add_button_clicked(GtkButton* button, gpointer gdi)
|
||||
{
|
||||
TR_UNUSED(button);
|
||||
|
||||
struct DetailsImpl* di = gdi;
|
||||
tr_torrent* tor = tracker_list_get_current_torrent(di);
|
||||
|
||||
|
@ -2732,8 +2734,10 @@ static void on_tracker_list_add_button_clicked(GtkButton* button UNUSED, gpointe
|
|||
}
|
||||
}
|
||||
|
||||
static void on_tracker_list_remove_button_clicked(GtkButton* button UNUSED, gpointer gdi)
|
||||
static void on_tracker_list_remove_button_clicked(GtkButton* button, gpointer gdi)
|
||||
{
|
||||
TR_UNUSED(button);
|
||||
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel* model;
|
||||
struct DetailsImpl* di = gdi;
|
||||
|
@ -2899,8 +2903,11 @@ static gboolean periodic_refresh(gpointer data)
|
|||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void on_details_window_size_allocated(GtkWidget* gtk_window, GtkAllocation* alloc UNUSED, gpointer gdata UNUSED)
|
||||
static void on_details_window_size_allocated(GtkWidget* gtk_window, GtkAllocation* alloc, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(alloc);
|
||||
TR_UNUSED(gdata);
|
||||
|
||||
int w, h;
|
||||
gtk_window_get_size(GTK_WINDOW(gtk_window), &w, &h);
|
||||
gtr_pref_int_set(TR_KEY_details_window_width, w);
|
||||
|
|
|
@ -118,9 +118,14 @@ static gboolean favicon_web_done_idle_cb(gpointer vfav)
|
|||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void favicon_web_done_cb(tr_session* session UNUSED, bool did_connect UNUSED, bool did_timeout UNUSED, long code UNUSED,
|
||||
static void favicon_web_done_cb(tr_session* session, bool did_connect, bool did_timeout, long code,
|
||||
void const* data, size_t len, void* vfav)
|
||||
{
|
||||
TR_UNUSED(session);
|
||||
TR_UNUSED(did_connect);
|
||||
TR_UNUSED(did_timeout);
|
||||
TR_UNUSED(code);
|
||||
|
||||
struct favicon_data* fav = vfav;
|
||||
fav->contents = g_memdup(data, len);
|
||||
fav->len = len;
|
||||
|
|
|
@ -91,8 +91,10 @@ struct RefreshData
|
|||
FileData* file_data;
|
||||
};
|
||||
|
||||
static gboolean refreshFilesForeach(GtkTreeModel* model, GtkTreePath* path UNUSED, GtkTreeIter* iter, gpointer gdata)
|
||||
static gboolean refreshFilesForeach(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(path);
|
||||
|
||||
struct RefreshData* refresh_data = gdata;
|
||||
FileData* data = refresh_data->file_data;
|
||||
unsigned int index;
|
||||
|
@ -307,8 +309,10 @@ struct ActiveData
|
|||
size_t indexCount;
|
||||
};
|
||||
|
||||
static gboolean getSelectedFilesForeach(GtkTreeModel* model, GtkTreePath* path UNUSED, GtkTreeIter* iter, gpointer gdata)
|
||||
static gboolean getSelectedFilesForeach(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(path);
|
||||
|
||||
gboolean const is_file = !gtk_tree_model_iter_has_child(model, iter);
|
||||
|
||||
if (is_file)
|
||||
|
@ -601,17 +605,23 @@ void gtr_file_list_set_torrent(GtkWidget* w, int torrentId)
|
|||
****
|
||||
***/
|
||||
|
||||
static void renderDownload(GtkTreeViewColumn* column UNUSED, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter,
|
||||
gpointer data UNUSED)
|
||||
static void renderDownload(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter,
|
||||
gpointer data)
|
||||
{
|
||||
TR_UNUSED(column);
|
||||
TR_UNUSED(data);
|
||||
|
||||
gboolean enabled;
|
||||
gtk_tree_model_get(model, iter, FC_ENABLED, &enabled, -1);
|
||||
g_object_set(renderer, "inconsistent", enabled == MIXED, "active", enabled == TRUE, NULL);
|
||||
}
|
||||
|
||||
static void renderPriority(GtkTreeViewColumn* column UNUSED, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter,
|
||||
gpointer data UNUSED)
|
||||
static void renderPriority(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter,
|
||||
gpointer data)
|
||||
{
|
||||
TR_UNUSED(column);
|
||||
TR_UNUSED(data);
|
||||
|
||||
int priority;
|
||||
char const* text;
|
||||
gtk_tree_model_get(model, iter, FC_PRIORITY, &priority, -1);
|
||||
|
@ -660,8 +670,10 @@ static char* buildFilename(tr_torrent* tor, GtkTreeModel* model, GtkTreePath* pa
|
|||
return ret;
|
||||
}
|
||||
|
||||
static gboolean onRowActivated(GtkTreeView* view, GtkTreePath* path, GtkTreeViewColumn* col UNUSED, gpointer gdata)
|
||||
static gboolean onRowActivated(GtkTreeView* view, GtkTreePath* path, GtkTreeViewColumn* col, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(col);
|
||||
|
||||
gboolean handled = FALSE;
|
||||
FileData* data = gdata;
|
||||
tr_torrent* tor = gtr_core_find_torrent(data->core, data->torrentId);
|
||||
|
|
62
gtk/filter.c
62
gtk/filter.c
|
@ -308,8 +308,10 @@ static GtkTreeModel* tracker_filter_model_new(GtkTreeModel* tmodel)
|
|||
return GTK_TREE_MODEL(store);
|
||||
}
|
||||
|
||||
static gboolean is_it_a_separator(GtkTreeModel* m, GtkTreeIter* iter, gpointer data UNUSED)
|
||||
static gboolean is_it_a_separator(GtkTreeModel* m, GtkTreeIter* iter, gpointer data)
|
||||
{
|
||||
TR_UNUSED(data);
|
||||
|
||||
int type;
|
||||
gtk_tree_model_get(m, iter, TRACKER_FILTER_COL_TYPE, &type, -1);
|
||||
return type == TRACKER_FILTER_TYPE_SEPARATOR;
|
||||
|
@ -328,20 +330,30 @@ static void tracker_model_update_idle(gpointer tracker_model)
|
|||
}
|
||||
}
|
||||
|
||||
static void torrent_model_row_changed(GtkTreeModel* tmodel UNUSED, GtkTreePath* path UNUSED, GtkTreeIter* iter UNUSED,
|
||||
static void torrent_model_row_changed(GtkTreeModel* tmodel, GtkTreePath* path, GtkTreeIter* iter,
|
||||
gpointer tracker_model)
|
||||
{
|
||||
TR_UNUSED(tmodel);
|
||||
TR_UNUSED(path);
|
||||
TR_UNUSED(iter);
|
||||
|
||||
tracker_model_update_idle(tracker_model);
|
||||
}
|
||||
|
||||
static void torrent_model_row_deleted_cb(GtkTreeModel* tmodel UNUSED, GtkTreePath* path UNUSED, gpointer tracker_model)
|
||||
static void torrent_model_row_deleted_cb(GtkTreeModel* tmodel, GtkTreePath* path, gpointer tracker_model)
|
||||
{
|
||||
TR_UNUSED(tmodel);
|
||||
TR_UNUSED(path);
|
||||
|
||||
tracker_model_update_idle(tracker_model);
|
||||
}
|
||||
|
||||
static void render_pixbuf_func(GtkCellLayout* cell_layout UNUSED, GtkCellRenderer* cell_renderer, GtkTreeModel* tree_model,
|
||||
GtkTreeIter* iter, gpointer data UNUSED)
|
||||
static void render_pixbuf_func(GtkCellLayout* cell_layout, GtkCellRenderer* cell_renderer, GtkTreeModel* tree_model,
|
||||
GtkTreeIter* iter, gpointer data)
|
||||
{
|
||||
TR_UNUSED(cell_layout);
|
||||
TR_UNUSED(data);
|
||||
|
||||
int type;
|
||||
int width;
|
||||
|
||||
|
@ -350,9 +362,12 @@ static void render_pixbuf_func(GtkCellLayout* cell_layout UNUSED, GtkCellRendere
|
|||
g_object_set(cell_renderer, "width", width, NULL);
|
||||
}
|
||||
|
||||
static void render_number_func(GtkCellLayout* cell_layout UNUSED, GtkCellRenderer* cell_renderer, GtkTreeModel* tree_model,
|
||||
GtkTreeIter* iter, gpointer data UNUSED)
|
||||
static void render_number_func(GtkCellLayout* cell_layout, GtkCellRenderer* cell_renderer, GtkTreeModel* tree_model,
|
||||
GtkTreeIter* iter, gpointer data)
|
||||
{
|
||||
TR_UNUSED(cell_layout);
|
||||
TR_UNUSED(data);
|
||||
|
||||
int count;
|
||||
char buf[32];
|
||||
|
||||
|
@ -472,8 +487,10 @@ enum
|
|||
ACTIVITY_FILTER_N_COLS
|
||||
};
|
||||
|
||||
static gboolean activity_is_it_a_separator(GtkTreeModel* m, GtkTreeIter* i, gpointer d UNUSED)
|
||||
static gboolean activity_is_it_a_separator(GtkTreeModel* m, GtkTreeIter* i, gpointer d)
|
||||
{
|
||||
TR_UNUSED(d);
|
||||
|
||||
int type;
|
||||
gtk_tree_model_get(m, i, ACTIVITY_FILTER_COL_TYPE, &type, -1);
|
||||
return type == ACTIVITY_FILTER_SEPARATOR;
|
||||
|
@ -612,9 +629,12 @@ static GtkTreeModel* activity_filter_model_new(GtkTreeModel* tmodel)
|
|||
return GTK_TREE_MODEL(store);
|
||||
}
|
||||
|
||||
static void render_activity_pixbuf_func(GtkCellLayout* cell_layout UNUSED, GtkCellRenderer* cell_renderer,
|
||||
GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer data UNUSED)
|
||||
static void render_activity_pixbuf_func(GtkCellLayout* cell_layout, GtkCellRenderer* cell_renderer,
|
||||
GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer data)
|
||||
{
|
||||
TR_UNUSED(cell_layout);
|
||||
TR_UNUSED(data);
|
||||
|
||||
int type;
|
||||
int width;
|
||||
int ypad;
|
||||
|
@ -639,15 +659,22 @@ static void activity_model_update_idle(gpointer activity_model)
|
|||
}
|
||||
}
|
||||
|
||||
static void activity_torrent_model_row_changed(GtkTreeModel* tmodel UNUSED, GtkTreePath* path UNUSED, GtkTreeIter* iter UNUSED,
|
||||
static void activity_torrent_model_row_changed(GtkTreeModel* tmodel, GtkTreePath* path, GtkTreeIter* iter,
|
||||
gpointer activity_model)
|
||||
{
|
||||
TR_UNUSED(tmodel);
|
||||
TR_UNUSED(path);
|
||||
TR_UNUSED(iter);
|
||||
|
||||
activity_model_update_idle(activity_model);
|
||||
}
|
||||
|
||||
static void activity_torrent_model_row_deleted_cb(GtkTreeModel* tmodel UNUSED, GtkTreePath* path UNUSED,
|
||||
static void activity_torrent_model_row_deleted_cb(GtkTreeModel* tmodel, GtkTreePath* path,
|
||||
gpointer activity_model)
|
||||
{
|
||||
TR_UNUSED(tmodel);
|
||||
TR_UNUSED(path);
|
||||
|
||||
activity_model_update_idle(activity_model);
|
||||
}
|
||||
|
||||
|
@ -904,14 +931,21 @@ static void update_count_label_idle(struct filter_data* data)
|
|||
}
|
||||
}
|
||||
|
||||
static void on_filter_model_row_inserted(GtkTreeModel* tree_model UNUSED, GtkTreePath* path UNUSED, GtkTreeIter* iter UNUSED,
|
||||
static void on_filter_model_row_inserted(GtkTreeModel* tree_model, GtkTreePath* path, GtkTreeIter* iter,
|
||||
gpointer data)
|
||||
{
|
||||
TR_UNUSED(tree_model);
|
||||
TR_UNUSED(path);
|
||||
TR_UNUSED(iter);
|
||||
|
||||
update_count_label_idle(data);
|
||||
}
|
||||
|
||||
static void on_filter_model_row_deleted(GtkTreeModel* tree_model UNUSED, GtkTreePath* path UNUSED, gpointer data)
|
||||
static void on_filter_model_row_deleted(GtkTreeModel* tree_model, GtkTreePath* path, gpointer data)
|
||||
{
|
||||
TR_UNUSED(tree_model);
|
||||
TR_UNUSED(path);
|
||||
|
||||
update_count_label_idle(data);
|
||||
}
|
||||
|
||||
|
|
83
gtk/main.c
83
gtk/main.c
|
@ -125,8 +125,10 @@ static char* get_details_dialog_key(GSList* id_list)
|
|||
return g_string_free(gstr, FALSE);
|
||||
}
|
||||
|
||||
static void get_selected_torrent_ids_foreach(GtkTreeModel* model, GtkTreePath* p UNUSED, GtkTreeIter* iter, gpointer gdata)
|
||||
static void get_selected_torrent_ids_foreach(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(path);
|
||||
|
||||
int id;
|
||||
GSList** ids = gdata;
|
||||
gtk_tree_model_get(model, iter, MC_TORRENT_ID, &id, -1);
|
||||
|
@ -189,9 +191,11 @@ struct counts_data
|
|||
int stopped_count;
|
||||
};
|
||||
|
||||
static void get_selected_torrent_counts_foreach(GtkTreeModel* model, GtkTreePath* path UNUSED, GtkTreeIter* iter,
|
||||
static void get_selected_torrent_counts_foreach(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter,
|
||||
gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(path);
|
||||
|
||||
int activity = 0;
|
||||
struct counts_data* counts = user_data;
|
||||
|
||||
|
@ -219,9 +223,11 @@ static void get_selected_torrent_counts(struct cbdata* data, struct counts_data*
|
|||
gtk_tree_selection_selected_foreach(data->sel, get_selected_torrent_counts_foreach, counts);
|
||||
}
|
||||
|
||||
static void count_updatable_foreach(GtkTreeModel* model, GtkTreePath* path UNUSED, GtkTreeIter* iter,
|
||||
static void count_updatable_foreach(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter,
|
||||
gpointer accumulated_status)
|
||||
{
|
||||
TR_UNUSED(path);
|
||||
|
||||
tr_torrent* tor;
|
||||
gtk_tree_model_get(model, iter, MC_TORRENT, &tor, -1);
|
||||
*(int*)accumulated_status |= tr_torrentCanManualUpdate(tor);
|
||||
|
@ -282,8 +288,10 @@ static void refresh_actions_soon(gpointer gdata)
|
|||
}
|
||||
}
|
||||
|
||||
static void on_selection_changed(GtkTreeSelection* s UNUSED, gpointer gdata)
|
||||
static void on_selection_changed(GtkTreeSelection* s, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(s);
|
||||
|
||||
refresh_actions_soon(gdata);
|
||||
}
|
||||
|
||||
|
@ -326,8 +334,11 @@ static void ensure_magnet_handler_exists(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void on_main_window_size_allocated(GtkWidget* gtk_window, GtkAllocation* alloc UNUSED, gpointer gdata UNUSED)
|
||||
static void on_main_window_size_allocated(GtkWidget* gtk_window, GtkAllocation* alloc, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(alloc);
|
||||
TR_UNUSED(gdata);
|
||||
|
||||
GdkWindow* gdk_window = gtk_widget_get_window(gtk_window);
|
||||
gboolean const isMaximized = gdk_window != NULL && (gdk_window_get_state(gdk_window) & GDK_WINDOW_STATE_MAXIMIZED) != 0;
|
||||
|
||||
|
@ -557,8 +568,10 @@ static void on_startup(GApplication* application, gpointer user_data)
|
|||
ensure_magnet_handler_exists();
|
||||
}
|
||||
|
||||
static void on_activate(GApplication* app UNUSED, struct cbdata* cbdata)
|
||||
static void on_activate(GApplication* app, struct cbdata* cbdata)
|
||||
{
|
||||
TR_UNUSED(app);
|
||||
|
||||
cbdata->activation_count++;
|
||||
|
||||
/* GApplication emits an 'activate' signal when bootstrapping the primary.
|
||||
|
@ -582,8 +595,11 @@ static void open_files(GSList* files, gpointer gdata)
|
|||
gtr_core_add_files(cbdata->core, files, do_start, do_prompt, do_notify);
|
||||
}
|
||||
|
||||
static void on_open(GApplication* application UNUSED, GFile** f, gint file_count, gchar* hint UNUSED, gpointer gdata)
|
||||
static void on_open(GApplication* application, GFile** f, gint file_count, gchar* hint, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(application);
|
||||
TR_UNUSED(hint);
|
||||
|
||||
GSList* files = NULL;
|
||||
|
||||
for (gint i = 0; i < file_count; i++)
|
||||
|
@ -687,8 +703,10 @@ int main(int argc, char** argv)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void on_core_busy(TrCore* core UNUSED, gboolean busy, struct cbdata* c)
|
||||
static void on_core_busy(TrCore* core, gboolean busy, struct cbdata* c)
|
||||
{
|
||||
TR_UNUSED(core);
|
||||
|
||||
gtr_window_set_busy(c->wind, busy);
|
||||
}
|
||||
|
||||
|
@ -807,8 +825,11 @@ static void toggleMainWindow(struct cbdata* cbdata)
|
|||
|
||||
static void on_app_exit(gpointer vdata);
|
||||
|
||||
static gboolean winclose(GtkWidget* w UNUSED, GdkEvent* event UNUSED, gpointer gdata)
|
||||
static gboolean winclose(GtkWidget* w, GdkEvent* event, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(w);
|
||||
TR_UNUSED(event);
|
||||
|
||||
struct cbdata* cbdata = gdata;
|
||||
|
||||
if (cbdata->icon != NULL)
|
||||
|
@ -823,8 +844,11 @@ static gboolean winclose(GtkWidget* w UNUSED, GdkEvent* event UNUSED, gpointer g
|
|||
return TRUE; /* don't propagate event further */
|
||||
}
|
||||
|
||||
static void rowChangedCB(GtkTreeModel* model UNUSED, GtkTreePath* path, GtkTreeIter* iter UNUSED, gpointer gdata)
|
||||
static void rowChangedCB(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(model);
|
||||
TR_UNUSED(iter);
|
||||
|
||||
struct cbdata* data = gdata;
|
||||
|
||||
if (gtk_tree_selection_path_is_selected(data->sel, path))
|
||||
|
@ -833,9 +857,14 @@ static void rowChangedCB(GtkTreeModel* model UNUSED, GtkTreePath* path, GtkTreeI
|
|||
}
|
||||
}
|
||||
|
||||
static void on_drag_data_received(GtkWidget* widget UNUSED, GdkDragContext* drag_context, gint x UNUSED, gint y UNUSED,
|
||||
GtkSelectionData* selection_data, guint info UNUSED, guint time_, gpointer gdata)
|
||||
static void on_drag_data_received(GtkWidget* widget, GdkDragContext* drag_context, gint x, gint y,
|
||||
GtkSelectionData* selection_data, guint info, guint time_, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(widget);
|
||||
TR_UNUSED(x);
|
||||
TR_UNUSED(y);
|
||||
TR_UNUSED(info);
|
||||
|
||||
char** uris = gtk_selection_data_get_uris(selection_data);
|
||||
guint const file_count = g_strv_length(uris);
|
||||
GSList* files = NULL;
|
||||
|
@ -931,8 +960,11 @@ static gpointer session_close_threadfunc(gpointer gdata)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void exit_now_cb(GtkWidget* w UNUSED, gpointer data UNUSED)
|
||||
static void exit_now_cb(GtkWidget* w, gpointer data)
|
||||
{
|
||||
TR_UNUSED(w);
|
||||
TR_UNUSED(data);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
@ -1046,8 +1078,10 @@ static void flush_torrent_errors(struct cbdata* cbdata)
|
|||
}
|
||||
}
|
||||
|
||||
static void on_core_error(TrCore* core UNUSED, guint code, char const* msg, struct cbdata* c)
|
||||
static void on_core_error(TrCore* core, guint code, char const* msg, struct cbdata* c)
|
||||
{
|
||||
TR_UNUSED(core);
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case TR_PARSE_ERR:
|
||||
|
@ -1068,8 +1102,11 @@ static void on_core_error(TrCore* core UNUSED, guint code, char const* msg, stru
|
|||
}
|
||||
}
|
||||
|
||||
static gboolean on_main_window_focus_in(GtkWidget* widget UNUSED, GdkEventFocus* event UNUSED, gpointer gdata)
|
||||
static gboolean on_main_window_focus_in(GtkWidget* widget, GdkEventFocus* event, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(widget);
|
||||
TR_UNUSED(event);
|
||||
|
||||
struct cbdata* cbdata = gdata;
|
||||
|
||||
if (cbdata->wind != NULL)
|
||||
|
@ -1095,8 +1132,10 @@ static void on_add_torrent(TrCore* core, tr_ctor* ctor, gpointer gdata)
|
|||
gtk_widget_show(w);
|
||||
}
|
||||
|
||||
static void on_prefs_changed(TrCore* core UNUSED, tr_quark const key, gpointer data)
|
||||
static void on_prefs_changed(TrCore* core, tr_quark const key, gpointer data)
|
||||
{
|
||||
TR_UNUSED(core);
|
||||
|
||||
struct cbdata* cbdata = data;
|
||||
tr_session* tr = gtr_core_session(cbdata->core);
|
||||
|
||||
|
@ -1378,8 +1417,10 @@ static void show_about_dialog(GtkWindow* parent)
|
|||
NULL);
|
||||
}
|
||||
|
||||
static void append_id_to_benc_list(GtkTreeModel* m, GtkTreePath* path UNUSED, GtkTreeIter* iter, gpointer list)
|
||||
static void append_id_to_benc_list(GtkTreeModel* m, GtkTreePath* path, GtkTreeIter* iter, gpointer list)
|
||||
{
|
||||
TR_UNUSED(path);
|
||||
|
||||
tr_torrent* tor = NULL;
|
||||
gtk_tree_model_get(m, iter, MC_TORRENT, &tor, -1);
|
||||
tr_variantListAddInt(list, tr_torrentId(tor));
|
||||
|
@ -1410,8 +1451,10 @@ static gboolean call_rpc_for_selected_torrents(struct cbdata* data, char const*
|
|||
return invoked;
|
||||
}
|
||||
|
||||
static void open_folder_foreach(GtkTreeModel* model, GtkTreePath* path UNUSED, GtkTreeIter* iter, gpointer core)
|
||||
static void open_folder_foreach(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer core)
|
||||
{
|
||||
TR_UNUSED(path);
|
||||
|
||||
int id;
|
||||
gtk_tree_model_get(model, iter, MC_TORRENT_ID, &id, -1);
|
||||
gtr_core_open_folder(core, id);
|
||||
|
@ -1423,8 +1466,10 @@ static gboolean on_message_window_closed(void)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static void accumulate_selected_torrents(GtkTreeModel* model, GtkTreePath* path UNUSED, GtkTreeIter* iter, gpointer gdata)
|
||||
static void accumulate_selected_torrents(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(path);
|
||||
|
||||
int id;
|
||||
GSList** data = gdata;
|
||||
|
||||
|
|
|
@ -126,8 +126,10 @@ static gboolean onProgressDialogRefresh(gpointer data)
|
|||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void onProgressDialogDestroyed(gpointer data, GObject* dead UNUSED)
|
||||
static void onProgressDialogDestroyed(gpointer data, GObject* dead)
|
||||
{
|
||||
TR_UNUSED(dead);
|
||||
|
||||
MakeMetaUI* ui = data;
|
||||
g_source_remove(ui->progress_tag);
|
||||
}
|
||||
|
@ -384,9 +386,14 @@ static char const* getDefaultSavePath(void)
|
|||
return g_get_user_special_dir(G_USER_DIRECTORY_DESKTOP);
|
||||
}
|
||||
|
||||
static void on_drag_data_received(GtkWidget* widget UNUSED, GdkDragContext* drag_context, gint x UNUSED, gint y UNUSED,
|
||||
GtkSelectionData* selection_data, guint info UNUSED, guint time_, gpointer user_data)
|
||||
static void on_drag_data_received(GtkWidget* widget, GdkDragContext* drag_context, gint x, gint y,
|
||||
GtkSelectionData* selection_data, guint info, guint time_, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(widget);
|
||||
TR_UNUSED(x);
|
||||
TR_UNUSED(y);
|
||||
TR_UNUSED(info);
|
||||
|
||||
gboolean success = FALSE;
|
||||
MakeMetaUI* ui = user_data;
|
||||
char** uris = gtk_selection_data_get_uris(selection_data);
|
||||
|
|
19
gtk/msgwin.c
19
gtk/msgwin.c
|
@ -215,8 +215,10 @@ static void onSaveRequest(GtkWidget* w, gpointer data)
|
|||
gtk_widget_show(d);
|
||||
}
|
||||
|
||||
static void onClearRequest(GtkWidget* w UNUSED, gpointer gdata)
|
||||
static void onClearRequest(GtkWidget* w, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(w);
|
||||
|
||||
struct MsgData* data = gdata;
|
||||
|
||||
gtk_list_store_clear(data->store);
|
||||
|
@ -250,9 +252,11 @@ static char const* getForegroundColor(int msgLevel)
|
|||
}
|
||||
}
|
||||
|
||||
static void renderText(GtkTreeViewColumn* column UNUSED, GtkCellRenderer* renderer, GtkTreeModel* tree_model, GtkTreeIter* iter,
|
||||
static void renderText(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* tree_model, GtkTreeIter* iter,
|
||||
gpointer gcol)
|
||||
{
|
||||
TR_UNUSED(column);
|
||||
|
||||
int const col = GPOINTER_TO_INT(gcol);
|
||||
char* str = NULL;
|
||||
struct tr_log_message const* node;
|
||||
|
@ -261,9 +265,12 @@ static void renderText(GtkTreeViewColumn* column UNUSED, GtkCellRenderer* render
|
|||
g_object_set(renderer, "text", str, "foreground", getForegroundColor(node->level), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
||||
}
|
||||
|
||||
static void renderTime(GtkTreeViewColumn* column UNUSED, GtkCellRenderer* renderer, GtkTreeModel* tree_model, GtkTreeIter* iter,
|
||||
gpointer data UNUSED)
|
||||
static void renderTime(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* tree_model, GtkTreeIter* iter,
|
||||
gpointer data)
|
||||
{
|
||||
TR_UNUSED(column);
|
||||
TR_UNUSED(data);
|
||||
|
||||
struct tm tm;
|
||||
char buf[16];
|
||||
struct tr_log_message const* node;
|
||||
|
@ -345,8 +352,10 @@ static gboolean isRowVisible(GtkTreeModel* model, GtkTreeIter* iter, gpointer gd
|
|||
return node->level <= data->maxLevel;
|
||||
}
|
||||
|
||||
static void onWindowDestroyed(gpointer gdata, GObject* deadWindow UNUSED)
|
||||
static void onWindowDestroyed(gpointer gdata, GObject* deadWindow)
|
||||
{
|
||||
TR_UNUSED(deadWindow);
|
||||
|
||||
struct MsgData* data = gdata;
|
||||
|
||||
g_source_remove(data->refresh_tag);
|
||||
|
|
17
gtk/notify.c
17
gtk/notify.c
|
@ -42,8 +42,10 @@ static void tr_notification_free(gpointer data)
|
|||
g_free(n);
|
||||
}
|
||||
|
||||
static void get_capabilities_callback(GObject* source, GAsyncResult* res, gpointer user_data UNUSED)
|
||||
static void get_capabilities_callback(GObject* source, GAsyncResult* res, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
char** caps;
|
||||
GVariant* result;
|
||||
|
||||
|
@ -74,9 +76,13 @@ static void get_capabilities_callback(GObject* source, GAsyncResult* res, gpoint
|
|||
g_variant_unref(result);
|
||||
}
|
||||
|
||||
static void g_signal_callback(GDBusProxy* dbus_proxy UNUSED, char* sender_name UNUSED, char* signal_name, GVariant* params,
|
||||
gpointer user_data UNUSED)
|
||||
static void g_signal_callback(GDBusProxy* dbus_proxy, char* sender_name, char* signal_name, GVariant* params,
|
||||
gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(dbus_proxy);
|
||||
TR_UNUSED(sender_name);
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
guint id;
|
||||
TrNotification* n;
|
||||
|
||||
|
@ -123,8 +129,11 @@ static void g_signal_callback(GDBusProxy* dbus_proxy UNUSED, char* sender_name U
|
|||
}
|
||||
}
|
||||
|
||||
static void dbus_proxy_ready_callback(GObject* source UNUSED, GAsyncResult* res, gpointer user_data UNUSED)
|
||||
static void dbus_proxy_ready_callback(GObject* source, GAsyncResult* res, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(source);
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
proxy = g_dbus_proxy_new_for_bus_finish(res, NULL);
|
||||
|
||||
if (proxy == NULL)
|
||||
|
|
|
@ -92,8 +92,10 @@ static gboolean onTimer(gpointer gdata)
|
|||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void onResponse(GtkDialog* dialog, int response, gpointer unused UNUSED)
|
||||
static void onResponse(GtkDialog* dialog, int response, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
if (response == GTK_RESPONSE_APPLY)
|
||||
{
|
||||
GtkWidget* w;
|
||||
|
|
|
@ -77,8 +77,10 @@ static gboolean updateStats(gpointer gdata)
|
|||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void dialogDestroyed(gpointer p, GObject* dialog UNUSED)
|
||||
static void dialogDestroyed(gpointer p, GObject* dialog)
|
||||
{
|
||||
TR_UNUSED(dialog);
|
||||
|
||||
g_source_remove(GPOINTER_TO_UINT(p));
|
||||
}
|
||||
|
||||
|
|
|
@ -570,9 +570,11 @@ static void gtr_cell_renderer_render(GtkCellRenderer* renderer, GtrDrawable* dra
|
|||
}
|
||||
|
||||
static void render_compact(TorrentCellRenderer* cell, GtrDrawable* window, GtkWidget* widget,
|
||||
GdkRectangle const* background_area, GdkRectangle const* cell_area UNUSED,
|
||||
GdkRectangle const* background_area, GdkRectangle const* cell_area,
|
||||
GtkCellRendererState flags)
|
||||
{
|
||||
TR_UNUSED(cell_area);
|
||||
|
||||
int xpad;
|
||||
int ypad;
|
||||
GtkRequisition size;
|
||||
|
@ -646,8 +648,10 @@ static void render_compact(TorrentCellRenderer* cell, GtrDrawable* window, GtkWi
|
|||
}
|
||||
|
||||
static void render_full(TorrentCellRenderer* cell, GtrDrawable* window, GtkWidget* widget, GdkRectangle const* background_area,
|
||||
GdkRectangle const* cell_area UNUSED, GtkCellRendererState flags)
|
||||
GdkRectangle const* cell_area, GtkCellRendererState flags)
|
||||
{
|
||||
TR_UNUSED(cell_area);
|
||||
|
||||
int xpad;
|
||||
int ypad;
|
||||
GtkRequisition size;
|
||||
|
|
|
@ -404,8 +404,10 @@ static int compare_time(time_t a, time_t b)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int compare_by_name(GtkTreeModel* m, GtkTreeIter* a, GtkTreeIter* b, gpointer user_data UNUSED)
|
||||
static int compare_by_name(GtkTreeModel* m, GtkTreeIter* a, GtkTreeIter* b, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
char const* ca;
|
||||
char const* cb;
|
||||
gtk_tree_model_get(m, a, MC_NAME_COLLATED, &ca, -1);
|
||||
|
@ -413,8 +415,10 @@ static int compare_by_name(GtkTreeModel* m, GtkTreeIter* a, GtkTreeIter* b, gpoi
|
|||
return g_strcmp0(ca, cb);
|
||||
}
|
||||
|
||||
static int compare_by_queue(GtkTreeModel* m, GtkTreeIter* a, GtkTreeIter* b, gpointer user_data UNUSED)
|
||||
static int compare_by_queue(GtkTreeModel* m, GtkTreeIter* a, GtkTreeIter* b, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
tr_torrent* ta;
|
||||
tr_torrent* tb;
|
||||
tr_stat const* sa;
|
||||
|
@ -797,9 +801,12 @@ static void core_watchdir_monitor_file(TrCore* core, GFile* file)
|
|||
}
|
||||
|
||||
/* GFileMonitor noticed a file was created */
|
||||
static void on_file_changed_in_watchdir(GFileMonitor* monitor UNUSED, GFile* file, GFile* other_type UNUSED,
|
||||
static void on_file_changed_in_watchdir(GFileMonitor* monitor, GFile* file, GFile* other_type,
|
||||
GFileMonitorEvent event_type, gpointer core)
|
||||
{
|
||||
TR_UNUSED(monitor);
|
||||
TR_UNUSED(other_type);
|
||||
|
||||
if (event_type == G_FILE_MONITOR_EVENT_CREATED)
|
||||
{
|
||||
core_watchdir_monitor_file(core, file);
|
||||
|
@ -865,8 +872,10 @@ static void core_watchdir_update(TrCore* core)
|
|||
****
|
||||
***/
|
||||
|
||||
static void on_pref_changed(TrCore* core, tr_quark const key, gpointer data UNUSED)
|
||||
static void on_pref_changed(TrCore* core, tr_quark const key, gpointer data)
|
||||
{
|
||||
TR_UNUSED(data);
|
||||
|
||||
switch (key)
|
||||
{
|
||||
case TR_KEY_sort_mode:
|
||||
|
@ -1788,8 +1797,11 @@ static gboolean core_read_rpc_response_idle(void* vresponse)
|
|||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void core_read_rpc_response(tr_session* session UNUSED, tr_variant* response, void* unused UNUSED)
|
||||
static void core_read_rpc_response(tr_session* session, tr_variant* response, void* user_data)
|
||||
{
|
||||
TR_UNUSED(session);
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
tr_variant* response_copy = tr_new(tr_variant, 1);
|
||||
|
||||
*response_copy = *response;
|
||||
|
@ -1840,8 +1852,10 @@ static void core_send_rpc_request(TrCore* core, tr_variant const* request, int t
|
|||
**** Sending a test-port request via RPC
|
||||
***/
|
||||
|
||||
static void on_port_test_response(TrCore* core, tr_variant* response, gpointer u UNUSED)
|
||||
static void on_port_test_response(TrCore* core, tr_variant* response, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
tr_variant* args;
|
||||
bool is_open;
|
||||
|
||||
|
@ -1871,8 +1885,10 @@ void gtr_core_port_test(TrCore* core)
|
|||
**** Updating a blocklist via RPC
|
||||
***/
|
||||
|
||||
static void on_blocklist_response(TrCore* core, tr_variant* response, gpointer data UNUSED)
|
||||
static void on_blocklist_response(TrCore* core, tr_variant* response, gpointer data)
|
||||
{
|
||||
TR_UNUSED(data);
|
||||
|
||||
tr_variant* args;
|
||||
int64_t ruleCount;
|
||||
|
||||
|
|
|
@ -23,19 +23,25 @@ static TR_DEFINE_QUARK(tr_core, core)
|
|||
|
||||
#ifdef HAVE_LIBAPPINDICATOR
|
||||
|
||||
void gtr_icon_refresh(gpointer vindicator UNUSED)
|
||||
void gtr_icon_refresh(gpointer vindicator)
|
||||
{
|
||||
TR_UNUSED(vindicator);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void activated(GtkStatusIcon* self UNUSED, gpointer user_data UNUSED)
|
||||
static void activated(GtkStatusIcon* self, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(self);
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
gtr_action_activate("toggle-main-window");
|
||||
}
|
||||
|
||||
static void popup(GtkStatusIcon* self, guint button, guint when, gpointer data UNUSED)
|
||||
static void popup(GtkStatusIcon* self, guint button, guint when, gpointer data)
|
||||
{
|
||||
TR_UNUSED(data);
|
||||
|
||||
GtkWidget* w = gtr_action_get_widget("/icon-popup");
|
||||
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
|
|
|
@ -42,8 +42,10 @@ struct prefs_dialog_data
|
|||
|
||||
#define PREF_KEY "pref-key"
|
||||
|
||||
static void response_cb(GtkDialog* dialog, int response, gpointer unused UNUSED)
|
||||
static void response_cb(GtkDialog* dialog, int response, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
if (response == GTK_RESPONSE_HELP)
|
||||
{
|
||||
char* uri = g_strconcat(gtr_get_help_uri(), "/html/preferences.html", NULL);
|
||||
|
@ -415,8 +417,10 @@ static void updateBlocklistText(GtkWidget* w, TrCore* core)
|
|||
}
|
||||
|
||||
/* prefs dialog is being destroyed, so stop listening to blocklist updates */
|
||||
static void privacyPageDestroyed(gpointer gdata, GObject* dead UNUSED)
|
||||
static void privacyPageDestroyed(gpointer gdata, GObject* dead)
|
||||
{
|
||||
TR_UNUSED(dead);
|
||||
|
||||
struct blocklist_data* data = gdata;
|
||||
|
||||
if (data->updateBlocklistTag > 0)
|
||||
|
@ -428,8 +432,10 @@ static void privacyPageDestroyed(gpointer gdata, GObject* dead UNUSED)
|
|||
}
|
||||
|
||||
/* user hit "close" in the blocklist-update dialog */
|
||||
static void onBlocklistUpdateResponse(GtkDialog* dialog, gint response UNUSED, gpointer gdata)
|
||||
static void onBlocklistUpdateResponse(GtkDialog* dialog, gint response, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(response);
|
||||
|
||||
struct blocklist_data* data = gdata;
|
||||
gtk_widget_destroy(GTK_WIDGET(dialog));
|
||||
gtk_widget_set_sensitive(data->updateBlocklistButton, TRUE);
|
||||
|
@ -630,8 +636,10 @@ static void refreshWhitelist(struct remote_page* page)
|
|||
g_string_free(gstr, TRUE);
|
||||
}
|
||||
|
||||
static void onAddressEdited(GtkCellRendererText* r UNUSED, gchar* path_string, gchar* address, gpointer gpage)
|
||||
static void onAddressEdited(GtkCellRendererText* r, gchar* path_string, gchar* address, gpointer gpage)
|
||||
{
|
||||
TR_UNUSED(r);
|
||||
|
||||
GtkTreeIter iter;
|
||||
struct remote_page* page = gpage;
|
||||
GtkTreeModel* model = GTK_TREE_MODEL(page->store);
|
||||
|
@ -646,8 +654,10 @@ static void onAddressEdited(GtkCellRendererText* r UNUSED, gchar* path_string, g
|
|||
refreshWhitelist(page);
|
||||
}
|
||||
|
||||
static void onAddWhitelistClicked(GtkButton* b UNUSED, gpointer gpage)
|
||||
static void onAddWhitelistClicked(GtkButton* b, gpointer gpage)
|
||||
{
|
||||
TR_UNUSED(b);
|
||||
|
||||
GtkTreeIter iter;
|
||||
GtkTreePath* path;
|
||||
struct remote_page* page = gpage;
|
||||
|
@ -660,8 +670,10 @@ static void onAddWhitelistClicked(GtkButton* b UNUSED, gpointer gpage)
|
|||
gtk_tree_path_free(path);
|
||||
}
|
||||
|
||||
static void onRemoveWhitelistClicked(GtkButton* b UNUSED, gpointer gpage)
|
||||
static void onRemoveWhitelistClicked(GtkButton* b, gpointer gpage)
|
||||
{
|
||||
TR_UNUSED(b);
|
||||
|
||||
struct remote_page* page = gpage;
|
||||
GtkTreeSelection* sel = gtk_tree_view_get_selection(page->view);
|
||||
GtkTreeIter iter;
|
||||
|
@ -700,18 +712,25 @@ static void refreshRPCSensitivity(struct remote_page* page)
|
|||
gtk_widget_set_sensitive(page->remove_button, rpc_active && have_addr && n_rules > 1);
|
||||
}
|
||||
|
||||
static void onRPCToggled(GtkToggleButton* tb UNUSED, gpointer page)
|
||||
static void onRPCToggled(GtkToggleButton* tb, gpointer page)
|
||||
{
|
||||
TR_UNUSED(tb);
|
||||
|
||||
refreshRPCSensitivity(page);
|
||||
}
|
||||
|
||||
static void onWhitelistSelectionChanged(GtkTreeSelection* sel UNUSED, gpointer page)
|
||||
static void onWhitelistSelectionChanged(GtkTreeSelection* sel, gpointer page)
|
||||
{
|
||||
TR_UNUSED(sel);
|
||||
|
||||
refreshRPCSensitivity(page);
|
||||
}
|
||||
|
||||
static void onLaunchClutchCB(GtkButton* w UNUSED, gpointer data UNUSED)
|
||||
static void onLaunchClutchCB(GtkButton* w, gpointer data)
|
||||
{
|
||||
TR_UNUSED(w);
|
||||
TR_UNUSED(data);
|
||||
|
||||
char* uri;
|
||||
int const port = gtr_pref_int_get(TR_KEY_rpc_port);
|
||||
|
||||
|
@ -874,8 +893,10 @@ static void refreshSchedSensitivity(struct BandwidthPage* p)
|
|||
}
|
||||
}
|
||||
|
||||
static void onSchedToggled(GtkToggleButton* tb UNUSED, gpointer user_data)
|
||||
static void onSchedToggled(GtkToggleButton* tb, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(tb);
|
||||
|
||||
refreshSchedSensitivity(user_data);
|
||||
}
|
||||
|
||||
|
@ -1054,8 +1075,10 @@ struct network_page_data
|
|||
gulong prefsTag;
|
||||
};
|
||||
|
||||
static void onCorePrefsChanged(TrCore* core UNUSED, tr_quark const key, gpointer gdata)
|
||||
static void onCorePrefsChanged(TrCore* core, tr_quark const key, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(core);
|
||||
|
||||
if (key == TR_KEY_peer_port)
|
||||
{
|
||||
struct network_page_data* data = gdata;
|
||||
|
@ -1065,8 +1088,10 @@ static void onCorePrefsChanged(TrCore* core UNUSED, tr_quark const key, gpointer
|
|||
}
|
||||
}
|
||||
|
||||
static void networkPageDestroyed(gpointer gdata, GObject* dead UNUSED)
|
||||
static void networkPageDestroyed(gpointer gdata, GObject* dead)
|
||||
{
|
||||
TR_UNUSED(dead);
|
||||
|
||||
struct network_page_data* data = gdata;
|
||||
|
||||
if (data->prefsTag > 0)
|
||||
|
@ -1082,8 +1107,10 @@ static void networkPageDestroyed(gpointer gdata, GObject* dead UNUSED)
|
|||
g_free(data);
|
||||
}
|
||||
|
||||
static void onPortTested(TrCore* core UNUSED, gboolean isOpen, gpointer vdata)
|
||||
static void onPortTested(TrCore* core, gboolean isOpen, gpointer vdata)
|
||||
{
|
||||
TR_UNUSED(core);
|
||||
|
||||
struct network_page_data* data = vdata;
|
||||
char const* markup = isOpen ? _("Port is <b>open</b>") : _("Port is <b>closed</b>");
|
||||
|
||||
|
@ -1094,8 +1121,10 @@ static void onPortTested(TrCore* core UNUSED, gboolean isOpen, gpointer vdata)
|
|||
// gdk_threads_leave();
|
||||
}
|
||||
|
||||
static void onPortTest(GtkButton* button UNUSED, gpointer vdata)
|
||||
static void onPortTest(GtkButton* button, gpointer vdata)
|
||||
{
|
||||
TR_UNUSED(button);
|
||||
|
||||
struct network_page_data* data = vdata;
|
||||
gtk_widget_set_sensitive(data->portButton, FALSE);
|
||||
gtk_widget_set_sensitive(data->portSpin, FALSE);
|
||||
|
|
|
@ -75,8 +75,10 @@ static PrivateData* get_private_data(GtkWindow * w)
|
|||
****
|
||||
***/
|
||||
|
||||
static void on_popup_menu(GtkWidget* self UNUSED, GdkEventButton* event)
|
||||
static void on_popup_menu(GtkWidget* self, GdkEventButton* event)
|
||||
{
|
||||
TR_UNUSED(self);
|
||||
|
||||
GtkWidget* menu = gtr_action_get_widget("/main-window-popup");
|
||||
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
|
@ -86,15 +88,23 @@ static void on_popup_menu(GtkWidget* self UNUSED, GdkEventButton* event)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void view_row_activated(GtkTreeView* tree_view UNUSED, GtkTreePath* path UNUSED, GtkTreeViewColumn* column UNUSED,
|
||||
gpointer user_data UNUSED)
|
||||
static void view_row_activated(GtkTreeView* tree_view, GtkTreePath* path, GtkTreeViewColumn* column,
|
||||
gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(tree_view);
|
||||
TR_UNUSED(path);
|
||||
TR_UNUSED(column);
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
gtr_action_activate("show-torrent-properties");
|
||||
}
|
||||
|
||||
static gboolean tree_view_search_equal_func(GtkTreeModel* model, gint column UNUSED, gchar const* key, GtkTreeIter* iter,
|
||||
gpointer search_data UNUSED)
|
||||
static gboolean tree_view_search_equal_func(GtkTreeModel* model, gint column, gchar const* key, GtkTreeIter* iter,
|
||||
gpointer search_data)
|
||||
{
|
||||
TR_UNUSED(column);
|
||||
TR_UNUSED(search_data);
|
||||
|
||||
gboolean match;
|
||||
char* lower;
|
||||
char const* name = NULL;
|
||||
|
@ -152,8 +162,10 @@ static GtkWidget* makeview(PrivateData* p)
|
|||
|
||||
static void syncAltSpeedButton(PrivateData* p);
|
||||
|
||||
static void prefsChanged(TrCore* core UNUSED, tr_quark const key, gpointer wind)
|
||||
static void prefsChanged(TrCore* core, tr_quark const key, gpointer wind)
|
||||
{
|
||||
TR_UNUSED(core);
|
||||
|
||||
gboolean isEnabled;
|
||||
PrivateData* p = get_private_data(GTK_WINDOW(wind));
|
||||
|
||||
|
@ -204,8 +216,10 @@ static void privateFree(gpointer vprivate)
|
|||
g_free(p);
|
||||
}
|
||||
|
||||
static void onYinYangClicked(GtkWidget* w UNUSED, gpointer vprivate)
|
||||
static void onYinYangClicked(GtkWidget* w, gpointer vprivate)
|
||||
{
|
||||
TR_UNUSED(w);
|
||||
|
||||
PrivateData* p = vprivate;
|
||||
|
||||
#if GTK_CHECK_VERSION(3, 22, 0)
|
||||
|
@ -275,8 +289,10 @@ static void alt_speed_toggled_cb(GtkToggleButton* button, gpointer vprivate)
|
|||
**** FILTER
|
||||
***/
|
||||
|
||||
static void findMaxAnnounceTime(GtkTreeModel* model, GtkTreePath* path UNUSED, GtkTreeIter* iter, gpointer gmaxTime)
|
||||
static void findMaxAnnounceTime(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer gmaxTime)
|
||||
{
|
||||
TR_UNUSED(path);
|
||||
|
||||
tr_torrent* tor;
|
||||
tr_stat const* torStat;
|
||||
time_t* maxTime = gmaxTime;
|
||||
|
@ -286,9 +302,14 @@ static void findMaxAnnounceTime(GtkTreeModel* model, GtkTreePath* path UNUSED, G
|
|||
*maxTime = MAX(*maxTime, torStat->manualAnnounceTime);
|
||||
}
|
||||
|
||||
static gboolean onAskTrackerQueryTooltip(GtkWidget* widget UNUSED, gint x UNUSED, gint y UNUSED, gboolean keyboard_tip UNUSED,
|
||||
static gboolean onAskTrackerQueryTooltip(GtkWidget* widget, gint x, gint y, gboolean keyboard_tip,
|
||||
GtkTooltip* tooltip, gpointer gdata)
|
||||
{
|
||||
TR_UNUSED(widget);
|
||||
TR_UNUSED(x);
|
||||
TR_UNUSED(y);
|
||||
TR_UNUSED(keyboard_tip);
|
||||
|
||||
gboolean handled;
|
||||
time_t maxTime = 0;
|
||||
PrivateData* p = gdata;
|
||||
|
@ -324,8 +345,12 @@ static gboolean onAltSpeedToggledIdle(gpointer vp)
|
|||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void onAltSpeedToggled(tr_session* s UNUSED, bool isEnabled UNUSED, bool byUser UNUSED, void* p)
|
||||
static void onAltSpeedToggled(tr_session* s, bool isEnabled, bool byUser, void* p)
|
||||
{
|
||||
TR_UNUSED(s);
|
||||
TR_UNUSED(isEnabled);
|
||||
TR_UNUSED(byUser);
|
||||
|
||||
gdk_threads_add_idle(onAltSpeedToggledIdle, p);
|
||||
}
|
||||
|
||||
|
|
|
@ -313,8 +313,10 @@ gboolean on_tree_view_button_pressed(GtkWidget* view, GdkEventButton* event, gpo
|
|||
|
||||
/* if the user clicked in an empty area of the list,
|
||||
* clear all the selections. */
|
||||
gboolean on_tree_view_button_released(GtkWidget* view, GdkEventButton* event, gpointer unused UNUSED)
|
||||
gboolean on_tree_view_button_released(GtkWidget* view, GdkEventButton* event, gpointer user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
GtkTreeView* tv = GTK_TREE_VIEW(view);
|
||||
|
||||
if (!gtk_tree_view_get_path_at_pos(tv, (gint)event->x, (gint)event->y, NULL, NULL, NULL, NULL))
|
||||
|
|
|
@ -204,7 +204,7 @@ static struct tr_scrape_info* tr_announcerGetScrapeInfo(struct tr_announcer* ann
|
|||
return info;
|
||||
}
|
||||
|
||||
static void onUpkeepTimer(evutil_socket_t foo UNUSED, short bar UNUSED, void* vannouncer);
|
||||
static void onUpkeepTimer(evutil_socket_t fd, short what, void* vannouncer);
|
||||
|
||||
void tr_announcerInit(tr_session* session)
|
||||
{
|
||||
|
@ -1733,8 +1733,11 @@ static void announceMore(tr_announcer* announcer)
|
|||
tr_ptrArrayDestruct(&announceMe, NULL);
|
||||
}
|
||||
|
||||
static void onUpkeepTimer(evutil_socket_t foo UNUSED, short bar UNUSED, void* vannouncer)
|
||||
static void onUpkeepTimer(evutil_socket_t fd, short what, void* vannouncer)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_announcer* announcer = vannouncer;
|
||||
tr_session* session = announcer->session;
|
||||
bool const is_closing = session->isClosed;
|
||||
|
@ -1882,8 +1885,10 @@ tr_tracker_stat* tr_announcerStats(tr_torrent const* torrent, int* setmeTrackerC
|
|||
return ret;
|
||||
}
|
||||
|
||||
void tr_announcerStatsFree(tr_tracker_stat* trackers, int trackerCount UNUSED)
|
||||
void tr_announcerStatsFree(tr_tracker_stat* trackers, int trackerCount)
|
||||
{
|
||||
TR_UNUSED(trackerCount);
|
||||
|
||||
tr_free(trackers);
|
||||
}
|
||||
|
||||
|
@ -1934,8 +1939,10 @@ static void copy_tier_attributes(struct tr_torrent_tiers* tt, tr_tier const* src
|
|||
}
|
||||
}
|
||||
|
||||
void tr_announcerResetTorrent(tr_announcer* announcer UNUSED, tr_torrent* tor)
|
||||
void tr_announcerResetTorrent(tr_announcer* announcer, tr_torrent* tor)
|
||||
{
|
||||
TR_UNUSED(announcer);
|
||||
|
||||
TR_ASSERT(tor->tiers != NULL);
|
||||
|
||||
time_t const now = tr_time();
|
||||
|
|
|
@ -239,8 +239,10 @@ void tr_dh_free(tr_dh_ctx_t raw_handle)
|
|||
tr_free(handle);
|
||||
}
|
||||
|
||||
bool tr_dh_make_key(tr_dh_ctx_t raw_handle, size_t private_key_length UNUSED, uint8_t* public_key, size_t* public_key_length)
|
||||
bool tr_dh_make_key(tr_dh_ctx_t raw_handle, size_t private_key_length, uint8_t* public_key, size_t* public_key_length)
|
||||
{
|
||||
TR_UNUSED(private_key_length);
|
||||
|
||||
TR_ASSERT(raw_handle != NULL);
|
||||
TR_ASSERT(public_key != NULL);
|
||||
|
||||
|
|
|
@ -87,8 +87,10 @@ static bool check_polarssl_result(int result, int expected_result, char const* f
|
|||
****
|
||||
***/
|
||||
|
||||
static int my_rand(void* context UNUSED, unsigned char* buffer, size_t buffer_size)
|
||||
static int my_rand(void* context, unsigned char* buffer, size_t buffer_size)
|
||||
{
|
||||
TR_UNUSED(context);
|
||||
|
||||
for (size_t i = 0; i < buffer_size; ++i)
|
||||
{
|
||||
buffer[i] = tr_rand_int_weak(256);
|
||||
|
|
|
@ -1201,8 +1201,11 @@ static void gotError(tr_peerIo* io, short what, void* vhandshake)
|
|||
***
|
||||
**/
|
||||
|
||||
static void handshakeTimeout(evutil_socket_t foo UNUSED, short bar UNUSED, void* handshake)
|
||||
static void handshakeTimeout(evutil_socket_t s, short type, void* handshake)
|
||||
{
|
||||
TR_UNUSED(s);
|
||||
TR_UNUSED(type);
|
||||
|
||||
tr_handshakeAbort(handshake);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,8 +33,9 @@ static inline bool IsDebuggerPresent(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
static inline void OutputDebugStringA(void const* unused UNUSED)
|
||||
static inline void OutputDebugStringA(void const* data)
|
||||
{
|
||||
TR_UNUSED(data);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -533,8 +533,10 @@ static tr_lock* getQueueLock(void)
|
|||
return lock;
|
||||
}
|
||||
|
||||
static void makeMetaWorkerFunc(void* unused UNUSED)
|
||||
static void makeMetaWorkerFunc(void* user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
tr_metainfo_builder* builder = NULL;
|
||||
|
|
|
@ -359,8 +359,10 @@ struct tr_peer_socket tr_netOpenPeerSocket(tr_session* session, tr_address const
|
|||
}
|
||||
|
||||
struct tr_peer_socket tr_netOpenPeerUTPSocket(tr_session* session, tr_address const* addr, tr_port port,
|
||||
bool clientIsSeed UNUSED)
|
||||
bool clientIsSeed)
|
||||
{
|
||||
TR_UNUSED(clientIsSeed);
|
||||
|
||||
struct tr_peer_socket ret = TR_PEER_SOCKET_INIT;
|
||||
|
||||
if (tr_address_is_valid_for_peers(addr, port))
|
||||
|
|
|
@ -260,8 +260,10 @@ static void canReadWrapper(tr_peerIo* io)
|
|||
tr_peerIoUnref(io);
|
||||
}
|
||||
|
||||
static void event_read_cb(evutil_socket_t fd, short event UNUSED, void* vio)
|
||||
static void event_read_cb(evutil_socket_t fd, short event, void* vio)
|
||||
{
|
||||
TR_UNUSED(event);
|
||||
|
||||
tr_peerIo* io = vio;
|
||||
|
||||
TR_ASSERT(tr_isPeerIo(io));
|
||||
|
@ -346,8 +348,10 @@ static int tr_evbuffer_write(tr_peerIo* io, int fd, size_t howmuch)
|
|||
return n;
|
||||
}
|
||||
|
||||
static void event_write_cb(evutil_socket_t fd, short event UNUSED, void* vio)
|
||||
static void event_write_cb(evutil_socket_t fd, short event, void* vio)
|
||||
{
|
||||
TR_UNUSED(event);
|
||||
|
||||
tr_peerIo* io = vio;
|
||||
|
||||
TR_ASSERT(tr_isPeerIo(io));
|
||||
|
@ -555,8 +559,10 @@ static void utp_on_error(void* closure, int errcode)
|
|||
}
|
||||
}
|
||||
|
||||
static void utp_on_overhead(void* closure, uint8_t /* bool */ send, size_t count, int type UNUSED)
|
||||
static void utp_on_overhead(void* closure, uint8_t /* bool */ send, size_t count, int type)
|
||||
{
|
||||
TR_UNUSED(type);
|
||||
|
||||
tr_peerIo* io = closure;
|
||||
|
||||
TR_ASSERT(tr_isPeerIo(io));
|
||||
|
@ -580,35 +586,51 @@ static struct UTPFunctionTable utp_function_table =
|
|||
/* We switch a UTP socket to use these after the associated peerIo has been
|
||||
destroyed -- see io_dtor. */
|
||||
|
||||
static void dummy_read(void* closure UNUSED, unsigned char const* buf UNUSED, size_t buflen UNUSED)
|
||||
static void dummy_read(void* closure, unsigned char const* buf, size_t buflen)
|
||||
{
|
||||
TR_UNUSED(closure);
|
||||
TR_UNUSED(buf);
|
||||
TR_UNUSED(buflen);
|
||||
|
||||
/* This cannot happen, as far as I'm aware. */
|
||||
tr_logAddNamedError("UTP", "On_read called on closed socket");
|
||||
}
|
||||
|
||||
static void dummy_write(void* closure UNUSED, unsigned char* buf, size_t buflen)
|
||||
static void dummy_write(void* closure, unsigned char* buf, size_t buflen)
|
||||
{
|
||||
TR_UNUSED(closure);
|
||||
|
||||
/* This can very well happen if we've shut down a peer connection that
|
||||
had unflushed buffers. Complain and send zeroes. */
|
||||
tr_logAddNamedDbg("UTP", "On_write called on closed socket");
|
||||
memset(buf, 0, buflen);
|
||||
}
|
||||
|
||||
static size_t dummy_get_rb_size(void* closure UNUSED)
|
||||
static size_t dummy_get_rb_size(void* closure)
|
||||
{
|
||||
TR_UNUSED(closure);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dummy_on_state_change(void* closure UNUSED, int state UNUSED)
|
||||
static void dummy_on_state_change(void* closure, int state)
|
||||
{
|
||||
TR_UNUSED(closure);
|
||||
TR_UNUSED(state);
|
||||
}
|
||||
|
||||
static void dummy_on_error(void* closure UNUSED, int errcode UNUSED)
|
||||
static void dummy_on_error(void* closure, int errcode)
|
||||
{
|
||||
TR_UNUSED(closure);
|
||||
TR_UNUSED(errcode);
|
||||
}
|
||||
|
||||
static void dummy_on_overhead(void* closure UNUSED, uint8_t /* bool */ send UNUSED, size_t count UNUSED, int type UNUSED)
|
||||
static void dummy_on_overhead(void* closure, uint8_t /* bool */ send, size_t count, int type)
|
||||
{
|
||||
TR_UNUSED(closure);
|
||||
TR_UNUSED(send);
|
||||
TR_UNUSED(count);
|
||||
TR_UNUSED(type);
|
||||
}
|
||||
|
||||
static struct UTPFunctionTable dummy_utp_function_table =
|
||||
|
|
|
@ -1501,8 +1501,11 @@ bool tr_peerMgrDidPeerRequest(tr_torrent const* tor, tr_peer const* peer, tr_blo
|
|||
}
|
||||
|
||||
/* cancel requests that are too old */
|
||||
static void refillUpkeep(evutil_socket_t foo UNUSED, short bar UNUSED, void* vmgr)
|
||||
static void refillUpkeep(evutil_socket_t fd, short what, void* vmgr)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
time_t now;
|
||||
time_t too_old;
|
||||
tr_torrent* tor;
|
||||
|
@ -1608,9 +1611,11 @@ static void addStrike(tr_swarm* s, tr_peer* peer)
|
|||
}
|
||||
}
|
||||
|
||||
static void peerSuggestedPiece(tr_swarm* s UNUSED, tr_peer* peer UNUSED, tr_piece_index_t pieceIndex UNUSED,
|
||||
int isFastAllowed UNUSED)
|
||||
static void peerSuggestedPiece(tr_swarm* s, tr_peer* peer, tr_piece_index_t pieceIndex,
|
||||
int isFastAllowed)
|
||||
{
|
||||
TR_UNUSED(s);
|
||||
|
||||
#if 0
|
||||
|
||||
TR_ASSERT(t != NULL);
|
||||
|
@ -1661,6 +1666,12 @@ static void peerSuggestedPiece(tr_swarm* s UNUSED, tr_peer* peer UNUSED, tr_piec
|
|||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
TR_UNUSED(peer);
|
||||
TR_UNUSED(pieceIndex);
|
||||
TR_UNUSED(isFastAllowed);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -3332,8 +3343,11 @@ static void rechokeUploads(tr_swarm* s, uint64_t const now)
|
|||
tr_free(choke);
|
||||
}
|
||||
|
||||
static void rechokePulse(evutil_socket_t foo UNUSED, short bar UNUSED, void* vmgr)
|
||||
static void rechokePulse(evutil_socket_t fd, short what, void* vmgr)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_torrent* tor = NULL;
|
||||
tr_peerMgr* mgr = vmgr;
|
||||
uint64_t const now = tr_time_msec();
|
||||
|
@ -3736,8 +3750,11 @@ static void enforceSessionPeerLimit(tr_session* session, uint64_t now)
|
|||
|
||||
static void makeNewPeerConnections(tr_peerMgr* mgr, int const max);
|
||||
|
||||
static void reconnectPulse(evutil_socket_t foo UNUSED, short bar UNUSED, void* vmgr)
|
||||
static void reconnectPulse(evutil_socket_t fd, short what, void* vmgr)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_torrent* tor;
|
||||
tr_peerMgr* mgr = vmgr;
|
||||
time_t const now_sec = tr_time();
|
||||
|
@ -3831,8 +3848,11 @@ static void queuePulse(tr_session* session, tr_direction dir)
|
|||
}
|
||||
}
|
||||
|
||||
static void bandwidthPulse(evutil_socket_t foo UNUSED, short bar UNUSED, void* vmgr)
|
||||
static void bandwidthPulse(evutil_socket_t fd, short what, void* vmgr)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_torrent* tor;
|
||||
tr_peerMgr* mgr = vmgr;
|
||||
tr_session* session = mgr->session;
|
||||
|
@ -3942,8 +3962,11 @@ static int getMaxAtomCount(tr_torrent const* tor)
|
|||
return MIN(50, tor->maxConnectedPeers * 3);
|
||||
}
|
||||
|
||||
static void atomPulse(evutil_socket_t foo UNUSED, short bar UNUSED, void* vmgr)
|
||||
static void atomPulse(evutil_socket_t fd, short what, void* vmgr)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_torrent* tor = NULL;
|
||||
tr_peerMgr* mgr = vmgr;
|
||||
managerLock(mgr);
|
||||
|
|
|
@ -619,8 +619,10 @@ size_t tr_generateAllowedSet(tr_piece_index_t* setmePieces, size_t desiredSetSiz
|
|||
return setSize;
|
||||
}
|
||||
|
||||
static void updateFastSet(tr_peerMsgs* msgs UNUSED)
|
||||
static void updateFastSet(tr_peerMsgs* msgs)
|
||||
{
|
||||
TR_UNUSED(msgs);
|
||||
|
||||
bool const fext = tr_peerIoSupportsFEXT(msgs->io);
|
||||
bool const peerIsNeedy = msgs->peer->progress < 0.10;
|
||||
|
||||
|
@ -736,8 +738,10 @@ static void sendInterest(tr_peerMsgs* msgs, bool b)
|
|||
dbgOutMessageLen(msgs);
|
||||
}
|
||||
|
||||
static void updateInterest(tr_peerMsgs* msgs UNUSED)
|
||||
static void updateInterest(tr_peerMsgs* msgs)
|
||||
{
|
||||
TR_UNUSED(msgs);
|
||||
|
||||
/* FIXME -- might need to poke the mgr on startup */
|
||||
}
|
||||
|
||||
|
@ -2216,8 +2220,10 @@ void tr_peerMsgsPulse(tr_peerMsgs* msgs)
|
|||
}
|
||||
}
|
||||
|
||||
static void gotError(tr_peerIo* io UNUSED, short what, void* vmsgs)
|
||||
static void gotError(tr_peerIo* io, short what, void* vmsgs)
|
||||
{
|
||||
TR_UNUSED(io);
|
||||
|
||||
if ((what & BEV_EVENT_TIMEOUT) != 0)
|
||||
{
|
||||
dbgmsg(vmsgs, "libevent got a timeout, what=%hd", what);
|
||||
|
@ -2557,8 +2563,11 @@ static void sendPex(tr_peerMsgs* msgs)
|
|||
}
|
||||
}
|
||||
|
||||
static void pexPulse(evutil_socket_t foo UNUSED, short bar UNUSED, void* vmsgs)
|
||||
static void pexPulse(evutil_socket_t fd, short what, void* vmsgs)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
struct tr_peerMsgs* msgs = vmsgs;
|
||||
|
||||
sendPex(msgs);
|
||||
|
|
|
@ -475,7 +475,7 @@ static bool isWebClientDir(char const* path)
|
|||
return ret;
|
||||
}
|
||||
|
||||
char const* tr_getWebClientDir(tr_session const* session UNUSED)
|
||||
char const* tr_getWebClientDir(tr_session const* session)
|
||||
{
|
||||
static char* s = NULL;
|
||||
|
||||
|
@ -524,6 +524,8 @@ char const* tr_getWebClientDir(tr_session const* session UNUSED)
|
|||
|
||||
#elif defined(_WIN32)
|
||||
|
||||
TR_UNUSED(session);
|
||||
|
||||
/* Generally, Web interface should be stored in a Web subdir of
|
||||
* calling executable dir. */
|
||||
|
||||
|
@ -572,6 +574,8 @@ char const* tr_getWebClientDir(tr_session const* session UNUSED)
|
|||
|
||||
#else /* everyone else, follow the XDG spec */
|
||||
|
||||
TR_UNUSED(session);
|
||||
|
||||
tr_list* candidates = NULL;
|
||||
char* tmp;
|
||||
|
||||
|
|
|
@ -140,8 +140,11 @@ static void set_evtimer_from_status(tr_shared* s)
|
|||
}
|
||||
}
|
||||
|
||||
static void onTimer(evutil_socket_t fd UNUSED, short what UNUSED, void* vshared)
|
||||
static void onTimer(evutil_socket_t fd, short what, void* vshared)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_shared* s = vshared;
|
||||
|
||||
TR_ASSERT(s != NULL);
|
||||
|
|
|
@ -376,8 +376,11 @@ static void add_time_header(struct evkeyvalq* headers, char const* key, time_t v
|
|||
evhttp_add_header(headers, key, buf);
|
||||
}
|
||||
|
||||
static void evbuffer_ref_cleanup_tr_free(void const* data UNUSED, size_t datalen UNUSED, void* extra)
|
||||
static void evbuffer_ref_cleanup_tr_free(void const* data, size_t datalen, void* extra)
|
||||
{
|
||||
TR_UNUSED(data);
|
||||
TR_UNUSED(datalen);
|
||||
|
||||
tr_free(extra);
|
||||
}
|
||||
|
||||
|
@ -476,8 +479,10 @@ struct rpc_response_data
|
|||
struct tr_rpc_server* server;
|
||||
};
|
||||
|
||||
static void rpc_response_func(tr_session* session UNUSED, tr_variant* response, void* user_data)
|
||||
static void rpc_response_func(tr_session* session, tr_variant* response, void* user_data)
|
||||
{
|
||||
TR_UNUSED(session);
|
||||
|
||||
struct rpc_response_data* data = user_data;
|
||||
struct evbuffer* response_buf = tr_variantToBuf(response, TR_VARIANT_FMT_JSON_LEAN);
|
||||
struct evbuffer* buf = evbuffer_new();
|
||||
|
@ -764,8 +769,11 @@ enum
|
|||
|
||||
static void startServer(void* vserver);
|
||||
|
||||
static void rpc_server_on_start_retry(evutil_socket_t fd UNUSED, short type UNUSED, void* context)
|
||||
static void rpc_server_on_start_retry(evutil_socket_t fd, short type, void* context)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(type);
|
||||
|
||||
startServer(context);
|
||||
}
|
||||
|
||||
|
|
|
@ -201,9 +201,12 @@ static void notifyBatchQueueChange(tr_session* session, tr_torrent** torrents, i
|
|||
notify(session, TR_RPC_SESSION_QUEUE_POSITIONS_CHANGED, NULL);
|
||||
}
|
||||
|
||||
static char const* queueMoveTop(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* queueMoveTop(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
int n;
|
||||
tr_torrent** torrents = getTorrents(session, args_in, &n);
|
||||
tr_torrentsQueueMoveTop(torrents, n);
|
||||
|
@ -212,9 +215,12 @@ static char const* queueMoveTop(tr_session* session, tr_variant* args_in, tr_var
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static char const* queueMoveUp(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* queueMoveUp(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
int n;
|
||||
tr_torrent** torrents = getTorrents(session, args_in, &n);
|
||||
tr_torrentsQueueMoveUp(torrents, n);
|
||||
|
@ -223,9 +229,12 @@ static char const* queueMoveUp(tr_session* session, tr_variant* args_in, tr_vari
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static char const* queueMoveDown(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* queueMoveDown(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
int n;
|
||||
tr_torrent** torrents = getTorrents(session, args_in, &n);
|
||||
tr_torrentsQueueMoveDown(torrents, n);
|
||||
|
@ -234,9 +243,12 @@ static char const* queueMoveDown(tr_session* session, tr_variant* args_in, tr_va
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static char const* queueMoveBottom(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* queueMoveBottom(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
int n;
|
||||
tr_torrent** torrents = getTorrents(session, args_in, &n);
|
||||
tr_torrentsQueueMoveBottom(torrents, n);
|
||||
|
@ -253,9 +265,12 @@ static int compareTorrentByQueuePosition(void const* va, void const* vb)
|
|||
return a->queuePosition - b->queuePosition;
|
||||
}
|
||||
|
||||
static char const* torrentStart(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* torrentStart(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
int torrentCount;
|
||||
|
@ -278,9 +293,12 @@ static char const* torrentStart(tr_session* session, tr_variant* args_in, tr_var
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static char const* torrentStartNow(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* torrentStartNow(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
int torrentCount;
|
||||
|
@ -303,9 +321,12 @@ static char const* torrentStartNow(tr_session* session, tr_variant* args_in, tr_
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static char const* torrentStop(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* torrentStop(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
int torrentCount;
|
||||
|
@ -326,9 +347,12 @@ static char const* torrentStop(tr_session* session, tr_variant* args_in, tr_vari
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static char const* torrentRemove(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* torrentRemove(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
bool deleteFlag;
|
||||
|
@ -358,9 +382,12 @@ static char const* torrentRemove(tr_session* session, tr_variant* args_in, tr_va
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static char const* torrentReannounce(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* torrentReannounce(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
int torrentCount;
|
||||
|
@ -381,9 +408,12 @@ static char const* torrentReannounce(tr_session* session, tr_variant* args_in, t
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static char const* torrentVerify(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* torrentVerify(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
int torrentCount;
|
||||
|
@ -905,8 +935,10 @@ static void addTorrentInfo(tr_torrent* tor, tr_format format, tr_variant* entry,
|
|||
}
|
||||
|
||||
static char const* torrentGet(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
int torrentCount;
|
||||
|
@ -1342,9 +1374,12 @@ static char const* removeTrackers(tr_torrent* tor, tr_variant* ids)
|
|||
return errmsg;
|
||||
}
|
||||
|
||||
static char const* torrentSet(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* torrentSet(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
int torrentCount;
|
||||
|
@ -1477,9 +1512,12 @@ static char const* torrentSet(tr_session* session, tr_variant* args_in, tr_varia
|
|||
return errmsg;
|
||||
}
|
||||
|
||||
static char const* torrentSetLocation(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* torrentSetLocation(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
char const* location = NULL;
|
||||
|
@ -1540,9 +1578,11 @@ static void torrentRenamePathDone(tr_torrent* tor, char const* oldpath, char con
|
|||
tr_idle_function_done(data, result);
|
||||
}
|
||||
|
||||
static char const* torrentRenamePath(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
static char const* torrentRenamePath(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
|
||||
int torrentCount;
|
||||
tr_torrent** torrents;
|
||||
char const* oldpath = NULL;
|
||||
|
@ -1571,9 +1611,13 @@ static char const* torrentRenamePath(tr_session* session, tr_variant* args_in, t
|
|||
****
|
||||
***/
|
||||
|
||||
static void portTested(tr_session* session UNUSED, bool did_connect UNUSED, bool did_timeout UNUSED, long response_code,
|
||||
static void portTested(tr_session* session, bool did_connect, bool did_timeout, long response_code,
|
||||
void const* response, size_t response_byte_count, void* user_data)
|
||||
{
|
||||
TR_UNUSED(session);
|
||||
TR_UNUSED(did_connect);
|
||||
TR_UNUSED(did_timeout);
|
||||
|
||||
char result[1024];
|
||||
struct tr_rpc_idle_data* data = user_data;
|
||||
|
||||
|
@ -1592,9 +1636,12 @@ static void portTested(tr_session* session UNUSED, bool did_connect UNUSED, bool
|
|||
tr_idle_function_done(data, result);
|
||||
}
|
||||
|
||||
static char const* portTest(tr_session* session, tr_variant* args_in UNUSED, tr_variant* args_out UNUSED,
|
||||
static char const* portTest(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_in);
|
||||
TR_UNUSED(args_out);
|
||||
|
||||
int const port = tr_sessionGetPeerPort(session);
|
||||
char* url = tr_strdup_printf("https://portcheck.transmissionbt.com/%d", port);
|
||||
tr_webRun(session, url, portTested, idle_data);
|
||||
|
@ -1606,9 +1653,12 @@ static char const* portTest(tr_session* session, tr_variant* args_in UNUSED, tr_
|
|||
****
|
||||
***/
|
||||
|
||||
static void gotNewBlocklist(tr_session* session, bool did_connect UNUSED, bool did_timeout UNUSED, long response_code,
|
||||
static void gotNewBlocklist(tr_session* session, bool did_connect, bool did_timeout, long response_code,
|
||||
void const* response, size_t response_byte_count, void* user_data)
|
||||
{
|
||||
TR_UNUSED(did_connect);
|
||||
TR_UNUSED(did_timeout);
|
||||
|
||||
char result[1024];
|
||||
struct tr_rpc_idle_data* data = user_data;
|
||||
|
||||
|
@ -1710,9 +1760,12 @@ static void gotNewBlocklist(tr_session* session, bool did_connect UNUSED, bool d
|
|||
tr_idle_function_done(data, result);
|
||||
}
|
||||
|
||||
static char const* blocklistUpdate(tr_session* session, tr_variant* args_in UNUSED, tr_variant* args_out UNUSED,
|
||||
static char const* blocklistUpdate(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_in);
|
||||
TR_UNUSED(args_out);
|
||||
|
||||
tr_webRun(session, session->blocklist_url, gotNewBlocklist, idle_data);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1779,9 +1832,13 @@ struct add_torrent_idle_data
|
|||
tr_ctor* ctor;
|
||||
};
|
||||
|
||||
static void gotMetadataFromURL(tr_session* session UNUSED, bool did_connect UNUSED, bool did_timeout UNUSED, long response_code,
|
||||
static void gotMetadataFromURL(tr_session* session, bool did_connect, bool did_timeout, long response_code,
|
||||
void const* response, size_t response_byte_count, void* user_data)
|
||||
{
|
||||
TR_UNUSED(session);
|
||||
TR_UNUSED(did_connect);
|
||||
TR_UNUSED(did_timeout);
|
||||
|
||||
struct add_torrent_idle_data* data = user_data;
|
||||
|
||||
dbgmsg("torrentAdd: HTTP response code was %ld (%s); response length was %zu bytes", response_code,
|
||||
|
@ -1833,9 +1890,11 @@ static tr_file_index_t* fileListFromList(tr_variant* list, tr_file_index_t* setm
|
|||
return files;
|
||||
}
|
||||
|
||||
static char const* torrentAdd(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
static char const* torrentAdd(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
|
||||
TR_ASSERT(idle_data != NULL);
|
||||
|
||||
char const* filename = NULL;
|
||||
|
@ -1970,9 +2029,12 @@ static char const* torrentAdd(tr_session* session, tr_variant* args_in, tr_varia
|
|||
****
|
||||
***/
|
||||
|
||||
static char const* sessionSet(tr_session* session, tr_variant* args_in, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* sessionSet(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
char const* download_dir = NULL;
|
||||
|
@ -2225,9 +2287,12 @@ static char const* sessionSet(tr_session* session, tr_variant* args_in, tr_varia
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static char const* sessionStats(tr_session* session, tr_variant* args_in UNUSED, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* sessionStats(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_in);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
int running = 0;
|
||||
|
@ -2499,8 +2564,10 @@ static void addSessionField(tr_session* s, tr_variant* d, tr_quark key)
|
|||
}
|
||||
|
||||
static char const* sessionGet(tr_session* s, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
TR_ASSERT(idle_data == NULL);
|
||||
|
||||
tr_variant* fields;
|
||||
|
@ -2540,8 +2607,10 @@ static char const* sessionGet(tr_session* s, tr_variant* args_in, tr_variant* ar
|
|||
}
|
||||
|
||||
static char const* freeSpace(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
int tmperr;
|
||||
char const* path = NULL;
|
||||
char const* err = NULL;
|
||||
|
@ -2583,9 +2652,13 @@ static char const* freeSpace(tr_session* session, tr_variant* args_in, tr_varian
|
|||
****
|
||||
***/
|
||||
|
||||
static char const* sessionClose(tr_session* session, tr_variant* args_in UNUSED, tr_variant* args_out UNUSED,
|
||||
struct tr_rpc_idle_data* idle_data UNUSED)
|
||||
static char const* sessionClose(tr_session* session, tr_variant* args_in, tr_variant* args_out,
|
||||
struct tr_rpc_idle_data* idle_data)
|
||||
{
|
||||
TR_UNUSED(args_in);
|
||||
TR_UNUSED(args_out);
|
||||
TR_UNUSED(idle_data);
|
||||
|
||||
notify(session, TR_RPC_SESSION_CLOSE, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2628,8 +2701,11 @@ methods[] =
|
|||
{ "queue-move-bottom", true, queueMoveBottom }
|
||||
};
|
||||
|
||||
static void noop_response_callback(tr_session* session UNUSED, tr_variant* response UNUSED, void* user_data UNUSED)
|
||||
static void noop_response_callback(tr_session* session, tr_variant* response, void* user_data)
|
||||
{
|
||||
TR_UNUSED(session);
|
||||
TR_UNUSED(response);
|
||||
TR_UNUSED(user_data);
|
||||
}
|
||||
|
||||
void tr_rpc_request_exec_json(tr_session* session, tr_variant const* request, tr_rpc_response_func callback,
|
||||
|
|
|
@ -163,8 +163,10 @@ static void free_incoming_peer_port(tr_session* session)
|
|||
session->public_ipv6 = NULL;
|
||||
}
|
||||
|
||||
static void accept_incoming_peer(evutil_socket_t fd, short what UNUSED, void* vsession)
|
||||
static void accept_incoming_peer(evutil_socket_t fd, short what, void* vsession)
|
||||
{
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_socket_t clientSocket;
|
||||
tr_port clientPort;
|
||||
tr_address clientAddr;
|
||||
|
@ -566,8 +568,11 @@ void tr_sessionSaveSettings(tr_session* session, char const* configDir, tr_varia
|
|||
* status has recently changed. This prevents loss of metadata
|
||||
* in the case of a crash, unclean shutdown, clumsy user, etc.
|
||||
*/
|
||||
static void onSaveTimer(evutil_socket_t foo UNUSED, short bar UNUSED, void* vsession)
|
||||
static void onSaveTimer(evutil_socket_t fd, short what, void* vsession)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_torrent* tor = NULL;
|
||||
tr_session* session = vsession;
|
||||
|
||||
|
@ -651,8 +656,11 @@ tr_session* tr_sessionInit(char const* configDir, bool messageQueuingEnabled, tr
|
|||
|
||||
static void turtleCheckClock(tr_session* s, struct tr_turtle_info* t);
|
||||
|
||||
static void onNowTimer(evutil_socket_t foo UNUSED, short bar UNUSED, void* vsession)
|
||||
static void onNowTimer(evutil_socket_t fd, short what, void* vsession)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_session* session = vsession;
|
||||
|
||||
TR_ASSERT(tr_isSession(session));
|
||||
|
@ -1911,7 +1919,7 @@ static int compareTorrentByCur(void const* va, void const* vb)
|
|||
|
||||
static void closeBlocklists(tr_session*);
|
||||
|
||||
static void sessionCloseImplWaitForIdleUdp(evutil_socket_t foo UNUSED, short bar UNUSED, void* vsession);
|
||||
static void sessionCloseImplWaitForIdleUdp(evutil_socket_t fd, short what, void* vsession);
|
||||
|
||||
static void sessionCloseImplStart(tr_session* session)
|
||||
{
|
||||
|
@ -1973,8 +1981,11 @@ static void sessionCloseImplStart(tr_session* session)
|
|||
|
||||
static void sessionCloseImplFinish(tr_session* session);
|
||||
|
||||
static void sessionCloseImplWaitForIdleUdp(evutil_socket_t foo UNUSED, short bar UNUSED, void* vsession)
|
||||
static void sessionCloseImplWaitForIdleUdp(evutil_socket_t fd, short what, void* vsession)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_session* session = vsession;
|
||||
|
||||
TR_ASSERT(tr_isSession(session));
|
||||
|
|
|
@ -22,8 +22,10 @@
|
|||
#include "tr-macros.h"
|
||||
#include "utils.h"
|
||||
|
||||
static void handle_sigchld(int i UNUSED)
|
||||
static void handle_sigchld(int i)
|
||||
{
|
||||
TR_UNUSED(i);
|
||||
|
||||
int rc;
|
||||
|
||||
do
|
||||
|
|
|
@ -586,8 +586,10 @@ static void tr_torrentClearError(tr_torrent* tor)
|
|||
tor->errorTracker[0] = '\0';
|
||||
}
|
||||
|
||||
static void onTrackerResponse(tr_torrent* tor, tr_tracker_event const* event, void* unused UNUSED)
|
||||
static void onTrackerResponse(tr_torrent* tor, tr_tracker_event const* event, void* user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
switch (event->messageType)
|
||||
{
|
||||
case TR_TRACKER_PEERS:
|
||||
|
@ -1596,8 +1598,10 @@ tr_file_stat* tr_torrentFiles(tr_torrent const* tor, tr_file_index_t* fileCount)
|
|||
return files;
|
||||
}
|
||||
|
||||
void tr_torrentFilesFree(tr_file_stat* files, tr_file_index_t fileCount UNUSED)
|
||||
void tr_torrentFilesFree(tr_file_stat* files, tr_file_index_t fileCount)
|
||||
{
|
||||
TR_UNUSED(fileCount);
|
||||
|
||||
tr_free(files);
|
||||
}
|
||||
|
||||
|
@ -1619,8 +1623,10 @@ tr_peer_stat* tr_torrentPeers(tr_torrent const* tor, int* peerCount)
|
|||
return tr_peerMgrPeerStats(tor, peerCount);
|
||||
}
|
||||
|
||||
void tr_torrentPeersFree(tr_peer_stat* peers, int peerCount UNUSED)
|
||||
void tr_torrentPeersFree(tr_peer_stat* peers, int peerCount)
|
||||
{
|
||||
TR_UNUSED(peerCount);
|
||||
|
||||
tr_free(peers);
|
||||
}
|
||||
|
||||
|
|
|
@ -639,8 +639,10 @@ char const* tr_dhtPrintableStatus(int status)
|
|||
}
|
||||
}
|
||||
|
||||
static void callback(void* ignore UNUSED, int event, unsigned char const* info_hash, void const* data, size_t data_len)
|
||||
static void callback(void* ignore, int event, unsigned char const* info_hash, void const* data, size_t data_len)
|
||||
{
|
||||
TR_UNUSED(ignore);
|
||||
|
||||
if (event == DHT_EVENT_VALUES || event == DHT_EVENT_VALUES6)
|
||||
{
|
||||
tr_torrent* tor;
|
||||
|
@ -811,8 +813,11 @@ void tr_dhtCallback(unsigned char* buf, int buflen, struct sockaddr* from, sockl
|
|||
tr_timerAdd(dht_timer, (int)tosleep, tr_rand_int_weak(1000000));
|
||||
}
|
||||
|
||||
static void timer_callback(evutil_socket_t s UNUSED, short type UNUSED, void* session)
|
||||
static void timer_callback(evutil_socket_t s, short type, void* session)
|
||||
{
|
||||
TR_UNUSED(s);
|
||||
TR_UNUSED(type);
|
||||
|
||||
tr_dhtCallback(NULL, 0, NULL, 0, session);
|
||||
}
|
||||
|
||||
|
@ -822,8 +827,11 @@ static void timer_callback(evutil_socket_t s UNUSED, short type UNUSED, void* se
|
|||
free to add support to your private copy as long as you don't
|
||||
redistribute it. */
|
||||
|
||||
int dht_blacklisted(struct sockaddr const* sa UNUSED, int salen UNUSED)
|
||||
int dht_blacklisted(struct sockaddr const* sa, int salen)
|
||||
{
|
||||
TR_UNUSED(sa);
|
||||
TR_UNUSED(salen);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ static tr_socket_t lpd_socket2; /**<and multicast send socket */
|
|||
static struct event* lpd_event = NULL;
|
||||
static tr_port lpd_port;
|
||||
|
||||
static tr_torrent* lpd_torStaticType UNUSED; /* just a helper for static type analysis */
|
||||
static tr_torrent* lpd_torStaticType; /* just a helper for static type analysis */
|
||||
static tr_session* session;
|
||||
|
||||
enum
|
||||
|
@ -295,8 +295,10 @@ static void on_upkeep_timer(evutil_socket_t, short, void*);
|
|||
* @remark Since the LPD service does not use another protocol family yet, this code is
|
||||
* IPv4 only for the time being.
|
||||
*/
|
||||
int tr_lpdInit(tr_session* ss, tr_address* tr_addr UNUSED)
|
||||
int tr_lpdInit(tr_session* ss, tr_address* tr_addr)
|
||||
{
|
||||
TR_UNUSED(tr_addr);
|
||||
|
||||
struct ip_mreq mcastReq;
|
||||
int const opt_on = 1;
|
||||
int const opt_off = 0;
|
||||
|
@ -458,7 +460,7 @@ bool tr_lpdEnabled(tr_session const* ss)
|
|||
* @remark Declared inline for the compiler not to allege us of feeding unused
|
||||
* functions. In any other respect, lpd_consistencyCheck is an orphaned function.
|
||||
*/
|
||||
UNUSED static inline void lpd_consistencyCheck(void)
|
||||
static inline void lpd_consistencyCheck(void)
|
||||
{
|
||||
/* if the following check fails, the definition of a hash string has changed
|
||||
* without our knowledge; revise string handling in functions tr_lpdSendAnnounce
|
||||
|
@ -692,8 +694,12 @@ static int tr_lpdAnnounceMore(time_t const now, int const interval)
|
|||
return announcesSent;
|
||||
}
|
||||
|
||||
static void on_upkeep_timer(evutil_socket_t foo UNUSED, short bar UNUSED, void* vsession UNUSED)
|
||||
static void on_upkeep_timer(evutil_socket_t s, short type, void* user_data)
|
||||
{
|
||||
TR_UNUSED(s);
|
||||
TR_UNUSED(type);
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
time_t const now = tr_time();
|
||||
tr_lpdAnnounceMore(now, UPKEEP_INTERVAL_SECS);
|
||||
tr_timerAdd(upkeep_timer, UPKEEP_INTERVAL_SECS, 0);
|
||||
|
@ -703,8 +709,11 @@ static void on_upkeep_timer(evutil_socket_t foo UNUSED, short bar UNUSED, void*
|
|||
* @brief Processing of timeout notifications and incoming data on the socket
|
||||
* @note maximum rate of read events is limited according to @a lpd_maxAnnounceCap
|
||||
* @see DoS */
|
||||
static void event_callback(evutil_socket_t s UNUSED, short type, void* ignore UNUSED)
|
||||
static void event_callback(evutil_socket_t s, short type, void* user_data)
|
||||
{
|
||||
TR_UNUSED(s);
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
TR_ASSERT(tr_isSession(session));
|
||||
|
||||
/* do not allow announces to be processed if LPD is disabled */
|
||||
|
|
|
@ -55,13 +55,7 @@
|
|||
****
|
||||
***/
|
||||
|
||||
#ifndef UNUSED
|
||||
#if __has_attribute(__unused__) || TR_GNUC_CHECK_VERSION(2, 7)
|
||||
#define UNUSED __attribute__((__unused__))
|
||||
#else
|
||||
#define UNUSED
|
||||
#endif
|
||||
#endif
|
||||
#define TR_UNUSED(x) (void)(x)
|
||||
|
||||
/***
|
||||
****
|
||||
|
|
|
@ -239,8 +239,10 @@ fail:
|
|||
}
|
||||
}
|
||||
|
||||
static void event_callback(evutil_socket_t s, short type UNUSED, void* sv)
|
||||
static void event_callback(evutil_socket_t s, short type, void* sv)
|
||||
{
|
||||
TR_UNUSED(type);
|
||||
|
||||
TR_ASSERT(tr_isSession(sv));
|
||||
TR_ASSERT(type == EV_READ);
|
||||
|
||||
|
|
|
@ -65,26 +65,43 @@ bool UTP_Write(struct UTPSocket* socket, size_t count)
|
|||
return false;
|
||||
}
|
||||
|
||||
int tr_utpPacket(unsigned char const* buf UNUSED, size_t buflen UNUSED, struct sockaddr const* from UNUSED,
|
||||
socklen_t fromlen UNUSED, tr_session* ss UNUSED)
|
||||
int tr_utpPacket(unsigned char const* buf, size_t buflen, struct sockaddr const* from,
|
||||
socklen_t fromlen, tr_session* ss)
|
||||
{
|
||||
TR_UNUSED(buf);
|
||||
TR_UNUSED(buflen);
|
||||
TR_UNUSED(from);
|
||||
TR_UNUSED(fromlen);
|
||||
TR_UNUSED(ss);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct UTPSocket* UTP_Create(SendToProc* send_to_proc UNUSED, void* send_to_userdata UNUSED, struct sockaddr const* addr UNUSED,
|
||||
socklen_t addrlen UNUSED)
|
||||
struct UTPSocket* UTP_Create(SendToProc* send_to_proc, void* send_to_userdata, struct sockaddr const* addr,
|
||||
socklen_t addrlen)
|
||||
{
|
||||
TR_UNUSED(send_to_proc);
|
||||
TR_UNUSED(send_to_userdata);
|
||||
TR_UNUSED(addr);
|
||||
TR_UNUSED(addrlen);
|
||||
|
||||
errno = ENOSYS;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void tr_utpClose(tr_session* ss UNUSED)
|
||||
void tr_utpClose(tr_session* ss)
|
||||
{
|
||||
TR_UNUSED(ss);
|
||||
}
|
||||
|
||||
void tr_utpSendTo(void* closure UNUSED, unsigned char const* buf UNUSED, size_t buflen UNUSED, struct sockaddr const* to UNUSED,
|
||||
socklen_t tolen UNUSED)
|
||||
void tr_utpSendTo(void* closure, unsigned char const* buf, size_t buflen, struct sockaddr const* to,
|
||||
socklen_t tolen)
|
||||
{
|
||||
TR_UNUSED(closure);
|
||||
TR_UNUSED(buf);
|
||||
TR_UNUSED(buflen);
|
||||
TR_UNUSED(to);
|
||||
TR_UNUSED(tolen);
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -158,8 +175,11 @@ static void reset_timer(tr_session* ss)
|
|||
tr_timerAdd(ss->utp_timer, sec, usec);
|
||||
}
|
||||
|
||||
static void timer_callback(evutil_socket_t s UNUSED, short type UNUSED, void* closure)
|
||||
static void timer_callback(evutil_socket_t s, short type, void* closure)
|
||||
{
|
||||
TR_UNUSED(s);
|
||||
TR_UNUSED(type);
|
||||
|
||||
tr_session* ss = closure;
|
||||
UTP_CheckTimeouts();
|
||||
reset_timer(ss);
|
||||
|
|
|
@ -366,18 +366,24 @@ static void saveStringFunc(tr_variant const* v, void* evbuf)
|
|||
evbuffer_add(evbuf, str, len);
|
||||
}
|
||||
|
||||
static void saveDictBeginFunc(tr_variant const* val UNUSED, void* evbuf)
|
||||
static void saveDictBeginFunc(tr_variant const* val, void* evbuf)
|
||||
{
|
||||
TR_UNUSED(val);
|
||||
|
||||
evbuffer_add(evbuf, "d", 1);
|
||||
}
|
||||
|
||||
static void saveListBeginFunc(tr_variant const* val UNUSED, void* evbuf)
|
||||
static void saveListBeginFunc(tr_variant const* val, void* evbuf)
|
||||
{
|
||||
TR_UNUSED(val);
|
||||
|
||||
evbuffer_add(evbuf, "l", 1);
|
||||
}
|
||||
|
||||
static void saveContainerEndFunc(tr_variant const* val UNUSED, void* evbuf)
|
||||
static void saveContainerEndFunc(tr_variant const* val, void* evbuf)
|
||||
{
|
||||
TR_UNUSED(val);
|
||||
|
||||
evbuffer_add(evbuf, "e", 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,8 +77,10 @@ static tr_variant* get_node(struct jsonsl_st* jsn)
|
|||
return node;
|
||||
}
|
||||
|
||||
static void error_handler(jsonsl_t jsn, jsonsl_error_t error, struct jsonsl_state_st* state UNUSED, jsonsl_char_t const* buf)
|
||||
static void error_handler(jsonsl_t jsn, jsonsl_error_t error, struct jsonsl_state_st* state, jsonsl_char_t const* buf)
|
||||
{
|
||||
TR_UNUSED(state);
|
||||
|
||||
struct json_wrapper_data* data = jsn->data;
|
||||
|
||||
if (data->source != NULL)
|
||||
|
@ -100,9 +102,12 @@ static int error_callback(jsonsl_t jsn, jsonsl_error_t error, struct jsonsl_stat
|
|||
return 0; /* bail */
|
||||
}
|
||||
|
||||
static void action_callback_PUSH(jsonsl_t jsn, jsonsl_action_t action UNUSED, struct jsonsl_state_st* state,
|
||||
jsonsl_char_t const* buf UNUSED)
|
||||
static void action_callback_PUSH(jsonsl_t jsn, jsonsl_action_t action, struct jsonsl_state_st* state,
|
||||
jsonsl_char_t const* buf)
|
||||
{
|
||||
TR_UNUSED(action);
|
||||
TR_UNUSED(buf);
|
||||
|
||||
tr_variant* node;
|
||||
struct json_wrapper_data* data = jsn->data;
|
||||
|
||||
|
@ -298,9 +303,12 @@ static char const* extract_string(jsonsl_t jsn, struct jsonsl_state_st* state, s
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void action_callback_POP(jsonsl_t jsn, jsonsl_action_t action UNUSED, struct jsonsl_state_st* state,
|
||||
jsonsl_char_t const* buf UNUSED)
|
||||
static void action_callback_POP(jsonsl_t jsn, jsonsl_action_t action, struct jsonsl_state_st* state,
|
||||
jsonsl_char_t const* buf)
|
||||
{
|
||||
TR_UNUSED(action);
|
||||
TR_UNUSED(buf);
|
||||
|
||||
struct json_wrapper_data* data = jsn->data;
|
||||
|
||||
if (state->type == JSONSL_T_STRING)
|
||||
|
|
|
@ -936,17 +936,23 @@ void tr_variantWalk(tr_variant const* v_in, struct VariantWalkFuncs const* walkF
|
|||
*****
|
||||
****/
|
||||
|
||||
static void freeDummyFunc(tr_variant const* v UNUSED, void* buf UNUSED)
|
||||
static void freeDummyFunc(tr_variant const* v, void* buf)
|
||||
{
|
||||
TR_UNUSED(v);
|
||||
TR_UNUSED(buf);
|
||||
}
|
||||
|
||||
static void freeStringFunc(tr_variant const* v, void* unused UNUSED)
|
||||
static void freeStringFunc(tr_variant const* v, void* user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
tr_variant_string_clear(&((tr_variant*)v)->val.s);
|
||||
}
|
||||
|
||||
static void freeContainerEndFunc(tr_variant const* v, void* unused UNUSED)
|
||||
static void freeContainerEndFunc(tr_variant const* v, void* user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
tr_free(v->val.l.vals);
|
||||
}
|
||||
|
||||
|
|
|
@ -193,8 +193,10 @@ static tr_lock* getVerifyLock(void)
|
|||
return lock;
|
||||
}
|
||||
|
||||
static void verifyThreadFunc(void* unused UNUSED)
|
||||
static void verifyThreadFunc(void* user_data)
|
||||
{
|
||||
TR_UNUSED(user_data);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
bool changed = false;
|
||||
|
@ -334,8 +336,10 @@ void tr_verifyRemove(tr_torrent* tor)
|
|||
tr_lockUnlock(lock);
|
||||
}
|
||||
|
||||
void tr_verifyClose(tr_session* session UNUSED)
|
||||
void tr_verifyClose(tr_session* session)
|
||||
{
|
||||
TR_UNUSED(session);
|
||||
|
||||
tr_lockLock(getVerifyLock());
|
||||
|
||||
stopCurrent = true;
|
||||
|
|
|
@ -49,8 +49,11 @@ struct timeval tr_watchdir_generic_interval = { .tv_sec = 10, .tv_usec = 0 };
|
|||
****
|
||||
***/
|
||||
|
||||
static void tr_watchdir_generic_on_event(evutil_socket_t fd UNUSED, short type UNUSED, void* context)
|
||||
static void tr_watchdir_generic_on_event(evutil_socket_t fd, short type, void* context)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(type);
|
||||
|
||||
tr_watchdir_t const handle = context;
|
||||
tr_watchdir_generic* const backend = BACKEND_UPCAST(tr_watchdir_get_backend(handle));
|
||||
|
||||
|
|
|
@ -55,8 +55,11 @@ tr_watchdir_inotify;
|
|||
****
|
||||
***/
|
||||
|
||||
static void tr_watchdir_inotify_on_first_scan(evutil_socket_t fd UNUSED, short type UNUSED, void* context)
|
||||
static void tr_watchdir_inotify_on_first_scan(evutil_socket_t fd, short type, void* context)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(type);
|
||||
|
||||
tr_watchdir_t const handle = context;
|
||||
|
||||
tr_watchdir_scan(handle, NULL);
|
||||
|
|
|
@ -61,8 +61,11 @@ tr_watchdir_kqueue;
|
|||
****
|
||||
***/
|
||||
|
||||
static void tr_watchdir_kqueue_on_event(evutil_socket_t fd UNUSED, short type UNUSED, void* context)
|
||||
static void tr_watchdir_kqueue_on_event(evutil_socket_t fd, short type, void* context)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(type);
|
||||
|
||||
tr_watchdir_t const handle = context;
|
||||
tr_watchdir_kqueue* const backend = BACKEND_UPCAST(tr_watchdir_get_backend(handle));
|
||||
struct kevent ke;
|
||||
|
|
|
@ -132,8 +132,11 @@ static unsigned int __stdcall tr_watchdir_win32_thread(void* context)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void tr_watchdir_win32_on_first_scan(evutil_socket_t fd UNUSED, short type UNUSED, void* context)
|
||||
static void tr_watchdir_win32_on_first_scan(evutil_socket_t fd, short type, void* context)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(type);
|
||||
|
||||
tr_watchdir_t const handle = context;
|
||||
|
||||
tr_watchdir_scan(handle, NULL);
|
||||
|
|
|
@ -144,8 +144,11 @@ static int compare_retry_names(void const* a, void const* b)
|
|||
|
||||
static void tr_watchdir_retry_free(tr_watchdir_retry* retry);
|
||||
|
||||
static void tr_watchdir_on_retry_timer(evutil_socket_t fd UNUSED, short type UNUSED, void* context)
|
||||
static void tr_watchdir_on_retry_timer(evutil_socket_t fd, short type, void* context)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(type);
|
||||
|
||||
TR_ASSERT(context != NULL);
|
||||
|
||||
tr_watchdir_retry* const retry = context;
|
||||
|
|
|
@ -128,8 +128,10 @@ static size_t writeFunc(void* ptr, size_t size, size_t nmemb, void* vtask)
|
|||
|
||||
#ifdef USE_LIBCURL_SOCKOPT
|
||||
|
||||
static int sockoptfunction(void* vtask, curl_socket_t fd, curlsocktype purpose UNUSED)
|
||||
static int sockoptfunction(void* vtask, curl_socket_t fd, curlsocktype purpose)
|
||||
{
|
||||
TR_UNUSED(purpose);
|
||||
|
||||
struct tr_web_task* task = vtask;
|
||||
bool const isScrape = strstr(task->url, "scrape") != NULL;
|
||||
bool const isAnnounce = strstr(task->url, "announce") != NULL;
|
||||
|
|
|
@ -361,9 +361,14 @@ static void on_idle(tr_webseed* w)
|
|||
}
|
||||
}
|
||||
|
||||
static void web_response_func(tr_session* session, bool did_connect UNUSED, bool did_timeout UNUSED, long response_code,
|
||||
void const* response UNUSED, size_t response_byte_count UNUSED, void* vtask)
|
||||
static void web_response_func(tr_session* session, bool did_connect, bool did_timeout, long response_code,
|
||||
void const* response, size_t response_byte_count, void* vtask)
|
||||
{
|
||||
TR_UNUSED(did_connect);
|
||||
TR_UNUSED(did_timeout);
|
||||
TR_UNUSED(response);
|
||||
TR_UNUSED(response_byte_count);
|
||||
|
||||
tr_webseed* w;
|
||||
tr_torrent* tor;
|
||||
struct tr_webseed_task* t = vtask;
|
||||
|
@ -501,8 +506,11 @@ static void task_request_next_chunk(struct tr_webseed_task* t)
|
|||
****
|
||||
***/
|
||||
|
||||
static void webseed_timer_func(evutil_socket_t foo UNUSED, short bar UNUSED, void* vw)
|
||||
static void webseed_timer_func(evutil_socket_t fd, short what, void* vw)
|
||||
{
|
||||
TR_UNUSED(fd);
|
||||
TR_UNUSED(what);
|
||||
|
||||
tr_webseed* w = vw;
|
||||
|
||||
if (w->retry_tickcount != 0)
|
||||
|
|
|
@ -134,16 +134,20 @@ typedef enum
|
|||
|
||||
#define DONATE_NAG_TIME (60 * 60 * 24 * 7)
|
||||
|
||||
static void altSpeedToggledCallback(tr_session * handle UNUSED, bool active, bool byUser, void * controller)
|
||||
static void altSpeedToggledCallback(tr_session * handle, bool active, bool byUser, void * controller)
|
||||
{
|
||||
TR_UNUSED(handle);
|
||||
|
||||
NSDictionary * dict = [[NSDictionary alloc] initWithObjects: @[@(active), @(byUser)] forKeys: @[@"Active", @"ByUser"]];
|
||||
[(__bridge Controller *)controller performSelectorOnMainThread: @selector(altSpeedToggledCallbackIsLimited:)
|
||||
withObject: dict waitUntilDone: NO];
|
||||
}
|
||||
|
||||
static tr_rpc_callback_status rpcCallback(tr_session * handle UNUSED, tr_rpc_callback_type type, struct tr_torrent * torrentStruct,
|
||||
static tr_rpc_callback_status rpcCallback(tr_session * handle, tr_rpc_callback_type type, struct tr_torrent * torrentStruct,
|
||||
void * controller)
|
||||
{
|
||||
TR_UNUSED(handle);
|
||||
|
||||
[(__bridge Controller *)controller rpcCallback: type forTorrentStruct: torrentStruct];
|
||||
return TR_RPC_NOREMOVE; //we'll do the remove manually
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ TEST_F(RpcTest, list)
|
|||
|
||||
TEST_F(RpcTest, sessionGet)
|
||||
{
|
||||
auto const rpc_response_func = [] (tr_session* session UNUSED, tr_variant* response, void* setme) noexcept
|
||||
auto const rpc_response_func = [] (tr_session* /*session*/, tr_variant* response, void* setme) noexcept
|
||||
{
|
||||
*static_cast<tr_variant*>(setme) = *response;
|
||||
tr_variantInitBool(response, false);
|
||||
|
|
|
@ -783,8 +783,10 @@ static size_t writeFunc(void* ptr, size_t size, size_t nmemb, void* buf)
|
|||
}
|
||||
|
||||
/* look for a session id in the header in case the server gives back a 409 */
|
||||
static size_t parseResponseHeader(void* ptr, size_t size, size_t nmemb, void* stream UNUSED)
|
||||
static size_t parseResponseHeader(void* ptr, size_t size, size_t nmemb, void* stream)
|
||||
{
|
||||
TR_UNUSED(stream);
|
||||
|
||||
char const* line = ptr;
|
||||
size_t const line_len = size * nmemb;
|
||||
char const* key = TR_RPC_SESSION_ID_HEADER ": ";
|
||||
|
|
Loading…
Reference in a new issue