mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-25 12:41:19 +00:00
Remove trailing shitspace
This commit is contained in:
parent
6f5a20e76b
commit
056779d3b8
1 changed files with 6 additions and 6 deletions
12
correct.c
12
correct.c
|
@ -132,7 +132,7 @@
|
||||||
* and speeds us up a little. It also saves us space in a way since each
|
* and speeds us up a little. It also saves us space in a way since each
|
||||||
* allocation isn't wasting a little header space for when NOTRACK isn't
|
* allocation isn't wasting a little header space for when NOTRACK isn't
|
||||||
* defined.
|
* defined.
|
||||||
*/
|
*/
|
||||||
static unsigned char **correct_pool_data = NULL;
|
static unsigned char **correct_pool_data = NULL;
|
||||||
static unsigned char *correct_pool_this = NULL;
|
static unsigned char *correct_pool_this = NULL;
|
||||||
static size_t correct_pool_addr = 0;
|
static size_t correct_pool_addr = 0;
|
||||||
|
@ -179,7 +179,7 @@ static GMQCC_INLINE char *correct_pool_claim(const char *data) {
|
||||||
* have one of the fastest hash functions for strings, but if you do a
|
* have one of the fastest hash functions for strings, but if you do a
|
||||||
* lost of hashing (which we do, almost 3 million hashes per identifier)
|
* lost of hashing (which we do, almost 3 million hashes per identifier)
|
||||||
* a hashtable becomes slow.
|
* a hashtable becomes slow.
|
||||||
*/
|
*/
|
||||||
correct_trie_t* correct_trie_new() {
|
correct_trie_t* correct_trie_new() {
|
||||||
correct_trie_t *t = (correct_trie_t*)mem_a(sizeof(correct_trie_t));
|
correct_trie_t *t = (correct_trie_t*)mem_a(sizeof(correct_trie_t));
|
||||||
t->value = NULL;
|
t->value = NULL;
|
||||||
|
@ -255,7 +255,7 @@ void correct_trie_set(correct_trie_t *t, const char *key, void * const value) {
|
||||||
/*
|
/*
|
||||||
* Implementation of the corrector algorithm commences. A very efficent
|
* Implementation of the corrector algorithm commences. A very efficent
|
||||||
* brute-force attack (thanks to tries and mempool :-)).
|
* brute-force attack (thanks to tries and mempool :-)).
|
||||||
*/
|
*/
|
||||||
static GMQCC_INLINE size_t *correct_find(correct_trie_t *table, const char *word) {
|
static GMQCC_INLINE size_t *correct_find(correct_trie_t *table, const char *word) {
|
||||||
return (size_t*)correct_trie_get(table, word);
|
return (size_t*)correct_trie_get(table, word);
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ static GMQCC_INLINE bool correct_update(correct_trie_t* *table, const char *word
|
||||||
void correct_add(correct_trie_t* table, size_t ***size, const char *ident) {
|
void correct_add(correct_trie_t* table, size_t ***size, const char *ident) {
|
||||||
size_t *data = NULL;
|
size_t *data = NULL;
|
||||||
const char *add = ident;
|
const char *add = ident;
|
||||||
|
|
||||||
if (!correct_update(&table, add)) {
|
if (!correct_update(&table, add)) {
|
||||||
data = (size_t*)mem_a(sizeof(size_t));
|
data = (size_t*)mem_a(sizeof(size_t));
|
||||||
*data = 1;
|
*data = 1;
|
||||||
|
@ -392,7 +392,7 @@ static GMQCC_INLINE size_t correct_size(const char *ident) {
|
||||||
* transposition = len - 1
|
* transposition = len - 1
|
||||||
* alteration = len * sizeof(correct_alpha)
|
* alteration = len * sizeof(correct_alpha)
|
||||||
* insertion = (len + 1) * sizeof(correct_alpha)
|
* insertion = (len + 1) * sizeof(correct_alpha)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
register size_t len = strlen(ident);
|
register size_t len = strlen(ident);
|
||||||
return (len) + (len - 1) + (len * (sizeof(correct_alpha)-1)) + ((len + 1) * (sizeof(correct_alpha)-1));
|
return (len) + (len - 1) + (len * (sizeof(correct_alpha)-1)) + ((len + 1) * (sizeof(correct_alpha)-1));
|
||||||
|
@ -417,7 +417,7 @@ static char **correct_edit(const char *ident) {
|
||||||
* We could use a hashtable but the space complexity isn't worth it
|
* We could use a hashtable but the space complexity isn't worth it
|
||||||
* since we're only going to determine the "did you mean?" identifier
|
* since we're only going to determine the "did you mean?" identifier
|
||||||
* on error.
|
* on error.
|
||||||
*/
|
*/
|
||||||
static int correct_exist(char **array, size_t rows, char *ident) {
|
static int correct_exist(char **array, size_t rows, char *ident) {
|
||||||
size_t itr;
|
size_t itr;
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue