From eef47993887a486890fe3116c828a1e939bf1b69 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Mon, 15 Jul 2019 00:30:14 +0300 Subject: [PATCH] Update Uncrustify config to 0.69 --- gtk/hig.c | 1 + gtk/main.c | 1 + gtk/tr-window.c | 1 + libtransmission/platform-quota.c | 7 ---- libtransmission/torrent.c | 2 +- libtransmission/tr-lpd.c | 1 + qt/DetailsDialog.cc | 2 ++ qt/FilterBar.cc | 1 + qt/Torrent.cc | 3 ++ qt/Utils.cc | 2 ++ uncrustify.cfg | 58 ++++++++++++++++++++------------ 11 files changed, 49 insertions(+), 30 deletions(-) diff --git a/gtk/hig.c b/gtk/hig.c index 844fb7903..25b206d73 100644 --- a/gtk/hig.c +++ b/gtk/hig.c @@ -55,6 +55,7 @@ void hig_workarea_add_wide_control(GtkWidget* t, guint* row, GtkWidget* w) gtk_grid_attach(GTK_GRID(t), w, 0, *row, 2, 1); ++*row; } + void hig_workarea_add_wide_tall_control(GtkWidget* t, guint* row, GtkWidget* w) { gtk_widget_set_hexpand(w, TRUE); diff --git a/gtk/main.c b/gtk/main.c index 8b9043a01..8f12360a0 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -317,6 +317,7 @@ static void register_magnet_link_handler(void) g_clear_object(&app); } + static void ensure_magnet_handler_exists(void) { if (!has_magnet_link_handler()) diff --git a/gtk/tr-window.c b/gtk/tr-window.c index bce933223..4ccc79ce3 100644 --- a/gtk/tr-window.c +++ b/gtk/tr-window.c @@ -422,6 +422,7 @@ static void onRatioToggled(GtkCheckMenuItem* check, gpointer vp) gtr_core_set_pref_bool(p->core, TR_KEY_ratio_limit_enabled, f); } } + static void onRatioSet(GtkCheckMenuItem* check, gpointer vp) { PrivateData* p = vp; diff --git a/libtransmission/platform-quota.c b/libtransmission/platform-quota.c index bace7db0c..9f33b628a 100644 --- a/libtransmission/platform-quota.c +++ b/libtransmission/platform-quota.c @@ -325,12 +325,9 @@ static int64_t getquota(char const* device) int64_t spaceused; #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) - if (quotactl(device, QCMD(Q_GETQUOTA, USRQUOTA), getuid(), (caddr_t)&dq) == 0) { - #elif defined(__sun) - struct quotctl op; int fd = open(device, O_RDONLY); @@ -346,14 +343,10 @@ static int64_t getquota(char const* device) if (ioctl(fd, Q_QUOTACTL, &op) == 0) { close(fd); - #else - if (quotactl(QCMD(Q_GETQUOTA, USRQUOTA), device, getuid(), (caddr_t)&dq) == 0) { - #endif - if (dq.dqb_bsoftlimit > 0) { /* Use soft limit first */ diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 839a7c201..5c9532b97 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -235,6 +235,7 @@ unsigned char const* tr_torrentGetPeerId(tr_torrent* tor) return tor->peer_id; } + /*** **** PER-TORRENT UL / DL SPEEDS ***/ @@ -2488,7 +2489,6 @@ static void setFileDND(tr_torrent* tor, tr_file_index_t fileIndex, bool doDownlo void tr_torrentInitFileDLs(tr_torrent* tor, tr_file_index_t const* files, tr_file_index_t fileCount, bool doDownload) { - TR_ASSERT(tr_isTorrent(tor)); tr_torrentLock(tor); diff --git a/libtransmission/tr-lpd.c b/libtransmission/tr-lpd.c index 8059fc37d..479a31e69 100644 --- a/libtransmission/tr-lpd.c +++ b/libtransmission/tr-lpd.c @@ -466,6 +466,7 @@ UNUSED static inline void lpd_consistencyCheck(void) * as interfaces to the rest of the lib remain compatible with char* strings. */ TR_STATIC_ASSERT(sizeof(lpd_torStaticType->info.hashString[0]) == sizeof(char), ""); } + /** * @endcond */ diff --git a/qt/DetailsDialog.cc b/qt/DetailsDialog.cc index 72dfda1b1..f29dca9f0 100644 --- a/qt/DetailsDialog.cc +++ b/qt/DetailsDialog.cc @@ -1237,11 +1237,13 @@ void DetailsDialog::onHonorsSessionLimitsToggled(bool val) mySession.torrentSet(myIds, TR_KEY_honorsSessionLimits, val); getNewData(); } + void DetailsDialog::onDownloadLimitedToggled(bool val) { mySession.torrentSet(myIds, TR_KEY_downloadLimited, val); getNewData(); } + void DetailsDialog::onSpinBoxEditingFinished() { QObject const* spin = sender(); diff --git a/qt/FilterBar.cc b/qt/FilterBar.cc index 1ddef7292..1a6567600 100644 --- a/qt/FilterBar.cc +++ b/qt/FilterBar.cc @@ -416,6 +416,7 @@ void FilterBar::recountSoon() myRecountTimer->start(800); } } + void FilterBar::recount() { QAbstractItemModel* model = myActivityCombo->model(); diff --git a/qt/Torrent.cc b/qt/Torrent.cc index 1040a31bf..c96488b65 100644 --- a/qt/Torrent.cc +++ b/qt/Torrent.cc @@ -296,6 +296,7 @@ qulonglong Torrent::getSize(int i) const return myValues[i].toULongLong(); } + double Torrent::getDouble(int i) const { assert(0 <= i && i < PROPERTY_COUNT); @@ -303,6 +304,7 @@ double Torrent::getDouble(int i) const return myValues[i].toDouble(); } + QString Torrent::getString(int i) const { assert(0 <= i && i < PROPERTY_COUNT); @@ -310,6 +312,7 @@ QString Torrent::getString(int i) const return myValues[i].toString(); } + QIcon Torrent::getIcon(int i) const { assert(0 <= i && i < PROPERTY_COUNT); diff --git a/qt/Utils.cc b/qt/Utils.cc index 93c8fd07f..3031607d1 100644 --- a/qt/Utils.cc +++ b/qt/Utils.cc @@ -45,6 +45,7 @@ namespace { #ifdef _WIN32 + void addAssociatedFileIcon(QFileInfo const& fileInfo, UINT iconSize, QIcon& icon) { QString const pixmapCacheKey = QLatin1String("tr_file_ext_") + QString::number(iconSize) + QLatin1Char('_') + @@ -76,6 +77,7 @@ void addAssociatedFileIcon(QFileInfo const& fileInfo, UINT iconSize, QIcon& icon icon.addPixmap(pixmap); } } + #endif bool isSlashChar(QChar const& c) diff --git a/uncrustify.cfg b/uncrustify.cfg index b5ed0f2a8..82829af70 100644 --- a/uncrustify.cfg +++ b/uncrustify.cfg @@ -1,4 +1,4 @@ -# Uncrustify-0.68_f +# Uncrustify-0.69.0_f newlines = auto input_tab_size = 8 output_tab_size = 8 @@ -56,6 +56,7 @@ sp_before_template_paren = ignore sp_template_angle = remove sp_before_angle = remove sp_inside_angle = remove +sp_inside_angle_empty = ignore sp_angle_colon = remove sp_after_angle = remove sp_angle_paren = remove @@ -91,7 +92,10 @@ sp_between_mdatype_commas = ignore sp_paren_comma = force sp_before_ellipsis = remove sp_type_ellipsis = remove +sp_type_question = ignore sp_paren_ellipsis = remove +sp_paren_qualifier = ignore +sp_paren_noexcept = ignore sp_after_class_colon = ignore sp_before_class_colon = force sp_after_constr_colon = ignore @@ -145,6 +149,7 @@ sp_throw_paren = force sp_after_throw = force sp_catch_paren = force sp_oc_catch_paren = ignore +sp_oc_classname_paren = ignore sp_version_paren = ignore sp_scope_paren = ignore sp_super_paren = remove @@ -219,6 +224,7 @@ sp_num_before_tr_emb_cmt = 1 sp_annotation_paren = ignore sp_skip_vbrace_tokens = false sp_after_noexcept = remove +sp_vala_after_translation = ignore force_tab_after_define = false indent_columns = 4 indent_continue = 4 @@ -272,6 +278,7 @@ indent_switch_pp = true indent_case_shift = 0 indent_case_brace = 4 indent_col1_comment = false +indent_col1_multi_string_literal = false indent_label = 1 indent_access_spec = 1 indent_access_spec_body = false @@ -331,13 +338,6 @@ nl_assign_brace = force nl_assign_square = ignore nl_tsquare_brace = ignore nl_after_square_assign = ignore -nl_func_var_def_blk = 0 -nl_typedef_blk_start = 0 -nl_typedef_blk_end = 0 -nl_typedef_blk_in = 0 -nl_var_def_blk_start = 0 -nl_var_def_blk_end = 0 -nl_var_def_blk_in = 0 nl_fcall_brace = ignore nl_enum_brace = force nl_enum_class = ignore @@ -415,11 +415,13 @@ nl_func_def_end_multi_line = false nl_func_decl_empty = remove nl_func_def_empty = remove nl_func_call_empty = remove +nl_func_call_start = ignore nl_func_call_start_multi_line = false nl_func_call_args_multi_line = false nl_func_call_end_multi_line = false nl_oc_msg_args = false nl_fdef_brace = force +nl_fdef_brace_cond = ignore nl_cpp_ldef_brace = force nl_return_expr = remove nl_after_semicolon = true @@ -450,10 +452,12 @@ nl_before_synchronized = ignore nl_after_synchronized = force nl_before_do = ignore nl_after_do = force +nl_before_return = false +nl_after_return = false nl_ds_struct_enum_cmt = false nl_ds_struct_enum_close_brace = false nl_class_colon = ignore -nl_constr_colon = ignore +nl_constr_colon = force nl_namespace_two_to_one_liner = false nl_create_if_one_liner = false nl_create_for_one_liner = false @@ -473,17 +477,24 @@ nl_after_func_proto_group = 0 nl_after_func_class_proto = 0 nl_after_func_class_proto_group = 0 nl_class_leave_one_liner_groups = false -nl_after_func_body = 0 -nl_after_func_body_class = 0 +nl_after_func_body = 2 +nl_after_func_body_class = 2 nl_after_func_body_one_liner = 0 +nl_func_var_def_blk = 0 +nl_typedef_blk_start = 0 +nl_typedef_blk_end = 0 +nl_typedef_blk_in = 0 +nl_var_def_blk_start = 0 +nl_var_def_blk_end = 0 +nl_var_def_blk_in = 0 nl_before_block_comment = 0 nl_before_c_comment = 0 nl_before_cpp_comment = 0 nl_after_multiline_comment = false nl_after_label_colon = false -nl_after_struct = 0 -nl_before_class = 0 -nl_after_class = 0 +nl_after_struct = 1 +nl_before_class = 2 +nl_after_class = 2 nl_before_access_spec = 2 nl_after_access_spec = 1 nl_comment_func_def = 0 @@ -492,11 +503,9 @@ nl_around_cs_property = 0 nl_between_get_set = 0 nl_property_brace = ignore nl_inside_namespace = 2 -eat_blanks_after_open_brace = false -eat_blanks_before_close_brace = false +eat_blanks_after_open_brace = true +eat_blanks_before_close_brace = true nl_remove_extra_newlines = 0 -nl_before_return = false -nl_after_return = false nl_after_annotation = ignore nl_between_annotation = ignore pos_arith = trail @@ -523,6 +532,9 @@ align_func_params = false align_func_params_span = 0 align_func_params_thresh = 0 align_func_params_gap = 0 +align_constr_value_span = 0 +align_constr_value_thresh = 0 +align_constr_value_gap = 0 align_same_func_call_params = false align_same_func_call_params_span = 0 align_same_func_call_params_thresh = 0 @@ -536,6 +548,7 @@ align_var_def_colon_gap = 0 align_var_def_attribute = false align_var_def_inline = false align_assign_span = 0 +align_assign_func_proto_span = 0 align_assign_thresh = 0 align_assign_decl_func = 0 align_enum_equ_span = 0 @@ -547,17 +560,18 @@ align_var_struct_span = 0 align_var_struct_thresh = 0 align_var_struct_gap = 0 align_struct_init_span = 0 -align_typedef_gap = 0 align_typedef_span = 0 +align_typedef_gap = 0 align_typedef_func = 0 align_typedef_star_style = 0 align_typedef_amp_style = 0 align_right_cmt_span = 0 +align_right_cmt_gap = 0 align_right_cmt_mix = false align_right_cmt_same_level = false -align_right_cmt_gap = 0 align_right_cmt_at_col = 0 align_func_proto_span = 0 +align_func_proto_thresh = 0 align_func_proto_gap = 0 align_on_operator = false align_mix_var_proto = false @@ -567,8 +581,8 @@ align_single_line_brace_gap = 0 align_oc_msg_spec_span = 0 align_nl_cont = false align_pp_define_together = false -align_pp_define_gap = 0 align_pp_define_span = 0 +align_pp_define_gap = 0 align_left_shift = true align_asm_colon = false align_oc_msg_colon_span = 0 @@ -659,5 +673,5 @@ warn_level_tabs_found_in_verbatim_string_literals = 2 type PtrArrayCompareFunc type SIZE_T type tr_session -# option(s) with 'not default' value: 218 +# option(s) with 'not default' value: 226 # -- 2.40.0