Skip to content

Commit 1165f78

Browse files
dpellechrisbra
authored andcommitted
patch 9.1.0600: Unused function and unused error constants
Problem: unused function typval_compare_class() and error constants Solution: remove function typval_compare_class() and ifdef out unused error constants (Dominique Pellé) closes: #15299 Signed-off-by: Dominique Pellé <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent aef6179 commit 1165f78

4 files changed

Lines changed: 25 additions & 37 deletions

File tree

src/errors.h

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,10 @@ EXTERN char e_missing_argument_str[]
10381038
INIT(= N_("E417: Missing argument: %s"));
10391039
EXTERN char e_illegal_value_str[]
10401040
INIT(= N_("E418: Illegal value: %s"));
1041+
#ifdef FEAT_EVAL
10411042
EXTERN char e_im_a_teapot[]
10421043
INIT(= N_("E418: I'm a teapot"));
1044+
#endif
10431045
EXTERN char e_fg_color_unknown[]
10441046
INIT(= N_("E419: FG color unknown"));
10451047
EXTERN char e_bg_color_unknown[]
@@ -1273,8 +1275,10 @@ EXTERN char e_is_not_file_or_writable_device[]
12731275
INIT(= N_("is not a file or writable device"));
12741276
EXTERN char e_str_is_not_file_or_writable_device[]
12751277
INIT(= N_("E503: \"%s\" is not a file or writable device"));
1278+
#ifdef FEAT_EVAL
12761279
EXTERN char e_coffee_currently_not_available[]
12771280
INIT(= N_("E503: Coffee is currently not available"));
1281+
#endif
12781282
// E504
12791283
EXTERN char e_is_read_only_cannot_override_W_in_cpoptions[]
12801284
INIT(= N_("is read-only (cannot override: \"W\" in 'cpoptions')"));
@@ -1571,11 +1575,12 @@ EXTERN char e_too_many_signs_defined[]
15711575
EXTERN char e_unknown_printer_font_str[]
15721576
INIT(= N_("E613: Unknown printer font: %s"));
15731577
#endif
1574-
EXTERN char e_class_required[]
1575-
INIT(= N_("E614: Class required"));
1578+
// E614 unused (deleted)
15761579
// E615 unused
1580+
#ifdef FEAT_EVAL
15771581
EXTERN char e_object_required_for_argument_nr[]
15781582
INIT(= N_("E616: Object required for argument %d"));
1583+
#endif
15791584
#ifdef FEAT_GUI_GTK
15801585
EXTERN char e_cannot_be_changed_in_gtk_GUI[]
15811586
INIT(= N_("E617: Cannot be changed in the GTK GUI"));
@@ -3315,8 +3320,10 @@ EXTERN char e_could_not_check_for_pending_sigalrm_str[]
33153320
#ifdef FEAT_EVAL
33163321
EXTERN char e_substitute_nesting_too_deep[]
33173322
INIT(= N_("E1290: substitute nesting too deep"));
3323+
# ifdef MSWIN
33183324
EXTERN char e_invalid_argument_nr[]
33193325
INIT(= N_("E1291: Invalid argument: %ld"));
3326+
# endif
33203327
#endif
33213328
EXTERN char e_cmdline_window_already_open[]
33223329
INIT(= N_("E1292: Command-line window is already open"));
@@ -3387,16 +3394,13 @@ EXTERN char e_invalid_object_variable_declaration_str[]
33873394
INIT(= N_("E1317: Invalid object variable declaration: %s"));
33883395
EXTERN char e_not_valid_command_in_class_str[]
33893396
INIT(= N_("E1318: Not a valid command in a class: %s"));
3390-
EXTERN char e_using_class_as_number[]
3391-
INIT(= N_("E1319: Using a Class as a Number"));
3397+
// E1319 unused
33923398
EXTERN char e_using_object_as_number[]
33933399
INIT(= N_("E1320: Using an Object as a Number"));
3394-
EXTERN char e_using_class_as_float[]
3395-
INIT(= N_("E1321: Using a Class as a Float"));
3400+
// E1321 unused
33963401
EXTERN char e_using_object_as_float[]
33973402
INIT(= N_("E1322: Using an Object as a Float"));
3398-
EXTERN char e_using_class_as_string[]
3399-
INIT(= N_("E1323: Using a Class as a String"));
3403+
// E1323 unused
34003404
EXTERN char e_using_object_as_string[]
34013405
INIT(= N_("E1324: Using an Object as a String"));
34023406
EXTERN char e_method_not_found_on_class_str_str[]
@@ -3547,8 +3551,7 @@ EXTERN char e_type_can_only_be_defined_in_vim9_script[]
35473551
INIT(= N_("E1393: Type can only be defined in Vim9 script"));
35483552
EXTERN char e_type_name_must_start_with_uppercase_letter_str[]
35493553
INIT(= N_("E1394: Type name must start with an uppercase letter: %s"));
3550-
EXTERN char e_cannot_modify_typealias[]
3551-
INIT(= N_("E1395: Type alias \"%s\" cannot be modified"));
3554+
// E1395 unused
35523555
EXTERN char e_typealias_already_exists_for_str[]
35533556
INIT(= N_("E1396: Type alias \"%s\" already exists"));
35543557
EXTERN char e_missing_typealias_name[]
@@ -3557,20 +3560,16 @@ EXTERN char e_missing_typealias_type[]
35573560
INIT(= N_("E1398: Missing type alias type"));
35583561
EXTERN char e_type_can_only_be_used_in_script[]
35593562
INIT(= N_("E1399: Type can only be used in a script"));
3560-
EXTERN char e_using_typealias_as_number[]
3561-
INIT(= N_("E1400: Using type alias \"%s\" as a Number"));
3562-
EXTERN char e_using_typealias_as_float[]
3563-
INIT(= N_("E1401: Using type alias \"%s\" as a Float"));
3564-
EXTERN char e_using_typealias_as_string[]
3565-
INIT(= N_("E1402: Using type alias \"%s\" as a String"));
3563+
// E1400 unused
3564+
// E1401 unused
3565+
// E1402 unused
35663566
EXTERN char e_using_typealias_as_value_str[]
35673567
INIT(= N_("E1403: Type alias \"%s\" cannot be used as a value"));
35683568
EXTERN char e_abstract_cannot_be_used_in_interface[]
35693569
INIT(= N_("E1404: Abstract cannot be used in an interface"));
35703570
EXTERN char e_using_class_as_value_str[]
35713571
INIT(= N_("E1405: Class \"%s\" cannot be used as a value"));
3572-
EXTERN char e_using_class_as_var_val[]
3573-
INIT(= N_("E1406: Cannot use a Class as a variable or value"));
3572+
// E1406 unused
35743573
EXTERN char e_using_typealias_as_var_val[]
35753574
INIT(= N_("E1407: Cannot use a Typealias as a variable or value"));
35763575
EXTERN char e_final_variable_not_supported_in_interface[]
@@ -3625,20 +3624,26 @@ EXTERN char e_fmt_arg_nr_unused_str[]
36253624
INIT(= N_("E1501: format argument %d unused in $-style format: %s"));
36263625
EXTERN char e_positional_num_field_spec_reused_str_str[]
36273626
INIT(= N_("E1502: Positional argument %d used as field width reused as different type: %s/%s"));
3627+
#ifdef FEAT_EVAL
36283628
EXTERN char e_positional_nr_out_of_bounds_str[]
36293629
INIT(= N_("E1503: Positional argument %d out of bounds: %s"));
3630+
#endif
36303631
EXTERN char e_positional_arg_num_type_inconsistent_str_str[]
36313632
INIT(= N_("E1504: Positional argument %d type used inconsistently: %s/%s"));
36323633
EXTERN char e_invalid_format_specifier_str[]
36333634
INIT(= N_("E1505: Invalid format specifier: %s"));
3635+
#ifdef FEAT_XATTR
36343636
EXTERN char e_xattr_erange[]
36353637
INIT(= N_("E1506: Buffer too small to copy xattr value or key"));
3638+
#endif
36363639
EXTERN char e_aptypes_is_null_nr_str[]
36373640
INIT(= "E1507: Internal error: ap_types or ap_types[idx] is NULL: %d: %s");
3641+
#ifdef FEAT_XATTR
36383642
EXTERN char e_xattr_e2big[]
36393643
INIT(= N_("E1508: Size of the extended attribute value is larger than the maximum size allowed"));
36403644
EXTERN char e_xattr_other[]
36413645
INIT(= N_("E1509: Error occurred when reading or writing extended attribute"));
3646+
#endif
36423647
EXTERN char e_val_too_large[]
36433648
INIT(= N_("E1510: Value too large: %s"));
36443649
EXTERN char e_wrong_number_of_characters_for_field_str[]

