=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sort/coll.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/sort/coll.c 2015/03/29 18:47:19 1.3 +++ src/usr.bin/sort/coll.c 2015/04/01 20:58:13 1.4 @@ -1,4 +1,4 @@ -/* $OpenBSD: coll.c,v 1.3 2015/03/29 18:47:19 miod Exp $ */ +/* $OpenBSD: coll.c,v 1.4 2015/04/01 20:58:13 millert Exp $ */ /*- * Copyright (C) 2009 Gabor Kovesdan @@ -81,7 +81,6 @@ static size_t key_hint_size(void) { - return need_hint ? sizeof(struct key_hint) : 0; } @@ -91,7 +90,6 @@ size_t keys_array_size(void) { - return keys_num * (sizeof(struct key_value) + key_hint_size()); } @@ -101,7 +99,6 @@ void clean_keys_array(const struct bwstring *s, struct keys_array *ka) { - if (ka) { size_t i; @@ -118,7 +115,6 @@ void set_key_on_keys_array(struct keys_array *ka, struct bwstring *s, size_t ind) { - if (ka && keys_num > ind) { struct key_value *kv; @@ -172,7 +168,6 @@ static void sort_list_item_make_key(struct sort_list_item *si) { - preproc(si->str, &(si->ka)); } @@ -183,7 +178,6 @@ void sort_list_item_set(struct sort_list_item *si, struct bwstring *str) { - if (si) { clean_keys_array(si->str, &(si->ka)); if (si->str) { @@ -206,7 +200,6 @@ void sort_list_item_clean(struct sort_list_item *si) { - if (si) { clean_keys_array(si->str, &(si->ka)); if (si->str) { @@ -247,7 +240,6 @@ static size_t skip_fields_to_start(const struct bwstring *s, size_t fields, bool *empty_field) { - if (fields < 2) { if (BWSLEN(s) == 0) *empty_field = true; @@ -296,7 +288,6 @@ find_field_start(const struct bwstring *s, struct key_specs *ks, size_t *field_start, size_t *key_start, bool *empty_field, bool *empty_key) { - *field_start = skip_fields_to_start(s, ks->f1, empty_field); if (!*empty_field) *key_start = skip_cols_to_start(s, ks->c1, *field_start, @@ -391,7 +382,6 @@ int preproc(struct bwstring *s, struct keys_array *ka) { - if (sort_opts_vals.kflag) { size_t i; for (i = 0; i < keys_num; i++) { @@ -447,7 +437,6 @@ cmpcoll_t get_sort_func(struct sort_mods *sm) { - if (sm->nflag) return numcoll; else if (sm->hflag) @@ -501,7 +490,6 @@ int top_level_str_coll(const struct bwstring *s1, const struct bwstring *s2) { - if (default_sort_mods->rflag) { const struct bwstring *tmp; @@ -590,7 +578,6 @@ int list_coll(const void *ss1, const void *ss2) { - return list_coll_offset((struct sort_list_item **)ss1, (struct sort_list_item **)ss2, 0); } @@ -647,7 +634,6 @@ int list_coll_by_str_only(struct sort_list_item **ss1, struct sort_list_item **ss2) { - return top_level_str_coll(((*ss1)->str), ((*ss2)->str)); } @@ -786,7 +772,6 @@ static inline int cmpsuffix(unsigned char si1, unsigned char si2) { - return (char)si1 - (char)si2; } @@ -951,7 +936,6 @@ static int numcoll(struct key_value *kv1, struct key_value *kv2, size_t offset) { - return numcoll_impl(kv1, kv2, offset, false); } @@ -961,7 +945,6 @@ static int hnumcoll(struct key_value *kv1, struct key_value *kv2, size_t offset) { - return numcoll_impl(kv1, kv2, offset, true); } @@ -1047,7 +1030,6 @@ static inline bool huge_minus(double d, int err1) { - if (err1 == ERANGE) if (d == -HUGE_VAL || d == -HUGE_VALF || d == -HUGE_VALL) return 1; @@ -1061,7 +1043,6 @@ static inline bool huge_plus(double d, int err1) { - if (err1 == ERANGE) if (d == HUGE_VAL || d == HUGE_VALF || d == HUGE_VALL) return 1; @@ -1088,7 +1069,6 @@ static int cmp_nans(double d1, double d2) { - if (d1 == d2) return 0; return d1 < d2 ? -1 : 1;