converted to 4-4

This commit is contained in:
ceriel 1987-03-31 10:58:30 +00:00
parent 5d32d4987e
commit b46981f4ce
3 changed files with 29 additions and 9 deletions

View file

@ -39,7 +39,7 @@ _pac(ad,zd,zp,i,ap) int i; struct descr *ad,*zd; char *zp,*ap; {
ap += (i * ad->size);
i = (zd->diff + 1) * zd->size;
if (zd->size == 1) {
assert(ad->size == 2);
assert(ad->size == EM_WSIZE);
while (--i >= 0)
*zp++ = *((int *)ap)++;
} else {

View file

@ -39,7 +39,7 @@ _unp(ad,zd,i,ap,zp) int i; struct descr *ad,*zd; char *ap,*zp; {
ap += (i * ad->size);
i = (zd->diff + 1) * zd->size;
if (zd->size == 1) {
assert(ad->size == 2);
assert(ad->size == EM_WSIZE);
while (--i >= 0)
*((int *)ap)++ = *zp++;
} else {

View file

@ -20,13 +20,33 @@
extern _wstrin();
_wsi(w,i,f) int w,i; struct file *f; {
char *p; int j; char buf[6];
#if EM_WSIZE==4
#define SZ 11
#define MININT -2147483648
#define STRMININT "-2147483648"
#endif
#if EM_WSIZE==2
#define SZ 6
#define MININT -32768
#define STRMININT "-32768"
#endif
#if EM_WSIZE==1
#define SZ 4
#define MININT -128
#define STRMININT "-128"
#endif
p = &buf[6];
#ifndef STRMININT
Something wrong here!
#endif
_wsi(w,i,f) int w,i; struct file *f; {
char *p; int j; char buf[SZ];
p = &buf[SZ];
if ((j=i) < 0) {
if (i == -32768) {
_wstrin(w,6,"-32768",f);
if (i == MININT) {
_wstrin(w,SZ,STRMININT,f);
return;
}
j = -j;
@ -36,9 +56,9 @@ _wsi(w,i,f) int w,i; struct file *f; {
while (j /= 10);
if (i<0)
*--p = '-';
_wstrin(w,&buf[6]-p,p,f);
_wstrin(w,&buf[SZ]-p,p,f);
}
_wri(i,f) int i; struct file *f; {
_wsi(6,i,f);
_wsi(SZ,i,f);
}