From c899541e2e78e04fc2170b86356a9999a327599a Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Tue, 13 Apr 2004 12:13:03 +0000 Subject: [PATCH] Converted nxtMCBsize back to a macro. There is no need to use far2para; FP_SEG works fine since MCBs always have offset 0. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@875 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/memmgr.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/kernel/memmgr.c b/kernel/memmgr.c index 00bbc80..3a0a62d 100644 --- a/kernel/memmgr.c +++ b/kernel/memmgr.c @@ -34,14 +34,7 @@ static BYTE *memmgrRcsId = "$Id$"; #endif -/*#define nxtMCBsize(mcb,size) \ - MK_FP(far2para((VOID FAR *) (mcb)) + (size) + 1, 0) */ - -void FAR *nxtMCBsize(mcb FAR * Mcb, int size) -{ - return MK_FP(far2para((VOID FAR *) (Mcb)) + (size) + 1, 0); -} - +#define nxtMCBsize(mcb,size) MK_FP(FP_SEG(mcb) + (size) + 1, 0) #define nxtMCB(mcb) nxtMCBsize((mcb), (mcb)->m_size) #define mcbFree(mcb) ((mcb)->m_psp == FREE_PSP) @@ -75,11 +68,6 @@ STATIC COUNT joinMCBs(mcb FAR * p) return SUCCESS; } -seg far2para(VOID FAR * p) -{ - return FP_SEG(p) + (FP_OFF(p) >> 4); -} - /* * Return a normalized far pointer */ @@ -252,7 +240,7 @@ stopIt: /* reached from FIRST_FIT on match */ foundSeg->m_psp = cu_psp; /* the new block is for current process */ foundSeg->m_name[0] = '\0'; - *para = far2para((VOID FAR *) (BYTE FAR *) foundSeg); + *para = FP_SEG(foundSeg); return SUCCESS; }