src/proto/typval.pro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ int typval_compare(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic);
6868
int typval_compare_list(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
6969
int typval_compare_null(typval_T *tv1, typval_T *tv2);
7070
int typval_compare_blob(typval_T *tv1, typval_T *tv2, exprtype_T type, int *res);
71-
int typval_compare_class(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
7271
int typval_compare_object(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
7372
int typval_compare_dict(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);
7473
int typval_compare_func(typval_T *tv1, typval_T *tv2, exprtype_T type, int ic, int *res);

src/typval.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,24 +1697,6 @@ typval_compare_blob(
16971697
return OK;
16981698
}
16991699

1700-
/*
1701-
* Compare "tv1" to "tv2" as classes according to "type".
1702-
* Put the result, false or true, in "res".
1703-
* Return FAIL and give an error message when the comparison can't be done.
1704-
*/
1705-
int
1706-
typval_compare_class(
1707-
typval_T *tv1,
1708-
typval_T *tv2,
1709-
exprtype_T type UNUSED,
1710-
int ic UNUSED,
1711-
int *res)
1712-
{
1713-
// TODO: use "type"
1714-
*res = tv1->vval.v_class == tv2->vval.v_class;
1715-
return OK;
1716-
}
1717-
17181700
/*
17191701
* Compare "tv1" to "tv2" as objects according to "type".
17201702
* Put the result, false or true, in "res".

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
600,
707709
/**/
708710
599,
709711
/**/

0 commit comments

Comments
 (0)