diff options
| author | Vibhav Pant | 2017-02-11 18:17:57 +0530 |
|---|---|---|
| committer | Vibhav Pant | 2017-02-11 18:17:57 +0530 |
| commit | a75d080b17a6b6c6296ff4e24d8129d77bb3bb6b (patch) | |
| tree | f06e54725c6cd8d52ad5a1e9df752d09e8ca256e /src | |
| parent | dcd0e6fe3ae24a716e1f665b12d877681bb8cc21 (diff) | |
| download | emacs-a75d080b17a6b6c6296ff4e24d8129d77bb3bb6b.tar.gz emacs-a75d080b17a6b6c6296ff4e24d8129d77bb3bb6b.zip | |
* src/bytecode.c: Refactor to follow GNU coding standards
Diffstat (limited to 'src')
| -rw-r--r-- | src/bytecode.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/bytecode.c b/src/bytecode.c index 1ac28110320..f3eab60c593 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -1420,9 +1420,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 1420 | search as the jump table. */ | 1420 | search as the jump table. */ |
| 1421 | Lisp_Object jmp_table = POP; | 1421 | Lisp_Object jmp_table = POP; |
| 1422 | Lisp_Object v1 = POP; | 1422 | Lisp_Object v1 = POP; |
| 1423 | #ifdef BYTE_CODE_SAFE | ||
| 1424 | CHECK_TYPE (HASH_TABLE_P (jmp_table), Qhash_table_p, jmp_table); | ||
| 1425 | #endif | ||
| 1426 | ptrdiff_t i; | 1423 | ptrdiff_t i; |
| 1427 | struct Lisp_Hash_Table *h = XHASH_TABLE(jmp_table); | 1424 | struct Lisp_Hash_Table *h = XHASH_TABLE(jmp_table); |
| 1428 | 1425 | ||
| @@ -1430,19 +1427,18 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 1430 | { /* Do a linear search if there are not many cases | 1427 | { /* Do a linear search if there are not many cases |
| 1431 | FIXME: 5 is arbitrarily chosen. */ | 1428 | FIXME: 5 is arbitrarily chosen. */ |
| 1432 | EMACS_UINT hash_code = h->test.hashfn (&h->test, v1); | 1429 | EMACS_UINT hash_code = h->test.hashfn (&h->test, v1); |
| 1430 | /* Hash tables for switch are declared with :size set to the | ||
| 1431 | exact number of cases, thus | ||
| 1432 | HASH_TABLE_SIZE (h) == h->count. */ | ||
| 1433 | for (i = 0; i < h->count; i++) | 1433 | for (i = 0; i < h->count; i++) |
| 1434 | { | 1434 | { |
| 1435 | #ifdef BYTE_CODE_SAFE | 1435 | if (BYTE_CODE_SAFE) |
| 1436 | eassert (!NILP (HASH_HASH (h, i))); | 1436 | eassert (!NILP (HASH_HASH (h, i))); |
| 1437 | #endif | 1437 | |
| 1438 | /* Hash tables for switch are declared with :size set to the | 1438 | if (EQ (v1, HASH_KEY (h, i)) |
| 1439 | exact number of cases, thus | 1439 | || (h->test.cmpfn |
| 1440 | HASH_TABLE_SIZE (h) == h->count. */ | 1440 | && hash_code == XUINT (HASH_HASH (h, i)) |
| 1441 | 1441 | && h->test.cmpfn (&h->test, v1, HASH_KEY (h, i)))) | |
| 1442 | if ((EQ (v1, HASH_KEY (h, i)) || | ||
| 1443 | (h->test.cmpfn | ||
| 1444 | && hash_code == XUINT (HASH_HASH (h, i)) | ||
| 1445 | && h->test.cmpfn (&h->test, v1, HASH_KEY (h, i))))) | ||
| 1446 | { | 1442 | { |
| 1447 | op = XINT (HASH_VALUE (h, i)); | 1443 | op = XINT (HASH_VALUE (h, i)); |
| 1448 | goto op_branch; | 1444 | goto op_branch; |