Microport ARC fix

Dragos Ruiu work at dragos.UUCP
Mon Mar 28 14:27:33 AEST 1988


 Here is a quick fix to get the System V version of SEA's ARC to
 work under uPort SV/AT. (It was recently posted to comp.binaries.ibm.pc
 [?!?])

 In the file arclzw.c the data exceeds 64K, and sizeof(string_tab) complains
 that it gets a number less than or equal to zero. (Did we remember to make
 sizeof unsigned Microport ? :-) This puzzled me at first, but to get it to
 work all you have to do is change

 arclzw.c: 54,62
-----
static struct entry {                  /* string table entry format */
    char used;                         /* true when this entry is in use */
    unsigned INT next;                 /* ptr to next in collision list */
    unsigned INT predecessor;          /* code for preceeding string */
    unsigned char follower;            /* char following string */
}   string_tab[TABSIZE];               /* the code string table */
-----
to
-----
static struct entry {                  /* string table entry format */
    char used;                         /* true when this entry is in use */
    unsigned char follower;            /* char following string */
    unsigned INT next;                 /* ptr to next in collision list */
    unsigned INT predecessor;          /* code for preceeding string */
}   string_tab[TABSIZE];               /* the code string table */
-----
 
  The trick is that integers are word aligned, and the first structure is
  eight bytes long and the second is six... quick fix, and it seems to work
  fine. Remember to use the -i flag on PC arcs or it will dump core with a 
  bus error. The lzw segment just barely squeaks under 64K with about 63.xK !

  The above makes me wonder in what other great programs memory could have
  been saved by keeping in mind size alignment! Sigh...
   
  [Death to memory segments]
-- 
Dragos Ruiu   ruiu at dragos.UUCP
        ...alberta!dragos!ruiu   "cat ansi.c | grep -v noalias >proper.c"



More information about the Comp.unix.microport mailing list