converted to 4-4
authorceriel <none@none>
Tue, 31 Mar 1987 10:58:30 +0000 (10:58 +0000)
committerceriel <none@none>
Tue, 31 Mar 1987 10:58:30 +0000 (10:58 +0000)
lang/pc/libpc/pac.c
lang/pc/libpc/unp.c
lang/pc/libpc/wri.c

index 8cea845..ddab405 100644 (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 {
index d667302..10990c5 100644 (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 {
index 37bac5a..7d30660 100644 (file)
 
 extern         _wstrin();
 
+#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
+
+#ifndef STRMININT
+Something wrong here!
+#endif
+
 _wsi(w,i,f) int w,i; struct file *f; {
-       char *p; int j; char buf[6];
+       char *p; int j; char buf[SZ];
 
-       p = &buf[6];
+       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);
 }