From 23fa7000fa69f6025eae7fd48a81a8d705ff44fc Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 16 Nov 2016 10:16:15 +0100 Subject: [PATCH] Removed functions sort_by_pot() and sort_by_salt_buf() from potfile.c - Code no longer required due to potfile --show and --left handling logic --- include/potfile.h | 2 -- src/potfile.c | 33 --------------------------------- 2 files changed, 35 deletions(-) diff --git a/include/potfile.h b/include/potfile.h index 72c54d805..ee9b3dc69 100644 --- a/include/potfile.h +++ b/include/potfile.h @@ -12,8 +12,6 @@ #define INCR_POT 1000 -int sort_by_pot (const void *v1, const void *v2, MAYBE_UNUSED void *v3); -int sort_by_salt_buf (const void *v1, const void *v2, MAYBE_UNUSED void *v3); int sort_by_hash_t_salt (const void *v1, const void *v2); int sort_by_hash_t_salt_hccap (const void *v1, const void *v2); diff --git a/src/potfile.c b/src/potfile.c index 4cb7b69a1..efb0d4ba2 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -27,39 +27,6 @@ int sort_by_hash (const void *v1, const void *v2, void *v3); int sort_by_hash_no_salt (const void *v1, const void *v2, void *v3); // get rid of this later -int sort_by_pot (const void *v1, const void *v2, MAYBE_UNUSED void *v3) -{ - const pot_t *p1 = (const pot_t *) v1; - const pot_t *p2 = (const pot_t *) v2; - - const hash_t *h1 = &p1->hash; - const hash_t *h2 = &p2->hash; - - return sort_by_hash (h1, h2, v3); -} - -int sort_by_salt_buf (const void *v1, const void *v2, MAYBE_UNUSED void *v3) -{ - const pot_t *p1 = (const pot_t *) v1; - const pot_t *p2 = (const pot_t *) v2; - - const hash_t *h1 = &p1->hash; - const hash_t *h2 = &p2->hash; - - const salt_t *s1 = h1->salt; - const salt_t *s2 = h2->salt; - - u32 n = 16; - - while (n--) - { - if (s1->salt_buf[n] > s2->salt_buf[n]) return 1; - if (s1->salt_buf[n] < s2->salt_buf[n]) return -1; - } - - return 0; -} - int sort_by_hash_t_salt (const void *v1, const void *v2) { const hash_t *h1 = (const hash_t *) v1;