--- os2sdk/demos/apps/sse/sseline.c 2018/08/09 12:25:13 1.1 +++ os2sdk/demos/apps/sse/sseline.c 2018/08/09 12:26:04 1.1.1.2 @@ -1,5 +1,7 @@ +/* Created by Microsoft Corp. 1987 */ + +#include #include -#include #include "ssedefs.h" @@ -18,10 +20,10 @@ * * EXIT rc - return code for allocating a segment * - * addline places the current line the in the segment + * addline places the current line in the segment * containing the previous line if possible to * reduce scattering, otherwise it scans other - * segments for first fit and if this fail allocates + * segments for first fit and if this fails allocates * a new segment. * * WARNING: do not modify the value of 'i' it is the @@ -35,13 +37,13 @@ */ short addline(linenum, linelength, line) -unsigned short linenum; -unsigned char linelength; -unsigned char line[]; +USHORT linenum; +UCHAR linelength; +UCHAR line[]; { - register unsigned short i, j; - unsigned char bytesneeded; - unsigned short selector; + register USHORT i, j; + UCHAR bytesneeded; + SEL selector; short rc; /* return code of allocseg */ bytesneeded = (HEADERSIZE + linelength); @@ -49,9 +51,9 @@ unsigned char line[]; /* use segment of previous line to reduce scattering */ if (linenum == 0) - selector = FP_SEG(LineTable[linenum]); + selector = SELECTOROF(LineTable[linenum]); else - selector = FP_SEG(LineTable[linenum -1]); + selector = SELECTOROF(LineTable[linenum -1]); /* find segment contianing line number -1 */ for(i = 0; (selector != SegTable[i].segment) && (i < TotalSegs); i++); @@ -66,8 +68,8 @@ unsigned char line[]; if (rc == 0) { /* no error allocating a segment */ /* point line table at segment */ - FP_SEG(LineTable[linenum]) = SegTable[i].segment; - FP_OFF(LineTable[linenum]) = SEGSIZE - SegTable[i].free; + SELECTOROF(LineTable[linenum]) = SegTable[i].segment; + OFFSETOF(LineTable[linenum]) = SEGSIZE - SegTable[i].free; /* place line in segment */ SegTable[i].free -= bytesneeded; @@ -83,8 +85,8 @@ unsigned char line[]; /*** deleteline - marks lines as deleted * - * deleteline marks a line as deteted in the segment - * it is contained in and marks the setment containing + * deleteline marks a line as detected in the segment + * it is contained in and marks the segment containing * the line as needing compacting. * * deleteline (linenum) @@ -97,13 +99,13 @@ unsigned char line[]; */ void deleteline(linenum) -unsigned short linenum; +USHORT linenum; { - register unsigned short i; - unsigned short selector; + register USHORT i; + SEL selector; LineTable[linenum]->deleted = TRUE; - selector = FP_SEG(LineTable[linenum]); + selector = SELECTOROF(LineTable[linenum]); for(i = 0; (selector != SegTable[i].segment) && (i < TotalSegs); i++); @@ -145,10 +147,10 @@ unsigned short linenum; */ flushline(linenum, line) -unsigned short linenum; -unsigned char line[]; +USHORT linenum; +UCHAR line[]; { - register unsigned char i; + register UCHAR i; /* delete the line if it's not beyond the end of the file */ if ( !(linenum == TotalLines)) @@ -186,10 +188,10 @@ unsigned char line[]; */ void getline(linenum, line) -unsigned short linenum; -unsigned char *line; +USHORT linenum; +UCHAR *line; { - register unsigned short i; + register USHORT i; i = 0;