mirror of
https://github.com/Interlisp/maiko.git
synced 2026-02-27 17:12:42 +00:00
Replaces integerlength(n) implementation with call to fls(n) and makes it static
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
#define GCFINALDEFS_H 1
|
||||
#include "lispemul.h" /* for LispPTR, DLword */
|
||||
void printarrayblock(LispPTR base);
|
||||
int integerlength(unsigned int n);
|
||||
LispPTR findptrsbuffer(LispPTR ptr);
|
||||
LispPTR releasingvmempage(LispPTR ptr);
|
||||
LispPTR checkarrayblock(LispPTR base, LispPTR free, LispPTR onfreelist);
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
/*************************************************************************/
|
||||
|
||||
#include <stdio.h> // for printf
|
||||
#include <strings.h> // for fls
|
||||
#include "address.h" // for HILOC
|
||||
#include "adr68k.h" // for NativeAligned4FromLAddr, LAddrFromNative
|
||||
#include "array.h" // for arrayblock, ARRAYBLOCKTRAILERCELLS, MAXBUCK...
|
||||
@@ -123,24 +124,10 @@ struct buf {
|
||||
#endif /* BIGVM */
|
||||
#endif /* BYTESWAP */
|
||||
|
||||
/************* The following procedure is common !! **************************/
|
||||
|
||||
int integerlength(unsigned int n) {
|
||||
int cnt;
|
||||
if (n <= 2)
|
||||
return (n);
|
||||
else {
|
||||
cnt = 1;
|
||||
do {
|
||||
cnt++;
|
||||
n = (n >> 1);
|
||||
} while (n != 1);
|
||||
return (cnt);
|
||||
}
|
||||
static int integerlength(unsigned int n) {
|
||||
return (fls(n));
|
||||
}
|
||||
|
||||
/************* The above procedure is common !! **************************/
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
/* f i n d p t r s b u f f e r */
|
||||
|
||||
Reference in New Issue
Block a user