Updated for 64-bit. Bumped copyright year.

Pascal J. Bourguignon [2011-05-01 20:37]
Updated for 64-bit.  Bumped copyright year.
Filename
ascii-utilities/sources/ascii.c
ascii-utilities/sources/binskip.c
ascii-utilities/sources/bintohex.c
ascii-utilities/sources/charcount.cc
ascii-utilities/sources/concatenate.c
ascii-utilities/sources/concatenate.h
ascii-utilities/sources/encoding.c
ascii-utilities/sources/hextobin.c
ascii-utilities/sources/lc.c
ascii-utilities/sources/parity.c
ascii-utilities/sources/randchar.c
ascii-utilities/sources/sevenbit.c
ascii-utilities/sources/sortchars.c
ascii-utilities/sources/text.c
ascii-utilities/sources/whatisit.c
base/sources/base.c
bocrypt/sources/Makefile
bocrypt/sources/bocrypt.c
bocrypt/sources/smallcrypt.c
bocrypt/sources/xor.c
cookie/sources/Makefile
cookie/sources/cookie.c
cookie/sources/random.c
cplusinherited/sources/Makefile
cplusinherited/sources/cplusinherited.c
dosname/sources/AttrString.cc
dosname/sources/AttrString.hh
dosname/sources/CapWord.cc
dosname/sources/CapWord.hh
dosname/sources/MfDirectory.cc
dosname/sources/MfDirectory.hh
dosname/sources/MfFile.cc
dosname/sources/MfFile.hh
dosname/sources/MfLink.cc
dosname/sources/MfLink.hh
dosname/sources/MfMode.cc
dosname/sources/MfMode.hh
dosname/sources/MfNode.cc
dosname/sources/MfNode.hh
dosname/sources/MfRootDirectory.cc
dosname/sources/MfRootDirectory.hh
dosname/sources/MfUtil.cc
dosname/sources/MfUtil.hh
dosname/sources/NameSeq.cc
dosname/sources/NameSeq.hh
dosname/sources/Pressure.cc
dosname/sources/Pressure.hh
dosname/sources/Renamer.cc
dosname/sources/Renamer.hh
dosname/sources/WordSeq.cc
dosname/sources/WordSeq.hh
dosname/sources/dosname.cc
dosname/sources/dosname.hh
dosname/sources/names.h
encoding/sources/bentest.c
encoding/sources/encoding.c
environment/sources/environment.c
extractbit1/sources/extractbit1.c
filldisk/sources/Makefile
formats/binhexlib/interfaces/BinHex4Stream.hh
formats/binhexlib/interfaces/CheckSumStream.hh
formats/binhexlib/interfaces/RunLengthStream.hh
formats/binhexlib/interfaces/SeqStream.hh
formats/binhexlib/interfaces/SevenStream.hh
formats/binhexlib/interfaces/StdIOStream.hh
formats/binhexlib/sources/BinHex4Stream.cc
formats/binhexlib/sources/CheckSumStream.cc
formats/binhexlib/sources/RunLengthStream.cc
formats/binhexlib/sources/SeqStream.cc
formats/binhexlib/sources/SevenStream.cc
formats/binhexlib/sources/StdIOStream.cc
formats/binhextools/sources/BinHex.c
formats/binhextools/sources/BinHex.h
formats/binhextools/sources/bh.c
formats/binhextools/sources/runlength.cc
formats/binhextools/sources/seven.cc
formats/macbinary/sources/mb.c
formats/macbinary_to_triple/MacBinary.c
formats/macbinary_to_triple/MacBinary.h
formats/macbinary_to_triple/mb2t.c
formats/single_to_double/Makefile
formats/single_to_double/encours/ASSegment.h
formats/single_to_double/encours/ASSegment.m
formats/single_to_double/encours/AppleSingle.h
formats/single_to_double/encours/AppleSingle.m
formats/single_to_double/s2d.c
geturls/sources/geturls.c
line-utilities/sources/arguments.c
line-utilities/sources/arguments.h
line-utilities/sources/fdiff.c
line-utilities/sources/fields.c
line-utilities/sources/fields.h
line-utilities/sources/lcat.c
line-utilities/sources/ldiff.c
line-utilities/sources/lgetvalue.c
line-utilities/sources/lines.c
line-utilities/sources/lines.h
line-utilities/sources/lmax.c
line-utilities/sources/lrev.c
mpa/sources/make-person-aliases.c
network/sources/network.c
newmoon/sources/newmoon.c
newton/sources/newton-ps.c
newton/sources/newton.c
objc-tools/sources/Makefile
objc-tools/sources/objc-make-accessors.c
od-tools/sources/odhv2hex.c
od-tools/sources/postodax.c
primes/sources/Makefile
primes/sources/primes.c
random-stat/sources/random-stat.cc
random-stat/sources/test-charbits.cc
romain/sources/romain.c
segment/sources/join.c
segment/sources/segment.c
segment/sources/unsparse.c
truncate/sources/binskip.c
truncate/sources/truncate.c
diff --git a/ascii-utilities/sources/ascii.c b/ascii-utilities/sources/ascii.c
index f24207b..03b7a53 100644
--- a/ascii-utilities/sources/ascii.c
+++ b/ascii-utilities/sources/ascii.c
@@ -47,7 +47,7 @@ MODIFICATIONS
                      (so this may be locale dependent too).
 LEGAL
     GPL
-    Copyright Pascal J. Bourguignon 1991 - 2003
+    Copyright Pascal J. Bourguignon 1991 - 2011

     This file is part of PJB ASCII UTILITIES.

diff --git a/ascii-utilities/sources/binskip.c b/ascii-utilities/sources/binskip.c
index 7b0b847..614f5dd 100644
--- a/ascii-utilities/sources/binskip.c
+++ b/ascii-utilities/sources/binskip.c
@@ -31,7 +31,7 @@ MODIFICATIONS
 BUGS
     - Should allow skipping bytes at the end and in the middle of the file.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
@@ -43,33 +43,33 @@ LEGAL
 #include <BcTypes.h>


-    static INT32 copy(FILE* input,FILE* output)
-    {
-            char            buffer[16*1024];
-            char*           p;
-            size_t          rsize;
-            size_t          wsize;
+static INT32 copy(FILE* input,FILE* output)
+{
+    char            buffer[16*1024];
+    char*           p;
+    size_t          rsize;
+    size_t          wsize;
 #define buffersize  (sizeof(buffer)/sizeof(char))
-        errno=0;
+    errno=0;
+    rsize=fread(buffer,sizeof(char),buffersize,input);
+    while(rsize>0){
+        wsize=0;
+        p=buffer;
+        do{
+            p+=(wsize/sizeof(char));
+            rsize-=wsize;
+            wsize=fwrite(buffer,sizeof(char),rsize,output);
+        }while(wsize<rsize);
         rsize=fread(buffer,sizeof(char),buffersize,input);
-        while(rsize>0){
-            wsize=0;
-            p=buffer;
-            do{
-                p+=(wsize/sizeof(char));
-                rsize-=wsize;
-                wsize=fwrite(buffer,sizeof(char),rsize,output);
-            }while(wsize<rsize);
-            rsize=fread(buffer,sizeof(char),buffersize,input);
-        }
-        return(errno);
-    }/*copy.*/
+    }
+    return(errno);
+}/*copy.*/


 int main(int argc,char** argv)
 {
-        char        c;
-        INT32       count;
+    char        c;
+    INT32       count;

     if(argc!=2){
         fprintf(stderr,"Usage:\n\t%s <skipcount>\n",argv[0]);
@@ -77,12 +77,12 @@ int main(int argc,char** argv)
     }
     count=atoi(argv[1]);
     while(count>0){
-        c=getchar();
+        c=(char)getchar();
         count--;
     }
     return(copy(stdin,stdout));
 }/*main.*/


+/**** THE END ****/

-/*** binskip.c                        --                     --          ***/
diff --git a/ascii-utilities/sources/bintohex.c b/ascii-utilities/sources/bintohex.c
index 05b785e..228ec13 100644
--- a/ascii-utilities/sources/bintohex.c
+++ b/ascii-utilities/sources/bintohex.c
@@ -38,7 +38,7 @@ MODIFICATIONS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1993 - 1993
+    Copyright Pascal Bourguignon 1993 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -104,8 +104,8 @@ int main(int argc,char** argv)
 {
     CARD8       buffer[16*1024];
     char        outbuf[128];
-    INT32       rsize;
-    INT32       wsize;
+    size_t      rsize;
+    size_t      wsize;
     INT32       isize;
     INT32       i;
     INT32       produit;
@@ -115,29 +115,31 @@ int main(int argc,char** argv)
         unsigned char byte;
         do{
             if(read(0,&byte,1)){
+                ssize_t r;
                 int h=byte>>4;
                 int l=byte&0xF;
                 outbuf[0]=hihex[h];
                 outbuf[1]=hihex[l];
                 outbuf[2]=' ';
-                write(1,outbuf,3);
+                r=write(1,outbuf,3);
+                (void)r;
             }
         }while(1);/* TODO: EOF! */
     }else{
         isize=0;
         rsize=fread(buffer,1,sizeof(buffer),stdin);
         while(rsize>0){
-            isize+=rsize;
+            isize=isize+(INT32)rsize;
             i=0;
             while(rsize>0){
-                bintohex(buffer+i,rsize,outbuf,16,0,1,1,&consomme,&produit);
+                bintohex(buffer+i,(INT32)rsize,outbuf,16,0,1,1,&consomme,&produit);
                 i+=consomme;
-                rsize-=consomme;
+                rsize=rsize-(size_t)consomme;
                 wsize=fwrite(outbuf,1,(unsigned)produit,stdout);
                 if(wsize!=produit){
                     fprintf(stderr,
                             "%s error: error while writting output stream "
-                            "(%ld/%ld).\n",argv[0],produit,wsize);
+                            "(%"FMT_INT32"/%"FMT_INT64").\n",argv[0],produit,wsize);
                     return(1);
                 }
             }
@@ -145,7 +147,7 @@ int main(int argc,char** argv)
         }
         if(!feof(stdin)){
             fprintf(stderr,"%s error: while reading input stream\n"
-                    "\t%ld bytes read.\n",argv[0],isize);
+                    "\t%"FMT_INT32" bytes read.\n",argv[0],isize);
             return(1);
         }
     }
diff --git a/ascii-utilities/sources/charcount.cc b/ascii-utilities/sources/charcount.cc
index 2a4584d..856830a 100644
--- a/ascii-utilities/sources/charcount.cc
+++ b/ascii-utilities/sources/charcount.cc
@@ -1,6 +1,7 @@
 extern "C"{
 #include <stdio.h>
 }
+#include <BcTypes.h>


 class File
@@ -135,7 +136,7 @@ protected:

         if(file->isOpen()){
             while(!(file->isAtEnd())){
-                size=file->read(buffer,buffer_size);
+                size=(int)(file->read(buffer,buffer_size));
                 for(i=0;i<size;i++){
                     _count[buffer[i]]++;
                 }
@@ -206,11 +207,9 @@ int main(int argc,const char** argv)
     }
     delete file;
     for(i=0;i<256;i++){
-        fprintf(stdout,"%02x %-8s %10ld\n",i,charName(i),count->countOf(i));
+        fprintf(stdout,"%02x %-8s %10ld\n",i,charName((unsigned char)i),count->countOf((unsigned char)i));
     }
     return(0);
 }/*main*/

-
-
-/*** charcount.cc                     -- 2003-12-01 04:45:53 -- pascal   ***/
+/**** THE END ****/
diff --git a/ascii-utilities/sources/concatenate.c b/ascii-utilities/sources/concatenate.c
index 499777a..db01d12 100644
--- a/ascii-utilities/sources/concatenate.c
+++ b/ascii-utilities/sources/concatenate.c
@@ -15,7 +15,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 2004 - 2004
+    Copyright Pascal Bourguignon 2004 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
diff --git a/ascii-utilities/sources/concatenate.h b/ascii-utilities/sources/concatenate.h
index 27d9ce4..20cbc05 100644
--- a/ascii-utilities/sources/concatenate.h
+++ b/ascii-utilities/sources/concatenate.h
@@ -15,7 +15,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 2004 - 2004
+    Copyright Pascal Bourguignon 2004 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
diff --git a/ascii-utilities/sources/encoding.c b/ascii-utilities/sources/encoding.c
index a38d38b..899875b 100644
--- a/ascii-utilities/sources/encoding.c
+++ b/ascii-utilities/sources/encoding.c
@@ -100,7 +100,7 @@ MODIFICATIONS
     1996/12/05 <PJB> Corrected a bug in BuildConversionTable with approx mode.
     1999/09/14 <PJB> Extracted the encodings into a separate library.
 LEGAL
-    Copyright Pascal J. Bourguignon 1991 - 1999
+    Copyright Pascal J. Bourguignon 1991 - 2011
     All Rights Reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
@@ -129,203 +129,203 @@ LEGAL
 #include <Bencoding.h>


-    static void printerr(int err)
-    {
-        fprintf(stderr,"Error: %s (%d)\n",strerror(err),err);
-    }/*printerr*/
+static void printerr(int err)
+{
+    fprintf(stderr,"Error: %s (%d)\n",strerror(err),err);
+}/*printerr*/


-    static void MakeTempName(char* src,char* temp)
-    {
-        strcpy(temp,src);
-        strcat(temp,".nema[ ]");
-    }/*MakeTempName*/
+static void MakeTempName(char* src,char* temp)
+{
+    strcpy(temp,src);
+    strcat(temp,".nema[ ]");
+}/*MakeTempName*/


-    static BOOLEAN ishexadigit(/*char*/int c)
-    {
-        return((('0'<=c)&&(c<='9'))||
-                (('a'<=c)&&(c<='f'))||(('A'<=c)&&(c<='F')));
-    }/*ishexadigit;*/
+static BOOLEAN ishexadigit(/*char*/int c)
+{
+    return((('0'<=c)&&(c<='9'))||
+           (('a'<=c)&&(c<='f'))||(('A'<=c)&&(c<='F')));
+}/*ishexadigit;*/


-    static int hexatoint(/*char*/int c)
-    {
-        if(c<='9'){
-            return(c-'0');
-        }else if(c<='F'){
-            return(c-'A'+10);
-        }else{
-            return(c-'a'+10);
-        }
-    }/*hexatoint;*/
+static int hexatoint(/*char*/int c)
+{
+    if(c<='9'){
+        return(c-'0');
+    }else if(c<='F'){
+        return(c-'A'+10);
+    }else{
+        return(c-'a'+10);
+    }
+}/*hexatoint;*/

 #if 0
-    static char inttohexa(int d)
-    {
-        if(d<10){
-            return('0'+d);
-        }else{
-            return('a'+d-10);
-        }
-    }/*inttohexa;*/
+static char inttohexa(int d)
+{
+    if(d<10){
+        return('0'+d);
+    }else{
+        return('a'+d-10);
+    }
+}/*inttohexa;*/
 #endif


-    static void usage(char* pname)
-    {
-        INT16        code;
-        INT16        col;
-        const char*  message="# Implemented codes are: ";
-        const char** codeNames=BenEncodingTableNames();
+static void usage(char* pname)
+{
+    INT16        code;
+    INT16        col;
+    const char*  message="# Implemented codes are: ";
+    const char** codeNames=BenEncodingTableNames();

-        fprintf(
+    fprintf(
             stderr,
             concatenate(
-                "# %s usage:\n",
-                "   %s -from code -to code ",
-                "[-a | -e [-ELR]] [-t] [-r] [-v] [-xC] < in > out \n",
-                "   %s -from code -to code ",
-                "[-a | -e [-ELR]] [-t] [-r] [-v] [-xC] file... \n",
-                "   %s -n | -m [-a | -e [-ELR]] [-t] [-r] ",
-                "[-v] [-xC] < in > out \n",
-                "   %s -n | -m [-a | -e [-ELR]] [-t] [-r] ",
-                "[-v] [-xC] file... \n",
-                "   %s -A [-t] [-r] [-v] [-xC] < in > out \n",
-                "   %s -A [-t] [-r] [-v] [-xC] file... \n",
-                "     -t   = dumps the conversion table,\n",
-                "     -a   = approximate (use it with -to ascii),\n",
-                "     -n   = -from macintosh -to next\n",
-                "     -m   = -from next -to macintosh\n",
-                "     -e   = replace missing characters in ",
-                "'to' set with their name,\n",
-                "     -xC  = replace missing characters in ",
-                "'to' set with C,\n",
-                "     -ELR = encasulate missing characters ",
-                "in 'to' set with L and R,\n",
-                "     -v   = prints on stderr the list of ",
-                "missing characters,\n",
-                "     -r   = the files are Rich Text Format files,\n",
-                "     -A   = filters all remaining 8-ths bits.\n",
-                0),pname,pname,pname,pname,pname,pname,pname);
-        code=0;
-        col=strlen(message)+strlen(codeNames[code])+2;
-        fprintf(stderr,"%s%s",message,codeNames[code]);
-        code++;
-        while(codeNames[code]!=0){
-            col+=strlen(codeNames[code])+2;
-            if(col>72){
-                fprintf(stderr,",\n    %s",codeNames[code]);
-                col-=68;
-            }else{
-                fprintf(stderr,", %s",codeNames[code]);
-            }
-            code++;
+                        "# %s usage:\n",
+                        "   %s -from code -to code ",
+                        "[-a | -e [-ELR]] [-t] [-r] [-v] [-xC] < in > out \n",
+                        "   %s -from code -to code ",
+                        "[-a | -e [-ELR]] [-t] [-r] [-v] [-xC] file... \n",
+                        "   %s -n | -m [-a | -e [-ELR]] [-t] [-r] ",
+                        "[-v] [-xC] < in > out \n",
+                        "   %s -n | -m [-a | -e [-ELR]] [-t] [-r] ",
+                        "[-v] [-xC] file... \n",
+                        "   %s -A [-t] [-r] [-v] [-xC] < in > out \n",
+                        "   %s -A [-t] [-r] [-v] [-xC] file... \n",
+                        "     -t   = dumps the conversion table,\n",
+                        "     -a   = approximate (use it with -to ascii),\n",
+                        "     -n   = -from macintosh -to next\n",
+                        "     -m   = -from next -to macintosh\n",
+                        "     -e   = replace missing characters in ",
+                        "'to' set with their name,\n",
+                        "     -xC  = replace missing characters in ",
+                        "'to' set with C,\n",
+                        "     -ELR = encasulate missing characters ",
+                        "in 'to' set with L and R,\n",
+                        "     -v   = prints on stderr the list of ",
+                        "missing characters,\n",
+                        "     -r   = the files are Rich Text Format files,\n",
+                        "     -A   = filters all remaining 8-ths bits.\n",
+                        0),pname,pname,pname,pname,pname,pname,pname);
+    code=0;
+    col=(INT16)(strlen(message)+strlen(codeNames[code])+2);
+    fprintf(stderr,"%s%s",message,codeNames[code]);
+    code++;
+    while(codeNames[code]!=0){
+        col=(INT16)((size_t)col+strlen(codeNames[code])+2);
+        if(col>72){
+            fprintf(stderr,",\n    %s",codeNames[code]);
+            col=(INT16)(col-68);
+        }else{
+            fprintf(stderr,", %s",codeNames[code]);
         }
-        fprintf(stderr,".\n");
-    }/*usage*/
+        code++;
+    }
+    fprintf(stderr,".\n");
+}/*usage*/



-    /* ConvertEncoding arguments */
-    static BenConversionTableT      Conversion;
-    static BOOLEAN                  rtf;
+/* ConvertEncoding arguments */
+static BenConversionTableT      Conversion;
+static BOOLEAN                  rtf;


-    static int ConvertEncoding(FILE* in,FILE* out)
-    {
-            int             c;
+static int ConvertEncoding(FILE* in,FILE* out)
+{
+    int             c;

-        if(rtf){
-            c=fgetc(in);
-            while(c!=EOF){
-                if(c=='\\'){
-                    c=fgetc(in);
-                    if(c=='\''){
-                            int             h,l;
-                        h=fgetc(in);
-                        l=fgetc(in);
-                        if(ishexadigit(h)&&ishexadigit(l)){
-                            c=hexatoint(h)*16+hexatoint(l);
-                            fputs(Conversion[c],out);
+    if(rtf){
+        c=fgetc(in);
+        while(c!=EOF){
+            if(c=='\\'){
+                c=fgetc(in);
+                if(c=='\''){
+                    int             h,l;
+                    h=fgetc(in);
+                    l=fgetc(in);
+                    if(ishexadigit(h)&&ishexadigit(l)){
+                        c=hexatoint(h)*16+hexatoint(l);
+                        fputs(Conversion[c],out);
                         /*** SEE: hexa escapes are not kept!
-                            buffer[i+2]=inttohexa(new/16);
-                            buffer[i+3]=inttohexa(new%16);
+                             buffer[i+2]=inttohexa(new/16);
+                             buffer[i+3]=inttohexa(new%16);
                         ***/
-                        }else{
-                            fputc('\\',out);
-                            fputc('\'',out);
-                            fputc(h,out);
-                            fputc(l,out);
-                        }
                     }else{
                         fputc('\\',out);
-                        fputc(c,out);
+                        fputc('\'',out);
+                        fputc(h,out);
+                        fputc(l,out);
                     }
                 }else{
-                    fputs(Conversion[c],out);
+                    fputc('\\',out);
+                    fputc(c,out);
                 }
-                c=fgetc(in);
-            }
-        }else{
-            c=fgetc(in);
-            while(c!=EOF){
+            }else{
                 fputs(Conversion[c],out);
-                c=fgetc(in);
             }
+            c=fgetc(in);
+        }
+    }else{
+        c=fgetc(in);
+        while(c!=EOF){
+            fputs(Conversion[c],out);
+            c=fgetc(in);
         }
-        return(0);
-    }/*ConvertEncoding*/
+    }
+    return(0);
+}/*ConvertEncoding*/


 #define BufSize (128*1024)
-    static int Filter8thBit(FILE* in,FILE* out)
-    {
-        unsigned char   buffer[BufSize];
-        int             rlength;
-        int             wlength;
-        int             i;
+static int Filter8thBit(FILE* in,FILE* out)
+{
+    unsigned char   buffer[BufSize];
+    size_t          rlength;
+    size_t          wlength;
+    int             i;

-        while(!feof(in)){
-            rlength=fread(buffer,1,BufSize,in);
-            i=0;
-            while(i<rlength){
-                buffer[i]=(char)(buffer[i]&0x7F);
-                i++;
-            }
-            if(rlength>0){
-                wlength=fwrite(buffer,1,(unsigned)rlength,out);
-                if(wlength!=rlength){
-                    fprintf(stderr,
+    while(!feof(in)){
+        rlength=fread(buffer,1,BufSize,in);
+        i=0;
+        while(i<rlength){
+            buffer[i]=(char)(buffer[i]&0x7F);
+            i++;
+        }
+        if(rlength>0){
+            wlength=fwrite(buffer,1,(unsigned)rlength,out);
+            if(wlength!=rlength){
+                fprintf(stderr,
                         "### Written length is different from read length:"
-                        " %d != %d\n",wlength,rlength);
-                }
+                        " %ld != %ld\n",wlength,rlength);
             }
         }
-        return(0);
-    }/*Filter8thBit*/
+    }
+    return(0);
+}/*Filter8thBit*/


 int main(int argc,char** argv,char** envp)
 {
-        FILE*               fin;
-        FILE*               fout;
-        int                 i;
-        int                 err;
-        struct stat         filestatus;
-        char                TempName[256];
-        BOOLEAN             nooption;
-        BOOLEAN             fromIsDetermined;
-        BOOLEAN             toIsDetermined;
-        BOOLEAN             eight2seven;
-        BOOLEAN             dumpTable;
-        BenModeT            mode;
-        const char*         fromname=0;
-        const char*         toname=0;
-        BenEncodingTableT*  fromtable=(BenEncodingTableT*)0;
-        BenEncodingTableT*  totable=(BenEncodingTableT*)0;
-        char                replacement[2]=" "; /* space is default replacement */
-        int (*convert)(FILE*,FILE*);
+    FILE*               fin;
+    FILE*               fout;
+    int                 i;
+    int                 err;
+    struct stat         filestatus;
+    char                TempName[256];
+    BOOLEAN             nooption;
+    BOOLEAN             fromIsDetermined;
+    BOOLEAN             toIsDetermined;
+    BOOLEAN             eight2seven;
+    BOOLEAN             dumpTable;
+    BenModeT            mode;
+    const char*         fromname=0;
+    const char*         toname=0;
+    BenEncodingTableT*  fromtable=(BenEncodingTableT*)0;
+    BenEncodingTableT*  totable=(BenEncodingTableT*)0;
+    char                replacement[2]=" "; /* space is default replacement */
+    int (*convert)(FILE*,FILE*);

     rtf=FALSE;
     nooption=TRUE;
@@ -369,7 +369,7 @@ int main(int argc,char** argv,char** envp)
                 fromIsDetermined=TRUE;
             }else{
                 fprintf(stderr,
-                    "### A code name is expected following -from option.\n");
+                        "### A code name is expected following -from option.\n");
                 usage(argv[0]);
                 return(1);
             }
@@ -387,7 +387,7 @@ int main(int argc,char** argv,char** envp)
                 toIsDetermined=TRUE;
             }else{
                 fprintf(stderr,
-                    "### A code name is expected following -to option.\n");
+                        "### A code name is expected following -to option.\n");
                 usage(argv[0]);
                 return(1);
             }
@@ -412,7 +412,7 @@ int main(int argc,char** argv,char** envp)
     if(eight2seven){
         if(fromIsDetermined||toIsDetermined||(mode!=BenMode_Normal)){
             fprintf(stderr,
-                "### -A option is incompatible with -from, -to, -a and -e\n");
+                    "### -A option is incompatible with -from, -to, -a and -e\n");
             usage(argv[0]);
             return(1);
         }
@@ -444,15 +444,15 @@ int main(int argc,char** argv,char** envp)
             fin=fopen(argv[i],"r");
             if(fin==NULL){
                 fprintf(stderr,
-                    "### I cannot open the input file \"%s\";"
-                    " skipping it.\n",argv[i]);
+                        "### I cannot open the input file \"%s\";"
+                        " skipping it.\n",argv[i]);
             }else{
                 MakeTempName(argv[i],TempName);
                 fout=fopen(TempName,"w");
                 if(fout==NULL){
                     fprintf(stderr,
-                        "### I cannot open the output file \"%s\";"
-                        " skipping \"%s\".\n",TempName,argv[i]);
+                            "### I cannot open the output file \"%s\";"
+                            " skipping \"%s\".\n",TempName,argv[i]);
                     fclose(fin);
                 }else{
                     err=convert(fin,fout);
@@ -465,32 +465,33 @@ int main(int argc,char** argv,char** envp)
                             if(err==0){
                                 err=stat("temp[nema]",&filestatus);
                                 if(err==0){
-                                    chown(argv[i],filestatus.st_uid,
-                                                        filestatus.st_gid);
+                                    int r=chown(argv[i],filestatus.st_uid,
+                                                filestatus.st_gid);
+                                    (void)r;
                                     chmod(argv[i],filestatus.st_mode);
                                 }
                                 unlink("temp[nema]");
                             }else{
                                 perror("Error while linking: ");
                                 fprintf(stderr,
-                                    "### I cannot link the output file "
-                                    "\"%s\" to the input file \"%s\"; "
-                                    "skipping it.\n",TempName,argv[i]);
+                                        "### I cannot link the output file "
+                                        "\"%s\" to the input file \"%s\"; "
+                                        "skipping it.\n",TempName,argv[i]);
                                 rename("temp[nema]",argv[i]);
                             }
                         }else{
                             printerr(err);
                             fprintf(stderr,
-                                "### I cannot rename the input file \"%s\";"
-                                " skipping it.\n",argv[i]);
+                                    "### I cannot rename the input file \"%s\";"
+                                    " skipping it.\n",argv[i]);
                         }
                         unlink(TempName);
                     }else{
                         fprintf(stderr,"error after convert\n");
                         printerr(err);
                         fprintf(stderr,
-                            "### Error while converting the input file "
-                            "\"%s\"; skipping it.\n",argv[i]);
+                                "### Error while converting the input file "
+                                "\"%s\"; skipping it.\n",argv[i]);
                     }
                 }
             }
@@ -501,12 +502,12 @@ int main(int argc,char** argv,char** envp)
         if(err!=0){
             printerr(err);
             fprintf(stderr,
-                "### Error while converting the input file \"%s\";"
-                " skipping it.\n","stdin");
+                    "### Error while converting the input file \"%s\";"
+                    " skipping it.\n","stdin");
         }
     }
     return(0);
 }/*main*/


-/*** encoding.c                       --                     --          ***/
+/**** THE END ****/
diff --git a/ascii-utilities/sources/hextobin.c b/ascii-utilities/sources/hextobin.c
index cd98779..e6822bd 100644
--- a/ascii-utilities/sources/hextobin.c
+++ b/ascii-utilities/sources/hextobin.c
@@ -34,7 +34,7 @@ MODIFICATIONS
     Added RCS keywords.

 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
@@ -77,7 +77,7 @@ LEGAL
             c2=hexdigit(c);

             if((c1>=0)&&(c2>=0)){
-                buffer[i]=(c1<<4)|c2;
+                buffer[i]=(CARD8)((c1<<4)|c2);
                 i++;
             }else{
                 return(i);
@@ -90,25 +90,25 @@ LEGAL
 int main(int argc,char** argv)
 {
         CARD8       buffer[16*1024];
-        INT32       rsize;
-        INT32       wsize;
+        size_t      rsize;
+        size_t      wsize;
         INT32       isize;

     isize=0;
-    rsize=loadhexwords(stdin,buffer,sizeof(buffer)/sizeof(CARD8));
+    rsize=(size_t)loadhexwords(stdin,buffer,sizeof(buffer)/sizeof(CARD8));
     while(rsize>0){
-        isize+=rsize;
+        isize+=(INT32)rsize;
         wsize=fwrite(buffer,1,(unsigned)rsize,stdout);
         if(wsize!=rsize){
             fprintf(stderr,"%s error: write count (%ld) differ read "
                             "count (%ld).\n",argv[0],wsize,rsize);
             return(1);
         }
-        rsize=loadhexwords(stdin,buffer,sizeof(buffer)/sizeof(CARD8));
+        rsize=(size_t)loadhexwords(stdin,buffer,sizeof(buffer)/sizeof(CARD8));
     }
     if(!feof(stdin)){
         fprintf(stderr,"%s error: invalid character in input stream\n"
-                    "\t%ld bytes read.\n",argv[0],isize);
+                "\t%"FMT_INT32" bytes read.\n",argv[0],isize);
         return(1);
     }
     return(0);
diff --git a/ascii-utilities/sources/lc.c b/ascii-utilities/sources/lc.c
index fee85c6..8e7682c 100644
--- a/ascii-utilities/sources/lc.c
+++ b/ascii-utilities/sources/lc.c
@@ -89,7 +89,7 @@ MODIFICATIONS
     Added RCS keywords.

 LEGAL
-    Copyright Pascal J. Bourguignon 1990 - 1993
+    Copyright Pascal J. Bourguignon 1990 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
@@ -110,7 +110,7 @@ LEGAL


 /*
-*/
+ */

 #define     ASCII_BS    (8)
 #define     ASCII_LF    (10)
@@ -131,397 +131,312 @@ LEGAL
 #define csIbmpc         (5)


-#if 0
-        /* not used yet */
-
-    static const char* Next_to_Macintosh[256]=
-        {
-            " ","!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/",
-            "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?",
-            "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
-            "P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_",
-            "`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",
-            "p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","",
-            "","","","","","€","","‚","","ƒ","","","","","","",
-            ".","„","","","","","…","","","","†",".",".","",".","",
-            "","","","","","","","","","'","","","","","","",
-            "","","","","",".","","","","","","","","","","",
-            ".","","","","","","","","",".","","",".","","","",
-            "","",".",".",".","ˆ","‡","‰","‹","Š","Œ","","","Ž","","‘",
-            "“","","’","","”","•","","–",".","","","","˜","—","™","›",
-            "š","","","œ","ž","","Ÿ",".",".","","","",".","",".","."
-        };
-
-    static const char*       Next_to_Macintosh_Approximative[256]=
-        {
-            " ","!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/",
-            "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?",
-            "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
-            "P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_",
-            "`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",
-            "p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","",
-            "","","","","","€","","‚","","ƒ","","","","","","",
-            "D","„","","","","","…","","","","†","Y","p","","x","",
-            "","","","","","","","","","'","","","","","","",
-            "","","","","","|","","","","","","","","","","",
-            "1","","","","","","","","","2","","","3","","","",
-            "","","1/4","1/2","3/4","ˆ","‡","‰","‹","Š","Œ","","","Ž","","‘",
-            "“","","’","","”","•","","–","L","","","","˜","—","™","›",
-            "š","","","œ","ž","","Ÿ","y","l","","","","P",""," "," "
-        };
-
-    static const char*       Macintosh_to_Next[256]=
-        {
-            "\000","\001","\002","\003","\004","\005","\006","\007",
-            "\010","\011","\012","\013","\014","\015","\016","\017",
-            "\020","\021","\022","\023","\024","\025","\026","\027",
-            "\030","\031","\032","\033","\034","\035","\036","\037",
-            " ","!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/",
-            "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?",
-            "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
-            "P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_",
-            "`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",
-            "p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","",
-            "…","†","‡","‰","‘","–","š","","","","","","","","","",
-            "","","","","","","","","","","","","","","","",
-            "","","","","","","","","","",NIL,"","",NIL,"","",
-            NIL,"",NIL,NIL,"","","",NIL,NIL,NIL,NIL,"","",NIL,"","",
-            "","","",NIL,"",NIL,NIL,"","","","€","","„","•","","",
-            "","","","","`","'","Ÿ",NIL,"",NIL,"","","","","","",
-            "","","","","","ƒ","Š","‚","‹","ˆ","","Ž","","Œ","“","”",
-            NIL,"’","˜","™","—","","","","","","","","","","",""
-        };
-
-    static const char*       Macintosh_to_Next_Approximative[256]=
-        {
-            "\000","\001","\002","\003","\004","\005","\006","\007",
-            "\010","\011","\012","\013","\014","\015","\016","\017",
-            "\020","\021","\022","\023","\024","\025","\026","\027",
-            "\030","\031","\032","\033","\034","\035","\036","\037",
-            " ","!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/",
-            "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?",
-            "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
-            "P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_",
-            "`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",
-            "p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","",
-            "…","†","‡","‰","‘","–","š","","","","","","","","","",
-            "","","","","","","","","","","","","","","","",
-            "","","","","","","","","","","TM","","","#","","",
-            "infinity","","<=",">=","","","","SIGMA",
-            "PI","pi","Intergral","","","OMEGA","","",
-            "","","","Root","","Approximative","DELTA","",
-            "","","€","","„","•","","",
-            "","","","","`","'","Ÿ","<>","","Y","","","","","","",
-            "","","","","","ƒ","Š","‚","‹","ˆ","","Ž","","Œ","“","”",
-            "Apple","’","˜","™","—","","","","","","","","","","",""
-        };
-
-

-#endif
-
-    typedef char        SmallStringT[4];
+typedef char        SmallStringT[4];

-    SmallStringT    linefeed[5/* toMac..toNone */]={{ASCII_CR,0},{ASCII_LF,0},{ASCII_CR,ASCII_LF,0},{ASCII_LF,ASCII_CR,0},{0}};
-    BOOLEAN         removebs;
-    BOOLEAN         removedel;
-    INT32           converto;
+SmallStringT    linefeed[5/* toMac..toNone */]={{ASCII_CR,0},{ASCII_LF,0},{ASCII_CR,ASCII_LF,0},{ASCII_LF,ASCII_CR,0},{0}};
+BOOLEAN         removebs;
+BOOLEAN         removedel;
+INT32           converto;

+
+#if 0
+static INT32 skip(char* line,INT32 current)
+{
+    INT32           count;

-    static INT32 skip(char* line,INT32 current)
-    {
-            INT32           count;
-
-        count=0;
-        while((current>=0)&&((removebs&&(line[current]==ASCII_BS))
-                            ||(removedel&&(line[current]==ASCII_DEL)))){
+    count=0;
+    while((current>=0)&&((removebs&&(line[current]==ASCII_BS))
+                         ||(removedel&&(line[current]==ASCII_DEL)))){
+        current--;
+        count++;
+    }
+    while((current>=0)&&(count>0)){
+        /* the first time, line[current]!=ASCII_BS */
+        if((removebs&&(line[current]==ASCII_BS))
+           ||(removedel&&(line[current]==ASCII_DEL))){
+            current=skip(line,current);
+        }else{
             current--;
-            count++;
-        }
-        while((current>=0)&&(count>0)){
-            /* the first time, line[current]!=ASCII_BS */
-            if((removebs&&(line[current]==ASCII_BS))
-                            ||(removedel&&(line[current]==ASCII_DEL))){
-                current=skip(line,current);
-            }else{
-                current--;
-                count--;
-            }
+            count--;
         }
-        return(current);
-    }/*skip*/
+    }
+    return(current);
+}/*skip*/
+#endif

 #if 0
-    static INT32 old_copytoend(char* line,INT32 length)
-        /*
-            POST:       for each i in copytoend(@@line,length,count)
-                        to length-1, line[i]#ASCII_BS
-        */
-    {
-            INT32           current;
-            INT32           destination;
+static INT32 old_copytoend(char* line,INT32 length)
+/*
+  POST:       for each i in copytoend(@@line,length,count)
+  to length-1, line[i]#ASCII_BS
+*/
+{
+    INT32           current;
+    INT32           destination;

-        destination=length;
-        current=length-1;
-        while(current>=0){
-            if((removebs&&(line[current]==ASCII_BS))
-            ||(removedel&&(line[current]==ASCII_DEL))){
-                current=skip(line,current);
-            }else{
-                destination--;
-                line[destination]=line[current/* current-1 ???? */];
-                current--;
-            }
+    destination=length;
+    current=length-1;
+    while(current>=0){
+        if((removebs&&(line[current]==ASCII_BS))
+           ||(removedel&&(line[current]==ASCII_DEL))){
+            current=skip(line,current);
+        }else{
+            destination--;
+            line[destination]=line[current/* current-1 ???? */];
+            current--;
         }
-        return(destination);
-    }/*copytoend*/
+    }
+    return(destination);
+}/*copytoend*/
 #endif

-    static INT32 copytobegin(char* line,INT32 length)
-        /*
-            POST:   for each i in 0 to copytobegin(@@line,length,count)-1,
-                        line[i]#ASCII_BS
-        */
-    {
-            INT32           current;
-            INT32           destination;
+static INT32 copytobegin(char* line,INT32 length)
+/*
+  POST:   for each i in 0 to copytobegin(@@line,length,count)-1,
+  line[i]#ASCII_BS
+*/
+{
+    INT32           current;
+    INT32           destination;

-        current=0;
-        destination=0;
-        while(current<length){
-            if((removebs&&(line[current]==ASCII_BS))
-            ||(removedel&&(line[current]==ASCII_DEL))){
-                if(destination>0){
-                    destination--;
-                }
-            }else{
-                line[destination]=line[current];
-                destination++;
+    current=0;
+    destination=0;
+    while(current<length){
+        if((removebs&&(line[current]==ASCII_BS))
+           ||(removedel&&(line[current]==ASCII_DEL))){
+            if(destination>0){
+                destination--;
             }
-            current++;
-        }
-        return(destination);
-    }/*copytobegin*/
+        }else{
+            line[destination]=line[current];
+            destination++;
+        }
+        current++;
+    }
+    return(destination);
+}/*copytobegin*/


 #define     BufSize     (128*1024)

-    static char            inbuf[BufSize];
-    static char            outbuf[BufSize];
-    static CARD32          inmark;
-    static CARD32          inlen;
-    static CARD32          outlen;
+static char            inbuf[BufSize];
+static char            outbuf[BufSize];
+static CARD32          inmark;
+static CARD32          inlen;
+static CARD32          outlen;


-    static void initbufs(void)
-    {
-        inmark=0;
-        inlen=0;
-        outlen=0;
-    }/*initbufs*/
+static void initbufs(void)
+{
+    inmark=0;
+    inlen=0;
+    outlen=0;
+}/*initbufs*/


-    static INT32 getline(FILE* in,char** line,INT32* len)
-        /*
-            PRE:        NOT feof(in) OR (inmark<inlen)
-            POST:       *line points to the first character of the next line.
-                        *len is the number of character in this next line.
-        */
-    {
-            INT32           start;
-            INT32           err;
+static INT32 lc_getline(FILE* in,char** line,INT32* len)
+/*
+  PRE:        NOT feof(in) OR (inmark<inlen)
+  POST:       *line points to the first character of the next line.
+  *len is the number of character in this next line.
+  */
+{
+    INT32           start;
+    INT32           err;

-        start=inmark;
-        *line=inbuf+inmark;
+    start=(INT32)inmark;
+    *line=inbuf+inmark;
+    while((inmark<inlen)&&(inbuf[inmark]!=ASCII_CR)
+          &&(inbuf[inmark]!=ASCII_LF)){
+        inmark++;
+    }
+    if(inmark>=inlen){
+        inlen-=(CARD32)start;
+        /* inlen = number of byte remaining in the buffer ; inlen << BufSize */
+        if(inlen>0){
+            strncpy(inbuf,inbuf+start,inlen);
+        }
+        clearerr(in);
+        inlen+=(CARD32)fread(inbuf+inlen,1,BufSize-inlen,in);
+        err=ferror(in);
+        if(err!=0){
+            fprintf(stderr,"error in lc_getline\n");
+            return(err);
+        }
+        inmark=0;
+        start=(INT32)inmark;
+        *line=inbuf;
         while((inmark<inlen)&&(inbuf[inmark]!=ASCII_CR)
-                &&(inbuf[inmark]!=ASCII_LF)){
+              &&(inbuf[inmark]!=ASCII_LF)){
             inmark++;
         }
-        if(inmark>=inlen){
-            inlen-=start;
-        /* inlen = number of byte remaining in the buffer ; inlen << BufSize */
-            if(inlen>0){
-                strncpy(inbuf,inbuf+start,inlen);
-            }
-            clearerr(in);
-            inlen+=fread(inbuf+inlen,1,BufSize-inlen,in);
-            err=ferror(in);
-            if(err!=0){
-                fprintf(stderr,"error in getline\n");
-                return(err);
-            }
-            inmark=0;
-            start=inmark;
-            *line=inbuf;
-            while((inmark<inlen)&&(inbuf[inmark]!=ASCII_CR)
-                    &&(inbuf[inmark]!=ASCII_LF)){
-                inmark++;
-            }
-        }
-        *len=inmark-start;
-        linefeed[toNone][0]=inbuf[inmark];
-        linefeed[toNone][1]=inbuf[inmark+1];
-        if(inmark+1<inlen){
-            if(inbuf[inmark]==ASCII_CR){
-                if(inbuf[inmark+1]==ASCII_LF){
-                    inmark+=2;
-                    linefeed[toNone][2]=0;
-                }else{
-                    inmark+=1;
-                    linefeed[toNone][1]=0;
-                }
-            }else if(inbuf[inmark]==ASCII_LF){
-                if(inbuf[inmark+1]==ASCII_CR){
-                    inmark+=2;
-                    linefeed[toNone][2]=0;
-                }else{
-                    inmark+=1;
-                    linefeed[toNone][1]=0;
-                }
+    }
+    *len=(INT32)inmark-start;
+    linefeed[toNone][0]=inbuf[inmark];
+    linefeed[toNone][1]=inbuf[inmark+1];
+    if(inmark+1<inlen){
+        if(inbuf[inmark]==ASCII_CR){
+            if(inbuf[inmark+1]==ASCII_LF){
+                inmark+=2;
+                linefeed[toNone][2]=0;
             }else{
-                /* should not occur ?!? */
+                inmark+=1;
+                linefeed[toNone][1]=0;
+            }
+        }else if(inbuf[inmark]==ASCII_LF){
+            if(inbuf[inmark+1]==ASCII_CR){
+                inmark+=2;
                 linefeed[toNone][2]=0;
+            }else{
+                inmark+=1;
+                linefeed[toNone][1]=0;
             }
-        }else if(inmark<inlen){
-            /* inbuf[inmark] is ASCII_CR or ASCII_LF */
-            linefeed[toNone][1]=0;
-            inmark++;
+        }else{
+            /* should not occur ?!? */
+            linefeed[toNone][2]=0;
         }
-        return(0);
-    }/*getline*/
+    }else if(inmark<inlen){
+        /* inbuf[inmark] is ASCII_CR or ASCII_LF */
+        linefeed[toNone][1]=0;
+        inmark++;
+    }
+    return(0);
+}/*lc_getline*/


-    static INT32 eof(FILE* fd)
-    {
-        return((feof(fd))&&(inmark>=inlen));
-    }/*eof*/
+static INT32 eof(FILE* fd)
+{
+    return((feof(fd))&&(inmark>=inlen));
+}/*eof*/


-    static INT32 flush(FILE* out)
-    {
-        clearerr(out);
-        if(outlen>0){
-            fwrite(outbuf,1,outlen,out);
-        }
-        outlen=0;
-        return(ferror(out));
-    }/*flush*/
+static INT32 flush(FILE* out)
+{
+    clearerr(out);
+    if(outlen>0){
+        size_t r=fwrite(outbuf,1,outlen,out);
+        (void)r;
+    }
+    outlen=0;
+    return(ferror(out));
+}/*flush*/


-    static INT32 putstr(FILE* out,char* str,CARD32 len)
-    {
-            char*       dst;
-            INT32       err;
+static INT32 putstr(FILE* out,char* str,CARD32 len)
+{
+    char*       dst;
+    INT32       err;

-        if(len>0){
-            if(outlen+len>BufSize){
-                err=flush(out);
-                if(err!=0){
-                    fprintf(stderr,"error in putstr\n");
-                    return(err);
-                }
+    if(len>0){
+        if(outlen+len>BufSize){
+            err=flush(out);
+            if(err!=0){
+                fprintf(stderr,"error in putstr\n");
+                return(err);
             }
-            dst=outbuf+outlen;
-            strncpy(dst,str,len);
-            outlen+=len;
         }
-        return(0);
-    }/*putstr*/
+        dst=outbuf+outlen;
+        strncpy(dst,str,len);
+        outlen+=len;
+    }
+    return(0);
+}/*putstr*/




-    static INT32 convert(FILE* in,FILE* out)
-    {
-        INT32           length;
-        INT32           err;
-        char*           line;
-        char*           lf;
-        CARD32          lfsize;
+static INT32 convert(FILE* in,FILE* out)
+{
+    INT32           length;
+    INT32           err;
+    char*           line;
+    char*           lf;
+    CARD32          lfsize;

-        lf=linefeed[converto];
-        lfsize=strlen(lf);
-        initbufs();
-        while(!eof(in)){
-            err=getline(in,&line,&length);
-            if(err!=0){
-                printf("error in convert (getline)\n");
-                return(err);
-            }
-            if(removebs||removedel){
-                length=copytobegin(line,length);
-            }
-            err=putstr(out,line,(unsigned)length);
-            if(err!=0){
-                printf("error in convert (putstr)\n");
-                return(err);
-            }
-            err=putstr(out,lf,lfsize);
-            if(err!=0){
-                return(err);
-            }
+    lf=linefeed[converto];
+    lfsize=(CARD32)strlen(lf);
+    initbufs();
+    while(!eof(in)){
+        err=lc_getline(in,&line,&length);
+        if(err!=0){
+            printf("error in convert (lc_getline)\n");
+            return(err);
         }
-        flush(out);
-        return(0);
-    }/*convert*/
+        if(removebs||removedel){
+            length=copytobegin(line,length);
+        }
+        err=putstr(out,line,(unsigned)length);
+        if(err!=0){
+            printf("error in convert (putstr)\n");
+            return(err);
+        }
+        err=putstr(out,lf,lfsize);
+        if(err!=0){
+            return(err);
+        }
+    }
+    flush(out);
+    return(0);
+}/*convert*/


-    static void usage(char* pname)
-    {
-        printf("# %s usage:\n   %s -[b](m|u|p|c) file... | < file > file\n",pname,pname);
-    }/*usage*/
+static void usage(char* pname)
+{
+    printf("# %s usage:\n   %s -[b](m|u|p|c) file... | < file > file\n",pname,pname);
+}/*usage*/


-    static void printerr(INT32 err)
-    {
-        fprintf(stderr,"Error: %ld G%sH\n",err,strerror(err));
-    }/*printerr*/
+static void printerr(INT32 err)
+{
+    fprintf(stderr,"Error: %"FMT_INT32" G%sH\n",err,strerror(err));
+}/*printerr*/


-    static void MakeTempName(char* src,char* temp)
-        /*
-            PRE:        The number of file in the file system < MAXINT32
-        */
-    {
-            INT32           n;
-            struct stat     status;
+static void MakeTempName(char* src,char* temp)
+/*
+  PRE:        The number of file in the file system < MAXINT32
+*/
+{
+    INT32           n;
+    struct stat     status;

-        n=-1;
-        do{
-            n++;
-            sprintf(temp,"%s.%ld",src,n);
-        }while(lstat(temp,&status)==0);
-    }/*MakeTempName*/
+    n=-1;
+    do{
+        n++;
+        sprintf(temp,"%s.%"FMT_INT32,src,n);
+    }while(lstat(temp,&status)==0);
+}/*MakeTempName*/


-    static const char* FileType(unsigned int mode)
-    {
-        switch(mode&S_IFMT){
-        case S_IFDIR:   return("directory");
-        case S_IFCHR:   return("character special device");
-        case S_IFBLK:   return("block special device");
-        case S_IFREG:   return("regular file");
-        case S_IFLNK:   return("symbolic link");
-        case S_IFSOCK:  return("socket");
-        default:        return("something of unknown type");
-        }
-    }/*FileType*/
+static const char* FileType(unsigned int mode)
+{
+    switch(mode&S_IFMT){
+    case S_IFDIR:   return("directory");
+    case S_IFCHR:   return("character special device");
+    case S_IFBLK:   return("block special device");
+    case S_IFREG:   return("regular file");
+    case S_IFLNK:   return("symbolic link");
+    case S_IFSOCK:  return("socket");
+    default:        return("something of unknown type");
+    }
+}/*FileType*/


 int main(int argc,char* argv[])
 {
-        FILE*           fin;
-        FILE*           fout;
-        INT32           i;
-        INT32           j;
-        INT32           maxlinesize=MAX_INT32;
-        INT32           err;
-        char*           opt;
-        struct stat     filestatus;
-        char            OutputName[BUFSIZ];
-        char            TempLink[BUFSIZ];
-        BOOLEAN         nooption;
-        BOOLEAN         filestatus_is_valid;
+    FILE*           fin;
+    FILE*           fout;
+    INT32           i;
+    INT32           j;
+    INT32           maxlinesize=MAX_INT32;
+    INT32           err;
+    char*           opt;
+    struct stat     filestatus;
+    char            OutputName[BUFSIZ];
+    char            TempLink[BUFSIZ];
+    BOOLEAN         nooption;
+    BOOLEAN         filestatus_is_valid;

     nooption=TRUE;
     removedel=FALSE;
@@ -611,9 +526,10 @@ int main(int argc,char* argv[])
                                 err=link(OutputName,argv[i]);
                                 if(err==0){
                                     if(filestatus_is_valid){
-                                        chown(argv[i],filestatus.st_uid,
-                                                        filestatus.st_gid);
-                                        chmod(argv[i],(short int)(filestatus.st_mode));
+                                        int r=chown(argv[i],filestatus.st_uid,
+                                                    filestatus.st_gid);
+                                        (void)r;
+                                        chmod(argv[i],filestatus.st_mode);
                                     }
                                     unlink(TempLink);
                                 }else{
@@ -650,4 +566,4 @@ int main(int argc,char* argv[])
     return(0);
 }/*main*/

-/*** lc.c                             --                     --          ***/
+/**** THE END ****/
diff --git a/ascii-utilities/sources/parity.c b/ascii-utilities/sources/parity.c
index 5ef0ae0..d7c61d8 100644
--- a/ascii-utilities/sources/parity.c
+++ b/ascii-utilities/sources/parity.c
@@ -19,7 +19,7 @@ BUGS
       binary data...
 LEGAL
     GPL
-    Copyright Pascal J. Bourguignon 1983 - 2000
+    Copyright Pascal J. Bourguignon 1983 - 2011

     This file is part of the PJB Ascii Utilities Suite.

@@ -61,339 +61,339 @@ typedef enum {
 } StatusT;


-    static void usage(const char* pname)
-    {
-        int len=strlen(pname);
-        fprintf(stderr,
-    "%s usage:\n"
-    "    %s [-q|--quiet]\n"
-    "    %*s [-c|--check|-f|--find|-t<err>|--flag=<err>|-s|--set] \n"
-    "    %*s [-e|--even|-o|--odd|-m|--mark|-n|--none] \n"
-    "    %*s < input > output\n"
-    "  check:   check and return status code.\n"
-    "  flag:    check and replace in output erroneous characters with <err>\n"
-    "  find:    tells which parity was used on input.\n"
-    "  set:     writes out bytes with the parity recomputed.\n"
-    "  default: output stream = input stream with specified parity (--set).\n"
-    "  default parity is none (--none).\n"
-    "\n",
-                pname,pname,len," ",len," ",len," ");
-    }/*usage*/
-
-
-    static const char* basename(const char* pname)
-    {
-        const char* bname=rindex(pname,'/');
-        if(bname==0){
-            return(pname);
-        }else{
-            return(bname+1);
-        }
-    }/*basename*/
+static void usage(const char* pname)
+{
+    int len=(int)strlen(pname);
+    fprintf(stderr,
+            "%s usage:\n"
+            "    %s [-q|--quiet]\n"
+            "    %*s [-c|--check|-f|--find|-t<err>|--flag=<err>|-s|--set] \n"
+            "    %*s [-e|--even|-o|--odd|-m|--mark|-n|--none] \n"
+            "    %*s < input > output\n"
+            "  check:   check and return status code.\n"
+            "  flag:    check and replace in output erroneous characters with <err>\n"
+            "  find:    tells which parity was used on input.\n"
+            "  set:     writes out bytes with the parity recomputed.\n"
+            "  default: output stream = input stream with specified parity (--set).\n"
+            "  default parity is none (--none).\n"
+            "\n",
+            pname,pname,len," ",len," ",len," ");
+}/*usage*/
+
+
+static const char* basename(const char* pname)
+{
+    const char* bname=rindex(pname,'/');
+    if(bname==0){
+        return(pname);
+    }else{
+        return(bname+1);
+    }
+}/*basename*/


-    static struct {
-        unsigned char even;
-        unsigned char odd;
-    }   parities[128];
+static struct {
+    unsigned char even;
+    unsigned char odd;
+}   parities[128];



-    static void parity_compute_parities(unsigned int/*char*/ c,
-                                        unsigned char* even,unsigned char* odd)
-    {
-        unsigned char currentBit;
-        unsigned char parityBit=0;
-        for(currentBit=1;currentBit<128;currentBit<<=1){
-            if((c&currentBit)!=0){
-                parityBit^=1;
-            }
-        }
-        if(parityBit){
-            (*even)=(c&0x7f)|0x80;
-            (*odd)=(c&0x7f);
-        }else{
-            (*odd)=(c&0x7f)|0x80;
-            (*even)=(c&0x7f);
+static void parity_compute_parities(unsigned int/*char*/ c,
+                                    unsigned char* even,unsigned char* odd)
+{
+    unsigned char currentBit;
+    unsigned char parityBit=0;
+    for(currentBit=(unsigned char)1;currentBit<(unsigned char)128;currentBit=(unsigned char)(currentBit<<1)){
+        if((c&currentBit)!=0){
+            parityBit^=1;
         }
-    }/*parity_compute_parities*/
+    }
+    if(parityBit){
+        (*even)=(unsigned char)((c&0x7f)|0x80);
+        (*odd)=(unsigned char)(c&0x7f);
+    }else{
+        (*odd)=(unsigned char)((c&0x7f)|0x80);
+        (*even)=(unsigned char)(c&0x7f);
+    }
+}/*parity_compute_parities*/


-    static void parity_initialize(void)
-    {
-        unsigned int c;
-        for(c=0;c<128;c++){
-            parity_compute_parities(c,&(parities[c].even),&(parities[c].odd));
-        }
-    }/*parity_initialize*/
-
-
-    static short parity_byte_check(unsigned int/*char*/ c,ParityT parity)
-    {
-        switch(parity){
-        case Parity_None:
-            return((c&0x80)==0);
-        case Parity_Even:
-            return(c==parities[c&0x7f].even);
-        case Parity_Odd:
-            return(c==parities[c&0x7f].odd);
-        case Parity_Mark:
-            return((c&0x80)!=0);
-        default:
-            fprintf(stderr,"Unknown parity %d, aborting.\n",parity);
-            exit(Status_InternalError);
-        }
-    }/*parity_byte_check*/
-
-
-   static  unsigned char parity_byte_set(unsigned int/*char*/ c,ParityT parity)
-    {
-        switch(parity){
-        case Parity_None:
-            return(c&0x7f);
-        case Parity_Even:
-            return(parities[c&0x7f].even);
-        case Parity_Odd:
-            return(parities[c&0x7f].odd);
-        case Parity_Mark:
-            return((c&0x7f)|0x80);
-        default:
-            fprintf(stderr,"Unknown parity %d, aborting.\n",parity);
-            exit(Status_InternalError);
-        }
-    }/*parity_byte_set*/
+static void parity_initialize(void)
+{
+    unsigned int c;
+    for(c=0;c<128;c++){
+        parity_compute_parities(c,&(parities[c].even),&(parities[c].odd));
+    }
+}/*parity_initialize*/


+static short parity_byte_check(unsigned int/*char*/ c,ParityT parity)
+{
+    switch(parity){
+    case Parity_None:
+        return((c&0x80)==0);
+    case Parity_Even:
+        return(c==parities[c&0x7f].even);
+    case Parity_Odd:
+        return(c==parities[c&0x7f].odd);
+    case Parity_Mark:
+        return((c&0x80)!=0);
+    default:
+        fprintf(stderr,"Unknown parity %d, aborting.\n",parity);
+        exit(Status_InternalError);
+    }
+}/*parity_byte_check*/

-    static int parity_byte_find(unsigned int/*char*/ c)
-        /*
-          00 : none or even
-          01 : none or odd
-          10 : mark or even
-          11 : mark or odd
-        */
-    {
-        int result=0;
-        if((c&0x80)!=0){
-            result|=2;
-        }
-        if(c==parities[c&0x7f].odd){
-            result|=1;
-        }
-        return(result);
-    }/*parity_byte_find*/
-
-
-
-    static StatusT parity_check(FILE* input,FILE* output,ParityT parity,
-                                int quiet)
-    {
-        int c;
-        int count=0;
-        while(EOF!=(c=fgetc(input))){
-            if(!parity_byte_check((unsigned)c,parity)){
-                if(!quiet){
-                    fprintf(output,"Byte #%d should be %02x instead of %02x\n",
-                            count,parity_byte_set((unsigned)c,parity),c);
-                }
-                return(Status_ParityError);
+
+static  unsigned char parity_byte_set(unsigned int/*char*/ c,ParityT parity)
+{
+    switch(parity){
+    case Parity_None:
+        return(c&0x7f);
+    case Parity_Even:
+        return(parities[c&0x7f].even);
+    case Parity_Odd:
+        return(parities[c&0x7f].odd);
+    case Parity_Mark:
+        return((unsigned char)((c&0x7f)|0x80));
+    default:
+        fprintf(stderr,"Unknown parity %d, aborting.\n",parity);
+        exit(Status_InternalError);
+    }
+}/*parity_byte_set*/
+
+
+
+static int parity_byte_find(unsigned int/*char*/ c)
+/*
+  00 : none or even
+  01 : none or odd
+  10 : mark or even
+  11 : mark or odd
+*/
+{
+    int result=0;
+    if((c&0x80)!=0){
+        result|=2;
+    }
+    if(c==parities[c&0x7f].odd){
+        result|=1;
+    }
+    return(result);
+}/*parity_byte_find*/
+
+
+
+static StatusT parity_check(FILE* input,FILE* output,ParityT parity,
+                            int quiet)
+{
+    int c;
+    int count=0;
+    while(EOF!=(c=fgetc(input))){
+        if(!parity_byte_check((unsigned)c,parity)){
+            if(!quiet){
+                fprintf(output,"Byte #%d should be %02x instead of %02x\n",
+                        count,parity_byte_set((unsigned)c,parity),c);
             }
-            count++;
+            return(Status_ParityError);
         }
-        return(Status_NoError);
-    }/*parity_check*/
+        count++;
+    }
+    return(Status_NoError);
+}/*parity_check*/

 #if 0
-    static void swap_int(int* i,int* j)
-    {
-        int t=(*i);
-        (*i)=(*j);
-        (*j)=t;
-    }/*swap_int*/
+static void swap_int(int* i,int* j)
+{
+    int t=(*i);
+    (*i)=(*j);
+    (*j)=t;
+}/*swap_int*/
 #endif

-    static StatusT parity_find(FILE* input,FILE* output,ParityT parity,
-                               int quiet)
-    {
-        int my_parities[4]={0};
-        int c;
-        int total=0;
-        int highPercentage;
-        int lowPercentage;
-        int errors;
-        StatusT status;
-
-        while(EOF!=(c=fgetc(input))){
-            my_parities[parity_byte_find((unsigned)c)]++;
-        }
+static StatusT parity_find(FILE* input,FILE* output,ParityT parity,
+                           int quiet)
+{
+    int my_parities[4]={0};
+    int c;
+    int total=0;
+    int highPercentage;
+    int lowPercentage;
+    int errors;
+    StatusT status;
+
+    while(EOF!=(c=fgetc(input))){
+        my_parities[parity_byte_find((unsigned)c)]++;
+    }

-        /* Yeah ! It's a BUBBLE sort here ! But it should not lose more
-           than one comparizon... */
-        /*
-        int order[4]={0,1,2,3};
-        int i,j;
-        for(i=0;i<3;i++){
-            for(j=i+1;j<4;j++){
-                if(my_parities[order[i]]<my_parities[order[j]]){
-                    int t=order[i];
-                    order[i]=order[j];
-                    order[j]=t;
-                }
-            }
-        }
-        */
-
-        /*
-          00 : none or even
-          01 : none or odd
-          10 : mark or even
-          11 : mark or odd
-        */
-
-        /*
-          100   0   0   0   -> good 7-bit stream with parity
-           50  50   0   0   -> good 7-bit stream with parity
-           80   7   7   6   -> 7-bit stream with parity and errors
-           40  40  20   0   -> 7-bit stream with parity and errors
-           40  40  10  10   -> 7-bit stream with parity and errors
-
-           40  39  11  10  \
-           39  39  11  11   \
-           33  33  33   0    > ?
-           31  31  29   9   /
-           31  30  30   9  /
-
-           30  30  30  10   \
-           30  23  23  23    > 8-bit binary stream (without parity)
-           25  25  25  25   /
-        */
-
-        total=my_parities[0]+my_parities[1]+my_parities[2]+my_parities[3];
-        highPercentage=total*85/100;
-        lowPercentage=total*30/100;
-
-
-        if(my_parities[0]+my_parities[1]>=highPercentage){
-            status=Status_ParityNone;
-            errors=my_parities[2]+my_parities[3];
-        }else if(my_parities[0]+my_parities[2]>=highPercentage){
-            status=Status_ParityEven;
-            errors=my_parities[1]+my_parities[3];
-        }else if(my_parities[2]+my_parities[3]>=highPercentage){
-            status=Status_ParityMark;
-            errors=my_parities[0]+my_parities[1];
-        }else if(my_parities[1]+my_parities[3]>=highPercentage){
-            status=Status_ParityOdd;
-            errors=my_parities[0]+my_parities[2];
-        }else if(my_parities[0]+my_parities[3]>=highPercentage){
-            /* none or even + mark or odd */
-            status=Status_ParityOdd;
-            errors=my_parities[1]+my_parities[2];
-        }else if(my_parities[1]+my_parities[2]>=highPercentage){
-            /*  none or odd + mark or even */
-            status=Status_ParityOdd;
-            errors=my_parities[0]+my_parities[3];
-        }else if((my_parities[0]<lowPercentage)
-                 &&(my_parities[1]<lowPercentage)
-                 &&(my_parities[2]<lowPercentage)
-                 &&(my_parities[3]<lowPercentage)){
-            status=Status_EightBitStream;
-            errors=0;
-        }else{
-            status=Status_Undetermined;
-            errors=0;
-        }
+    /* Yeah ! It's a BUBBLE sort here ! But it should not lose more
+       than one comparizon... */
+    /*
+      int order[4]={0,1,2,3};
+      int i,j;
+      for(i=0;i<3;i++){
+      for(j=i+1;j<4;j++){
+      if(my_parities[order[i]]<my_parities[order[j]]){
+      int t=order[i];
+      order[i]=order[j];
+      order[j]=t;
+      }
+      }
+      }
+    */
+
+    /*
+      00 : none or even
+      01 : none or odd
+      10 : mark or even
+      11 : mark or odd
+    */
+
+    /*
+      100   0   0   0   -> good 7-bit stream with parity
+      50  50   0   0   -> good 7-bit stream with parity
+      80   7   7   6   -> 7-bit stream with parity and errors
+      40  40  20   0   -> 7-bit stream with parity and errors
+      40  40  10  10   -> 7-bit stream with parity and errors
+
+      40  39  11  10  \
+      39  39  11  11   \
+      33  33  33   0    > ?
+      31  31  29   9   /
+      31  30  30   9  /
+
+      30  30  30  10   \
+      30  23  23  23    > 8-bit binary stream (without parity)
+      25  25  25  25   /
+    */
+
+    total=my_parities[0]+my_parities[1]+my_parities[2]+my_parities[3];
+    highPercentage=total*85/100;
+    lowPercentage=total*30/100;
+
+
+    if(my_parities[0]+my_parities[1]>=highPercentage){
+        status=Status_ParityNone;
+        errors=my_parities[2]+my_parities[3];
+    }else if(my_parities[0]+my_parities[2]>=highPercentage){
+        status=Status_ParityEven;
+        errors=my_parities[1]+my_parities[3];
+    }else if(my_parities[2]+my_parities[3]>=highPercentage){
+        status=Status_ParityMark;
+        errors=my_parities[0]+my_parities[1];
+    }else if(my_parities[1]+my_parities[3]>=highPercentage){
+        status=Status_ParityOdd;
+        errors=my_parities[0]+my_parities[2];
+    }else if(my_parities[0]+my_parities[3]>=highPercentage){
+        /* none or even + mark or odd */
+        status=Status_ParityOdd;
+        errors=my_parities[1]+my_parities[2];
+    }else if(my_parities[1]+my_parities[2]>=highPercentage){
+        /*  none or odd + mark or even */
+        status=Status_ParityOdd;
+        errors=my_parities[0]+my_parities[3];
+    }else if((my_parities[0]<lowPercentage)
+             &&(my_parities[1]<lowPercentage)
+             &&(my_parities[2]<lowPercentage)
+             &&(my_parities[3]<lowPercentage)){
+        status=Status_EightBitStream;
+        errors=0;
+    }else{
+        status=Status_Undetermined;
+        errors=0;
+    }

-         if(!quiet){
-            fprintf(output,"%10d bytes are of parity none or even\n",
-                    my_parities[0]);
-            fprintf(output,"%10d bytes are of parity none or odd\n",
-                    my_parities[1]);
-            fprintf(output,"%10d bytes are of parity mark or even\n",
-                    my_parities[2]);
-            fprintf(output,"%10d bytes are of parity mark or odd\n",
-                    my_parities[3]);
-            fprintf(output,"\n");
-
-            switch(status){
-            case Status_ParityNone:
-                fprintf(output,
-                        "Input is 7-bit with parity None (%3d %% errors)\n",
-                        100*errors/total);
-                break;
-            case Status_ParityEven:
-                fprintf(output,
-                        "Input is 7-bit with parity Even (%3d %% errors)\n",
-                        100*errors/total);
-                break;
-            case Status_ParityOdd:
-                fprintf(output,
-                        "Input is 7-bit with parity Odd (%3d %% errors)\n",
-                        100*errors/total);
-                break;
-            case Status_ParityMark:
-                fprintf(output,
-                        "Input is 7-bit with parity Mark (%3d %% errors)\n",
-                        100*errors/total);
-                break;
-            case Status_EightBitStream:
-                fprintf(output,
-                        "Input is 8-bit without parity   (%3d %% errors)\n",
-                        100*errors/total);
-                break;
-            case Status_Undetermined:
-                fprintf(output,
-                        "Input is undertermined parity  \n");
-                break;
-            default:
-                fprintf(stderr,"Unexpected status %d, aborting.\n",status);
-                exit(Status_InternalError);
-            }
-            return(Status_NoError);
-         }else{
-             return(status);
-         }
-    }/*parity_find*/
-
-
-    static StatusT parity_flag(FILE* input,FILE* output,ParityT parity,
-                               int quiet,const char* err)
-    {
-        int c;
-        int total=0;
-        int errors=0;
-        int errlen=strlen(err);
-
-        while(EOF!=(c=fgetc(input))){
-            if(c==parity_byte_find((unsigned)c)){
-                fputc(c,output);
-            }else{
-                fputs(err,output);
-                errors++;
-            }
-            total++;
+    if(!quiet){
+        fprintf(output,"%10d bytes are of parity none or even\n",
+                my_parities[0]);
+        fprintf(output,"%10d bytes are of parity none or odd\n",
+                my_parities[1]);
+        fprintf(output,"%10d bytes are of parity mark or even\n",
+                my_parities[2]);
+        fprintf(output,"%10d bytes are of parity mark or odd\n",
+                my_parities[3]);
+        fprintf(output,"\n");
+
+        switch(status){
+        case Status_ParityNone:
+            fprintf(output,
+                    "Input is 7-bit with parity None (%3d %% errors)\n",
+                    100*errors/total);
+            break;
+        case Status_ParityEven:
+            fprintf(output,
+                    "Input is 7-bit with parity Even (%3d %% errors)\n",
+                    100*errors/total);
+            break;
+        case Status_ParityOdd:
+            fprintf(output,
+                    "Input is 7-bit with parity Odd (%3d %% errors)\n",
+                    100*errors/total);
+            break;
+        case Status_ParityMark:
+            fprintf(output,
+                    "Input is 7-bit with parity Mark (%3d %% errors)\n",
+                    100*errors/total);
+            break;
+        case Status_EightBitStream:
+            fprintf(output,
+                    "Input is 8-bit without parity   (%3d %% errors)\n",
+                    100*errors/total);
+            break;
+        case Status_Undetermined:
+            fprintf(output,
+                    "Input is undertermined parity  \n");
+            break;
+        default:
+            fprintf(stderr,"Unexpected status %d, aborting.\n",status);
+            exit(Status_InternalError);
         }
-        if(!quiet){
-            fprintf(stderr,"%10d bytes read, %10d bytes written, %10d errors\n",
-                    total,total+(errlen-1)*errors,errors);
-            return(Status_NoError);
-        }else if(errors>0){
-            return(Status_ParityError);
+        return(Status_NoError);
+    }else{
+        return(status);
+    }
+}/*parity_find*/
+
+
+static StatusT parity_flag(FILE* input,FILE* output,ParityT parity,
+                           int quiet,const char* err)
+{
+    int c;
+    int total=0;
+    int errors=0;
+    int errlen=(int)strlen(err);
+
+    while(EOF!=(c=fgetc(input))){
+        if(c==parity_byte_find((unsigned)c)){
+            fputc(c,output);
         }else{
-            return(Status_NoError);
+            fputs(err,output);
+            errors++;
         }
-    }/*parity_flag*/
+        total++;
+    }
+    if(!quiet){
+        fprintf(stderr,"%10d bytes read, %10d bytes written, %10d errors\n",
+                total,total+(errlen-1)*errors,errors);
+        return(Status_NoError);
+    }else if(errors>0){
+        return(Status_ParityError);
+    }else{
+        return(Status_NoError);
+    }
+}/*parity_flag*/


-    static StatusT parity_set(FILE* input,FILE* output,ParityT parity)
-    {
-        int c;
+static StatusT parity_set(FILE* input,FILE* output,ParityT parity)
+{
+    int c;

-        while(EOF!=(c=fgetc(input))){
-            fputc(parity_byte_set((unsigned)c,parity),output);
-       }
-        return(Status_NoError);
-    }/*parity_set*/
+    while(EOF!=(c=fgetc(input))){
+        fputc(parity_byte_set((unsigned)c,parity),output);
+    }
+    return(Status_NoError);
+}/*parity_set*/


 int main(int argc,char* argv[])
@@ -461,4 +461,4 @@ int main(int argc,char* argv[])



-/*** parity.c                         -- 2003-12-01 03:33:04 -- pascal   ***/
+/**** THE END ****/
diff --git a/ascii-utilities/sources/randchar.c b/ascii-utilities/sources/randchar.c
index 0eca861..a34cd1b 100644
--- a/ascii-utilities/sources/randchar.c
+++ b/ascii-utilities/sources/randchar.c
@@ -56,7 +56,7 @@ MODIFICATIONS
     Added RCS keywords.

 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1994
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
@@ -77,188 +77,188 @@ LEGAL
 #include <BcImplementation.h>


-    static FILE*    randfile;
-    static CARD32   X[56];
-    static CARD32   save[56];
-    static BOOLEAN  copying;
+static FILE*    randfile;
+static CARD32   X[56];
+static CARD32   save[56];
+static BOOLEAN  copying;


-    static void CopyX(CARD32* from,CARD32* to)
-    {
-            INT16       i;
+static void CopyX(CARD32* from,CARD32* to)
+{
+    INT16       i;

-        i=0;
-        copying=TRUE;
-        while(i<56){
-            to[i]=from[i];
-            INC(i);
-        }
-        copying=FALSE;
-    }/*CopyX;*/
+    i=0;
+    copying=TRUE;
+    while(i<56){
+        to[i]=from[i];
+        INC(i);
+    }
+    copying=FALSE;
+}/*CopyX;*/


-    static void handler(int sig)
-    {
-        if(copying){
-            CopyX(&X[0],&save[0]);
-        }
-        BcRandom_save(randfile,save);
-        exit(0);
-    }/*handler;*/
+static void handler(int sig)
+{
+    if(copying){
+        CopyX(&X[0],&save[0]);
+    }
+    BcRandom_save(randfile,save);
+    exit(0);
+}/*handler;*/

-    static const char*  DefaultCharList=
-    " !\"#$%&'()*+,-./0123456789:;<=>?"
-    "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
-    "`abcdefghijklmnopqrstuvwxyz{|}~";
+static const char*  DefaultCharList=
+  " !\"#$%&'()*+,-./0123456789:;<=>?"
+  "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
+  "`abcdefghijklmnopqrstuvwxyz{|}~";

-    static char CharList[258];
-    static int  CharListCount;
-    static int  CharSet[256/32];
+static char CharList[258];
+static int  CharListCount;
+static int  CharSet[256/32];

 #define setinclude(set,bit)     ((set)[(bit)/32]|=(1<<((bit)%32)))
 #define setexclude(set,bit)     ((set)[(bit)/32]&=(~(1<<((bit)%32))))
 #define setcontains(set,bit)    (((set)[(bit)/32]&(1<<((bit)%32)))!=0)
-#define setempty(set)   \
-        {int setempty_i;\
-        for(setempty_i=sizeof(set)/sizeof(int)-1;setempty_i>=0;setempty_i--){\
-        (set)[setempty_i]=0;}}
+#define setempty(set)                                                   \
+    {int setempty_i;                                                    \
+        for(setempty_i=sizeof(set)/sizeof(int)-1;setempty_i>=0;setempty_i--){ \
+            (set)[setempty_i]=0;}}


 #define maxbuffer               (4096)

-    int main(int argc,char* argv[])
-    {
-        int         i;
-        char        buffer[maxbuffer];
-        long int    count=0;
-        int         linelength=78;
-        int         countmode=0;    /* 0 = infinite, 1 = characters, 2 = lines.*/
-        int         linemode=1;     /* 0 = no line, 1 = 78-char lines.*/
-        int         generate;
+int main(int argc,char* argv[])
+{
+    int         i;
+    char        buffer[maxbuffer];
+    long int    count=0;
+    int         linelength=78;
+    int         countmode=0;    /* 0 = infinite, 1 = characters, 2 = lines.*/
+    int         linemode=1;     /* 0 = no line, 1 = 78-char lines.*/
+    int         generate;


-        strcpy(CharList,DefaultCharList);
-        CharListCount=strlen(CharList);
-        setempty(CharSet);
+    strcpy(CharList,DefaultCharList);
+    CharListCount=(int)strlen(CharList);
+    setempty(CharSet);

-        for(i=1;i<argc;i++){
-            if(strcmp(argv[i],"-n")==0){
-                if(countmode!=2){
-                    linemode=0;
-                }
-            }else if((strcmp(argv[i],"-w")==0)&&(++i<argc)){
-                linelength=atoi(argv[i]);
-                if((linelength<=0)||(maxbuffer<linelength)){
-                    linelength=78;
-                }
-            }else if((strcmp(argv[i],"-l")==0)&&(++i<argc)){
-                linemode=1;
-                countmode=2;
-                count=atoi(argv[i]);
-            }else if((strcmp(argv[i],"-r")==0)&&(++i<argc-1)){
-                int     min,max,k;
-                min=atoi(argv[i++]);
-                max=atoi(argv[i]);
-                if(min>max){
-                    fprintf(stderr,"%s: range minimum %d (%s) cannot be greater"
-                            " than maximum %d (%s).\n",
-                            argv[0],min,argv[i-1],max,argv[i]);
-                    return(1);
-                }else if((min<0)||(255<max)){
-                    fprintf(stderr,"%s: range minimum %d (%s) and maximum "
-                            "%d (%s) must both belong to the [0, 255] range.\n",
-                            argv[0],min,argv[i-1],max,argv[i]);
-                    return(1);
-                }else{
-                    CharListCount=0;
-                    for(k=min;k<=max;k++){
-                        setinclude(CharSet,k);
-                    }
-                }
-            }else if((strcmp(argv[i],"-c")==0)&&(++i<argc)){
-                countmode=1;
-                count=atoi(argv[i]);
+    for(i=1;i<argc;i++){
+        if(strcmp(argv[i],"-n")==0){
+            if(countmode!=2){
+                linemode=0;
+            }
+        }else if((strcmp(argv[i],"-w")==0)&&(++i<argc)){
+            linelength=atoi(argv[i]);
+            if((linelength<=0)||(maxbuffer<linelength)){
+                linelength=78;
+            }
+        }else if((strcmp(argv[i],"-l")==0)&&(++i<argc)){
+            linemode=1;
+            countmode=2;
+            count=atoi(argv[i]);
+        }else if((strcmp(argv[i],"-r")==0)&&(++i<argc-1)){
+            int     min,max,k;
+            min=atoi(argv[i++]);
+            max=atoi(argv[i]);
+            if(min>max){
+                fprintf(stderr,"%s: range minimum %d (%s) cannot be greater"
+                        " than maximum %d (%s).\n",
+                        argv[0],min,argv[i-1],max,argv[i]);
+                return(1);
+            }else if((min<0)||(255<max)){
+                fprintf(stderr,"%s: range minimum %d (%s) and maximum "
+                        "%d (%s) must both belong to the [0, 255] range.\n",
+                        argv[0],min,argv[i-1],max,argv[i]);
+                return(1);
             }else{
-                fprintf(
+                CharListCount=0;
+                for(k=min;k<=max;k++){
+                    setinclude(CharSet,k);
+                }
+            }
+        }else if((strcmp(argv[i],"-c")==0)&&(++i<argc)){
+            countmode=1;
+            count=atoi(argv[i]);
+        }else{
+            fprintf(
                     stderr,
                     concatenate(
-                        "%s usage:\n",
-                        "%s [-n] [-w charcount] [-c charcount | -l linecount] \n",
-                        "   [-r mincode maxcode]... > randomtextfile \n",
-                        "     -n    print a continuous flow (no eoln). \n",
-                        "     -w    specify the line length (default=78, max=4095). \n",
-                        "     -c    specify the number of ASCII printable characters generated. \n",
-                        "     -l    specify the number of lines generated  \n",
-                        "           (-l suppercedes -n). \n",
-                        "     -r min max\n",
-                        "           defines the range of generated characters. min and max are\n",
-                        "           decimal ASCII codes, or extended (127<code<256). Several\n",
-                        "           ranges may be specified.\n",
-                        "     default is an infinite flow of 78-character lines, \n",
-                        "     in the range 32..126.\n",
-                        0),
+                                "%s usage:\n",
+                                "%s [-n] [-w charcount] [-c charcount | -l linecount] \n",
+                                "   [-r mincode maxcode]... > randomtextfile \n",
+                                "     -n    print a continuous flow (no eoln). \n",
+                                "     -w    specify the line length (default=78, max=4095). \n",
+                                "     -c    specify the number of ASCII printable characters generated. \n",
+                                "     -l    specify the number of lines generated  \n",
+                                "           (-l suppercedes -n). \n",
+                                "     -r min max\n",
+                                "           defines the range of generated characters. min and max are\n",
+                                "           decimal ASCII codes, or extended (127<code<256). Several\n",
+                                "           ranges may be specified.\n",
+                                "     default is an infinite flow of 78-character lines, \n",
+                                "     in the range 32..126.\n",
+                                0),
                     argv[0],argv[0]);
-                return(1);
-            }
-        }/*for arg*/
+            return(1);
+        }
+    }/*for arg*/

-        if(CharListCount==0){
-            int         ii,jj;
-            jj=0;
-            for(ii=0;ii<256;ii++){
-                /*DEBUG printf("%d: %s\n",ii,setcontains(CharSet,ii)?"in":"out");*/
-                if(setcontains(CharSet,ii)){
-                    CharList[jj]=(char)ii;
-                    jj++;
-                }
+    if(CharListCount==0){
+        int         ii,jj;
+        jj=0;
+        for(ii=0;ii<256;ii++){
+            /*DEBUG printf("%d: %s\n",ii,setcontains(CharSet,ii)?"in":"out");*/
+            if(setcontains(CharSet,ii)){
+                CharList[jj]=(char)ii;
+                jj++;
             }
-            CharListCount=jj;
         }
+        CharListCount=jj;
+    }

-        /* CharListCount > 0, for strlen(DefaultCharList)>0 and min<=max.*/
+    /* CharListCount > 0, for strlen(DefaultCharList)>0 and min<=max.*/

-        /* printf("%d : %s\n",MaxAscii,Ascii);*/
-        randfile=BcRandom_load(X);
+    /* printf("%d : %s\n",MaxAscii,Ascii);*/
+    randfile=BcRandom_load(X);
+    CopyX(&X[0],&save[0]);
+    signal(SIGINT,handler);
+    generate=(countmode==0)||(count>0);
+    while(generate){
+        i=0;
+        while(i<linelength){
+            buffer[i]=CharList[(int)BcRandom_random(X) % CharListCount];
+            i++;
+        }
+        buffer[i]='\0';
         CopyX(&X[0],&save[0]);
-        signal(SIGINT,handler);
-        generate=(countmode==0)||(count>0);
-        while(generate){
-            i=0;
-            while(i<linelength){
-                buffer[i]=CharList[BcRandom_random(X) % CharListCount];
-                i++;
-            }
-            buffer[i]='\0';
-            CopyX(&X[0],&save[0]);

-            switch(countmode){
-            case 1:/*character count*/
-                if(count<linelength){
-                    buffer[count]='\0';
-                    count=0;
-                }else{
-                    count-=linelength;
-                }
-                generate=(count>0);
-                break;
-            case 2:/*line count*/
-                count--;
-                generate=(count>0);
-                break;
-            case 0:/*infinite*/
-                /* fall thru*/
-            default:
-                break;
-            }/*switch*/
-            if(linemode){
-                puts(buffer);           /* puts adds a newline.*/
+        switch(countmode){
+        case 1:/*character count*/
+            if(count<linelength){
+                buffer[count]='\0';
+                count=0;
             }else{
-                fputs(buffer,stdout);   /* fputs doesn't add a newline.*/
-            }
-        }
-        BcRandom_save(randfile,save);
-        return(0);
-    }/*main*/
+                count-=linelength;
+            }
+            generate=(count>0);
+            break;
+        case 2:/*line count*/
+            count--;
+            generate=(count>0);
+            break;
+        case 0:/*infinite*/
+            /* fall thru*/
+        default:
+            break;
+        }/*switch*/
+        if(linemode){
+            puts(buffer);           /* puts adds a newline.*/
+        }else{
+            fputs(buffer,stdout);   /* fputs doesn't add a newline.*/
+        }
+    }
+    BcRandom_save(randfile,save);
+    return(0);
+}/*main*/


-/*** randchar.c                       --                     --          ***/
+/**** THE END ****/
diff --git a/ascii-utilities/sources/sevenbit.c b/ascii-utilities/sources/sevenbit.c
index fc43c71..4e7427b 100644
--- a/ascii-utilities/sources/sevenbit.c
+++ b/ascii-utilities/sources/sevenbit.c
@@ -38,7 +38,7 @@ MODIFICATIONS
     Added RCS keywords.

 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
@@ -131,7 +131,7 @@ LEGAL
     {
         int i;
         char* escapeStr=malloc(2);
-        escapeStr[0]=escapeCh;
+        escapeStr[0]=(char)escapeCh;
         escapeStr[1]='\0';
         for(i=0;i<appr->count;i++){
             appr->approximations[i].asciiApproximation=escapeStr;
@@ -150,14 +150,13 @@ LEGAL

         l=0;
         for(i=0;i<appr->count;i++){
-            l+=strlen(appr->approximations[i].asciiApproximation)+1;
+            l+=(int)strlen(appr->approximations[i].asciiApproximation)+1;
         }

         copy=(BenApproximationTableT*)malloc(sizeof(BenApproximationTableT));
         copy->count=appr->count;
-        copy->approximations=(BenApproximationT*)
-            malloc(sizeof(BenApproximationT)*(copy->count+1));
-        copyData=(char*)malloc(sizeof(char)*l);
+        copy->approximations=(BenApproximationT*)malloc(sizeof(BenApproximationT)*(size_t)(copy->count+1));
+        copyData=(char*)malloc(sizeof(char)*(size_t)l);

         for(i=0;i<copy->count;i++){
             copy->approximations[i].charName=appr->approximations[i].charName;
@@ -231,32 +230,32 @@ LEGAL

         b=fgetc(in);
         if(b==EOF){
-            buffer[0]=escapeChar;
-            buffer[1]=numberChar;
+            buffer[0]=(unsigned char)escapeChar;
+            buffer[1]=(unsigned char)numberChar;
             buffer[2]='\0';
             return(buffer);
         }
-        buffer[0]=b;
+        buffer[0]=(unsigned char)b;

         b=fgetc(in);
         if(b==EOF){
             buffer[2]=buffer[0];
-            buffer[0]=escapeChar;
-            buffer[1]=numberChar;
+            buffer[0]=(unsigned char)escapeChar;
+            buffer[1]=(unsigned char)numberChar;
             buffer[3]='\0';
             return(buffer);
         }
-        buffer[1]=b;
+        buffer[1]=(unsigned char)b;
         buffer[2]='\0';

         if(sscanf((const char*)buffer,"%x",&u)!=1){
             buffer[2]=buffer[0];
             buffer[3]=buffer[1];
-            buffer[0]=escapeChar;
-            buffer[1]=numberChar;
+            buffer[0]=(unsigned char)escapeChar;
+            buffer[1]=(unsigned char)numberChar;
             buffer[4]='\0';
         }else{
-            buffer[0]=u;
+            buffer[0]=(unsigned char)u;
             buffer[1]='\0';
         }
         return(buffer);
@@ -313,15 +312,15 @@ LEGAL
                 }else if(b==escapeChar){
                     fputc(escapeChar,out);
                 }else{
-                    buffer[0]=escapeChar;
-                    buffer[1]=b;
+                    buffer[0]=(char)escapeChar;
+                    buffer[1]=(char)b;
                     b=fgetc(in);
                     if(b==EOF){
                         buffer[2]='\0';
                         fputs(buffer,out);
                         continue;
                     }else{
-                        buffer[2]=b;
+                        buffer[2]=(char)b;
                         buffer[3]='\0';
                         fputs(convtoeight(buffer),out);
                     }
@@ -398,11 +397,11 @@ LEGAL
             const char** codeNames=BenEncodingTableNames();
             const char* message="Available encodings are: ";
             int code=0;
-            int col=strlen(message)+strlen(codeNames[code])+2;
+            int col=(int)strlen(message)+(int)strlen(codeNames[code])+2;
             fprintf(stderr,"%s%s",message,codeNames[code]);
             code++;
             while(codeNames[code]!=0){
-                col+=strlen(codeNames[code])+2;
+                col+=(int)strlen(codeNames[code])+2;
                 if(col>72){
                     fprintf(stderr,",\n    %s",codeNames[code]);
                     col-=68;
diff --git a/ascii-utilities/sources/sortchars.c b/ascii-utilities/sources/sortchars.c
index 013c3e2..a0cd600 100644
--- a/ascii-utilities/sources/sortchars.c
+++ b/ascii-utilities/sources/sortchars.c
@@ -30,23 +30,23 @@ MODIFICATIONS
     Revision 1.1  2001/04/27 06:45:11  pascal
     Added to CVS.

- * Revision 1.3  1994/07/13  12:12:57  pbo
- * *** empty log message ***
- *
- * Revision 1.3  1994/07/13  12:12:57  pbo
- * *** empty log message ***
- *
- * Revision 1.2  1994/07/13  12:11:43  pbo
- * Transformed C++ comments into C comments.
- *
- * Revision 1.2  1994/07/13  12:11:43  pbo
- * Transformed C++ comments into C comments.
- *
- * Revision 1.1  94/03/28  13:11:16  pascal
- * Initial revision
- *
+    * Revision 1.3  1994/07/13  12:12:57  pbo
+    * *** empty log message ***
+    *
+    * Revision 1.3  1994/07/13  12:12:57  pbo
+    * *** empty log message ***
+    *
+    * Revision 1.2  1994/07/13  12:11:43  pbo
+    * Transformed C++ comments into C comments.
+    *
+    * Revision 1.2  1994/07/13  12:11:43  pbo
+    * Transformed C++ comments into C comments.
+    *
+    * Revision 1.1  94/03/28  13:11:16  pascal
+    * Initial revision
+    *
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 1994
+    Copyright Pascal J. Bourguignon 1994 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
@@ -57,41 +57,41 @@ LEGAL
 #include <ctype.h>

 extern void* qsort(void* base,size_t nmemb,size_t size,
-            int(*compar)(const void*,const void*));
+                   int(*compar)(const void*,const void*));


-    static int comparechar(const void* a, const void* b)
-    {
-        return((*((const char*)a))-(*((const char*)b)));
-    }/*comparechar;*/
+static int comparechar(const void* a, const void* b)
+{
+    return((*((const char*)a))-(*((const char*)b)));
+}/*comparechar;*/


-    static int revcomparechar(const void* a, const void* b)
-    {
-        return((*((const char*)b))-(*((const char*)a)));
-    }/*revcomparechar;*/
+static int revcomparechar(const void* a, const void* b)
+{
+    return((*((const char*)b))-(*((const char*)a)));
+}/*revcomparechar;*/


-    static void usage(char* pname)
-    {
-        fprintf(stderr,"%s [-b] [-f] [-u] [-r] < input > output\n"
+static void usage(char* pname)
+{
+    fprintf(stderr,"%s [-b] [-f] [-u] [-r] < input > output\n"
             "   -b  Ignore and remove non-graphic characters\n"
             "       (including spaces and tabulations).\n"
             "   -f  Fold upper case letters onto lower case.\n"
             "   -u  leave only one occurence of characters.\n"
             "   -r  Reverse the sense of comparisons.\n",pname);
-    }/*usage;*/
+}/*usage;*/


 int main(int argc,char** argv)
 {
-        char            buffer[BUFSIZ];
-        unsigned char   maxchar=255;
-        int             blanc=0;
-        int             fold=0;
-        int             unique=0;
-        int(*compar)(const void*,const void*);
-        int             i;
+    char            buffer[BUFSIZ];
+    unsigned char   maxchar=255;
+    int             blanc=0;
+    int             fold=0;
+    int             unique=0;
+    int(*compar)(const void*,const void*);
+    int             i;

     compar=comparechar;
     for(i=1;i<argc;i++){
@@ -110,14 +110,14 @@ int main(int argc,char** argv)
     }
     while(fgets(buffer,sizeof(buffer)-1,stdin)){
         if(buffer[0]!='\0'){
-                int             len;
-            len=strlen(buffer);
+            int             len;
+            len=(int)strlen(buffer);
             if(blanc){
                 int         ii,jj;
                 ii=0;
                 for(jj=0;jj<len;jj++){
                     if((' '<(unsigned char)(buffer[jj]))
-                    &&((unsigned char)(buffer[jj])<=maxchar)){
+                       &&((unsigned char)(buffer[jj])<=maxchar)){
                         buffer[ii]=buffer[jj];
                         ii++;
                     }
@@ -154,5 +154,4 @@ int main(int argc,char** argv)
 }/*main;*/


-
-/*** sortchars.c                      --                     --          ***/
+/**** THE END ****/
diff --git a/ascii-utilities/sources/text.c b/ascii-utilities/sources/text.c
index e39f7ae..163cc98 100644
--- a/ascii-utilities/sources/text.c
+++ b/ascii-utilities/sources/text.c
@@ -27,7 +27,7 @@ MODIFICATIONS
     Added RCS keywords.

 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
diff --git a/ascii-utilities/sources/whatisit.c b/ascii-utilities/sources/whatisit.c
index 55775e8..b314bca 100644
--- a/ascii-utilities/sources/whatisit.c
+++ b/ascii-utilities/sources/whatisit.c
@@ -42,7 +42,7 @@ MODIFICATIONS
     Added RCS keywords.

 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
@@ -147,7 +147,7 @@ binaryCount,asciiCount,macintoshCount,nextCount,size);
         if(fseek(file,0,SEEK_END)<0){
             return(NULL);
         }else{
-            (*size)=ftell(file);
+            (*size)=(INT32)ftell(file);
             if(fseek(file,0,SEEK_SET)<0){
                 return(NULL);
             }else{
@@ -186,7 +186,7 @@ int main(int argc,char** argv)
         if(strcmp(argv[i],"-v")==0){
             printCount=1;
         }else{
-            l=strlen(argv[i]);
+            l=(INT32)strlen(argv[i]);
             if(l>maxlen){
                 maxlen=l;
             }
@@ -212,7 +212,7 @@ int main(int argc,char** argv)
                     free(buffer);
                     if(printCount){
                         fprintf(stdout,
-                                "%-*s : %-12s %8ld %8ld %8ld %8ld %10ld\n",
+                                "%-*s : %-12s %8"FMT_INT32" %8"FMT_INT32" %8"FMT_INT32" %8"FMT_INT32" %10"FMT_INT32"\n",
                                 maxlen,argv[i],KindLabel[k],
                                 binaryCount,asciiCount,macintoshCount,
                                 nextCount,size);
diff --git a/base/sources/base.c b/base/sources/base.c
index 18077dc..12bbda5 100644
--- a/base/sources/base.c
+++ b/base/sources/base.c
@@ -16,7 +16,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 2003 - 2003
+    Copyright Pascal Bourguignon 2003 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
diff --git a/bocrypt/sources/Makefile b/bocrypt/sources/Makefile
index fdb64e8..bb5a3a0 100644
--- a/bocrypt/sources/Makefile
+++ b/bocrypt/sources/Makefile
@@ -13,7 +13,7 @@
 #LEGAL
 #    GPL
 #
-#    Copyright Pascal Bourguignon 1994 - 1994
+#    Copyright Pascal Bourguignon 1994 - 2011
 #
 #    This program is free software; you can redistribute it and/or
 #    modify it under the terms of the GNU General Public License
diff --git a/bocrypt/sources/bocrypt.c b/bocrypt/sources/bocrypt.c
index 09eb55f..fa017bd 100644
--- a/bocrypt/sources/bocrypt.c
+++ b/bocrypt/sources/bocrypt.c
@@ -15,7 +15,7 @@ MODIFICATIONS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 2003 - 2003
+    Copyright Pascal Bourguignon 2003 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -36,115 +36,115 @@ LEGAL
 #include <stdlib.h>
 #include <string.h>

-    static void usage(char* pname)
-    {
-        fprintf(stderr,
+static void usage(char* pname)
+{
+    fprintf(stderr,
             "Usage: %s 'password' offset keyfile inputfile > outputfile\n",
             pname);
-    }/* usage; */
+}/* usage; */


-    static char* getpassword(char* argument)
-    {
-            char*   password;
-            int     len;
-            int     i;
+static char* getpassword(char* argument)
+{
+    char*   password;
+    int     len;
+    int     i;

-        len=strlen(argument);
-        if(len<=0){
-            return(NULL);
-        }
-        password=malloc((unsigned)(len+1));
-        i=0;
-        while(i<len){
-            password[i]=argument[i];
-            argument[i]='X';
-            i++;
-        }
-        password[i]=(char)0;
-        return(password);
-    }/* getpassword; */
+    len=(int)strlen(argument);
+    if(len<=0){
+        return(NULL);
+    }
+    password=malloc((unsigned)(len+1));
+    i=0;
+    while(i<len){
+        password[i]=argument[i];
+        argument[i]='X';
+        i++;
+    }
+    password[i]=(char)0;
+    return(password);
+}/* getpassword; */


-    static int getoffset(char* argument)
-    {
-            int     offset;
+static int getoffset(char* argument)
+{
+    int     offset;

-        offset=0;
-        sscanf(argument,"%d",&offset);
-        return(offset);
-    }/* getoffset; */
+    offset=0;
+    sscanf(argument,"%d",&offset);
+    return(offset);
+}/* getoffset; */


-    static FILE* openfile(const char* fkind,const char* fname)
-    {
-            FILE*       file;
+static FILE* openfile(const char* fkind,const char* fname)
+{
+    FILE*       file;

-        file=fopen(fname,"rb");
-        if(file==NULL){
-            fprintf(stderr,"I cannot open the %s file '%s'.\n",
-                    fkind,fname);
-        }
-        return(file);
-    }/* openfile; */
+    file=fopen(fname,"rb");
+    if(file==NULL){
+        fprintf(stderr,"I cannot open the %s file '%s'.\n",
+                fkind,fname);
+    }
+    return(file);
+}/* openfile; */


-    static int process(char* password,int offset,FILE* key,FILE* input,FILE* output)
-    {
-            int         err;
-            int         i;
-            int         pindex;
-            int         keysize;
-            int         datsize;
-            int         wrtsize;
-            int         processedcount;
-            char        keybuffer[8192];
-            char        datbuffer[8192];
+static int process(char* password,int offset,FILE* key,FILE* input,FILE* output)
+{
+    int         err;
+    int         i;
+    int         pindex;
+    int         keysize;
+    int         datsize;
+    int         wrtsize;
+    int         processedcount;
+    char        keybuffer[8192];
+    char        datbuffer[8192];

-        err=fseek(key,offset,SEEK_SET);
-        if(err==-1){
-            perror("fseek on the key file");
+    err=fseek(key,offset,SEEK_SET);
+    if(err==-1){
+        perror("fseek on the key file");
+        return(1);
+    }
+    processedcount=0;
+    pindex=0;
+    datsize=(int)fread(datbuffer,sizeof(char),sizeof(datbuffer)/sizeof(char),input);
+    while(datsize>0){
+        keysize=(int)fread(keybuffer,sizeof(char),(unsigned)datsize,key);
+        if(keysize!=datsize){
+            fprintf(stderr,"I cannot read as many bytes from the key file than from the input file!\n");
+            fprintf(stderr,"Processed count=%d, datsize=%d, keysize=%d\n",
+                    processedcount,datsize,keysize);
             return(1);
         }
-        processedcount=0;
-        pindex=0;
-        datsize=fread(datbuffer,sizeof(char),sizeof(datbuffer)/sizeof(char),input);
-        while(datsize>0){
-            keysize=fread(keybuffer,sizeof(char),(unsigned)datsize,key);
-            if(keysize!=datsize){
-                fprintf(stderr,"I cannot read as many bytes from the key file than from the input file!\n");
-                fprintf(stderr,"Processed count=%d, datsize=%d, keysize=%d\n",
-                        processedcount,datsize,keysize);
-                return(1);
-            }
-            i=0;
-            while(i<datsize){
-                datbuffer[i]=((password[pindex]^keybuffer[i])^datbuffer[i]);
-                pindex++;
-                if(password[pindex]==(char)0){
-                    pindex=0;
-                }
-                i++;
-            }
-            wrtsize=fwrite(datbuffer,sizeof(char),(unsigned)datsize,output);
-            if(wrtsize!=datsize){
-                fprintf(stderr,"I cannot write as many bytes to the output file than read from the input file!\n");
-                fprintf(stderr,"Processed count=%d, datsize=%d, keysize=%d\n",
-                        processedcount,datsize,keysize);
-                return(1);
+        i=0;
+        while(i<datsize){
+            datbuffer[i]=((password[pindex]^keybuffer[i])^datbuffer[i]);
+            pindex++;
+            if(password[pindex]==(char)0){
+                pindex=0;
             }
-            processedcount+=datsize;
-            datsize=fread(datbuffer,sizeof(char),sizeof(datbuffer)/sizeof(char),input);
+            i++;
         }
-        return(0);
-    }/* process; */
+        wrtsize=(int)fwrite(datbuffer,sizeof(char),(unsigned)datsize,output);
+        if(wrtsize!=datsize){
+            fprintf(stderr,"I cannot write as many bytes to the output file than read from the input file!\n");
+            fprintf(stderr,"Processed count=%d, datsize=%d, keysize=%d\n",
+                    processedcount,datsize,keysize);
+            return(1);
+        }
+        processedcount+=datsize;
+        datsize=(int)fread(datbuffer,sizeof(char),sizeof(datbuffer)/sizeof(char),input);
+    }
+    return(0);
+}/* process; */

 int main(int argc,char** argv)
 {
-        FILE*           key;
-        FILE*           input;
-        char*           password;
-        int             offset;
+    FILE*           key;
+    FILE*           input;
+    char*           password;
+    int             offset;

     if(argc!=5){
         usage(argv[0]);
@@ -173,4 +173,4 @@ int main(int argc,char** argv)
     return(0);
 }/* main */

-/*** bocrypt.c                        -- 2003-12-02 11:09:08 -- pascal   ***/
+/**** THE END ****/
diff --git a/bocrypt/sources/smallcrypt.c b/bocrypt/sources/smallcrypt.c
index ccb2865..7e216f5 100644
--- a/bocrypt/sources/smallcrypt.c
+++ b/bocrypt/sources/smallcrypt.c
@@ -20,7 +20,7 @@ MODIFICATIONS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1994 - 1994
+    Copyright Pascal Bourguignon 1994 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -43,257 +43,257 @@ LEGAL
 #include <stdarg.h>
 #include <sys/file.h>

-    static char*        pname;
-    static int          quiet=0;
+static char*        pname;
+static int          quiet=0;

-    static void qerror(const char* format,...)
-    {
-            va_list     plist;
-            char        message[BUFSIZ];
+static void qerror(const char* format,...)
+{
+    va_list     plist;
+    char        message[BUFSIZ];

-        va_start(plist,format);
-        vsprintf(message,format,plist);
-        va_end(plist);
-        perror(message);
-    }/*qerror*/
+    va_start(plist,format);
+    vsprintf(message,format,plist);
+    va_end(plist);
+    perror(message);
+}/*qerror*/


-    static int fsize(FILE* stream)
-    {
-            int     res;
-            int     size;
-            int     pos;
+static int fsize(FILE* stream)
+{
+    int     res;
+    int     size;
+    int     pos;

-        pos=ftell(stream);
-        if(pos<0){
-            return(pos);
-        }
-        res=fseek(stream,0,SEEK_END);
+    pos=(int)ftell(stream);
+    if(pos<0){
+        return(pos);
+    }
+    res=fseek(stream,0,SEEK_END);
+    if(res<0){
+        return(res);
+    }else{
+        size=(int)ftell(stream);
+        res=fseek(stream,pos,SEEK_SET);
         if(res<0){
             return(res);
         }else{
-            size=ftell(stream);
-            res=fseek(stream,pos,SEEK_SET);
-            if(res<0){
-                return(res);
-            }else{
-                return(size);
-            }
+            return(size);
         }
-    }/*fsize;*/
+    }
+}/*fsize;*/


-    static char* loadkey(FILE* keyfile)
-    {
-            int         size;
-            char*       key;
-            int         len;
-            char        buffer[BUFSIZ];
+static char* loadkey(FILE* keyfile)
+{
+    int         size;
+    char*       key;
+    int         len;
+    char        buffer[BUFSIZ];

-        size=fsize(keyfile);
-        if(size<0){
-            qerror("fsize '%s'",pname);
-            return(NULL);
-        }
+    size=fsize(keyfile);
+    if(size<0){
+        qerror("fsize '%s'",pname);
+        return(NULL);
+    }

-        key=malloc((unsigned)size);
-        key[0]='\0';
+    key=malloc((unsigned)size);
+    key[0]='\0';

-        while((size>0)&&(fgets(buffer,sizeof(buffer),keyfile)!=NULL)){
-            len=strlen(buffer);
-            size-=len;
-            if(buffer[len-1]=='\n'){
-                len--;
-                buffer[len]='\0';
-            }
-            strcat(key,buffer);
+    while((size>0)&&(fgets(buffer,sizeof(buffer),keyfile)!=NULL)){
+        len=(int)strlen(buffer);
+        size-=len;
+        if(buffer[len-1]=='\n'){
+            len--;
+            buffer[len]='\0';
         }
+        strcat(key,buffer);
+    }

-        return(key);
-    }/*loadkey;*/
+    return(key);
+}/*loadkey;*/


-    static char* dpos(/*char*/int c,/*char*/int d,const char* key,int keyindex)
-    {
-            char*       kip;
+static char* dpos(/*char*/int c,/*char*/int d,const char* key,int keyindex)
+{
+    char*       kip;

-        kip=index(key+keyindex,c);
-        while(kip!=NULL){
-            if(kip[1]==d){
-                return(kip);
-            }
-            kip=index(kip+1,c);
+    kip=index(key+keyindex,c);
+    while(kip!=NULL){
+        if(kip[1]==d){
+            return(kip);
         }
-        kip=index(key,c);
-        while(kip!=NULL){
-            if(kip[1]==d){
-                return(kip);
-            }
-            kip=index(kip+1,c);
+        kip=index(kip+1,c);
+    }
+    kip=index(key,c);
+    while(kip!=NULL){
+        if(kip[1]==d){
+            return(kip);
         }
-        return(NULL);
-    }/*dpos;*/
+        kip=index(kip+1,c);
+    }
+    return(NULL);
+}/*dpos;*/


-    static int encrypt(const char* key,FILE* input,FILE* output)
-    {
-            int             keylength;
-            int             keyindex;
-            const char*     kip;
-            const char*     kop;
-            int             c;
-            int             count;
+static int encrypt(const char* key,FILE* input,FILE* output)
+{
+    int             keylength;
+    int             keyindex;
+    const char*     kip;
+    const char*     kop;
+    int             c;
+    int             count;

-        count=0;
-        keylength=strlen(key);
-        keyindex=2;
-        c=fgetc(input);
-        while(c!=EOF){
-            if((c!='\n')&&(c!='\0')){
-                kip=index(key+keyindex,c);
-                if(kip==NULL){
-                    kip=index(key,c);
-                }
-                if(kip==NULL){
-                    if((c!=' ')&&(!quiet)){
-                        fprintf(stderr,"%s error:   char '%c' not in "
+    count=0;
+    keylength=(int)strlen(key);
+    keyindex=2;
+    c=fgetc(input);
+    while(c!=EOF){
+        if((c!='\n')&&(c!='\0')){
+            kip=index(key+keyindex,c);
+            if(kip==NULL){
+                kip=index(key,c);
+            }
+            if(kip==NULL){
+                if((c!=' ')&&(!quiet)){
+                    fprintf(stderr,"%s error:   char '%c' not in "
                             "key file. Substituted with a space.\n",
                             pname,c);
-                    }
-                    c=key[2];
-                    kip=index(key+keyindex,c);
-                    if(kip==NULL){
-                        kip=key+2;
-                    }
                 }
+                c=key[2];
+                kip=index(key+keyindex,c);
+                if(kip==NULL){
+                    kip=key+2;
+                }
+            }

-                kop=2+dpos(kip[-2],kip[-1],key,keyindex-2);
-                if((key+keyindex<=kop)&&(kop<kip)&&(!quiet)){
-                    fprintf(stderr,"%s warning: char '%c' from "
+            kop=2+dpos(kip[-2],kip[-1],key,keyindex-2);
+            if((key+keyindex<=kop)&&(kop<kip)&&(!quiet)){
+                fprintf(stderr,"%s warning: char '%c' from "
                         "keyindex=%d will be wrongly decoded as '%c'\n",
                         pname,c,keyindex,*kop);
-                }
+            }

-                keyindex=kip-key;
-                if(EOF==fputc(kip[-2],output)){
-                    qerror("fputc to output");
-                    return(4);
-                }
-                if(EOF==fputc(kip[-1],output)){
+            keyindex=(int)(kip-key);
+            if(EOF==fputc(kip[-2],output)){
+                qerror("fputc to output");
+                return(4);
+            }
+            if(EOF==fputc(kip[-1],output)){
+                qerror("fputc to output");
+                return(4);
+            }
+            count+=2;
+            if(count>=72){
+                count=0;
+                if(EOF==fputc('\n',output)){
                     qerror("fputc to output");
                     return(4);
                 }
-                count+=2;
-                if(count>=72){
-                    count=0;
-                    if(EOF==fputc('\n',output)){
-                        qerror("fputc to output");
-                        return(4);
-                    }
-                }
-                keyindex++;
-                if(key[keyindex]=='\0'){
-                    keyindex=2;
-                }
             }
-            c=fgetc(input);
-        }
-        if(EOF==fputc('\n',output)){
-            qerror("fputc to output");
-            return(4);
+            keyindex++;
+            if(key[keyindex]=='\0'){
+                keyindex=2;
+            }
         }
-        return(0);
-    }/*encrypt;*/
+        c=fgetc(input);
+    }
+    if(EOF==fputc('\n',output)){
+        qerror("fputc to output");
+        return(4);
+    }
+    return(0);
+}/*encrypt;*/


-    static int decrypt(const char* key,FILE* input,FILE* output)
-    {
-            int             keylength;
-            int             keyindex;
-            const char*     kip;
-            int             c;
-            int             d;
-            int             count;
+static int decrypt(const char* key,FILE* input,FILE* output)
+{
+    int             keylength;
+    int             keyindex;
+    const char*     kip;
+    int             c;
+    int             d;
+    int             count;

-        count=0;
-        keylength=strlen(key);
-        keyindex=0;
-        c=fgetc(input);
-        while(c!=EOF){
-            while((c=='\n')||(c=='\0')){
-                c=fgetc(input);
-            }
+    count=0;
+    keylength=(int)strlen(key);
+    keyindex=0;
+    c=fgetc(input);
+    while(c!=EOF){
+        while((c=='\n')||(c=='\0')){
+            c=fgetc(input);
+        }
+        d=fgetc(input);
+        while((d=='\n')||(d=='\0')){
             d=fgetc(input);
-            while((d=='\n')||(d=='\0')){
-                d=fgetc(input);
-            }
-            if(d!=EOF){
-                kip=dpos(c,d,key,keyindex);
-                if(kip==NULL){
-                    if(!quiet){
-                        fprintf(stderr,"%s error:   char '%c' not in "
+        }
+        if(d!=EOF){
+            kip=dpos(c,d,key,keyindex);
+            if(kip==NULL){
+                if(!quiet){
+                    fprintf(stderr,"%s error:   char '%c' not in "
                             "key file. Substituted with a '?'\n",
                             pname,c);
-                    }
-                    if(EOF==fputc('?',output)){
-                        qerror("fputc to output");
-                        return(4);
-                    }
-                    count++;
-                }else{
-                    kip+=2;
-                    c=*kip;
-                    keyindex=kip-key;
-                    if(c==key[2]){
-                        c=' ';
-                    }
-                    if(EOF==fputc(c,output)){
-                        qerror("fputc to output");
-                        return(4);
-                    }
-                    count++;
                 }
-
-                if((count>=60)&&((c==' ')||(c=='?'))){
-                    count=0;
-                    if(EOF==fputc('\n',output)){
-                        qerror("fputc to output");
-                        return(4);
-                    }
+                if(EOF==fputc('?',output)){
+                    qerror("fputc to output");
+                    return(4);
                 }
-                if(key[keyindex]=='\0'){
-                    keyindex=0;
+                count++;
+            }else{
+                kip+=2;
+                c=*kip;
+                keyindex=(int)(kip-key);
+                if(c==key[2]){
+                    c=' ';
                 }
+                if(EOF==fputc(c,output)){
+                    qerror("fputc to output");
+                    return(4);
+                }
+                count++;
+            }
+
+            if((count>=60)&&((c==' ')||(c=='?'))){
+                count=0;
+                if(EOF==fputc('\n',output)){
+                    qerror("fputc to output");
+                    return(4);
+                }
+            }
+            if(key[keyindex]=='\0'){
+                keyindex=0;
             }
-            c=fgetc(input);
-        }
-        if(EOF==fputc('\n',output)){
-            qerror("fputc to output");
-            return(4);
         }
-        return(0);
-    }/*decrypt;*/
+        c=fgetc(input);
+    }
+    if(EOF==fputc('\n',output)){
+        qerror("fputc to output");
+        return(4);
+    }
+    return(0);
+}/*decrypt;*/


-    static void usage(const char* upname)
-    {
-        fprintf(stderr,"%s usage:\n"
-    "   sencrypt [-q] keyfile [ clearfile   | < clearfile   ] > cryptedfile\n"
-    "   sdecrypt [-q] keyfile [ cryptedfile | < cryptedfile ] > clearfile\n",
-        upname);
-    }/*usage;*/
+static void usage(const char* upname)
+{
+    fprintf(stderr,"%s usage:\n"
+            "   sencrypt [-q] keyfile [ clearfile   | < clearfile   ] > cryptedfile\n"
+            "   sdecrypt [-q] keyfile [ cryptedfile | < cryptedfile ] > clearfile\n",
+            upname);
+}/*usage;*/


 int main(int argc,char* argv[])
 {
-        int         encrypting=0;
-        FILE*       keyfile;
-        FILE*       inputfile;
-        char*       key;
-        int         res;
-        int         i;
-        char*       kfname=NULL;
-        char*       ifname=NULL;
+    int         encrypting=0;
+    FILE*       keyfile;
+    FILE*       inputfile;
+    char*       key;
+    int         res;
+    int         i;
+    char*       kfname=NULL;
+    char*       ifname=NULL;

     pname=rindex(argv[0],'/');
     if(pname==NULL){
@@ -308,11 +308,11 @@ int main(int argc,char* argv[])
         encrypting=0;
     }else{
         fprintf(stderr,
-            "You should do:\n"
-            "    ln -s %s sencrypt\n"
-            "    ln -s %s sdecrypt\n"
-            " and use sencrypt or sdecrypt instead of %s.\n",
-            pname,pname,pname);
+                "You should do:\n"
+                "    ln -s %s sencrypt\n"
+                "    ln -s %s sdecrypt\n"
+                " and use sencrypt or sdecrypt instead of %s.\n",
+                pname,pname,pname);
         usage(pname);
         return(1);
     }
@@ -366,4 +366,4 @@ int main(int argc,char* argv[])
     return(res);
 }/*main.*/

-/*** smallcrypt.c                     --                     --          ***/
+/**** THE END ****/
diff --git a/bocrypt/sources/xor.c b/bocrypt/sources/xor.c
index a59c6af..10cbe77 100644
--- a/bocrypt/sources/xor.c
+++ b/bocrypt/sources/xor.c
@@ -18,7 +18,7 @@ MODIFICATIONS
 BUGS
 LEGAL
     GPL
-    Copyright Pascal J. Bourguignon 2002 - 2002
+    Copyright Pascal J. Bourguignon 2002 - 2011

     This file is part of xor tool.

@@ -81,7 +81,7 @@ LEGAL

         while(!feof(inpf)){

-            dat_len=fread(dat_buf,sizeof(unsigned char),sizeof(dat_buf),inpf);
+            dat_len=(int)fread(dat_buf,sizeof(unsigned char),sizeof(dat_buf),inpf);
             if(ferror(inpf)){
                 fprintf(stderr,
                         "%s: error while reading input file. ABORTING.\n",
@@ -98,8 +98,10 @@ LEGAL
                             clearerr(keyf);
                             rewind(keyf);
                         }
-                        key_len=fread(key_buf,sizeof(unsigned char),
-                                      sizeof(key_buf),keyf);
+                        key_len=(int)fread(key_buf,
+                                           sizeof(unsigned char),
+                                           sizeof(key_buf),
+                                           keyf);
                         if(ferror(keyf)){
                             fprintf(stderr,
                                     "%s: error while reading key file. "\
@@ -134,8 +136,10 @@ LEGAL
             out_idx=0;
             do{
                 clearerr(outf);
-                out_len=fwrite(dat_buf+out_idx,sizeof(unsigned char),
-                               (unsigned)(dat_len-out_idx),outf);
+                out_len=(int)fwrite(dat_buf+out_idx,
+                                    sizeof(unsigned char),
+                                    (size_t)(dat_len-out_idx),
+                                    outf);
                 out_idx+=out_len;
                 if(ferror(outf)){
                     err_cnt++;
@@ -156,7 +160,7 @@ LEGAL

     static void usage(const char* upname)
     {
-        int len=strlen(upname);
+        int len=(int)strlen(upname);
         fprintf(stderr,
                 "%s usage:\n"\
                 "    %s   -k|--key KEY_FILE \\\n"\
diff --git a/cookie/sources/Makefile b/cookie/sources/Makefile
index 027eab1..ab38659 100644
--- a/cookie/sources/Makefile
+++ b/cookie/sources/Makefile
@@ -12,7 +12,7 @@
 #LEGAL
 #    GPL
 #
-#    Copyright Pascal Bourguignon 1993 - 1993
+#    Copyright Pascal Bourguignon 1993 - 2011
 #
 #    This program is free software; you can redistribute it and/or
 #    modify it under the terms of the GNU General Public License
diff --git a/cookie/sources/cookie.c b/cookie/sources/cookie.c
index 72b2303..859033f 100644
--- a/cookie/sources/cookie.c
+++ b/cookie/sources/cookie.c
@@ -19,7 +19,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1990 - 2003
+    Copyright Pascal Bourguignon 1990 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -113,7 +113,7 @@ LEGAL
                     break;
                 }
                 if(filename[0]!='#'){
-                    l=strlen(filename);
+                    l=(INT32)strlen(filename);
                     loadedfiles[i]=malloc((unsigned)l);
                     /* (we're removing the newline). */
                     strncpy(loadedfiles[i],filename,(unsigned)(l-1));
@@ -168,7 +168,7 @@ LEGAL
             fd=fopen(loadedfiles[i],"r");
             if(fd!=NIL){
                 fseek(fd,0,SEEK_END);
-                sizes[i]=ftell(fd);
+                sizes[i]=(CARD32)ftell(fd);
                 sizes[MAXFILES]+=sizes[i];
                 fclose(fd);
             }else{
diff --git a/cookie/sources/random.c b/cookie/sources/random.c
index 5780bc7..f594874 100644
--- a/cookie/sources/random.c
+++ b/cookie/sources/random.c
@@ -12,7 +12,7 @@ MODIFICATIONS
     1993/08/16 <PJB> Added modulo parameter.
     1993/09/08 <PJB> Used BcRandom instead of random.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1993
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
@@ -21,10 +21,10 @@ LEGAL
 #include <BcRandom.h>
 #include <BcImplementation.h>

-    static void Usage(char* pname)
-    {
-        fprintf(stderr,"Usage:\n\t%s [ <module> ]\n",pname);
-    }/*Usage*/
+static void Usage(char* pname)
+{
+    fprintf(stderr,"Usage:\n\t%s [ <module> ]\n",pname);
+}/*Usage*/

 int main(int argc,char** argv)
 {
@@ -32,11 +32,11 @@ int main(int argc,char** argv)

     switch(argc){
     case 1:
-        printf("%lu\n",BcRandom_fromfile());
+        printf("%"FMT_CARD32"\n",BcRandom_fromfile());
         break;
     case 2:
         if((1==sscanf(argv[1],"%u",&n))&&(n>0)){
-            printf("%lu\n",BcRandom_fromfile()%n);
+            printf("%"FMT_CARD32"\n",BcRandom_fromfile()%n);
         }else{
             Usage(argv[0]);
             return(1);
@@ -50,4 +50,4 @@ int main(int argc,char** argv)
 }/*main*/


-/*** random.c                         --                     --          ***/
+/**** THE END ****/
diff --git a/cplusinherited/sources/Makefile b/cplusinherited/sources/Makefile
index cd26d58..20ea3a3 100644
--- a/cplusinherited/sources/Makefile
+++ b/cplusinherited/sources/Makefile
@@ -13,7 +13,7 @@
 #LEGAL
 #    GPL
 #
-#    Copyright Pascal Bourguignon 1993 - 1999
+#    Copyright Pascal Bourguignon 1993 - 2011
 #
 #    This program is free software; you can redistribute it and/or
 #    modify it under the terms of the GNU General Public License
diff --git a/cplusinherited/sources/cplusinherited.c b/cplusinherited/sources/cplusinherited.c
index ef6d3a7..f3d30ab 100644
--- a/cplusinherited/sources/cplusinherited.c
+++ b/cplusinherited/sources/cplusinherited.c
@@ -27,7 +27,7 @@ MODIFICATIONS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1992 - 1993
+    Copyright Pascal Bourguignon 1992 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -55,217 +55,217 @@ typedef struct {
 }               EntryT;


-    static void LoadRelations(const char* filename,char* hbuffer,int hbufsize,
-                    EntryT* hierarchy,int* hcount)
-    {
-            FILE*               f;
-            int                 size;
-            char*               p;
+static void LoadRelations(const char* filename,char* hbuffer,int hbufsize,
+                          EntryT* hierarchy,int* hcount)
+{
+    FILE*               f;
+    int                 size;
+    char*               p;

-        f=fopen(filename,"r");
-        if(f==NULL){
-            perror("LoadRelations fopen");
-            exit(1);
-        }
-        size=fread(hbuffer,sizeof(char),(unsigned)hbufsize,f);
-        if(size==0){
-            perror("LoadRelations fread");
-            exit(1);
-        }
-        fclose(f);
+    f=fopen(filename,"r");
+    if(f==NULL){
+        perror("LoadRelations fopen");
+        exit(1);
+    }
+    size=(int)fread(hbuffer,sizeof(char),(unsigned)hbufsize,f);
+    if(size==0){
+        perror("LoadRelations fread");
+        exit(1);
+    }
+    fclose(f);

-        hbuffer[size]=(char)0;
-        hbuffer[size+1]=(char)0;
-        (*hcount)=0;
-        p=hbuffer;
-        while((*p)!=(char)0){
-            hierarchy[(*hcount)].classname=p;
-            while(((*p)!='\n')&&((*p)!=(char)9)){
-                p++;
-            }
-            if((*p)==(char)9){
-                (*p)=(char)0;
-                p++;
-                hierarchy[(*hcount)].supername=p;
-                while(((*p)!='\n')&&((*p)!=(char)0)){
-                    p++;
-                }
-            }else{
-                hierarchy[(*hcount)].supername=NULL;
-            }
-            (*hcount)++;
+    hbuffer[size]=(char)0;
+    hbuffer[size+1]=(char)0;
+    (*hcount)=0;
+    p=hbuffer;
+    while((*p)!=(char)0){
+        hierarchy[(*hcount)].classname=p;
+        while(((*p)!='\n')&&((*p)!=(char)9)){
+            p++;
+        }
+        if((*p)==(char)9){
             (*p)=(char)0;
             p++;
+            hierarchy[(*hcount)].supername=p;
+            while(((*p)!='\n')&&((*p)!=(char)0)){
+                p++;
+            }
+        }else{
+            hierarchy[(*hcount)].supername=NULL;
         }
-    }/* LoadRelations; */
+        (*hcount)++;
+        (*p)=(char)0;
+        p++;
+    }
+}/* LoadRelations; */



-    typedef struct classdesc {
-        const char*             classname;
-        struct classdesc*       brother;
-        struct classdesc*       subclasses;
-    }                       classdesc;
-    typedef void (*classtree_action)(classdesc*,int);
+typedef struct classdesc {
+    const char*             classname;
+    struct classdesc*       brother;
+    struct classdesc*       subclasses;
+}                       classdesc;
+typedef void (*classtree_action)(classdesc*,int);


-    static classdesc* classtree_new(const char* classname)
-    {
-        classdesc*          newnode;
-        newnode=malloc(sizeof(*newnode));
-        newnode->classname=classname;
-        newnode->brother=NULL;
-        newnode->subclasses=NULL;
-        return(newnode);
-    }/* classtree_new; */
-
-
-    static void classtree_free(classdesc* tree)
-    {
-        if(tree->subclasses!=NULL){
-            classtree_free(tree->subclasses);
-        }
-        if(tree->brother!=NULL){
-            classtree_free(tree->brother);
-        }
-        free(tree);
-    }/* classtree_free; */
-
-
-    static classdesc* classtree_find(classdesc* tree,const char* classname)
-    {
-            classdesc*      found;
-        if(tree==NULL){
-            return(tree);
-        }else if(classname==NULL){
-            return(NULL);
-        }else if(strcmp(classname,tree->classname)==0){
-            return(tree);
+static classdesc* classtree_new(const char* classname)
+{
+    classdesc*          newnode;
+    newnode=malloc(sizeof(*newnode));
+    newnode->classname=classname;
+    newnode->brother=NULL;
+    newnode->subclasses=NULL;
+    return(newnode);
+}/* classtree_new; */
+
+
+static void classtree_free(classdesc* tree)
+{
+    if(tree->subclasses!=NULL){
+        classtree_free(tree->subclasses);
+    }
+    if(tree->brother!=NULL){
+        classtree_free(tree->brother);
+    }
+    free(tree);
+}/* classtree_free; */
+
+
+static classdesc* classtree_find(classdesc* tree,const char* classname)
+{
+    classdesc*      found;
+    if(tree==NULL){
+        return(tree);
+    }else if(classname==NULL){
+        return(NULL);
+    }else if(strcmp(classname,tree->classname)==0){
+        return(tree);
+    }else{
+        found=classtree_find(tree->subclasses,classname);
+        if(!found){
+            return(classtree_find(tree->brother,classname));
         }else{
-            found=classtree_find(tree->subclasses,classname);
-            if(!found){
-                return(classtree_find(tree->brother,classname));
-            }else{
-                return(found);
-            }
+            return(found);
         }
-    }/* classtree_find; */
+    }
+}/* classtree_find; */

 #if 0
-    static void classtree_addbrother(classdesc* tree,classdesc* node)
-    {
-        node->brother=tree->brother;
-        tree->brother=node;
-    }/* classtree_addbrother; */
+static void classtree_addbrother(classdesc* tree,classdesc* node)
+{
+    node->brother=tree->brother;
+    tree->brother=node;
+}/* classtree_addbrother; */
 #endif

-    static void classtree_addsubclass(classdesc* tree,classdesc* node)
-    {
-        node->brother=tree->subclasses;
-        tree->subclasses=node;
-    }/* classtree_addsubclass; */
+static void classtree_addsubclass(classdesc* tree,classdesc* node)
+{
+    node->brother=tree->subclasses;
+    tree->subclasses=node;
+}/* classtree_addsubclass; */


-    static classdesc* classtree_extract(classdesc* tree,classdesc* node)
-    {
-            classdesc*      extracted;
+static classdesc* classtree_extract(classdesc* tree,classdesc* node)
+{
+    classdesc*      extracted;

-        if(tree==NULL){
-            return(NULL);
-        }
-        if(node==tree->brother){
-            tree->brother=node->brother;
-            node->brother=NULL;
-            return(node);
-        }else{
-            extracted=classtree_extract(tree->brother,node);
-            if(extracted){
-                return(extracted);
-            }
+    if(tree==NULL){
+        return(NULL);
+    }
+    if(node==tree->brother){
+        tree->brother=node->brother;
+        node->brother=NULL;
+        return(node);
+    }else{
+        extracted=classtree_extract(tree->brother,node);
+        if(extracted){
+            return(extracted);
         }
-         if(node==tree->subclasses){
-            tree->subclasses=node->brother;
-            node->brother=NULL;
-            return(node);
-        }else{
-            extracted=classtree_extract(tree->subclasses,node);
-            if(extracted){
-                return(extracted);
-            }
+    }
+    if(node==tree->subclasses){
+        tree->subclasses=node->brother;
+        node->brother=NULL;
+        return(node);
+    }else{
+        extracted=classtree_extract(tree->subclasses,node);
+        if(extracted){
+            return(extracted);
         }
-        return(NULL);
-    }/* classtree_extract; */
+    }
+    return(NULL);
+}/* classtree_extract; */


-    static void classtree_print(classdesc* node,int level)
-    {
-        printf("%*c %s\n",2+level*4,':',node->classname);
-    }/* classtree_print; */
+static void classtree_print(classdesc* node,int level)
+{
+    printf("%*c %s\n",2+level*4,':',node->classname);
+}/* classtree_print; */


-    static void classtree_prefixed(classdesc* tree,classtree_action action,int level)
-    {
-        action(tree,level);
-        if(tree->subclasses!=NULL){
-            classtree_prefixed(tree->subclasses,action,level+1);
-        }
-        if(tree->brother!=NULL){
-            classtree_prefixed(tree->brother,action,level);
-        }
-    }/* classtree_prefixed; */
+static void classtree_prefixed(classdesc* tree,classtree_action action,int level)
+{
+    action(tree,level);
+    if(tree->subclasses!=NULL){
+        classtree_prefixed(tree->subclasses,action,level+1);
+    }
+    if(tree->brother!=NULL){
+        classtree_prefixed(tree->brother,action,level);
+    }
+}/* classtree_prefixed; */


-    static int classtree_numberOfChildren(classdesc* tree)
-    {
-            int         result=0;
-            classdesc*  child;
-        child=tree->subclasses;
-        while(child!=NULL){
-            result++;
-            child=child->brother;
-        }
-        return(result);
-    }/* classtree_numberOfChildren; */
+static int classtree_numberOfChildren(classdesc* tree)
+{
+    int         result=0;
+    classdesc*  child;
+    child=tree->subclasses;
+    while(child!=NULL){
+        result++;
+        child=child->brother;
+    }
+    return(result);
+}/* classtree_numberOfChildren; */


-    static int compareAlpha(const void* a,const void* b)
-    {
-        return(strcmp((*(const classdesc* const*)a)->classname,
-                      (*(const classdesc* const*)b)->classname));
-    }/* compareAlpha; */
+static int compareAlpha(const void* a,const void* b)
+{
+    return(strcmp((*(const classdesc* const*)a)->classname,
+                  (*(const classdesc* const*)b)->classname));
+}/* compareAlpha; */


-    static void classtree_sortAlphabetically(classdesc* tree)
-    {
-            classdesc**     children;
-            classdesc*      child;
-            int             count;
-            int             i;
+static void classtree_sortAlphabetically(classdesc* tree)
+{
+    classdesc**     children;
+    classdesc*      child;
+    int             count;
+    int             i;

-        count=classtree_numberOfChildren(tree);
-        if(count>1){
-            children=(classdesc**)malloc(sizeof(classdesc*)*count);
-            child=tree->subclasses;
-            for(i=0;i<count;i++){
-                children[i]=child;
-                child=child->brother;
-            }
-            qsort((void*)children,(unsigned)count,
-                  sizeof(classdesc*),compareAlpha);
-            child=NULL;
-            for(i=count-1;i>=0;i--){
-                children[i]->brother=child;
-                child=children[i];
-            }
-            tree->subclasses=child;
-            free(children);
-        }
+    count=classtree_numberOfChildren(tree);
+    if(count>1){
+        children=(classdesc**)malloc(sizeof(classdesc*)*(size_t)count);
         child=tree->subclasses;
-        while(child!=NULL){
-            classtree_sortAlphabetically(child);
+        for(i=0;i<count;i++){
+            children[i]=child;
             child=child->brother;
         }
-    }/* classtree_sortAlphabetically; */
+        qsort((void*)children,(unsigned)count,
+              sizeof(classdesc*),compareAlpha);
+        child=NULL;
+        for(i=count-1;i>=0;i--){
+            children[i]->brother=child;
+            child=children[i];
+        }
+        tree->subclasses=child;
+        free(children);
+    }
+    child=tree->subclasses;
+    while(child!=NULL){
+        classtree_sortAlphabetically(child);
+        child=child->brother;
+    }
+}/* classtree_sortAlphabetically; */


 typedef struct {
@@ -274,424 +274,424 @@ typedef struct {
 }               treeAndDepthT;


-    static int compareDepth(const void* a,const void* b)
-    {
-        if(((const treeAndDepthT*)a)->depth < ((const treeAndDepthT*)b)->depth){
-            return(-1);
-        }else if(((const treeAndDepthT*)a)->depth
-                 > ((const treeAndDepthT*)b)->depth){
-            return(1);
-        }else{
-            return(strcmp(((const treeAndDepthT*)a)->subtree->classname,
-                          ((const treeAndDepthT*)b)->subtree->classname));
-        }
-    }/* compareDepth; */
+static int compareDepth(const void* a,const void* b)
+{
+    if(((const treeAndDepthT*)a)->depth < ((const treeAndDepthT*)b)->depth){
+        return(-1);
+    }else if(((const treeAndDepthT*)a)->depth
+             > ((const treeAndDepthT*)b)->depth){
+        return(1);
+    }else{
+        return(strcmp(((const treeAndDepthT*)a)->subtree->classname,
+                      ((const treeAndDepthT*)b)->subtree->classname));
+    }
+}/* compareDepth; */


-    static int classtree_sortDepth(classdesc* tree)
-    {
-            treeAndDepthT*  children;
-            classdesc*      child;
-            int             depth;
-            int             count;
-            int             i,d;
+static int classtree_sortDepth(classdesc* tree)
+{
+    treeAndDepthT*  children;
+    classdesc*      child;
+    int             depth;
+    int             count;
+    int             i,d;

-        depth=0;
-        count=classtree_numberOfChildren(tree);
-        if(count>1){
-            children=(treeAndDepthT*)malloc(sizeof(treeAndDepthT)*count);
-            child=tree->subclasses;
-            for(i=0;i<count;i++){
-                d=classtree_sortDepth(child);
-                if(depth<d){
-                    depth=d;
-                }
-                children[i].depth=d;
-                children[i].subtree=child;
-                child=child->brother;
-            }
-            qsort((void*)children,(unsigned)count,
-                  sizeof(treeAndDepthT),compareDepth);
-            child=NULL;
-            for(i=count-1;i>=0;i--){
-                children[i].subtree->brother=child;
-                child=children[i].subtree;
+    depth=0;
+    count=classtree_numberOfChildren(tree);
+    if(count>1){
+        children=(treeAndDepthT*)malloc(sizeof(treeAndDepthT)*(size_t)count);
+        child=tree->subclasses;
+        for(i=0;i<count;i++){
+            d=classtree_sortDepth(child);
+            if(depth<d){
+                depth=d;
             }
-            tree->subclasses=child;
-            free(children);
-        }else if(count>0){
-            depth=classtree_sortDepth(tree->subclasses);
-        }else{
-            depth=0;
+            children[i].depth=d;
+            children[i].subtree=child;
+            child=child->brother;
+        }
+        qsort((void*)children,(unsigned)count,
+              sizeof(treeAndDepthT),compareDepth);
+        child=NULL;
+        for(i=count-1;i>=0;i--){
+            children[i].subtree->brother=child;
+            child=children[i].subtree;
         }
-        return(depth+1);
-    }/* classtree_sortDepth; */
+        tree->subclasses=child;
+        free(children);
+    }else if(count>0){
+        depth=classtree_sortDepth(tree->subclasses);
+    }else{
+        depth=0;
+    }
+    return(depth+1);
+}/* classtree_sortDepth; */



-    static classdesc* BuildTree(EntryT* hierarchy,int hcount)
-    {
-            int             i;
-            classdesc*      tree;
-            classdesc*      superclassnode;
-            classdesc*      classnode;
+static classdesc* BuildTree(EntryT* hierarchy,int hcount)
+{
+    int             i;
+    classdesc*      tree;
+    classdesc*      superclassnode;
+    classdesc*      classnode;

-        tree=classtree_new("<ROOT>");
-        for(i=0;i<hcount;i++){
-            if(hierarchy[i].supername==NULL){
-                /*  hierarchy[i] is a new root class. */
-                superclassnode=tree;
-            }else{
-                superclassnode=classtree_find(tree,hierarchy[i].supername);
-                if(superclassnode==NULL){
-                    /*  hierarchy[i] has a superclass yet unclassified. */
-                    superclassnode=classtree_new(hierarchy[i].supername);
-                    classtree_addsubclass(tree,superclassnode);
-                    /* classtree_addbrother(tree,superclassnode); */
-                }
-            }
-            classnode=classtree_find(tree,hierarchy[i].classname);
-            if(classnode!=NULL){
-                /*  we must extract for the implementation of classdesc */
-                /*  use brother lists while a node may have several */
-                /*  brother lists when multiple inheritance is allowed. */
-                /*  (Brotherhood is actually defined according to a parent). */
-                classtree_extract(tree,classnode);
-            }else{
-                classnode=classtree_new(hierarchy[i].classname);
+    tree=classtree_new("<ROOT>");
+    for(i=0;i<hcount;i++){
+        if(hierarchy[i].supername==NULL){
+            /*  hierarchy[i] is a new root class. */
+            superclassnode=tree;
+        }else{
+            superclassnode=classtree_find(tree,hierarchy[i].supername);
+            if(superclassnode==NULL){
+                /*  hierarchy[i] has a superclass yet unclassified. */
+                superclassnode=classtree_new(hierarchy[i].supername);
+                classtree_addsubclass(tree,superclassnode);
+                /* classtree_addbrother(tree,superclassnode); */
             }
-            classtree_addsubclass(superclassnode,classnode);
         }
+        classnode=classtree_find(tree,hierarchy[i].classname);
+        if(classnode!=NULL){
+            /*  we must extract for the implementation of classdesc */
+            /*  use brother lists while a node may have several */
+            /*  brother lists when multiple inheritance is allowed. */
+            /*  (Brotherhood is actually defined according to a parent). */
+            classtree_extract(tree,classnode);
+        }else{
+            classnode=classtree_new(hierarchy[i].classname);
+        }
+        classtree_addsubclass(superclassnode,classnode);
+    }

-        return(tree);
-    }/* BuildTree; */
+    return(tree);
+}/* BuildTree; */


-    static int CheckHierarchy(char* subclass,char* superclass,
-                EntryT* hierarchy,int hcount)
-    {
-            int     i;
-        i=0;
-        while(i<hcount){
-            if((strcmp(subclass,hierarchy[i].classname)==0)
-            &&((superclass==NULL)
-             ||(strcmp(superclass,hierarchy[i].supername)==0))){
-                return(1);
-            }
-            i++;
+static int CheckHierarchy(char* subclass,char* superclass,
+                          EntryT* hierarchy,int hcount)
+{
+    int     i;
+    i=0;
+    while(i<hcount){
+        if((strcmp(subclass,hierarchy[i].classname)==0)
+           &&((superclass==NULL)
+              ||(strcmp(superclass,hierarchy[i].supername)==0))){
+            return(1);
         }
-        return(0);
-    }/* CheckHierarchy; */
+        i++;
+    }
+    return(0);
+}/* CheckHierarchy; */



 static char         fbuffer[8192];
 static char         dbuffer[256*1024];

-    static int Pos(const char* string,const char* substring,unsigned int startpos)
-    {
-        unsigned int        l;
+static int Pos(const char* string,const char* substring,unsigned int startpos)
+{
+    unsigned int        l;

-        l=strlen(substring);
-        while(string[startpos]!=(char)0){
-            if(strncmp(string+startpos,substring,l)==0){
-                return(startpos);
-            }
-            startpos++;
+    l=(unsigned int)strlen(substring);
+    while(string[startpos]!=(char)0){
+        if(strncmp(string+startpos,substring,l)==0){
+            return((int)startpos);
         }
-        return(-1);
-    }/* Pos; */
+        startpos++;
+    }
+    return(-1);
+}/* Pos; */

 static char     wbuffer[1024];


-    static void GetNextWords(char* string,int pos,char** words,int wcount)
-    {
-            int         i;
-            int         w;
+static void GetNextWords(char* string,int pos,char** words,int wcount)
+{
+    int         i;
+    int         w;

-        i=0;
-        w=0;
-        while(w<wcount){
-            words[w]=wbuffer+i;
-            if(ispunct(string[pos])){
-                wbuffer[i]=string[pos];
-                i++;
-                pos++;
-            }else{
-                while(isalnum(string[pos])){
-                    wbuffer[i]=string[pos];
-                    pos++;
-                    i++;
-                }
-            }
-            wbuffer[i]=(char)0;
+    i=0;
+    w=0;
+    while(w<wcount){
+        words[w]=wbuffer+i;
+        if(ispunct(string[pos])){
+            wbuffer[i]=string[pos];
             i++;
-            while(isspace(string[pos])){
+            pos++;
+        }else{
+            while(isalnum(string[pos])){
+                wbuffer[i]=string[pos];
                 pos++;
+                i++;
             }
-            w++;
         }
-    }/* GetNextWords; */
+        wbuffer[i]=(char)0;
+        i++;
+        while(isspace(string[pos])){
+            pos++;
+        }
+        w++;
+    }
+}/* GetNextWords; */


-    static void MoveUp(char* from,char* to,int size)
-    {
-        to+=size;
-        from+=size;
-        while(size-->0){
-            to--;
-            from--;
-            (*to)=(*from);
-        }
-    }/* MoveUp; */
+static void MoveUp(char* from,char* to,int size)
+{
+    to+=size;
+    from+=size;
+    while(size-->0){
+        to--;
+        from--;
+        (*to)=(*from);
+    }
+}/* MoveUp; */


-    static int UpdateInterface(int size,EntryT* hierarchy,int hcount)
-    {
-        unsigned int    pos;
-        char*           words[5];
-        char            definition[128];
-        int             inclen;
-        int             incpos;
+static int UpdateInterface(int size,EntryT* hierarchy,int hcount)
+{
+    int             pos;
+    char*           words[5];
+    char            definition[128];
+    int             inclen;
+    int             incpos;

-        pos=0;
-        pos=Pos(dbuffer,"class",pos);
-        while(pos>0){
-            GetNextWords(dbuffer,(signed)pos,words,5);
-            if((strcmp(words[2],":")==0)
-            &&(strcmp(words[3],"public")==0)){
-                if(!CheckHierarchy(words[1],words[4],hierarchy,hcount)){
-                    printf("I don't have %s %s in class hierarchy!\n",
-                            words[1],words[4]);
-                }
+    pos=0;
+    pos=Pos(dbuffer,"class",(unsigned int)pos);
+    while(pos>0){
+        GetNextWords(dbuffer,(signed)pos,words,5);
+        if((strcmp(words[2],":")==0)
+           &&(strcmp(words[3],"public")==0)){
+            if(!CheckHierarchy(words[1],words[4],hierarchy,hcount)){
+                printf("I don't have %s %s in class hierarchy!\n",
+                       words[1],words[4]);
+            }

-                sprintf(definition,"#define %s_SUPER %s\n",
-                            words[1],words[4]);
-                inclen=strlen(definition);
-                incpos=pos;
-                while((dbuffer[incpos])!='\n'){
-                    incpos--;
-                }
-                incpos++;
-                MoveUp(dbuffer+incpos,dbuffer+incpos+inclen,size-incpos+1);
-                strncpy(dbuffer+incpos,definition,(unsigned)inclen);
-                size+=inclen;
-                pos+=inclen;
+            sprintf(definition,"#define %s_SUPER %s\n",
+                    words[1],words[4]);
+            inclen=(int)strlen(definition);
+            incpos=pos;
+            while((dbuffer[incpos])!='\n'){
+                incpos--;
             }
-            pos++;
-            pos=Pos(dbuffer,"class",pos);
+            incpos++;
+            MoveUp(dbuffer+incpos,dbuffer+incpos+inclen,size-incpos+1);
+            strncpy(dbuffer+incpos,definition,(unsigned)inclen);
+            size+=inclen;
+            pos+=inclen;
         }
-        return(size);
-    }/* UpdateInterface; */
+        pos++;
+        pos=Pos(dbuffer,"class",(unsigned int)pos);
+    }
+    return(size);
+}/* UpdateInterface; */


-    static void CorrectInterfaces(const char* filename,EntryT* hierarchy,int hcount)
-    {
-            FILE*       f;
-            int         size,wsize;
-            char*       p;
-            char*       np;
+static void CorrectInterfaces(const char* filename,EntryT* hierarchy,int hcount)
+{
+    FILE*       f;
+    int         size,wsize;
+    char*       p;
+    char*       np;


-        /*  load the file list: */
-        f=fopen(filename,"r");
+    /*  load the file list: */
+    f=fopen(filename,"r");
+    if(f==NULL){
+        perror("CorrectInterfaces fopen");
+        exit(1);
+    }
+    size=(int)fread(fbuffer,sizeof(char),sizeof(fbuffer),f);
+    if(size==0){
+        perror("CorrectInterfaces fread");
+        exit(1);
+    }
+    fclose(f);
+
+    /*  process all file in the file list: */
+    fbuffer[size]=(char)0;
+    fbuffer[size+1]=(char)0;
+    p=fbuffer;
+    np=fbuffer;
+    while((*p)!=(char)0){
+        /*  get the next file name in the file list: */
+        while(((*np)!='\n')&&((*np)!=(char)0)){
+            np++;
+        }
+        (*np)=(char)0;
+        np++;
+        /*  process the file: */
+        f=fopen(p,"r+");
         if(f==NULL){
-            perror("CorrectInterfaces fopen");
+            char        message[256];
+            sprintf(message,"CorrectInterfaces fopen %s",p);
+            perror(message);
             exit(1);
         }
-        size=fread(fbuffer,sizeof(char),sizeof(fbuffer),f);
+        /*  load the file: */
+        size=(int)fread(dbuffer,sizeof(char),sizeof(dbuffer),f);
         if(size==0){
-            perror("CorrectInterfaces fread");
+            char        message[256];
+            sprintf(message,"CorrectInterfaces fread %s",p);
+            perror(message);
             exit(1);
         }
-        fclose(f);
-
-        /*  process all file in the file list: */
-        fbuffer[size]=(char)0;
-        fbuffer[size+1]=(char)0;
-        p=fbuffer;
-        np=fbuffer;
-        while((*p)!=(char)0){
-            /*  get the next file name in the file list: */
-            while(((*np)!='\n')&&((*np)!=(char)0)){
-                np++;
-            }
-            (*np)=(char)0;
-            np++;
-            /*  process the file: */
-            f=fopen(p,"r+");
-            if(f==NULL){
-                    char        message[256];
-                sprintf(message,"CorrectInterfaces fopen %s",p);
-                perror(message);
-                exit(1);
-            }
-            /*  load the file: */
-            size=fread(dbuffer,sizeof(char),sizeof(dbuffer),f);
-            if(size==0){
-                    char        message[256];
-                sprintf(message,"CorrectInterfaces fread %s",p);
-                perror(message);
-                exit(1);
-            }
-            dbuffer[size]=(char)0;
-            dbuffer[size+1]=(char)0;
+        dbuffer[size]=(char)0;
+        dbuffer[size+1]=(char)0;

-            /*  correct it: */
-            size=UpdateInterface(size,hierarchy,hcount);
+        /*  correct it: */
+        size=UpdateInterface(size,hierarchy,hcount);

-            /*  save the file: */
-            if(fseek(f,0,SEEK_SET)<0){
-                    char        message[256];
-                sprintf(message,"CorrectInterfaces fseek %s",p);
-                perror(message);
-                exit(1);
-            }
+        /*  save the file: */
+        if(fseek(f,0,SEEK_SET)<0){
+            char        message[256];
+            sprintf(message,"CorrectInterfaces fseek %s",p);
+            perror(message);
+            exit(1);
+        }

-            wsize=fwrite(dbuffer,sizeof(char),(unsigned)size,f);
-            if(wsize!=size){
-                    char        message[256];
-                sprintf(message,"CorrectInterfaces fwrite %s",p);
-                perror(message);
-                exit(1);
-            }
-            fclose(f);
-            p=np;
+        wsize=(int)fwrite(dbuffer,sizeof(char),(unsigned)size,f);
+        if(wsize!=size){
+            char        message[256];
+            sprintf(message,"CorrectInterfaces fwrite %s",p);
+            perror(message);
+            exit(1);
         }
-    }/* CorrectInterfaces; */
+        fclose(f);
+        p=np;
+    }
+}/* CorrectInterfaces; */


-    static int UpdateImplementation(int size,EntryT* hierarchy,int hcount)
-    {
-            int     pos;
-            int     i,j,l;
-            char    classname[128];
-            char    definition[128];
+static int UpdateImplementation(int size,EntryT* hierarchy,int hcount)
+{
+    int     pos;
+    int     i,j,l;
+    char    classname[128];
+    char    definition[128];

-        pos=0;
-        while(dbuffer[pos]!=(char)0){
-            if(strncmp(dbuffer+pos,"::",2)==0){
-                i=pos-1;
-                while(!isalnum(dbuffer[i])){
-                    i--;
-                }
-                j=i;
-                while(isalnum(dbuffer[i])){
-                    i--;
-                }
-                l=j-i;
-                strncpy(classname,dbuffer+i+1,(unsigned)l);
-                classname[l]=(char)0;
-            }else if(strncmp(dbuffer+pos,"inherited",9)==0){
-                if(!CheckHierarchy(classname,NULL,hierarchy,hcount)){
-                    printf("I don't have %s in class hierarchy!\n",
-                            classname);
-                }
-                sprintf(definition,"%s_SUPER",classname);
-                l=strlen(definition);
-                MoveUp(dbuffer+pos,dbuffer+pos+l-9,size-pos);
-                strncpy(dbuffer+pos,definition,(unsigned)l);
-                size+=l-9;
-                pos+=l;
+    pos=0;
+    while(dbuffer[pos]!=(char)0){
+        if(strncmp(dbuffer+pos,"::",2)==0){
+            i=pos-1;
+            while(!isalnum(dbuffer[i])){
+                i--;
             }
-            pos++;
+            j=i;
+            while(isalnum(dbuffer[i])){
+                i--;
+            }
+            l=j-i;
+            strncpy(classname,dbuffer+i+1,(unsigned)l);
+            classname[l]=(char)0;
+        }else if(strncmp(dbuffer+pos,"inherited",9)==0){
+            if(!CheckHierarchy(classname,NULL,hierarchy,hcount)){
+                printf("I don't have %s in class hierarchy!\n",
+                       classname);
+            }
+            sprintf(definition,"%s_SUPER",classname);
+            l=(int)strlen(definition);
+            MoveUp(dbuffer+pos,dbuffer+pos+l-9,size-pos);
+            strncpy(dbuffer+pos,definition,(unsigned)l);
+            size+=l-9;
+            pos+=l;
         }
-        return(size);
-    }/* UpdateImplementation; */
+        pos++;
+    }
+    return(size);
+}/* UpdateImplementation; */


-    static void CorrectImplementation(const char* filename,
-                        EntryT* hierarchy,int hcount)
-    {
-            FILE*       f;
-            int         size,wsize;
-            char*       p;
-            char*       np;
+static void CorrectImplementation(const char* filename,
+                                  EntryT* hierarchy,int hcount)
+{
+    FILE*       f;
+    int         size,wsize;
+    char*       p;
+    char*       np;

-        f=fopen(filename,"r");
+    f=fopen(filename,"r");
+    if(f==NULL){
+        perror("CorrectImplementation fopen");
+        exit(1);
+    }
+    size=(int)fread(fbuffer,sizeof(char),sizeof(fbuffer),f);
+    if(size==0){
+        perror("CorrectImplementation fread");
+        exit(1);
+    }
+    fclose(f);
+
+    fbuffer[size]=(char)0;
+    fbuffer[size+1]=(char)0;
+    p=fbuffer;
+    np=fbuffer;
+    while((*p)!=(char)0){
+        while(((*np)!='\n')&&((*np)!=(char)0)){
+            np++;
+        }
+        (*np)=(char)0;
+        np++;
+        f=fopen(p,"r+");
         if(f==NULL){
-            perror("CorrectImplementation fopen");
+            char        message[256];
+            sprintf(message,"CorrectImplementation fopen %s",p);
+            perror(message);
             exit(1);
         }
-        size=fread(fbuffer,sizeof(char),sizeof(fbuffer),f);
+        size=(int)fread(dbuffer,sizeof(char),sizeof(dbuffer),f);
         if(size==0){
-            perror("CorrectImplementation fread");
+            char        message[256];
+            sprintf(message,"CorrectImplementation fread %s",p);
+            perror(message);
             exit(1);
         }
-        fclose(f);
-
-        fbuffer[size]=(char)0;
-        fbuffer[size+1]=(char)0;
-        p=fbuffer;
-        np=fbuffer;
-        while((*p)!=(char)0){
-            while(((*np)!='\n')&&((*np)!=(char)0)){
-                np++;
-            }
-            (*np)=(char)0;
-            np++;
-            f=fopen(p,"r+");
-            if(f==NULL){
-                    char        message[256];
-                sprintf(message,"CorrectImplementation fopen %s",p);
-                perror(message);
-                exit(1);
-            }
-            size=fread(dbuffer,sizeof(char),sizeof(dbuffer),f);
-            if(size==0){
-                    char        message[256];
-                sprintf(message,"CorrectImplementation fread %s",p);
-                perror(message);
-                exit(1);
-            }
-            dbuffer[size]=(char)0;
-            dbuffer[size+1]=(char)0;
+        dbuffer[size]=(char)0;
+        dbuffer[size+1]=(char)0;

-            size=UpdateImplementation(size,hierarchy,hcount);
+        size=UpdateImplementation(size,hierarchy,hcount);

-            if(fseek(f,0,SEEK_SET)<0){
-                    char        message[256];
-                sprintf(message,"CorrectImplementation fseek %s",p);
-                perror(message);
-                exit(1);
-            }
+        if(fseek(f,0,SEEK_SET)<0){
+            char        message[256];
+            sprintf(message,"CorrectImplementation fseek %s",p);
+            perror(message);
+            exit(1);
+        }

-            wsize=fwrite(dbuffer,sizeof(char),(unsigned)size,f);
-            if(wsize!=size){
-                    char        message[256];
-                sprintf(message,"CorrectImplementation fwrite %s",p);
-                perror(message);
-                exit(1);
-            }
-            fclose(f);
-            p=np;
+        wsize=(int)fwrite(dbuffer,sizeof(char),(unsigned)size,f);
+        if(wsize!=size){
+            char        message[256];
+            sprintf(message,"CorrectImplementation fwrite %s",p);
+            perror(message);
+            exit(1);
         }
-    }/* CorrectImplementation; */
+        fclose(f);
+        p=np;
+    }
+}/* CorrectImplementation; */


-    static void usage(const char* pname)
-    {
-        fprintf(stderr,"Usage:  %s [-a|-d] <inherit_relation_file>"
+static void usage(const char* pname)
+{
+    fprintf(stderr,"Usage:  %s [-a|-d] <inherit_relation_file>"
             " [ <interface_list_file> <source_list_file> ]\n",pname);
-        fprintf(stderr,"    -a   sort each level alphabetically.\n");
-        fprintf(stderr,"    -d   sort subtrees by increasing depth.\n");
-        fprintf(stderr,"         (default is no sort).\n");
-    }/* usage; */
+    fprintf(stderr,"    -a   sort each level alphabetically.\n");
+    fprintf(stderr,"    -d   sort subtrees by increasing depth.\n");
+    fprintf(stderr,"         (default is no sort).\n");
+}/* usage; */


 int main(int argc,char**argv)
 {
-        const char*         relationFName=NULL;
-        const char*         interfacesFName=NULL;
-        const char*         implementationsFName=NULL;
-        short               sortAlgorithm=0;
-        int                 i;
+    const char*         relationFName=NULL;
+    const char*         interfacesFName=NULL;
+    const char*         implementationsFName=NULL;
+    short               sortAlgorithm=0;
+    int                 i;

-        static EntryT       hierarchy[2000];
-        static int          hcount;
-        static char         hbuffer[81920];
-        classdesc*          tree;
+    static EntryT       hierarchy[2000];
+    static int          hcount;
+    static char         hbuffer[81920];
+    classdesc*          tree;

     for(i=1;i<argc;i++){
         if(argv[i][0]=='-'){
@@ -721,7 +721,7 @@ int main(int argc,char**argv)
         }
     }
     if((relationFName==NULL)
-    ||((interfacesFName!=NULL)&&(implementationsFName==NULL))){
+       ||((interfacesFName!=NULL)&&(implementationsFName==NULL))){
         usage(argv[0]);
         return(1);
     }
@@ -747,4 +747,4 @@ int main(int argc,char**argv)
     return(0);
 }

-/*** cplusinherited.c                 -- 2003-12-02 11:16:55 -- pascal   ***/
+/**** THE END ****/
diff --git a/dosname/sources/AttrString.cc b/dosname/sources/AttrString.cc
index 2319c56..fca49e2 100644
--- a/dosname/sources/AttrString.cc
+++ b/dosname/sources/AttrString.cc
@@ -14,7 +14,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/AttrString.hh b/dosname/sources/AttrString.hh
index b65377e..ae3de68 100644
--- a/dosname/sources/AttrString.hh
+++ b/dosname/sources/AttrString.hh
@@ -13,7 +13,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/CapWord.cc b/dosname/sources/CapWord.cc
index d62a526..b8e8f9d 100644
--- a/dosname/sources/CapWord.cc
+++ b/dosname/sources/CapWord.cc
@@ -14,7 +14,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

@@ -45,56 +45,56 @@ extern "C"{
 #include BpClass_hh
 #include BcImplementation_h

-    static const char rcsid[]="$Id: CapWord.cc,v 1.1 2003/12/04 03:46:04 pjbpjb Exp $";
+static const char rcsid[]="$Id: CapWord.cc,v 1.1 2003/12/04 03:46:04 pjbpjb Exp $";


-    CharKindT charKind[256]={
-        ck_sep,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,
-        ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,
-        ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,
-        ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,
-        /*        !      "      #      $      %       &     '    */
-        ck_end,ck_ini,ck_ini,ck_ini,ck_end,ck_end,ck_ini,ck_ini,
-        /* (      )      *      +      ,      -       .     /    */
-        ck_end,ck_ini,ck_ign,ck_ign,ck_end,ck_end,ck_sep,ck_ign,
-        /* 0 1 2 3 4 5 6 7 */
-        ck_dig,ck_dig,ck_dig,ck_dig,ck_dig,ck_dig,ck_dig,ck_dig,
-        /* 8 9 : ; < = > ? */
-        ck_dig,ck_dig,ck_end,ck_end,ck_end,ck_ini,ck_ini,ck_ign,
-        /* @ A B C D E F G  */
-        ck_end,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,
-        /* H I J K L M N O  */
-        ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,
-        /* P Q R S T U V W  */
-        ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,
-        /* X Y Z [ \ ] ^ _  */
-        ck_cap,ck_cap,ck_cap,ck_end,ck_end,ck_ini,ck_ini,ck_end,
-        /* ` a b c d e f g */
-        ck_ini,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        /* h i j k l m n o  */
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        /* p q r s t u v w  */
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        /* x y z { | } ~   */
-        ck_low,ck_low,ck_low,ck_end,ck_end,ck_ini,ck_ini,ck_end,
-        /* >= 128 */
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
-        ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low
-    };
+CharKindT charKind[256]={
+    ck_sep,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,
+    ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,
+    ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,
+    ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,ck_end,
+    /*        !      "      #      $      %       &     '    */
+    ck_end,ck_ini,ck_ini,ck_ini,ck_end,ck_end,ck_ini,ck_ini,
+    /* (      )      *      +      ,      -       .     /    */
+    ck_end,ck_ini,ck_ign,ck_ign,ck_end,ck_end,ck_sep,ck_ign,
+    /* 0 1 2 3 4 5 6 7 */
+    ck_dig,ck_dig,ck_dig,ck_dig,ck_dig,ck_dig,ck_dig,ck_dig,
+    /* 8 9 : ; < = > ? */
+    ck_dig,ck_dig,ck_end,ck_end,ck_end,ck_ini,ck_ini,ck_ign,
+    /* @ A B C D E F G  */
+    ck_end,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,
+    /* H I J K L M N O  */
+    ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,
+    /* P Q R S T U V W  */
+    ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,ck_cap,
+    /* X Y Z [ \ ] ^ _  */
+    ck_cap,ck_cap,ck_cap,ck_end,ck_end,ck_ini,ck_ini,ck_end,
+    /* ` a b c d e f g */
+    ck_ini,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    /* h i j k l m n o  */
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    /* p q r s t u v w  */
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    /* x y z { | } ~   */
+    ck_low,ck_low,ck_low,ck_end,ck_end,ck_ini,ck_ini,ck_end,
+    /* >= 128 */
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,
+    ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low,ck_low
+};



@@ -103,289 +103,285 @@ extern "C"{
 /////////////////////////////////////////////////////////////////////////////


-    CONSTRUCTOR(CapWord)
-    {
-        BpClass_PLUG(CapWord);
-        initers=NIL;
-        letters=NIL;
-        trailers=NIL;
-    }//CapWord;
+CONSTRUCTOR(CapWord)
+{
+    BpClass_PLUG(CapWord);
+    initers=NIL;
+    letters=NIL;
+    trailers=NIL;
+}//CapWord;


-    DESTRUCTOR(CapWord)
-    {
-        if(initers!=NIL){
-            free(initers);
-        }
-        if(letters!=NIL){
-            free(letters);
-        }
-        if(trailers!=NIL){
-            free(trailers);
-        }
-    }//~CapWord;
+DESTRUCTOR(CapWord)
+{
+    if(initers!=NIL){
+        free(initers);
+    }
+    if(letters!=NIL){
+        free(letters);
+    }
+    if(trailers!=NIL){
+        free(trailers);
+    }
+}//~CapWord;


-    METHOD(CapWord,makeBrother,(void),BpObject*)
-    {
-        return(NEW(CapWord));
-    }//makeBrother;
+METHOD(CapWord,makeBrother,(void),BpObject*)
+{
+    return(NEW(CapWord));
+}//makeBrother;


-    METHOD(CapWord,printOnLevel,(FILE* file,CARD32 level),void)
-    {
-        CapWord_SUPER::printOnLevel(file,level);
-        PRINTONLEVEL(file,level,"%s",initers,NULLSTR(initers));
-        PRINTONLEVEL(file,level,"%s",letters,NULLSTR(letters));
-        PRINTONLEVEL(file,level,"%s",trailers,NULLSTR(trailers));
-    }//printOnLevel;
+METHOD(CapWord,printOnLevel,(FILE* file,CARD32 level),void)
+{
+    CapWord_SUPER::printOnLevel(file,level);
+    PRINTONLEVEL(file,level,"%s",initers,NULLSTR(initers));
+    PRINTONLEVEL(file,level,"%s",letters,NULLSTR(letters));
+    PRINTONLEVEL(file,level,"%s",trailers,NULLSTR(trailers));
+}//printOnLevel;


-    METHOD(CapWord,analyzeRun,
-                    (const char* source,INT32* next,INT32 kinds),char*)
-    {
-            INT32       cNext;
-            INT32       mark;
-            char*       run;
-            INT32       size;
-            INT32       i;
-            INT32       j;
+METHOD(CapWord,analyzeRun,
+       (const char* source,INT32* next,INT32 kinds),char*)
+{
+    INT32       cNext;
+    INT32       mark;
+    char*       run;
+    INT32       size;
+    INT32       i;
+    INT32       j;

-        cNext=(*next);
-        mark=cNext;
-        kinds|=(1<<ck_ign);
-        while(BITIN(charKind[(unsigned char)source[cNext]],(CARD32)kinds)){
-            cNext++;
-        }
-        if(cNext>mark){
-            size=cNext-mark;
-            run=(char*)malloc(size+1);
-            j=0;
-            for(i=mark;i<cNext;i++){
-                if(charKind[(unsigned char)source[i]]!=ck_ign){
-                    run[j]=source[i];
-                    j++;
-                }
+    cNext=(*next);
+    mark=cNext;
+    kinds|=(1<<ck_ign);
+    while(BITIN(charKind[(unsigned char)source[cNext]],(CARD32)kinds)){
+        cNext++;
+    }
+    if(cNext>mark){
+        size=cNext-mark;
+        run=(char*)malloc(size+1);
+        j=0;
+        for(i=mark;i<cNext;i++){
+            if(charKind[(unsigned char)source[i]]!=ck_ign){
+                run[j]=source[i];
+                j++;
             }
-            run[size]='\0';
-        }else{
-            run=NIL;
         }
-        (*next)=cNext;
-        return(run);
-    }//analyzeRun;
+        run[size]='\0';
+    }else{
+        run=NIL;
+    }
+    (*next)=cNext;
+    return(run);
+}//analyzeRun;


-    METHOD(CapWord,analyze,(const char* source,INT32* next),void)
-    {
-            char*       uppers;
-            char*       lowers;
-        if(initers!=NIL){
-            free(initers);
-        }
-        if(letters!=NIL){
-            free(letters);
-        }
-        if(trailers!=NIL){
-            free(trailers);
+METHOD(CapWord,analyze,(const char* source,INT32* next),void)
+{
+    char*       uppers;
+    char*       lowers;
+    if(initers!=NIL){
+        free(initers);
+    }
+    if(letters!=NIL){
+        free(letters);
+    }
+    if(trailers!=NIL){
+        free(trailers);
+    }
+    initers=analyzeRun(source,next,1<<ck_ini);
+    uppers=analyzeRun(source,next,(1<<ck_cap));
+    lowers=analyzeRun(source,next,(1<<ck_low)|(1<<ck_dig));
+    if(uppers==NIL){
+        if(lowers==NIL){
+            letters=NIL;
+        }else{
+            letters=lowers;
         }
-        initers=analyzeRun(source,next,1<<ck_ini);
-        uppers=analyzeRun(source,next,(1<<ck_cap));
-        lowers=analyzeRun(source,next,(1<<ck_low)|(1<<ck_dig));
-        if(uppers==NIL){
-            if(lowers==NIL){
-                letters=NIL;
-            }else{
-                letters=lowers;
-            }
+    }else{
+        if(lowers==NIL){
+            letters=uppers;
         }else{
-            if(lowers==NIL){
-                letters=uppers;
-            }else{
-                letters=(char*)malloc(strlen(uppers)+strlen(lowers)+1);
-                strcpy(letters,uppers);
-                strcat(letters,lowers);
-                free(uppers);
-                free(lowers);
-            }
+            letters=(char*)malloc(strlen(uppers)+strlen(lowers)+1);
+            strcpy(letters,uppers);
+            strcat(letters,lowers);
+            free(uppers);
+            free(lowers);
         }
-        trailers=analyzeRun(source,next,1<<ck_end);
-    }//analyze;
+    }
+    trailers=analyzeRun(source,next,1<<ck_end);
+}//analyze;


-    METHOD(CapWord,catenate,(char* buffer,INT32* bsize),void)
-    {
-            INT32       cNext;
-            INT32       i;
+METHOD(CapWord,catenate,(char* buffer,INT32* bsize),void)
+{
+    INT32       cNext;
+    INT32       i;

-        cNext=(*bsize);
-        if(initers!=NIL){
-            for(i=0;initers[i]!='\0';i++){
-                buffer[cNext]=initers[i];
-                cNext++;
-            }
+    cNext=(*bsize);
+    if(initers!=NIL){
+        for(i=0;initers[i]!='\0';i++){
+            buffer[cNext]=initers[i];
+            cNext++;
         }
-        if(letters!=NIL){
-            for(i=0;letters[i]!='\0';i++){
-                buffer[cNext]=letters[i];
-                cNext++;
-            }
+    }
+    if(letters!=NIL){
+        for(i=0;letters[i]!='\0';i++){
+            buffer[cNext]=letters[i];
+            cNext++;
         }
-        if(trailers!=NIL){
-            for(i=0;trailers[i]!='\0';i++){
-                buffer[cNext]=trailers[i];
-                cNext++;
-            }
+    }
+    if(trailers!=NIL){
+        for(i=0;trailers[i]!='\0';i++){
+            buffer[cNext]=trailers[i];
+            cNext++;
         }
-        buffer[cNext]='\0';
-        (*bsize)=cNext;
-    }//catenate;
+    }
+    buffer[cNext]='\0';
+    (*bsize)=cNext;
+}//catenate;


-    METHOD(CapWord,reduceBy,(PressureT pressure,float ratio),void)
-    {
-            INT32       slice;
-            INT32       len;
+METHOD(CapWord,reduceBy,(PressureT pressure,float ratio),void)
+{
+    INT32       slice;
+    INT32       len;

-        switch(pressure){
-        case Pressure_heavy:
-            if(initers!=NIL){
-                free(initers);
-                initers=NIL;
-            }
-            //fall thru;
-        case Pressure_medium:
-            if(trailers!=NIL){
-                free(trailers);
-                trailers=NIL;
-            }
-            //fall thru;
-        case Pressure_light:
-            //fall thru:
-        default:
-            break;
+    switch(pressure){
+    case Pressure_heavy:
+        if(initers!=NIL){
+            free(initers);
+            initers=NIL;
+        }
+        //fall thru;
+    case Pressure_medium:
+        if(trailers!=NIL){
+            free(trailers);
+            trailers=NIL;
         }
+        //fall thru;
+    case Pressure_light:
+        //fall thru:
+    default:
+        break;
+    }

-        len=length(pressure);
-        slice=len-(INT32)ceil((((float)len)/ratio));
-        reduceSlice(slice);
-    }//reduceBy;
+    len=length(pressure);
+    slice=len-(INT32)ceil((((float)len)/ratio));
+    reduceSlice(slice);
+}//reduceBy;


-    METHOD(CapWord,reduceSlice,(INT32 slice),INT32)
-    {
-            INT32       len;
-            INT32       chunk;
+METHOD(CapWord,reduceSlice,(INT32 slice),INT32)
+{
+    INT32       len;
+    INT32       chunk;

-        chunk=0;
-        if((slice>0)&&(trailers!=NIL)){
-            len=strlen(trailers);
-            if(len>slice){
-                trailers[len-slice]='\0';
-                chunk+=slice;
-                slice=0;
-            }else{
-                chunk+=len;
-                slice-=len;
-                free(trailers);
-                trailers=NIL;
-            }
+    chunk=0;
+    if((slice>0)&&(trailers!=NIL)){
+        len=(int)strlen(trailers);
+        if(len>slice){
+            trailers[len-slice]='\0';
+            chunk+=slice;
+            slice=0;
+        }else{
+            chunk+=len;
+            slice-=len;
+            free(trailers);
+            trailers=NIL;
         }
-        if((slice>0)&&(initers!=NIL)){
-            len=strlen(initers);
-            if(len>slice){
-                initers[len-slice]='\0';
-                chunk+=slice;
-                slice=0;
-            }else{
-                chunk+=len;
-                slice-=len;
-                free(initers);
-                initers=NIL;
-            }
+    }
+    if((slice>0)&&(initers!=NIL)){
+        len=(int)strlen(initers);
+        if(len>slice){
+            initers[len-slice]='\0';
+            chunk+=slice;
+            slice=0;
+        }else{
+            chunk+=len;
+            slice-=len;
+            free(initers);
+            initers=NIL;
         }
-        if((slice>0)&&(letters!=NIL)){
-            len=strlen(letters);
-            if(len>slice){
-                letters[len-slice]='\0';
-                chunk+=slice;
-                slice=0;
-            }else{
-                chunk+=len;
-                slice-=len;
-                free(letters);
-                letters=NIL;
-            }
+    }
+    if((slice>0)&&(letters!=NIL)){
+        len=(int)strlen(letters);
+        if(len>slice){
+            letters[len-slice]='\0';
+            chunk+=slice;
+            slice=0;
+        }else{
+            chunk+=len;
+            slice-=len;
+            free(letters);
+            letters=NIL;
         }
-        return(chunk);
-    }//reduceSlice;
+    }
+    return(chunk);
+}//reduceSlice;


-    METHOD(CapWord,reduceSoft,(INT32* remainder),void)
-    {
-        (*remainder)-=reduceSlice(1);
-    }//reduceSoft;
+METHOD(CapWord,reduceSoft,(INT32* remainder),void)
+{
+    (*remainder)-=reduceSlice(1);
+}//reduceSoft;


-    METHOD(CapWord,print,(FILE* file),void)
-    {
-        fprintf(file,"\t%s %s %s\n",
-                initers?initers:"<NIL>",
-                letters?letters:"<NIL>",
-                trailers?trailers:"<NIL>");
-    }/*print*/
+METHOD(CapWord,print,(FILE* file),void)
+{
+    fprintf(file,"\t%s %s %s\n",
+            initers?initers:"<NIL>",
+            letters?letters:"<NIL>",
+            trailers?trailers:"<NIL>");
+}/*print*/


-    METHOD(CapWord,length,(PressureT pressure),INT32)
-    {
-        switch(pressure){
-        case Pressure_light:
-            return((initers?strlen(initers):0)
-                +(letters?strlen(letters):0)
-                +(trailers?strlen(trailers):0));
-        case Pressure_medium:
-            return((initers?strlen(initers):0)
-                +(letters?strlen(letters):0));
-        case Pressure_heavy: //fall thru
-        default:
-            return((letters?strlen(letters):0));
-        }
-    }//length;
+METHOD(CapWord,length,(PressureT pressure),INT32)
+{
+    switch(pressure){
+    case Pressure_light:
+        return((INT32)((initers?strlen(initers):0)
+                       +(letters?strlen(letters):0)
+                       +(trailers?strlen(trailers):0)));
+    case Pressure_medium:
+        return((INT32)((initers?strlen(initers):0)
+                       +(letters?strlen(letters):0)));
+    case Pressure_heavy: //fall thru
+    default:
+        return((INT32)((letters?strlen(letters):0)));
+    }
+}//length;


-    METHOD(CapWord,compareLength,(CapWord* other),SignT)
-    {
-            INT32       thislen,otherlen;
+METHOD(CapWord,compareLength,(CapWord* other),SignT)
+{
+    INT32       thislen,otherlen;

-        thislen=length(Pressure_heavy);
-        otherlen=other->length(Pressure_heavy);
+    thislen=length(Pressure_heavy);
+    otherlen=other->length(Pressure_heavy);
+    if(thislen<otherlen){
+        return(-1);
+    }else if(thislen>otherlen){
+        return(+1);
+    }else{
+        thislen=length(Pressure_medium);
+        otherlen=other->length(Pressure_medium);
         if(thislen<otherlen){
             return(-1);
         }else if(thislen>otherlen){
             return(+1);
         }else{
-            thislen=length(Pressure_medium);
-            otherlen=other->length(Pressure_medium);
+            thislen=length(Pressure_light);
+            otherlen=other->length(Pressure_light);
             if(thislen<otherlen){
                 return(-1);
             }else if(thislen>otherlen){
                 return(+1);
             }else{
-                thislen=length(Pressure_light);
-                otherlen=other->length(Pressure_light);
-                if(thislen<otherlen){
-                    return(-1);
-                }else if(thislen>otherlen){
-                    return(+1);
-                }else{
-                    return(0);
-                }
+                return(0);
             }
         }
-    }//compareLength;
-
-
-
-//END CapWord.
+    }
+}//compareLength;

-/*** CapWord.cc                       -- 2003-11-20 03:38:35 -- pascal   ***/
+//// THE END ////
diff --git a/dosname/sources/CapWord.hh b/dosname/sources/CapWord.hh
index 73891d7..2f04e44 100644
--- a/dosname/sources/CapWord.hh
+++ b/dosname/sources/CapWord.hh
@@ -15,7 +15,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/MfDirectory.cc b/dosname/sources/MfDirectory.cc
index 25c6f0a..7c87093 100644
--- a/dosname/sources/MfDirectory.cc
+++ b/dosname/sources/MfDirectory.cc
@@ -26,7 +26,7 @@ MODIFICATIONS

     1994-12-25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

@@ -243,7 +243,7 @@ BpString*path=NEW(BpString);
                             dir->nameSet(entryName);
                             dir->holderSet(0,this);
                             lMode=NEW(MfMode);
-                            lMode->modeSet(status.st_mode);
+                            lMode->modeSet((CARD16)status.st_mode);
                             dir->modeSet(lMode);
                             contentSet(contentCard(),dir);
 dir->pathNameGet(path);
@@ -255,7 +255,7 @@ fprintf(stderr,"\r%c[K%s\r",0x1b,path->string());
                             fil->nameSet(entryName);
                             fil->holderSet(0,this);
                             lMode=NEW(MfMode);
-                            lMode->modeSet(status.st_mode);
+                            lMode->modeSet((CARD16)status.st_mode);
                             fil->modeSet(lMode);
                             contentSet(contentCard(),fil);
 fil->pathNameGet(path);
@@ -266,7 +266,7 @@ fprintf(stderr,"\r%c[K%s\r",0x1b,path->string());
                             fil->nameSet(entryName);
                             fil->holderSet(0,this);
                             lMode=NEW(MfMode);
-                            lMode->modeSet(status.st_mode);
+                            lMode->modeSet((CARD16)status.st_mode);
                             fil->modeSet(lMode);
                             contentSet(contentCard(),fil);
 fil->pathNameGet(path);
diff --git a/dosname/sources/MfDirectory.hh b/dosname/sources/MfDirectory.hh
index ef448d2..9d8a7b1 100644
--- a/dosname/sources/MfDirectory.hh
+++ b/dosname/sources/MfDirectory.hh
@@ -27,7 +27,7 @@ MODIFICATIONS

     1994-12-25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

diff --git a/dosname/sources/MfFile.cc b/dosname/sources/MfFile.cc
index b57fd1a..82183df 100644
--- a/dosname/sources/MfFile.cc
+++ b/dosname/sources/MfFile.cc
@@ -33,7 +33,7 @@ MODIFICATIONS

     1994-12-25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

@@ -68,474 +68,474 @@ extern "C"{
 #include BpClass_hh
 #include BcImplementation_h

-    static const char rcsident[]="$Id: MfFile.cc,v 1.1 2003/12/04 03:46:04 pjbpjb Exp $";
+static const char rcsident[]="$Id: MfFile.cc,v 1.1 2003/12/04 03:46:04 pjbpjb Exp $";

 #define blockSize   (512)

 // birth and death:

-    CONSTRUCTOR(MfFile)
-    {
-        BpClass_PLUG(MfFile);
-        fSize=MAX_CARD32;
-        fLineCount=MAX_CARD32;
-        fBlock=NULL;
-    }//MfFile;
+CONSTRUCTOR(MfFile)
+{
+    BpClass_PLUG(MfFile);
+    fSize=MAX_CARD32;
+    fLineCount=MAX_CARD32;
+    fBlock=NULL;
+}//MfFile;


-    DESTRUCTOR(MfFile)
-    {
-    }//~MfFile;
+DESTRUCTOR(MfFile)
+{
+}//~MfFile;


 // override of BpObject methods:

-    METHOD(MfFile,makeBrother,(void),BpObject*)
-    {
-        return(NEW(MfFile));
-    }//makeBrother;
+METHOD(MfFile,makeBrother,(void),BpObject*)
+{
+    return(NEW(MfFile));
+}//makeBrother;


-    METHOD(MfFile,printOnLevel,(FILE* file,CARD32 level),void)
-    {
-        MfFile_SUPER::printOnLevel(file,level);
-        PRINTONLEVEL(file,level,"%lu",fSize,fSize);
-    }//printOn;
+METHOD(MfFile,printOnLevel,(FILE* file,CARD32 level),void)
+{
+    MfFile_SUPER::printOnLevel(file,level);
+    PRINTONLEVEL(file,level,"%lu",fSize,fSize);
+}//printOn;


 // override of MfNode methods:

-    METHOD(MfFile,isDirectory,(void),BOOLEAN)
-    {
-        return(FALSE);
-    }//isDirectory;
+METHOD(MfFile,isDirectory,(void),BOOLEAN)
+{
+    return(FALSE);
+}//isDirectory;



 // MfFile methods:

-    METHOD(MfFile,size,(void),CARD32)
-    {
-        if(fSize==MAX_CARD32){
-                struct stat     status;
-                BpString*       fname=NEW(BpString);
-            pathNameGet(fname);
-            if(stat(fname->string(),&status)==0){
-                fSize=status.st_size;
-            }
+METHOD(MfFile,size,(void),CARD32)
+{
+    if(fSize==MAX_CARD32){
+        struct stat     status;
+        BpString*       fname=NEW(BpString);
+        pathNameGet(fname);
+        if(stat(fname->string(),&status)==0){
+            fSize=(CARD32)status.st_size;
         }
-        return(fSize);
-    }//size;
+    }
+    return(fSize);
+}//size;


-    METHOD(MfFile,lineCount,(void),CARD32)
-    {
-            char            command[BUFSIZ];
-            FILE*           output;
-            BpString*       fname=NEW(BpString);
+METHOD(MfFile,lineCount,(void),CARD32)
+{
+    char            command[BUFSIZ];
+    FILE*           output;
+    BpString*       fname=NEW(BpString);

-        if(fLineCount==MAX_CARD32){
-            pathNameGet(fname);
-            sprintf(command,"wc -l %s",fname->shellQuoted()->string());
-            output=popen(command,"r");
-            if(output==NULL){
-                return(MAX_CARD32);
-            }else{
-                if(1==fscanf(output,"%lu",&fLineCount)){
-                    pclose(output);
-                    return(fLineCount);
-                }else{
-                    pclose(output);
-                    return(MAX_CARD32);
-                }
-            }
-        }else{
-            return(fLineCount);
-        }
-    }//lineCount;
-
-
-    METHOD(MfFile,compare,(MfFile* otherFile),CARD32)
-    {
-            char            command[BUFSIZ];
-            FILE*           output;
-            CARD32          result;
-            BpString*       fname=NEW(BpString);
-            BpString*       oname=NEW(BpString);
-
+    if(fLineCount==MAX_CARD32){
         pathNameGet(fname);
-        otherFile->pathNameGet(oname);
-        sprintf(command,"diff -B -n %s %s | ./countdiffed",
-                fname->shellQuoted()->string(),
-                oname->shellQuoted()->string());
+        sprintf(command,"wc -l %s",fname->shellQuoted()->string());
         output=popen(command,"r");
         if(output==NULL){
             return(MAX_CARD32);
         }else{
-            if(1==fscanf(output,"%lu",&result)){
+            if(1==fscanf(output,"%"FMT_CARD32,&fLineCount)){
                 pclose(output);
-                return(result);
+                return(fLineCount);
             }else{
                 pclose(output);
                 return(MAX_CARD32);
             }
         }
-    }//compare;
+    }else{
+        return(fLineCount);
+    }
+}//lineCount;
+
+
+METHOD(MfFile,compare,(MfFile* otherFile),CARD32)
+{
+    char            command[BUFSIZ];
+    FILE*           output;
+    CARD32          result;
+    BpString*       fname=NEW(BpString);
+    BpString*       oname=NEW(BpString);
+
+    pathNameGet(fname);
+    otherFile->pathNameGet(oname);
+    sprintf(command,"diff -B -n %s %s | ./countdiffed",
+            fname->shellQuoted()->string(),
+            oname->shellQuoted()->string());
+    output=popen(command,"r");
+    if(output==NULL){
+        return(MAX_CARD32);
+    }else{
+        if(1==fscanf(output,"%"FMT_CARD32,&result)){
+            pclose(output);
+            return(result);
+        }else{
+            pclose(output);
+            return(MAX_CARD32);
+        }
+    }
+}//compare;


-    METHOD(MfFile,loadFirstBlock,(void),void)
-    {
-            CARD32          wordCount;
-            BpString*       fname;
-            FILE*           file;
-            CARD32          readCount;
+METHOD(MfFile,loadFirstBlock,(void),void)
+{
+    CARD32          wordCount;
+    BpString*       fname;
+    FILE*           file;
+    CARD32          readCount;

+    if(fBlock==NULL){
+        wordCount=(CARD32)((size()+sizeof(CARD32)-1)/sizeof(CARD32));
+        fBlock=(CARD32*)malloc(wordCount*sizeof(CARD32));
         if(fBlock==NULL){
-            wordCount=((size()+sizeof(CARD32)-1)/sizeof(CARD32));
-            fBlock=(CARD32*)malloc(wordCount*sizeof(CARD32));
-            if(fBlock==NULL){
-                perror("loadFirstBlock malloc");
-                return;
-            }
-            fBlock[wordCount-1]=0;
-            fname=NEW(BpString);
-            pathNameGet(fname);
-            file=fopen(fname->string(),"rb");
-            if(file==NULL){
-                perror("loadFirstBlock fopen");
-                free(fBlock);
-                fBlock=NULL;
-                return;
-            }
-            readCount=fread((void*)fBlock,sizeof(char),size(),file);
-            fclose(file);
-            if(readCount!=size()){
-                perror("loadFirstBlock fread");
-                free(fBlock);
-                fBlock=NULL;
-                return;
-            }
+            perror("loadFirstBlock malloc");
+            return;
+        }
+        fBlock[wordCount-1]=0;
+        fname=NEW(BpString);
+        pathNameGet(fname);
+        file=fopen(fname->string(),"rb");
+        if(file==NULL){
+            perror("loadFirstBlock fopen");
+            free(fBlock);
+            fBlock=NULL;
+            return;
         }
-    }//loadFirstBlock;
+        readCount=(CARD32)fread((void*)fBlock,sizeof(char),size(),file);
+        fclose(file);
+        if(readCount!=size()){
+            perror("loadFirstBlock fread");
+            free(fBlock);
+            fBlock=NULL;
+            return;
+        }
+    }
+}//loadFirstBlock;


-    METHOD(MfFile,compareFirstBlock,(MfFile* otherFile),CARD32)
-    {
-            CARD32      sizeToCompare;
-            CARD32      s;
+METHOD(MfFile,compareFirstBlock,(MfFile* otherFile),CARD32)
+{
+    CARD32      sizeToCompare;
+    CARD32      s;

-        this->loadFirstBlock();
-        otherFile->loadFirstBlock();
+    this->loadFirstBlock();
+    otherFile->loadFirstBlock();

-        sizeToCompare=blockSize;
-        s=size();
-        if(s<sizeToCompare){
-            sizeToCompare=s;
-        }
-        s=otherFile->size();
-        if(s<sizeToCompare){
-            sizeToCompare=s;
-        }
-        if(memcmp((void*)fBlock,(void*)(otherFile->fBlock),sizeToCompare)==0){
-            if((sizeToCompare==size())&&(sizeToCompare==otherFile->size())){
-                return(0);
-            }else{
-                return(1);
-            }
+    sizeToCompare=blockSize;
+    s=size();
+    if(s<sizeToCompare){
+        sizeToCompare=s;
+    }
+    s=otherFile->size();
+    if(s<sizeToCompare){
+        sizeToCompare=s;
+    }
+    if(memcmp((void*)fBlock,(void*)(otherFile->fBlock),sizeToCompare)==0){
+        if((sizeToCompare==size())&&(sizeToCompare==otherFile->size())){
+            return(0);
         }else{
-            return(2);
+            return(1);
         }
-    }//compareFirstBlock;
+    }else{
+        return(2);
+    }
+}//compareFirstBlock;


-    METHOD(MfFile,copyToDos,
-           (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
-    {
-        MfFile*     theCopy;
+METHOD(MfFile,copyToDos,
+       (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
+{
+    MfFile*     theCopy;

-        theCopy=((MfDirectory*)dDir)->newFile();
-        theCopy->holderSet(0,dDir);
-        theCopy->nameSet(dName);
-        theCopy->modeSet(dMode);
-        if(printIt){
-            printf("cp %s %s\n",this->pathName()->shellQuoted()->string(),
-                   theCopy->pathName()->shellQuoted()->string());
-            printf("chmod %04u %s\n",07777&(theCopy->mode()->mode()),
-                   theCopy->pathName()->shellQuoted()->string());
-        }else{
-            //  theCopy->fileSystemSet(MfDirectory_FileSystem_MSDOS);
-            theCopy->copyFileFrom(this);
-        }
-    }//copyToDos;
+    theCopy=((MfDirectory*)dDir)->newFile();
+    theCopy->holderSet(0,dDir);
+    theCopy->nameSet(dName);
+    theCopy->modeSet(dMode);
+    if(printIt){
+        printf("cp %s %s\n",this->pathName()->shellQuoted()->string(),
+               theCopy->pathName()->shellQuoted()->string());
+        printf("chmod %04u %s\n",07777&(theCopy->mode()->mode()),
+               theCopy->pathName()->shellQuoted()->string());
+    }else{
+        //  theCopy->fileSystemSet(MfDirectory_FileSystem_MSDOS);
+        theCopy->copyFileFrom(this);
+    }
+}//copyToDos;


-    METHOD(MfFile,copyToUnix,
-           (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
-    {
-        MfFile*     theCopy;
+METHOD(MfFile,copyToUnix,
+       (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
+{
+    MfFile*     theCopy;

-        /*
-            A MS-DOS file may contain either the data of a UNIX file,
-            or the linked path of a UNIX symbolic link.
-        */
-        if((uMode->mode()&S_IFMT)==S_IFLNK){
-            theCopy=((MfDirectory*)uDir)->newLink();
-        }else{
-            theCopy=((MfDirectory*)uDir)->newFile();
-        }
-        theCopy->holderSet(0,uDir);
-        theCopy->nameSet(uName);
-        theCopy->modeSet(uMode);
+    /*
+      A MS-DOS file may contain either the data of a UNIX file,
+      or the linked path of a UNIX symbolic link.
+    */
+    if((uMode->mode()&S_IFMT)==S_IFLNK){
+        theCopy=((MfDirectory*)uDir)->newLink();
+    }else{
+        theCopy=((MfDirectory*)uDir)->newFile();
+    }
+    theCopy->holderSet(0,uDir);
+    theCopy->nameSet(uName);
+    theCopy->modeSet(uMode);
     //  theCopy->fileSystemSet(MfDirectory_FileSystem_UNIX);
-        if(printIt){
-            if((uMode->mode()&S_IFMT)==S_IFLNK){
-                printf("ln -s %s %s\n",
-                       this->textContents()->shellQuoted()->string(),
-                       theCopy->pathName()->shellQuoted()->string());
-            }else{
-                printf("cp %s %s\n",
-                       this->pathName()->shellQuoted()->string(),
-                       theCopy->pathName()->shellQuoted()->string());
-            }
+    if(printIt){
+        if((uMode->mode()&S_IFMT)==S_IFLNK){
+            printf("ln -s %s %s\n",
+                   this->textContents()->shellQuoted()->string(),
+                   theCopy->pathName()->shellQuoted()->string());
         }else{
-            theCopy->copyFileFrom(this);
+            printf("cp %s %s\n",
+                   this->pathName()->shellQuoted()->string(),
+                   theCopy->pathName()->shellQuoted()->string());
         }
-    }//copyToUnix;
+    }else{
+        theCopy->copyFileFrom(this);
+    }
+}//copyToUnix;


-    METHOD(MfFile,symLinkToDos,
-           (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
-    {
-        MfFile*     theCopy;
+METHOD(MfFile,symLinkToDos,
+       (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
+{
+    MfFile*     theCopy;

-        theCopy=((MfDirectory*)dDir)->newFile();
-        theCopy->holderSet(0,dDir);
-        theCopy->nameSet(dName);
-        theCopy->modeSet(dMode);
-        if(printIt){
-            // SEE: What kind of relative path could we use ?
-            //      (This should be an option).
-            printf("ln -s %s %s\n",
-                   this->pathName()->shellQuoted()->string(),
-                   theCopy->pathName()->shellQuoted()->string());
-        }else{
-            // theCopy->fileSystemSet(MfDirectory_FileSystem_MSDOS);
-            if(0!=symlink(this->pathName()->string(),
-                          theCopy->pathName()->string())){
-                perror("MfFile::symLinkToDos symlink");
-            }
+    theCopy=((MfDirectory*)dDir)->newFile();
+    theCopy->holderSet(0,dDir);
+    theCopy->nameSet(dName);
+    theCopy->modeSet(dMode);
+    if(printIt){
+        // SEE: What kind of relative path could we use ?
+        //      (This should be an option).
+        printf("ln -s %s %s\n",
+               this->pathName()->shellQuoted()->string(),
+               theCopy->pathName()->shellQuoted()->string());
+    }else{
+        // theCopy->fileSystemSet(MfDirectory_FileSystem_MSDOS);
+        if(0!=symlink(this->pathName()->string(),
+                      theCopy->pathName()->string())){
+            perror("MfFile::symLinkToDos symlink");
         }
-    }//symLinkToDos;
+    }
+}//symLinkToDos;


-    METHOD(MfFile,symLinkToUnix,
-           (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
-    {
-        MfFile*     theCopy;
+METHOD(MfFile,symLinkToUnix,
+       (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
+{
+    MfFile*     theCopy;

-        /*
-            A MS-DOS file may contain either the data of a UNIX file,
-            or the linked path of a UNIX symbolic link.
-        */
+    /*
+      A MS-DOS file may contain either the data of a UNIX file,
+      or the linked path of a UNIX symbolic link.
+    */
+    if((uMode->mode()&S_IFMT)==S_IFLNK){
+        theCopy=((MfDirectory*)uDir)->newLink();
+    }else{
+        theCopy=((MfDirectory*)uDir)->newFile();
+    }
+    theCopy->holderSet(0,uDir);
+    theCopy->nameSet(uName);
+    theCopy->modeSet(uMode);
+    //  theCopy->fileSystemSet(MfDirectory_FileSystem_UNIX);
+    if(printIt){
         if((uMode->mode()&S_IFMT)==S_IFLNK){
-            theCopy=((MfDirectory*)uDir)->newLink();
+            // We rebuild the link, since the DOS file is not a link.
+            // Hopefully, it'll be a relative symlink.
+            printf("ln -s %s %s\n",
+                   this->textContents()->shellQuoted()->string(),
+                   theCopy->pathName()->shellQuoted()->string());
         }else{
-            theCopy=((MfDirectory*)uDir)->newFile();
+            // We link to the DOS file.
+            printf("ln -s %s %s\n",
+                   this->pathName()->shellQuoted()->string(),
+                   theCopy->pathName()->shellQuoted()->string());
         }
-        theCopy->holderSet(0,uDir);
-        theCopy->nameSet(uName);
-        theCopy->modeSet(uMode);
-    //  theCopy->fileSystemSet(MfDirectory_FileSystem_UNIX);
-        if(printIt){
-            if((uMode->mode()&S_IFMT)==S_IFLNK){
-                // We rebuild the link, since the DOS file is not a link.
-                // Hopefully, it'll be a relative symlink.
-                printf("ln -s %s %s\n",
-                       this->textContents()->shellQuoted()->string(),
-                       theCopy->pathName()->shellQuoted()->string());
-            }else{
-                // We link to the DOS file.
-                printf("ln -s %s %s\n",
-                       this->pathName()->shellQuoted()->string(),
-                       theCopy->pathName()->shellQuoted()->string());
+    }else{
+        if((uMode->mode()&S_IFMT)==S_IFLNK){
+            // We rebuild the link, since the DOS file is not a link.
+            // Hopefully, it'll be a relative symlink.
+            if(0!=symlink(this->textContents()->string(),
+                          theCopy->pathName()->string())){
+                perror("MfFile::symLinkToUnix symlink");
             }
         }else{
-            if((uMode->mode()&S_IFMT)==S_IFLNK){
-                // We rebuild the link, since the DOS file is not a link.
-                // Hopefully, it'll be a relative symlink.
-                if(0!=symlink(this->textContents()->string(),
-                              theCopy->pathName()->string())){
-                    perror("MfFile::symLinkToUnix symlink");
-                }
-            }else{
-                // We link to the DOS file.
-                if(0!=symlink(this->pathName()->string(),
-                              theCopy->pathName()->string())){
-                    perror("MfFile::symLinkToUnix symlink");
-                }
+            // We link to the DOS file.
+            if(0!=symlink(this->pathName()->string(),
+                          theCopy->pathName()->string())){
+                perror("MfFile::symLinkToUnix symlink");
             }
         }
-    }//symLinkToUnix;
+    }
+}//symLinkToUnix;


-    METHOD(MfFile,hardLinkToDos,
-           (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
-    {
-        MfFile*     theCopy;
+METHOD(MfFile,hardLinkToDos,
+       (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
+{
+    MfFile*     theCopy;

-        theCopy=((MfDirectory*)dDir)->newFile();
-        theCopy->holderSet(0,dDir);
-        theCopy->nameSet(dName);
-        theCopy->modeSet(dMode);
-        if(printIt){
-            printf("ln %s %s\n",
-                   this->pathName()->shellQuoted()->string(),
-                   theCopy->pathName()->shellQuoted()->string());
-        }else{
-            // theCopy->fileSystemSet(MfDirectory_FileSystem_MSDOS);
-            if(0!=link(this->pathName()->string(),
-                          theCopy->pathName()->string())){
-                perror("MfFile::hardLinkToDos link");
-            }
+    theCopy=((MfDirectory*)dDir)->newFile();
+    theCopy->holderSet(0,dDir);
+    theCopy->nameSet(dName);
+    theCopy->modeSet(dMode);
+    if(printIt){
+        printf("ln %s %s\n",
+               this->pathName()->shellQuoted()->string(),
+               theCopy->pathName()->shellQuoted()->string());
+    }else{
+        // theCopy->fileSystemSet(MfDirectory_FileSystem_MSDOS);
+        if(0!=link(this->pathName()->string(),
+                   theCopy->pathName()->string())){
+            perror("MfFile::hardLinkToDos link");
         }
-    }//hardLinkToDos;
+    }
+}//hardLinkToDos;


-    METHOD(MfFile,hardLinkToUnix,
-           (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
-    {
-        MfFile*     theCopy;
+METHOD(MfFile,hardLinkToUnix,
+       (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
+{
+    MfFile*     theCopy;

-        /*
-            A MS-DOS file may contain either the data of a UNIX file,
-            or the linked path of a UNIX symbolic link.
-        */
+    /*
+      A MS-DOS file may contain either the data of a UNIX file,
+      or the linked path of a UNIX symbolic link.
+    */
+    if((uMode->mode()&S_IFMT)==S_IFLNK){
+        theCopy=((MfDirectory*)uDir)->newLink();
+    }else{
+        theCopy=((MfDirectory*)uDir)->newFile();
+    }
+    theCopy->holderSet(0,uDir);
+    theCopy->nameSet(uName);
+    theCopy->modeSet(uMode);
+    //  theCopy->fileSystemSet(MfDirectory_FileSystem_UNIX);
+    if(printIt){
         if((uMode->mode()&S_IFMT)==S_IFLNK){
-            theCopy=((MfDirectory*)uDir)->newLink();
+            // We rebuild the link, since the DOS file is not a link.
+            // Hopefully, it'll be a relative symlink.
+            printf("ln -s %s %s\n",
+                   this->textContents()->shellQuoted()->string(),
+                   theCopy->pathName()->shellQuoted()->string());
         }else{
-            theCopy=((MfDirectory*)uDir)->newFile();
+            // We link to the DOS file.
+            printf("ln %s %s\n",
+                   this->pathName()->shellQuoted()->string(),
+                   theCopy->pathName()->shellQuoted()->string());
         }
-        theCopy->holderSet(0,uDir);
-        theCopy->nameSet(uName);
-        theCopy->modeSet(uMode);
-    //  theCopy->fileSystemSet(MfDirectory_FileSystem_UNIX);
-        if(printIt){
-            if((uMode->mode()&S_IFMT)==S_IFLNK){
-                // We rebuild the link, since the DOS file is not a link.
-                // Hopefully, it'll be a relative symlink.
-                printf("ln -s %s %s\n",
-                       this->textContents()->shellQuoted()->string(),
-                       theCopy->pathName()->shellQuoted()->string());
-            }else{
-                // We link to the DOS file.
-                printf("ln %s %s\n",
-                       this->pathName()->shellQuoted()->string(),
-                       theCopy->pathName()->shellQuoted()->string());
+    }else{
+        if((uMode->mode()&S_IFMT)==S_IFLNK){
+            // We rebuild the sym link, since the DOS file is not a link.
+            // Hopefully, it'll be a relative symlink.
+            if(0!=symlink(this->textContents()->string(),
+                          theCopy->pathName()->string())){
+                perror("MfFile::hardLinkToUnix symlink");
             }
         }else{
-             if((uMode->mode()&S_IFMT)==S_IFLNK){
-                // We rebuild the sym link, since the DOS file is not a link.
-                // Hopefully, it'll be a relative symlink.
-                if(0!=symlink(this->textContents()->string(),
-                              theCopy->pathName()->string())){
-                    perror("MfFile::hardLinkToUnix symlink");
-                }
-            }else{
-                // We link to the DOS file.
-                if(0!=link(this->pathName()->string(),
-                           theCopy->pathName()->string())){
-                    perror("MfFile::hardLinkToUnix link");
-                }
+            // We link to the DOS file.
+            if(0!=link(this->pathName()->string(),
+                       theCopy->pathName()->string())){
+                perror("MfFile::hardLinkToUnix link");
             }
-        }
-    }//hardLinkToUnix;
+        }
+    }
+}//hardLinkToUnix;



-    METHOD(MfFile,copyFileFrom,(MfFile* source),void)
-    {
-        char*       buffer;
-        char*       writeBuffer;
-        INT32       readCount;
-        INT32       writeCount;
-        INT32       openCount;
+METHOD(MfFile,copyFileFrom,(MfFile* source),void)
+{
+    char*       buffer;
+    char*       writeBuffer;
+    INT32       readCount;
+    INT32       writeCount;
+    INT32       openCount;

-        create();
-        if(exists()&&(source->size()>0)){
-            chmod(pathName()->string(),00666);
-            openCount=0;
-            if(open("w")){
-                openCount++;
-            }else{
-                fprintf(stderr,
-                        "MfFile::copyFileFrom cannot open %s for writting.\n",
-                        pathName()->string());
-            }
-            if(source->open("r")){
-                openCount++;
-            }else{
-                fprintf(stderr,
-                        "MfFile::copyFileFrom cannot open %s for reading.\n",
-                        source->pathName()->string());
-            }
-            if(openCount==2){
-                buffer=(char*)BcMem_Allocate(128*1024);
-                while(!(source->eof())){
-                    readCount=source->read(buffer,128*1024);
-                    writeBuffer=buffer;
-                    while(readCount>0){
-                        writeCount=write(writeBuffer,readCount);
-                        if(writeCount>0){
-                            writeBuffer+=writeCount;
-                            readCount-=writeCount;
-                        }
+    create();
+    if(exists()&&(source->size()>0)){
+        chmod(pathName()->string(),00666);
+        openCount=0;
+        if(open("w")){
+            openCount++;
+        }else{
+            fprintf(stderr,
+                    "MfFile::copyFileFrom cannot open %s for writting.\n",
+                    pathName()->string());
+        }
+        if(source->open("r")){
+            openCount++;
+        }else{
+            fprintf(stderr,
+                    "MfFile::copyFileFrom cannot open %s for reading.\n",
+                    source->pathName()->string());
+        }
+        if(openCount==2){
+            buffer=(char*)BcMem_Allocate(128*1024);
+            while(!(source->eof())){
+                readCount=source->read(buffer,128*1024);
+                writeBuffer=buffer;
+                while(readCount>0){
+                    writeCount=write(writeBuffer,readCount);
+                    if(writeCount>0){
+                        writeBuffer+=writeCount;
+                        readCount-=writeCount;
                     }
                 }
-                BcMem_Deallocate((void**)&buffer);
-            }else{
-                fprintf(stderr,"Cannot open output (%s) or input (%s) file.\n",
-                    pathName()->string(),source->pathName()->string());
             }
-            close();
-            source->close();
+            BcMem_Deallocate((void**)&buffer);
+        }else{
+            fprintf(stderr,"Cannot open output (%s) or input (%s) file.\n",
+                    pathName()->string(),source->pathName()->string());
         }
-        chmod(pathName()->string(),07777&(fMode->mode()));
-    }//copyFileFrom;
+        close();
+        source->close();
+    }
+    chmod(pathName()->string(),07777&(fMode->mode()));
+}//copyFileFrom;



-    METHOD(MfFile,textContents,(void),BpString*)
-    {
-        BpString*       fname;
-        BpString*       contents;
-        FILE*           file;
-        CARD32          readCount;
-        char*           data;
-        size_t          fsize=this->size();
-
-        if(fsize==0){
-            return(NEW(BpString));
-        }
-        fname=NEW(BpString);
-        pathNameGet(fname);
-        file=fopen(fname->string(),"rb");
-        if(file==NULL){
-            perror("MfFile::textContents fopen");
-            return(0);
-        }
-        data=(char*)malloc((fsize+1)*sizeof(char));
-        readCount=fread((void*)data,sizeof(char),fsize,file);
-        fclose(file);
-        if(readCount!=fsize){
-            perror("MfFile::textContents fread");
-            free(data);
-            return(0);
-        }
-        data[fsize]='\0';
-        contents=NEW(BpString);
-        contents->setString(data);
+METHOD(MfFile,textContents,(void),BpString*)
+{
+    BpString*       fname;
+    BpString*       contents;
+    FILE*           file;
+    CARD32          readCount;
+    char*           data;
+    size_t          fsize=this->size();
+
+    if(fsize==0){
+        return(NEW(BpString));
+    }
+    fname=NEW(BpString);
+    pathNameGet(fname);
+    file=fopen(fname->string(),"rb");
+    if(file==NULL){
+        perror("MfFile::textContents fopen");
+        return(0);
+    }
+    data=(char*)malloc((fsize+1)*sizeof(char));
+    readCount=(CARD32)fread((void*)data,sizeof(char),fsize,file);
+    fclose(file);
+    if(readCount!=fsize){
+        perror("MfFile::textContents fread");
         free(data);
-        return(contents);
-    }//textContents;
+        return(0);
+    }
+    data[fsize]='\0';
+    contents=NEW(BpString);
+    contents->setString(data);
+    free(data);
+    return(contents);
+}//textContents;

-//END MfFile.
+//// THE END ////
diff --git a/dosname/sources/MfFile.hh b/dosname/sources/MfFile.hh
index 0a84c33..8344373 100644
--- a/dosname/sources/MfFile.hh
+++ b/dosname/sources/MfFile.hh
@@ -32,7 +32,7 @@ MODIFICATIONS

     1994-12-25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

diff --git a/dosname/sources/MfLink.cc b/dosname/sources/MfLink.cc
index fda62f4..5052b29 100644
--- a/dosname/sources/MfLink.cc
+++ b/dosname/sources/MfLink.cc
@@ -14,7 +14,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

@@ -50,244 +50,239 @@ extern "C"{
 #include BpClass_hh
 #include BcImplementation_h

-    static const char rcsid[]="$Id";
+static const char rcsid[]="$Id";

 // birth and death:

-    typedef enum {
-        State_closed,State_reading,State_writting,State_opened
-    }               StateT;
+typedef enum {
+    State_closed,State_reading,State_writting,State_opened
+}               StateT;


-    CONSTRUCTOR(MfLink)
-    {
-        BpClass_PLUG(MfLink);
-        state=State_closed;
-    }//MfLink;
+CONSTRUCTOR(MfLink)
+{
+    BpClass_PLUG(MfLink);
+    state=State_closed;
+}//MfLink;


-    DESTRUCTOR(MfLink)
-    {
-    }//~MfLink;
+DESTRUCTOR(MfLink)
+{
+}//~MfLink;


 // override of BpObject methods:

-    METHOD(MfLink,makeBrother,(void),BpObject*)
-    {
-        return(NEW(MfLink));
-    }//makeBrother;
+METHOD(MfLink,makeBrother,(void),BpObject*)
+{
+    return(NEW(MfLink));
+}//makeBrother;


-    METHOD(MfLink,printOnLevel,(FILE* file,CARD32 level),void)
-    {
-        MfLink_SUPER::printOnLevel(file,level);
-//  PRINTONLEVEL(file,level,"%s",NEWFIELD,NEWFIELD);
-    }//printOnLevel;
+METHOD(MfLink,printOnLevel,(FILE* file,CARD32 level),void)
+{
+    MfLink_SUPER::printOnLevel(file,level);
+    //  PRINTONLEVEL(file,level,"%s",NEWFIELD,NEWFIELD);
+}//printOnLevel;


 // override of MfNode methods:


-    METHOD(MfLink,exists,(void),BOOLEAN)
-    {
-        return(TRUE);
-    }//exists;
+METHOD(MfLink,exists,(void),BOOLEAN)
+{
+    return(TRUE);
+}//exists;


-    METHOD(MfLink,create,(void),BOOLEAN)
-    {
-        state=State_closed;
-        return(TRUE);
-    }//create;
+METHOD(MfLink,create,(void),BOOLEAN)
+{
+    state=State_closed;
+    return(TRUE);
+}//create;


-    METHOD(MfLink,open,(const char* omode),BOOLEAN)
-    {
-        switch(*omode){
-        case 'r':
-            state=State_reading;
-            fEof=readlink(pathName()->string(),linkbuf,BUFSIZ);
-            if(fEof<0){
-                fEof=0;
-            }
-            break;
-        case 'w':
-            state=State_writting;
+METHOD(MfLink,open,(const char* omode),BOOLEAN)
+{
+    switch(*omode){
+    case 'r':
+        state=State_reading;
+        fEof=(INT32)readlink(pathName()->string(),linkbuf,BUFSIZ);
+        if(fEof<0){
             fEof=0;
-            break;
-        default:
-            return(FALSE);
         }
-        position=0;
-        fSize=fEof;
-        return(TRUE);
-    }//open;
+        break;
+    case 'w':
+        state=State_writting;
+        fEof=0;
+        break;
+    default:
+        return(FALSE);
+    }
+    position=0;
+    fSize=fEof;
+    return(TRUE);
+}//open;


-    METHOD(MfLink,read,(void* buffer,INT32 bufSize),INT32)
-    {
-        if(state==State_reading){
-            if(bufSize>fEof-position){
-                bufSize=fEof-position;
-            }
-            memcpy(buffer,linkbuf+position,bufSize);
-            position+=bufSize;
-            return(bufSize);
-        }else{
-            return(0);
+METHOD(MfLink,read,(void* buffer,INT32 bufSize),INT32)
+{
+    if(state==State_reading){
+        if(bufSize>fEof-position){
+            bufSize=fEof-position;
         }
-    }//read;
+        memcpy(buffer,linkbuf+position,bufSize);
+        position+=bufSize;
+        return(bufSize);
+    }else{
+        return(0);
+    }
+}//read;


-    METHOD(MfLink,write,(void* buffer,INT32 bufSize),INT32)
-    {
-        if(state==State_writting){
-            if(bufSize>BUFSIZ-1-position){
-                bufSize=BUFSIZ-1-position;
-            }
-            memcpy(linkbuf+position,buffer,bufSize);
-            position+=bufSize;
-            fEof=position;
-            fSize=fEof;
-            return(bufSize);
-        }else{
-            return(0);
+METHOD(MfLink,write,(void* buffer,INT32 bufSize),INT32)
+{
+    if(state==State_writting){
+        if(bufSize>BUFSIZ-1-position){
+            bufSize=BUFSIZ-1-position;
         }
-    }//write;
+        memcpy(linkbuf+position,buffer,bufSize);
+        position+=bufSize;
+        fEof=position;
+        fSize=fEof;
+        return(bufSize);
+    }else{
+        return(0);
+    }
+}//write;


-    METHOD(MfLink,seek,(INT32 newPosition),INT32)
-    {
-        return(-1);
-    }//seek;
+METHOD(MfLink,seek,(INT32 newPosition),INT32)
+{
+    return(-1);
+}//seek;


-    METHOD(MfLink,eof,(void),BOOLEAN)
-    {
-        if(state==State_reading){
-            return(fEof==position);
-        }else{
-            return(TRUE);
-        }
-    }//eof;
+METHOD(MfLink,eof,(void),BOOLEAN)
+{
+    if(state==State_reading){
+        return(fEof==position);
+    }else{
+        return(TRUE);
+    }
+}//eof;


-    METHOD(MfLink,close,(void),void)
-    {
-        if(state==State_writting){
-            linkbuf[fEof]='\0';
-            while((fEof>0)
-            &&((linkbuf[fEof-1]=='\n')||(linkbuf[fEof-1]=='\r'))){
-                fEof--;
-            }
-            linkbuf[fEof]='\0';
-            if(fEof>0){
-                unlink(pathName()->string());
-                symlink(linkbuf,pathName()->string());
-            }
+METHOD(MfLink,close,(void),void)
+{
+    if(state==State_writting){
+        linkbuf[fEof]='\0';
+        while((fEof>0)
+              &&((linkbuf[fEof-1]=='\n')||(linkbuf[fEof-1]=='\r'))){
+            fEof--;
         }
-        state=State_closed;
-    }//close;
+        linkbuf[fEof]='\0';
+        if(fEof>0){
+            unlink(pathName()->string());
+            int r=symlink(linkbuf,pathName()->string());
+            (void)r;
+        }
+    }
+    state=State_closed;
+}//close;


-    METHOD(MfLink,size,(void),CARD32)
-    {
-        if(fSize==MAX_CARD32){
-                struct stat     status;
-                BpString*       fname=NEW(BpString);
-            pathNameGet(fname);
-            if(lstat(fname->string(),&status)==0){
-                fSize=status.st_size;
-            }
+METHOD(MfLink,size,(void),CARD32)
+{
+    if(fSize==MAX_CARD32){
+        struct stat     status;
+        BpString*       fname=NEW(BpString);
+        pathNameGet(fname);
+        if(lstat(fname->string(),&status)==0){
+            fSize=(CARD32)status.st_size;
         }
-        return(fSize);
-    }//size;
+    }
+    return(fSize);
+}//size;


-    METHOD(MfLink,copyToDos,
-           (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
-    {
-        MfFile*     theCopy;
+METHOD(MfLink,copyToDos,
+       (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
+{
+    MfFile*     theCopy;

-        if(!(dDir->isKindOfClassNamed("MfDirectory"))){
-            fprintf(stderr,"dDir is not a MfDirectory in MfLink::copyToDos, "
-                    "but is %s!\n",dDir->className());
-            return;
-        }
-        theCopy=((MfDirectory*)dDir)->newFile();
-        theCopy->holderSet(0,dDir);
-        theCopy->nameSet(dName);
-        theCopy->modeSet(dMode);
-        if(printIt){
-            printf("echo %s >  %s\n",
-                   this->pathName()->shellQuoted()->string(),
-                   theCopy->pathName()->shellQuoted()->string());
-            printf("chmod %04u %s\n",theCopy->mode()->mode(),
-                   theCopy->pathName()->shellQuoted()->string());
-        }else{
-            theCopy->copyFileFrom(this);
-        }
-    }//copyToDos;
+    if(!(dDir->isKindOfClassNamed("MfDirectory"))){
+        fprintf(stderr,"dDir is not a MfDirectory in MfLink::copyToDos, "
+                "but is %s!\n",dDir->className());
+        return;
+    }
+    theCopy=((MfDirectory*)dDir)->newFile();
+    theCopy->holderSet(0,dDir);
+    theCopy->nameSet(dName);
+    theCopy->modeSet(dMode);
+    if(printIt){
+        printf("echo %s >  %s\n",
+               this->pathName()->shellQuoted()->string(),
+               theCopy->pathName()->shellQuoted()->string());
+        printf("chmod %04u %s\n",theCopy->mode()->mode(),
+               theCopy->pathName()->shellQuoted()->string());
+    }else{
+        theCopy->copyFileFrom(this);
+    }
+}//copyToDos;



-    METHOD(MfLink,copyToUnix,
-           (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
-    {
-        MfLink*     theCopy;
+METHOD(MfLink,copyToUnix,
+       (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
+{
+    MfLink*     theCopy;

-        if(!(uDir->isKindOfClassNamed("MfDirectory"))){
-            fprintf(stderr,"uDir is not a MfDirectory in MfLink::copyToDos, "
-                    "but is %s!\n",uDir->className());
-            return;
-        }
-        theCopy=((MfDirectory*)uDir)->newLink();
-        theCopy->holderSet(0,uDir);
-        theCopy->nameSet(uName);
-        theCopy->modeSet(uMode);
-        if(printIt){
-            printf("cp %s %s\n",this->pathName()->shellQuoted()->string(),
-                   theCopy->pathName()->shellQuoted()->string());
-        }else{
-            theCopy->copyFileFrom(this);
-        }
-    }//copyToUnix;
-
-
-
-    METHOD(MfLink,symLinkToDos,
-           (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
-    {
-        MfLink_SUPER::symLinkToDos(dDir,dName,dMode,printIt);
-    }//symLinkToDos;
-
-
-    METHOD(MfLink,symLinkToUnix,
-           (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
-    {
-        MfLink_SUPER::symLinkToUnix(uDir,uName,uMode,printIt);
-    }//symLinkToUnix;
-
-
-    METHOD(MfLink,hardLinkToDos,
-           (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
-    {
-        MfLink_SUPER::hardLinkToDos(dDir,dName,dMode,printIt);
-    }//hardLinkToDos;
-
-
-    METHOD(MfLink,hardLinkToUnix,
-           (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
-    {
-        MfLink_SUPER::hardLinkToUnix(uDir,uName,uMode,printIt);
-    }//hardLinkToUnix;
-
-
-// MfLink methods:
-
-
-
-//END MfLink.
-
-/*** MfLink.cc                        -- 2003-12-01 04:59:03 -- pascal   ***/
+    if(!(uDir->isKindOfClassNamed("MfDirectory"))){
+        fprintf(stderr,"uDir is not a MfDirectory in MfLink::copyToDos, "
+                "but is %s!\n",uDir->className());
+        return;
+    }
+    theCopy=((MfDirectory*)uDir)->newLink();
+    theCopy->holderSet(0,uDir);
+    theCopy->nameSet(uName);
+    theCopy->modeSet(uMode);
+    if(printIt){
+        printf("cp %s %s\n",this->pathName()->shellQuoted()->string(),
+               theCopy->pathName()->shellQuoted()->string());
+    }else{
+        theCopy->copyFileFrom(this);
+    }
+}//copyToUnix;
+
+
+
+METHOD(MfLink,symLinkToDos,
+       (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
+{
+    MfLink_SUPER::symLinkToDos(dDir,dName,dMode,printIt);
+}//symLinkToDos;
+
+
+METHOD(MfLink,symLinkToUnix,
+       (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
+{
+    MfLink_SUPER::symLinkToUnix(uDir,uName,uMode,printIt);
+}//symLinkToUnix;
+
+
+METHOD(MfLink,hardLinkToDos,
+       (MfNode* dDir,BpString* dName,MfMode* dMode,BOOLEAN printIt),void)
+{
+    MfLink_SUPER::hardLinkToDos(dDir,dName,dMode,printIt);
+}//hardLinkToDos;
+
+
+METHOD(MfLink,hardLinkToUnix,
+       (MfNode* uDir,BpString* uName,MfMode* uMode,BOOLEAN printIt),void)
+{
+    MfLink_SUPER::hardLinkToUnix(uDir,uName,uMode,printIt);
+}//hardLinkToUnix;
+
+
+//// THE END ////
diff --git a/dosname/sources/MfLink.hh b/dosname/sources/MfLink.hh
index 7555c36..21a97f7 100644
--- a/dosname/sources/MfLink.hh
+++ b/dosname/sources/MfLink.hh
@@ -14,7 +14,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/MfMode.cc b/dosname/sources/MfMode.cc
index dc14589..6b2eae1 100644
--- a/dosname/sources/MfMode.cc
+++ b/dosname/sources/MfMode.cc
@@ -14,7 +14,7 @@ MODIFICATIONS

     1994-12-29 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

@@ -43,111 +43,110 @@ extern "C"{
 #include BpClass_hh
 #include <BcImplementation.h>

-    static const char rcsident[]="$Id: MfMode.cc,v 1.1 2003/12/04 03:46:04 pjbpjb Exp $";
+static const char rcsident[]="$Id: MfMode.cc,v 1.1 2003/12/04 03:46:04 pjbpjb Exp $";

-    CONSTRUCTOR(MfMode)
-    {
-        BpClass_PLUG(MfMode);
-        fMode=0;
-    }//MfMode;
+CONSTRUCTOR(MfMode)
+{
+    BpClass_PLUG(MfMode);
+    fMode=0;
+}//MfMode;


-    DESTRUCTOR(MfMode)
-    {
-    }//~MfMode;
+DESTRUCTOR(MfMode)
+{
+}//~MfMode;


 // override of BpObject methods:

-    METHOD(MfMode,makeBrother,(void),BpObject*)
-    {
-        return(NEW(MfMode));
-    }//makeBrother;
+METHOD(MfMode,makeBrother,(void),BpObject*)
+{
+    return(NEW(MfMode));
+}//makeBrother;


-    METHOD(MfMode,printOnLevel,(FILE* file,CARD32 level),void)
-    {
-        MfMode_SUPER::printOnLevel(file,level);
-        PRINTONLEVEL(file,level,"%o",fMode,fMode);
-    }//printOnLevel;
+METHOD(MfMode,printOnLevel,(FILE* file,CARD32 level),void)
+{
+    MfMode_SUPER::printOnLevel(file,level);
+    PRINTONLEVEL(file,level,"%o",fMode,fMode);
+}//printOnLevel;

 // MfMode methods:

-    METHOD(MfMode,mode,(void),CARD16)
-    {
-        return(fMode);
-    }//mode;
+METHOD(MfMode,mode,(void),CARD16)
+{
+    return(fMode);
+}//mode;


-    METHOD(MfMode,modeSet,(CARD16 nMode),void)
-    {
-        fMode=nMode;
-    }//modeSet;
+METHOD(MfMode,modeSet,(CARD16 nMode),void)
+{
+    fMode=nMode;
+}//modeSet;

-    static char MfMode_stringTemplate[]="-ugtrwxrwxrwx";
+static char MfMode_stringTemplate[]="-ugtrwxrwxrwx";

-    METHOD(MfMode,stringValue,(void),BpString*)
-    {
-            BpString*       modeStr=NEW(BpString);
-            char            buffer[14];
-            CARD16          bit;
-            INT32           i;
+METHOD(MfMode,stringValue,(void),BpString*)
+{
+    BpString*       modeStr=NEW(BpString);
+    char            buffer[14];
+    CARD16          bit;
+    INT32           i;

-        switch(fMode&S_IFMT){
-        case S_IFDIR:
-            buffer[0]='d';
+    switch(fMode&S_IFMT){
+    case S_IFDIR:
+        buffer[0]='d';
+        break;
+    case S_IFLNK:
+        buffer[0]='l';
+        break;
+    default:
+        buffer[0]='-';
+        break;
+    }
+    for(i=1,bit=04000;i<13;i++,bit=(CARD16)(bit>>1)){
+        if(bit&fMode){
+            buffer[i]=MfMode_stringTemplate[i];
+        }else{
+            buffer[i]='-';
+        }
+    }
+    buffer[i]='\0';
+    modeStr->setString(buffer);
+    return(modeStr);
+}//stringValue;
+
+
+METHOD(MfMode,stringValueSet,(BpString* nModeStr),void)
+{
+    const char*     buffer;
+    CARD16          bit;
+    INT32           i;
+    CARD16          nMode;
+
+    nMode=0;
+    if(nModeStr->length()==13){
+        buffer=nModeStr->string();
+        switch(buffer[0]){
+        case 'd':
+            nMode=S_IFDIR;
             break;
-        case S_IFLNK:
-            buffer[0]='l';
+        case 'l':
+            nMode=S_IFLNK;
             break;
         default:
-            buffer[0]='-';
+            nMode=S_IFREG;
             break;
         }
-        for(i=1,bit=04000;i<13;i++,bit>>=1){
-            if(bit&fMode){
-                buffer[i]=MfMode_stringTemplate[i];
-            }else{
-                buffer[i]='-';
+        for(i=1,bit=04000;i<13;i++,bit=(CARD16)(bit>>1)){
+            if(buffer[i]==MfMode_stringTemplate[i]){
+                nMode|=bit;
+            }else if(buffer[i]!='-'){
+                return;
             }
         }
-        buffer[i]='\0';
-        modeStr->setString(buffer);
-        return(modeStr);
-    }//stringValue;
-
-
-    METHOD(MfMode,stringValueSet,(BpString* nModeStr),void)
-    {
-            const char*     buffer;
-            CARD16          bit;
-            INT32           i;
-            CARD16          nMode;
-
-        nMode=0;
-        if(nModeStr->length()==13){
-            buffer=nModeStr->string();
-            switch(buffer[0]){
-            case 'd':
-                nMode=S_IFDIR;
-                break;
-            case 'l':
-                nMode=S_IFLNK;
-                break;
-            default:
-                nMode=S_IFREG;
-                break;
-            }
-            for(i=1,bit=04000;i<13;i++,bit>>=1){
-                if(buffer[i]==MfMode_stringTemplate[i]){
-                    nMode|=bit;
-                }else if(buffer[i]!='-'){
-                    return;
-                }
-            }
-            fMode=nMode;
-        }
-    }//stringValueSet;
-
+        fMode=nMode;
+    }
+}//stringValueSet;

-//END MfMode.
+//// THE END ////
diff --git a/dosname/sources/MfMode.hh b/dosname/sources/MfMode.hh
index 7f71d98..16a6c6b 100644
--- a/dosname/sources/MfMode.hh
+++ b/dosname/sources/MfMode.hh
@@ -13,7 +13,7 @@ MODIFICATIONS
    Initial revision

 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

diff --git a/dosname/sources/MfNode.cc b/dosname/sources/MfNode.cc
index 414fc94..a28d9d0 100644
--- a/dosname/sources/MfNode.cc
+++ b/dosname/sources/MfNode.cc
@@ -27,7 +27,7 @@ MODIFICATIONS

     1994-12-25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

@@ -324,7 +324,7 @@ extern "C"{
     {
         if(fFile!=NIL){
             clearerr(fFile);
-            return(fread(buffer,1,bufSize,fFile));
+            return((INT32)fread(buffer,1,bufSize,fFile));
         }else{
             return(-1);
         }
@@ -335,7 +335,7 @@ extern "C"{
     {
         if(fFile!=NIL){
             clearerr(fFile);
-            return(fwrite(buffer,1,bufSize,fFile));
+            return((INT32)fwrite(buffer,1,bufSize,fFile));
         }else{
             return(-1);
         }
diff --git a/dosname/sources/MfNode.hh b/dosname/sources/MfNode.hh
index 70fb5f8..11871f8 100644
--- a/dosname/sources/MfNode.hh
+++ b/dosname/sources/MfNode.hh
@@ -28,7 +28,7 @@ MODIFICATIONS

     1994-12-25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

diff --git a/dosname/sources/MfRootDirectory.cc b/dosname/sources/MfRootDirectory.cc
index fa1b351..00fe003 100644
--- a/dosname/sources/MfRootDirectory.cc
+++ b/dosname/sources/MfRootDirectory.cc
@@ -23,7 +23,7 @@ MODIFICATIONS

     1994-12-25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

diff --git a/dosname/sources/MfRootDirectory.hh b/dosname/sources/MfRootDirectory.hh
index 55355b6..3d94047 100644
--- a/dosname/sources/MfRootDirectory.hh
+++ b/dosname/sources/MfRootDirectory.hh
@@ -24,7 +24,7 @@ MODIFICATIONS

     1994-12-25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

diff --git a/dosname/sources/MfUtil.cc b/dosname/sources/MfUtil.cc
index e0a3c2b..ed51774 100644
--- a/dosname/sources/MfUtil.cc
+++ b/dosname/sources/MfUtil.cc
@@ -22,7 +22,7 @@ MODIFICATIONS

     1994-12-29 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

diff --git a/dosname/sources/MfUtil.hh b/dosname/sources/MfUtil.hh
index 9d58009..e68c78f 100644
--- a/dosname/sources/MfUtil.hh
+++ b/dosname/sources/MfUtil.hh
@@ -23,7 +23,7 @@ MODIFICATIONS

     1994-12-29 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1994 - 2001
+    Copyright Pascal J. Bourguignon 1994 - 2011

     GPL

diff --git a/dosname/sources/NameSeq.cc b/dosname/sources/NameSeq.cc
index 7c2bb7f..1b1901d 100644
--- a/dosname/sources/NameSeq.cc
+++ b/dosname/sources/NameSeq.cc
@@ -14,7 +14,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/NameSeq.hh b/dosname/sources/NameSeq.hh
index 68bad3e..43ab827 100644
--- a/dosname/sources/NameSeq.hh
+++ b/dosname/sources/NameSeq.hh
@@ -15,7 +15,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/Pressure.cc b/dosname/sources/Pressure.cc
index cc96268..1ac2fe6 100644
--- a/dosname/sources/Pressure.cc
+++ b/dosname/sources/Pressure.cc
@@ -14,7 +14,7 @@ MODIFICATIONS
     1995-01-01 <PJB> Creation.
 BUGS
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/Pressure.hh b/dosname/sources/Pressure.hh
index 03fa1a6..079c1a4 100644
--- a/dosname/sources/Pressure.hh
+++ b/dosname/sources/Pressure.hh
@@ -14,7 +14,7 @@ MODIFICATIONS
     1995-01-01 <PJB> Creation.
 BUGS
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/Renamer.cc b/dosname/sources/Renamer.cc
index 87c0547..7e5fb7a 100644
--- a/dosname/sources/Renamer.cc
+++ b/dosname/sources/Renamer.cc
@@ -14,7 +14,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

@@ -47,524 +47,522 @@ extern "C"{
 #include BpClass_hh
 #include BcImplementation_h

-    static const char rcsid[]="$Id: Renamer.cc,v 1.1 2003/12/04 03:46:04 pjbpjb Exp $";
-
-
-    CONSTRUCTOR(Renamer)
-    {
-        BpClass_PLUG(Renamer);
-        curUnixName=NIL;
-        curDosName=NIL;
-        curMode=NIL;
-        unixToDos=NEW(BpDict);
-        unixToDos->retain();
-        dosToUnix=NEW(BpDict);
-        dosToUnix->retain();
-    }//Renamer;
-
-
-    DESTRUCTOR(Renamer)
-    {
-        if(curUnixName!=NIL){
-            free(curUnixName);
-        }
-        if(curDosName!=NIL){
-            free(curDosName);
-        }
-        if(curMode!=NIL){
-            curMode->release();
-        }
-        unixToDos->release();
-        dosToUnix->release();
-    }//~Renamer;
-
-
-    METHOD(Renamer,makeBrother,(void),BpObject*)
-    {
-        return(NEW(Renamer));
-    }//makeBrother;
-
-
-    METHOD(Renamer,printOnLevel,(FILE* file,CARD32 level),void)
-    {
-        Renamer_SUPER::printOnLevel(file,level);
-        PRINTONLEVEL(file,level,"%s",curUnixName,NULLSTR(curUnixName));
-        PRINTONLEVEL(file,level,"%p",curMode,curMode);
-        if(curMode!=NIL){
-            PRINTONLEVEL_OPEN(file,level, curMode);
-            curMode->printOnLevel(file,level+1);
-            PRINTONLEVEL_CLOSE(file,level);
-        }
-        PRINTONLEVEL(file,level,"%s",curDosName,NULLSTR(curDosName));
-        PRINTONLEVEL(file,level,"%p",dosToUnix,dosToUnix);
-        if(dosToUnix!=NIL){
-            PRINTONLEVEL_OPEN(file,level,dosToUnix);
-            dosToUnix->printOnLevel(file,level+1);
-            PRINTONLEVEL_CLOSE(file,level);
-        }
-        PRINTONLEVEL(file,level,"%p",unixToDos,unixToDos);
-        if(unixToDos!=NIL){
-            PRINTONLEVEL_OPEN(file,level,unixToDos);
-            unixToDos->printOnLevel(file,level+1);
-            PRINTONLEVEL_CLOSE(file,level);
-        }
-    }//printOnLevel;
+static const char rcsid[]="$Id: Renamer.cc,v 1.1 2003/12/04 03:46:04 pjbpjb Exp $";
+
+
+CONSTRUCTOR(Renamer)
+{
+    BpClass_PLUG(Renamer);
+    curUnixName=NIL;
+    curDosName=NIL;
+    curMode=NIL;
+    unixToDos=NEW(BpDict);
+    unixToDos->retain();
+    dosToUnix=NEW(BpDict);
+    dosToUnix->retain();
+}//Renamer;
+
+
+DESTRUCTOR(Renamer)
+{
+    if(curUnixName!=NIL){
+        free(curUnixName);
+    }
+    if(curDosName!=NIL){
+        free(curDosName);
+    }
+    if(curMode!=NIL){
+        curMode->release();
+    }
+    unixToDos->release();
+    dosToUnix->release();
+}//~Renamer;
+
+
+METHOD(Renamer,makeBrother,(void),BpObject*)
+{
+    return(NEW(Renamer));
+}//makeBrother;
+
+
+METHOD(Renamer,printOnLevel,(FILE* file,CARD32 level),void)
+{
+    Renamer_SUPER::printOnLevel(file,level);
+    PRINTONLEVEL(file,level,"%s",curUnixName,NULLSTR(curUnixName));
+    PRINTONLEVEL(file,level,"%p",curMode,curMode);
+    if(curMode!=NIL){
+        PRINTONLEVEL_OPEN(file,level, curMode);
+        curMode->printOnLevel(file,level+1);
+        PRINTONLEVEL_CLOSE(file,level);
+    }
+    PRINTONLEVEL(file,level,"%s",curDosName,NULLSTR(curDosName));
+    PRINTONLEVEL(file,level,"%p",dosToUnix,dosToUnix);
+    if(dosToUnix!=NIL){
+        PRINTONLEVEL_OPEN(file,level,dosToUnix);
+        dosToUnix->printOnLevel(file,level+1);
+        PRINTONLEVEL_CLOSE(file,level);
+    }
+    PRINTONLEVEL(file,level,"%p",unixToDos,unixToDos);
+    if(unixToDos!=NIL){
+        PRINTONLEVEL_OPEN(file,level,unixToDos);
+        unixToDos->printOnLevel(file,level+1);
+        PRINTONLEVEL_CLOSE(file,level);
+    }
+}//printOnLevel;


 /*
-    .           .
-    ..          ..
-    ...         ___
-    .x          _x
-    ..x         __x
-    ...x        ___x
-    x.          x.
-    x..         x__
-    x.x         x.x
-    x..x        x__x
-    x...x       x___x
+  .           .
+  ..          ..
+  ...         ___
+  .x          _x
+  ..x         __x
+  ...x        ___x
+  x.          x.
+  x..         x__
+  x.x         x.x
+  x..x        x__x
+  x...x       x___x
 */

-    METHOD(Renamer,processDots,(char* processedUN),void)
-    {
-            INT32       i;
+METHOD(Renamer,processDots,(char* processedUN),void)
+{
+    INT32       i;

-        i=0;
+    i=0;
+    if(curUnixName[i]=='.'){
+        if((curUnixName[1]=='\0')
+           ||((curUnixName[1]=='.')&&(curUnixName[2]=='\0'))){
+            /* "." or ".." */
+            while(curUnixName[i]!='\0'){
+                processedUN[i]='.';
+                i++;
+            }
+        }else{
+            /* curUnixName[1]!='\0' */
+            while(curUnixName[i]=='.'){
+                processedUN[i]='_';
+                i++;
+            }
+        }
+    }
+    while(curUnixName[i]!='\0'){
+        while((curUnixName[i]!='.')&&(curUnixName[i]!='\0')){
+            processedUN[i]=curUnixName[i];
+            i++;
+        }
         if(curUnixName[i]=='.'){
-            if((curUnixName[1]=='\0')
-            ||((curUnixName[1]=='.')&&(curUnixName[2]=='\0'))){
-                /* "." or ".." */
-                while(curUnixName[i]!='\0'){
-                    processedUN[i]='.';
-                    i++;
-                }
-            }else{
-                /* curUnixName[1]!='\0' */
+            if(curUnixName[i+1]=='.'){
                 while(curUnixName[i]=='.'){
                     processedUN[i]='_';
                     i++;
                 }
-            }
-        }
-        while(curUnixName[i]!='\0'){
-            while((curUnixName[i]!='.')&&(curUnixName[i]!='\0')){
+            }else{
                 processedUN[i]=curUnixName[i];
                 i++;
             }
-            if(curUnixName[i]=='.'){
-                if(curUnixName[i+1]=='.'){
-                    while(curUnixName[i]=='.'){
-                        processedUN[i]='_';
-                        i++;
-                    }
-                }else{
-                    processedUN[i]=curUnixName[i];
-                    i++;
-                }
-            }
         }
-        processedUN[i]='\0';
-    }//processDots;
+    }
+    processedUN[i]='\0';
+}//processDots;


-    METHOD(Renamer,setUnixName,(const char* nUN,MfMode* nMode),void)
-    {
-        if(curUnixName!=NIL){
-            free(curUnixName);
-        }
-        curUnixName=newstr(nUN);
-        if(curMode!=NIL){
-            curMode->release();
-        }
-        curMode=nMode;
-        curMode->retain();
-        if(curDosName!=NIL){
-            free(curDosName);
-            curDosName=NIL;
-        }
-    }//setUnixName;
+METHOD(Renamer,setUnixName,(const char* nUN,MfMode* nMode),void)
+{
+    if(curUnixName!=NIL){
+        free(curUnixName);
+    }
+    curUnixName=newstr(nUN);
+    if(curMode!=NIL){
+        curMode->release();
+    }
+    curMode=nMode;
+    curMode->retain();
+    if(curDosName!=NIL){
+        free(curDosName);
+        curDosName=NIL;
+    }
+}//setUnixName;


-    METHOD(Renamer,dosName,(void),const char*)
-    {
-        if(curDosName==NIL){
-            computeDosName();
-        }
-        return(curDosName);
-    }//dosName;
+METHOD(Renamer,dosName,(void),const char*)
+{
+    if(curDosName==NIL){
+        computeDosName();
+    }
+    return(curDosName);
+}//dosName;


-    METHOD(Renamer,setDosName,(const char* nDN),void)
-    {
-        if(curDosName!=NIL){
-            free(curDosName);
-        }
-        curDosName=newstr(nDN);
-        if(curUnixName!=NIL){
-            free(curUnixName);
-            curUnixName=NIL;
-        }
-        if(curMode!=NIL){
-            curMode->release();
-            curMode=NIL;
-        }
-    }//setDosName;
+METHOD(Renamer,setDosName,(const char* nDN),void)
+{
+    if(curDosName!=NIL){
+        free(curDosName);
+    }
+    curDosName=newstr(nDN);
+    if(curUnixName!=NIL){
+        free(curUnixName);
+        curUnixName=NIL;
+    }
+    if(curMode!=NIL){
+        curMode->release();
+        curMode=NIL;
+    }
+}//setDosName;


-    METHOD(Renamer,unixName,(void),const char*)
-    {
-        if(curUnixName==NIL){
-            computeUnixName();
-        }
-        return(curUnixName);
-    }//unixName;
+METHOD(Renamer,unixName,(void),const char*)
+{
+    if(curUnixName==NIL){
+        computeUnixName();
+    }
+    return(curUnixName);
+}//unixName;


-    METHOD(Renamer,mode,(void),MfMode*)
-    {
-        if(curMode==NIL){
-            computeUnixName();
-        }
-        return(curMode);
-    }//mode;
+METHOD(Renamer,mode,(void),MfMode*)
+{
+    if(curMode==NIL){
+        computeUnixName();
+    }
+    return(curMode);
+}//mode;



 /*
-    The mode is always attached to the value string of the dictionaries
-    (because BpDict makes its own copies of the keys).
-    computeDosName takes the mode from curMode, which has be set from the
-    setUnixName parameter. It puts the mode into the saved 'cache'.
-    computeUnixMame takes the mode from the dosToUnix dictionary, loaded
-    from the msdosnam file. It puts the mode to the curMode, which will be
-    retrieved by mode().
+  The mode is always attached to the value string of the dictionaries
+  (because BpDict makes its own copies of the keys).
+  computeDosName takes the mode from curMode, which has be set from the
+  setUnixName parameter. It puts the mode into the saved 'cache'.
+  computeUnixMame takes the mode from the dosToUnix dictionary, loaded
+  from the msdosnam file. It puts the mode to the curMode, which will be
+  retrieved by mode().

 */


-    METHOD(Renamer,computeUnixName,(void),void)
-    {
-        AttrString* aDosName;
-        AttrString* aUnixName;
+METHOD(Renamer,computeUnixName,(void),void)
+{
+    AttrString* aDosName;
+    AttrString* aUnixName;

-        if(curUnixName!=NIL){
-            free(curUnixName);
-        }
-        if(curMode!=NIL){
-            curMode->release();
-        }
-        aDosName=NEW(AttrString);
-        aDosName->setString(curDosName);
-        aUnixName=(AttrString*)(dosToUnix->objectForKey(aDosName));
-        if(aUnixName!=NIL){
-            curUnixName=newstr(aUnixName->string());
-            curMode=aUnixName->mode();
-        }else{
+    if(curUnixName!=NIL){
+        free(curUnixName);
+    }
+    if(curMode!=NIL){
+        curMode->release();
+    }
+    aDosName=NEW(AttrString);
+    aDosName->setString(curDosName);
+    aUnixName=(AttrString*)(dosToUnix->objectForKey(aDosName));
+    if(aUnixName!=NIL){
+        curUnixName=newstr(aUnixName->string());
+        curMode=aUnixName->mode();
+    }else{
         //SEE: the CurDosName could be already used by a unix file.
-            curUnixName=newstr(curDosName);
-            aUnixName=NEW(AttrString);
-            aUnixName->setString(curUnixName);
-            curMode=NEW(MfMode);
-            curMode->modeSet(00777);
-        }
-        curMode->retain();
-        aDosName->setMode(curMode);
-        unixToDos->setObjectForKey(aDosName,aUnixName);
-    }//computeUnixName;
-
-
-    METHOD(Renamer,computeDosName,(void),void)
-        /*
-            PRE:        curDosName=NIL.
-            POST:       curDosName!=NIL. curDosName contains a DOS name.
-        */
-    {
-        INT32       i;
-        char*       processedUN;
-        NameSeq*    names;
-        AttrString* aUnixName;
-        AttrString* aDosName;
-        INT32       n;
-        char*       p;
-
+        curUnixName=newstr(curDosName);
         aUnixName=NEW(AttrString);
         aUnixName->setString(curUnixName);
-        aDosName=(AttrString*)(unixToDos->objectForKey(aUnixName));
-        if(aDosName!=NIL){
-            curDosName=newstr(aDosName->string());
-            aUnixName->setMode(curMode);
-            dosToUnix->setObjectForKey(aUnixName,aDosName);
-        }else{
+        curMode=NEW(MfMode);
+        curMode->modeSet(00777);
+    }
+    curMode->retain();
+    aDosName->setMode(curMode);
+    unixToDos->setObjectForKey(aDosName,aUnixName);
+}//computeUnixName;
+
+
+METHOD(Renamer,computeDosName,(void),void)
+/*
+  PRE:        curDosName=NIL.
+  POST:       curDosName!=NIL. curDosName contains a DOS name.
+*/
+{
+    INT32       i;
+    char*       processedUN;
+    NameSeq*    names;
+    AttrString* aUnixName;
+    AttrString* aDosName;
+    INT32       n;
+    char*       p;

-    //***************************************
-    //*** BEGIN PROCESS UNX NAME TO DOS NAME
-
-            processedUN=(char*)malloc(strlen(curUnixName)+1);
-            processDots(processedUN);
-            for(i=0;processedUN[i]!='\0';i++){
-                switch(processedUN[i]){
-                case '*':
-                case '?':
-                case '\\':
-                case '/':
-                    processedUN[i]='_';
-                    break;
-                default:
-                    break;
-                }
+    aUnixName=NEW(AttrString);
+    aUnixName->setString(curUnixName);
+    aDosName=(AttrString*)(unixToDos->objectForKey(aUnixName));
+    if(aDosName!=NIL){
+        curDosName=newstr(aDosName->string());
+        aUnixName->setMode(curMode);
+        dosToUnix->setObjectForKey(aUnixName,aDosName);
+    }else{
+
+        //***************************************
+        //*** BEGIN PROCESS UNX NAME TO DOS NAME
+
+        processedUN=(char*)malloc(strlen(curUnixName)+1);
+        processDots(processedUN);
+        for(i=0;processedUN[i]!='\0';i++){
+            switch(processedUN[i]){
+            case '*':
+            case '?':
+            case '\\':
+            case '/':
+                processedUN[i]='_';
+                break;
+            default:
+                break;
             }
-            if(processedUN[0]=='.'){
-                /* "." or ".." */
-                strcpy(curDosName,processedUN);
-                // no entry in the cache.
-            }else{
-                names=NEW(NameSeq);
-                names->retain();
+        }
+        if(processedUN[0]=='.'){
+            /* "." or ".." */
+            strcpy(curDosName,processedUN);
+            // no entry in the cache.
+        }else{
+            names=NEW(NameSeq);
+            names->retain();

-                i=0;names->analyze(processedUN,&i);
-                if(curUnixName[i]!='\0'){
-                    fprintf(stderr,"Warning: computeDosName: unix name cannot be analysed entirely\n\t(%s); remaining: (%s)\n",curUnixName,curUnixName+i);
-                }
+            i=0;names->analyze(processedUN,&i);
+            if(curUnixName[i]!='\0'){
+                fprintf(stderr,"Warning: computeDosName: unix name cannot be analysed entirely\n\t(%s); remaining: (%s)\n",curUnixName,curUnixName+i);
+            }

-                names->reduce();
-                curDosName=(char*)malloc(8+1+3+1);
-                i=0;names->catenate(curDosName,&i);
-                names->release();
+            names->reduce();
+            curDosName=(char*)malloc(8+1+3+1);
+            i=0;names->catenate(curDosName,&i);
+            names->release();

-                for(i=0;curDosName[i]!='\0';i++){
-                    if(isupper(curDosName[i])){
-                        curDosName[i]=tolower(curDosName[i]);
-                    }
+            for(i=0;curDosName[i]!='\0';i++){
+                if(isupper(curDosName[i])){
+                    curDosName[i]=(char)tolower(curDosName[i]);
                 }
+            }

-    //*** END PROCESS UNX NAME TO DOS NAME
-    //***************************************
+            //*** END PROCESS UNX NAME TO DOS NAME
+            //***************************************

-                aDosName=NEW(AttrString);
-                aDosName->setString(curDosName);
+            aDosName=NEW(AttrString);
+            aDosName->setString(curDosName);

-    //***************************************
-    //*** BEGIN PROCESS DOUBLE NAMES
+            //***************************************
+            //*** BEGIN PROCESS DOUBLE NAMES

-                if(dosToUnix->objectForKey(aDosName)!=NULL){
-                    n=0;
-                    p=strchr(curDosName,'.');
-                    if(p==NULL){
-                        p=curDosName+strlen(curDosName);
-                        (*p)='.';
-                    }
-                    p++;
-                    while((dosToUnix->objectForKey(aDosName)!=NULL)&&(n<1000)){
-                        sprintf(p,"%03ld",n);
-                        n++;
-                        aDosName->setString(curDosName);
-                    }
-                    if(n==1000){
-                        fprintf(stderr,"Renamer::computeDosName: please be serrious: I'm getting more than a \n   thousand unix names collapsing to the same DOS name!\n");
-                        exit(2);
-                    }
+            if(dosToUnix->objectForKey(aDosName)!=NULL){
+                n=0;
+                p=strchr(curDosName,'.');
+                if(p==NULL){
+                    p=curDosName+strlen(curDosName);
+                    (*p)='.';
+                }
+                p++;
+                while((dosToUnix->objectForKey(aDosName)!=NULL)&&(n<1000)){
+                    sprintf(p,"%03"FMT_INT32,n);
+                    n++;
+                    aDosName->setString(curDosName);
                 }
+                if(n==1000){
+                    fprintf(stderr,"Renamer::computeDosName: please be serrious: I'm getting more than a \n   thousand unix names collapsing to the same DOS name!\n");
+                    exit(2);
+                }
+            }

-    //*** END PROCESS DOUBLE NAMES
-    //***************************************
+            //*** END PROCESS DOUBLE NAMES
+            //***************************************

-                aUnixName->setMode(curMode);
-                dosToUnix->setObjectForKey(aUnixName,aDosName);
-            }
-            free(processedUN);
+            aUnixName->setMode(curMode);
+            dosToUnix->setObjectForKey(aUnixName,aDosName);
         }
-    }//computeDosName;
+        free(processedUN);
+    }
+}//computeDosName;


-    PROCEDURE(addIfAbsent,(BpDict* cache,CARD16 nMode,
-                            const char* nKey,const char* nValue),void)
-    {
-            AttrString*     key=NEW(AttrString);
-        key->setString(nKey);
-        if(cache->objectForKey(key)==NULL){
-                AttrString*     value=NEW(AttrString);
-                MfMode*         mode=NEW(MfMode);
-            value->setString(nValue);
-            mode->modeSet(nMode);
-            value->setMode(mode);
-            cache->setObjectForKey(value,key);
+PROCEDURE(addIfAbsent,(BpDict* cache,CARD16 nMode,
+                       const char* nKey,const char* nValue),void)
+{
+    AttrString*     key=NEW(AttrString);
+    key->setString(nKey);
+    if(cache->objectForKey(key)==NULL){
+        AttrString*     value=NEW(AttrString);
+        MfMode*         mode=NEW(MfMode);
+        value->setString(nValue);
+        mode->modeSet(nMode);
+        value->setMode(mode);
+        cache->setObjectForKey(value,key);
+    }
+}//addIfAbsent;
+
+
+METHOD(Renamer,loadUnixCache,(FILE* fCache),void)
+{
+    dosToUnix->removeAllObjects();
+    unixToDos->removeAllObjects();
+    if(fCache!=NULL){
+        loadCache(fCache,unixToDos,TRUE);
+    }
+    addIfAbsent(unixToDos,0666,".msdosnames","msdosnam");
+}//loadUnixCache;
+
+
+METHOD(Renamer,saveUnixCache,(FILE* fCache),void)
+{
+    if(fCache!=NULL){
+        saveCache(fCache,unixToDos,TRUE);
+    }
+}//saveUnixCache;
+
+
+METHOD(Renamer,loadDosCache,(FILE* fCache),void)
+{
+    unixToDos->removeAllObjects();
+    dosToUnix->removeAllObjects();
+    if(fCache!=NULL){
+        loadCache(fCache,dosToUnix,FALSE);
+    }
+    addIfAbsent(dosToUnix,0666,"msdosnam",".msdosnames");
+}//loadDosCache;
+
+
+METHOD(Renamer,saveDosCache,(FILE* fCache),void)
+{
+    if(fCache!=NULL){
+        saveCache(fCache,dosToUnix,FALSE);
+    }
+}//saveDosCache;
+
+
+PROCEDURE(fgets_crnl,(char* buffer,size_t size,FILE* file),char*)
+{
+    int             nextc;
+    size_t          i;
+
+    nextc=fgetc(file);
+    i=0;
+    while((i<size)&&(nextc!=EOF)){
+        buffer[i]=(char)nextc;
+        i++;
+        if((nextc=='\n')||(nextc=='\r')){
+            buffer[i]='\0';
+            return(buffer);
         }
-    }//addIfAbsent;
-
-
-    METHOD(Renamer,loadUnixCache,(FILE* fCache),void)
-    {
-        dosToUnix->removeAllObjects();
-        unixToDos->removeAllObjects();
-        if(fCache!=NULL){
-            loadCache(fCache,unixToDos,TRUE);
+        nextc=fgetc(file);
+    }
+    buffer[i]='\0';
+    if(nextc!=EOF){
+        return(buffer);
+    }else{
+        return(NULL);
+    }
+}//fgets_crnl;
+
+
+METHOD(Renamer,loadCache,(FILE* fCache,BpDict* cache,BOOLEAN unox),void)
+{
+    char        buffer[BUFSIZ];
+    char*       m;
+    char*       d;
+    char*       u;
+    char*       mt;
+    char*       dt;
+    char*       ut;
+    INT32       i;
+    BpString*   key;
+    AttrString* value;
+    MfMode*     amode;
+
+    while(fgets_crnl(buffer,BUFSIZ-1,fCache)){
+        ut=strchr(buffer,'\n');
+        if(ut==NULL){
+            ut=strchr(buffer,'\r');
         }
-        addIfAbsent(unixToDos,0666,".msdosnames","msdosnam");
-    }//loadUnixCache;
-
-
-    METHOD(Renamer,saveUnixCache,(FILE* fCache),void)
-    {
-        if(fCache!=NULL){
-            saveCache(fCache,unixToDos,TRUE);
+        if(ut!=NULL){
+            (*ut)='\0';
         }
-    }//saveUnixCache;
-
-
-    METHOD(Renamer,loadDosCache,(FILE* fCache),void)
-    {
-        unixToDos->removeAllObjects();
-        dosToUnix->removeAllObjects();
-        if(fCache!=NULL){
-            loadCache(fCache,dosToUnix,FALSE);
+
+        i=0;
+        m=buffer+i;
+        while((buffer[i]!=' ')&&(buffer[i]!='\t')&&(buffer[i]!='\0')){
+            i++;
         }
-        addIfAbsent(dosToUnix,0666,"msdosnam",".msdosnames");
-    }//loadDosCache;
-
-
-    METHOD(Renamer,saveDosCache,(FILE* fCache),void)
-    {
-        if(fCache!=NULL){
-            saveCache(fCache,dosToUnix,FALSE);
+        mt=buffer+i;
+        while((buffer[i]==' ')||(buffer[i]=='\t')){
+            i++;
         }
-    }//saveDosCache;
-
-
-    PROCEDURE(fgets_crnl,(char* buffer,size_t size,FILE* file),char*)
-    {
-            int             nextc;
-            size_t          i;

-        nextc=fgetc(file);
-        i=0;
-        while((i<size)&&(nextc!=EOF)){
-            buffer[i]=(char)nextc;
+        d=buffer+i;
+        while((buffer[i]!=' ')&&(buffer[i]!='\t')&&(buffer[i]!='\0')){
             i++;
-            if((nextc=='\n')||(nextc=='\r')){
-                buffer[i]='\0';
-                return(buffer);
-            }
-            nextc=fgetc(file);
         }
-        buffer[i]='\0';
-        if(nextc!=EOF){
-            return(buffer);
-        }else{
-            return(NULL);
+        dt=buffer+i;
+        while((buffer[i]==' ')||(buffer[i]=='\t')){
+            i++;
         }
-    }//fgets_crnl;
-
-
-    METHOD(Renamer,loadCache,(FILE* fCache,BpDict* cache,BOOLEAN unox),void)
-    {
-            char        buffer[BUFSIZ];
-            char*       m;
-            char*       d;
-            char*       u;
-            char*       mt;
-            char*       dt;
-            char*       ut;
-            INT32       i;
-            BpString*   key;
-            AttrString* value;
-            MfMode*     amode;
-
-        while(fgets_crnl(buffer,BUFSIZ-1,fCache)){
-            ut=strchr(buffer,'\n');
-            if(ut==NULL){
-                ut=strchr(buffer,'\r');
-            }
-            if(ut!=NULL){
-                (*ut)='\0';
-            }
-
-            i=0;
-            m=buffer+i;
-            while((buffer[i]!=' ')&&(buffer[i]!='\t')&&(buffer[i]!='\0')){
-                i++;
-            }
-            mt=buffer+i;
-            while((buffer[i]==' ')||(buffer[i]=='\t')){
-                i++;
-            }
-
-            d=buffer+i;
-            while((buffer[i]!=' ')&&(buffer[i]!='\t')&&(buffer[i]!='\0')){
-                i++;
-            }
-            dt=buffer+i;
-            while((buffer[i]==' ')||(buffer[i]=='\t')){
-                i++;
-            }

-            u=buffer+i;
-            while((buffer[i]!=' ')&&(buffer[i]!='\t')&&(buffer[i]!='\0')){
-                i++;
-            }
-            ut=buffer+i;
+        u=buffer+i;
+        while((buffer[i]!=' ')&&(buffer[i]!='\t')&&(buffer[i]!='\0')){
+            i++;
+        }
+        ut=buffer+i;

-            if((m==mt)||(d==dt)||(u==ut)){
-                if(!((m==mt)&&(d==dt)&&(u==ut))){
-                    fprintf(stderr,"NameSeq::loadCache: Missing a name on line: '%s' (skipping).\n",buffer);
-                }// else the line is empty, so we completely ignore it.
+        if((m==mt)||(d==dt)||(u==ut)){
+            if(!((m==mt)&&(d==dt)&&(u==ut))){
+                fprintf(stderr,"NameSeq::loadCache: Missing a name on line: '%s' (skipping).\n",buffer);
+            }// else the line is empty, so we completely ignore it.
+        }else{
+            (*mt)='\0';
+            (*dt)='\0';
+            (*ut)='\0';
+            amode=NEW(MfMode);
+            amode->stringValueSet(NEW(BpString(m)));
+            key=NEW(AttrString);
+            value=NEW(AttrString);
+            value->setMode(amode);
+            if(unox){
+                key->setString(u);
+                value->setString(d);
             }else{
-                (*mt)='\0';
-                (*dt)='\0';
-                (*ut)='\0';
-                amode=NEW(MfMode);
-                amode->stringValueSet(NEW(BpString(m)));
-                key=NEW(AttrString);
-                value=NEW(AttrString);
-                value->setMode(amode);
-                if(unox){
-                    key->setString(u);
-                    value->setString(d);
-                }else{
-                    key->setString(d);
-                    value->setString(u);
-                }
-                cache->setObjectForKey(value,key);
+                key->setString(d);
+                value->setString(u);
             }
+            cache->setObjectForKey(value,key);
         }
-    }//loadCache;
+    }
+}//loadCache;


-    METHOD(Renamer,saveCache,(FILE* fCache,BpDict* cache,BOOLEAN unox),void)
-    {
-            BpArray*        keys;
-            INT32           i;
-            INT32           c;
-            AttrString*     value;
-            BpString*       key;
+METHOD(Renamer,saveCache,(FILE* fCache,BpDict* cache,BOOLEAN unox),void)
+{
+    BpArray*        keys;
+    INT32           i;
+    INT32           c;
+    AttrString*     value;
+    BpString*       key;

-//this->printOn(stderr);
+    //this->printOn(stderr);

-        keys=cache->allKeys();
-        c=keys->size();
-        for(i=0;i<c;i++){
-            key=(BpString*)(keys->objectAt(i));
-            value=(AttrString*)(cache->objectForKey(key));
-            if(unox){
-                fprintf(fCache,"%-15s %-14s %s\n",
-                        value->mode()->stringValue()->string(),
-                        value->string(),key->string());
-                //For now, write it any way: this allows the user to change
-                //easily the dos name, having all the entries in the cache.
-                //if(strcmp(key->string(),value->string())!=0){
-                //else there is no need to save in cache: all data is in the
-                //     unix directory.
-                //}
-            }else{
-                // we write even when key==value for unix modes are not
-                // preserved in dos file system.
-                fprintf(fCache,"%-15s %-14s %s\n",
-                        value->mode()->stringValue()->string(),
-                        key->string(),value->string());
-            }
+    keys=cache->allKeys();
+    c=keys->size();
+    for(i=0;i<c;i++){
+        key=(BpString*)(keys->objectAt(i));
+        value=(AttrString*)(cache->objectForKey(key));
+        if(unox){
+            fprintf(fCache,"%-15s %-14s %s\n",
+                    value->mode()->stringValue()->string(),
+                    value->string(),key->string());
+            //For now, write it any way: this allows the user to change
+            //easily the dos name, having all the entries in the cache.
+            //if(strcmp(key->string(),value->string())!=0){
+            //else there is no need to save in cache: all data is in the
+            //     unix directory.
+            //}
+        }else{
+            // we write even when key==value for unix modes are not
+            // preserved in dos file system.
+            fprintf(fCache,"%-15s %-14s %s\n",
+                    value->mode()->stringValue()->string(),
+                    key->string(),value->string());
         }
-    }//saveCache;
+    }
+}//saveCache;


-//END Renamer.
-
-/*** Renamer.cc                       -- 2003-12-01 05:06:10 -- pascal   ***/
+//// THE END ////
diff --git a/dosname/sources/Renamer.hh b/dosname/sources/Renamer.hh
index b8bddd4..7f65eff 100644
--- a/dosname/sources/Renamer.hh
+++ b/dosname/sources/Renamer.hh
@@ -16,7 +16,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/WordSeq.cc b/dosname/sources/WordSeq.cc
index 4ee8d6f..4bd9c19 100644
--- a/dosname/sources/WordSeq.cc
+++ b/dosname/sources/WordSeq.cc
@@ -14,7 +14,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/WordSeq.hh b/dosname/sources/WordSeq.hh
index 8a28fba..d961984 100644
--- a/dosname/sources/WordSeq.hh
+++ b/dosname/sources/WordSeq.hh
@@ -15,7 +15,7 @@ MODIFICATIONS

     1995-11-05 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/dosname.cc b/dosname/sources/dosname.cc
index e3563da..cb3e764 100644
--- a/dosname/sources/dosname.cc
+++ b/dosname/sources/dosname.cc
@@ -20,7 +20,7 @@ MODIFICATIONS
     1995-01-01 <PJB> Creation.
 BUGS
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

@@ -53,156 +53,156 @@ extern "C"{
 #include <BcImplementation.h>


-    const char*     pname;
+const char*     pname;

 /*
-    makeDosName (from unix to dos)
+  makeDosName (from unix to dos)

-    Load the name conversion table.
-    If the curUnixName is in the table,
-    then
-        use the dosName in the table;
-    else
-        Analyze curUnixName with the following grammar :
+  Load the name conversion table.
+  If the curUnixName is in the table,
+  then
+  use the dosName in the table;
+  else
+  Analyze curUnixName with the following grammar :

-            curUnixName     ::= [ dot ] wordSeq { dot wordSeq } .
-            wordSeq      ::= capWord { capWord } .
-            capWord      ::= {initers}{capletters}
-                                    {smallletters|digit|trailers} .
+  curUnixName     ::= [ dot ] wordSeq { dot wordSeq } .
+  wordSeq      ::= capWord { capWord } .
+  capWord      ::= {initers}{capletters}
+  {smallletters|digit|trailers} .

-            capletters    ::= ABCDEFGHIJKLMNOPQRSTUVWXYZ
-            smallletters  ::= abcdefghijklmnopqrstuvwxyz
-            digit        ::= 0123456789
-            initers      ::=  !"#&')*+=>?]^`|}
-            trailers     ::=  $%(,-/:;<@[\_{~
+  capletters    ::= ABCDEFGHIJKLMNOPQRSTUVWXYZ
+  smallletters  ::= abcdefghijklmnopqrstuvwxyz
+  digit        ::= 0123456789
+  initers      ::=  !"#&')*+=>?]^`|}
+  trailers     ::=  $%(,-/:;<@[\_{~

-        If the curUnixName is composed of more than two wordSeq
-        then
-            while the length of the wordSeq but the last is more
-                    than eight
-            do
-                reduce the length of each of the wordSeq but the last
-                    of one, starting
-            endwhile
-        else
-            if the length of the first wordSeq is more than eight
-            then
-                reduce the length of the first wordSeq to eight
-            endif
-        endif
-        if the length of the last wordSeq is more than three
-        then
-            reduce the length of the last wordSeq to three
-        endif
+  If the curUnixName is composed of more than two wordSeq
+  then
+  while the length of the wordSeq but the last is more
+  than eight
+  do
+  reduce the length of each of the wordSeq but the last
+  of one, starting
+  endwhile
+  else
+  if the length of the first wordSeq is more than eight
+  then
+  reduce the length of the first wordSeq to eight
+  endif
+  endif
+  if the length of the last wordSeq is more than three
+  then
+  reduce the length of the last wordSeq to three
+  endif

-        set the name to the concatenation of the wordSeq but the last
-        removing initers and trailers.
-        set the extension to the last wordSeq.
-        set the name and extension to lowercase.
-        set the dosName to the concatenation of name dot and extension.
-        if the dosName alreaydy exists whether in the name table, or in
-            already converted dosName,
-        then
-            increment the name part
-        endif
-    endif
+  set the name to the concatenation of the wordSeq but the last
+  removing initers and trailers.
+  set the extension to the last wordSeq.
+  set the name and extension to lowercase.
+  set the dosName to the concatenation of name dot and extension.
+  if the dosName alreaydy exists whether in the name table, or in
+  already converted dosName,
+  then
+  increment the name part
+  endif
+  endif
 */



-    void test1(INT32 argc,char** argv)
-    {
-            INT32       i;
-            Renamer*    un;
-            FILE*       fCache;
-            MfMode*     mode;
+void test1(INT32 argc,char** argv)
+{
+    INT32       i;
+    Renamer*    un;
+    FILE*       fCache;
+    MfMode*     mode;

-        mode=NEW(MfMode);
-        mode->modeSet(00664);
+    mode=NEW(MfMode);
+    mode->modeSet(00664);

-        un=NEW(Renamer);
-        un->retain();
+    un=NEW(Renamer);
+    un->retain();

-        fCache=fopen(".msdosnames","r");
-        if(fCache!=NULL){
-            un->loadUnixCache(fCache);
-            fclose(fCache);
-        }
+    fCache=fopen(".msdosnames","r");
+    if(fCache!=NULL){
+        un->loadUnixCache(fCache);
+        fclose(fCache);
+    }


-        i=1;
-        while(i<argc){
-            un->setUnixName(argv[i],mode);
-            printf("%-16s%s\n",un->dosName(),un->unixName());
-            BpObject_ProcessDeletePool();
-            i++;
-        }
-
-        fCache=fopen(".msdosnames","w");
-        if(fCache!=NULL){
-            un->saveDosCache(fCache);
-            fclose(fCache);
-        }
-        un->release();
+    i=1;
+    while(i<argc){
+        un->setUnixName(argv[i],mode);
+        printf("%-16s%s\n",un->dosName(),un->unixName());
         BpObject_ProcessDeletePool();
-    }//test1;
+        i++;
+    }
+
+    fCache=fopen(".msdosnames","w");
+    if(fCache!=NULL){
+        un->saveDosCache(fCache);
+        fclose(fCache);
+    }
+    un->release();
+    BpObject_ProcessDeletePool();
+}//test1;


-    void usage(const char* upname)
-    {
-        int plength=strlen(upname);
-        fprintf(stderr,"%s usage:\n"
-        "  %s -d|--to-dos|-u|--to-unix [-s|--silent] [-f|--force]\n"
-        "  %*s [-c|--copy|-l|--hard-link|-y|--sym-link] [-p|--print]\n"
-        "  %*s <from-dir> <to-dir>\n"
-        "\t  -d --to-dos       rename from UNIX names to DOS  names.\n"
-        "\t  -u --to-unix      rename from DOS  names to UNIX names.\n"
-        "\t  -c --copy         make copies of files (default).\n"
-        "\t  -h --hard-link    make hard links of files.\n"
-        "\t  -y --sym-link     make symbolic links of files.\n"
-        "\t  -p --print        write the commands instead of executing them.\n"
-        "\t  -s --silent       silent.\n"
-        "\t  -f --force        force.\n"
-        "  When making copies, the UNIX sym-links are converted to or from \n"
-        "  mere DOS files containing the linked path. When making links \n"
-        "  (either hard or symbolic), the sym-links are linked as well as \n"
-        "  plain files. In this case sym-links are not kept on a DOS FS.\n"
-        ,upname,upname,plength," ",plength," ");
-    }//usage;
+void usage(const char* upname)
+{
+    int plength=(int)strlen(upname);
+    fprintf(stderr,"%s usage:\n"
+            "  %s -d|--to-dos|-u|--to-unix [-s|--silent] [-f|--force]\n"
+            "  %*s [-c|--copy|-l|--hard-link|-y|--sym-link] [-p|--print]\n"
+            "  %*s <from-dir> <to-dir>\n"
+            "\t  -d --to-dos       rename from UNIX names to DOS  names.\n"
+            "\t  -u --to-unix      rename from DOS  names to UNIX names.\n"
+            "\t  -c --copy         make copies of files (default).\n"
+            "\t  -h --hard-link    make hard links of files.\n"
+            "\t  -y --sym-link     make symbolic links of files.\n"
+            "\t  -p --print        write the commands instead of executing them.\n"
+            "\t  -s --silent       silent.\n"
+            "\t  -f --force        force.\n"
+            "  When making copies, the UNIX sym-links are converted to or from \n"
+            "  mere DOS files containing the linked path. When making links \n"
+            "  (either hard or symbolic), the sym-links are linked as well as \n"
+            "  plain files. In this case sym-links are not kept on a DOS FS.\n"
+            ,upname,upname,plength," ",plength," ");
+}//usage;


-    void check_direction_set(BOOLEAN set)
-    {
-        if(set){
-            fprintf(stderr,"%s: only one of -d, -u, --to-dos, or --to-unix "
-                    "may be specified.\n",pname);
-            usage(pname);
-            exit(1);
-        }
-    }//check_direction_set;
+void check_direction_set(BOOLEAN set)
+{
+    if(set){
+        fprintf(stderr,"%s: only one of -d, -u, --to-dos, or --to-unix "
+                "may be specified.\n",pname);
+        usage(pname);
+        exit(1);
+    }
+}//check_direction_set;


-    void check_action_set(BOOLEAN set)
-    {
-        if(set){
-            fprintf(stderr,"%s: only one of -c, -y, -h, --copy, "
-                    "--sym-link, or --hard-link may be specified.\n",pname);
-            usage(pname);
-            exit(1);
-        }
-    }//check_action_set;
+void check_action_set(BOOLEAN set)
+{
+    if(set){
+        fprintf(stderr,"%s: only one of -c, -y, -h, --copy, "
+                "--sym-link, or --hard-link may be specified.\n",pname);
+        usage(pname);
+        exit(1);
+    }
+}//check_action_set;


-    static char* basename(char* path)
-    {
-        char* result=strrchr(path,'/');
-        if(result==0){
-            result=path;
-        }else{
-            result++;
-        }
-        return(result);
-    }//basename;
+static char* dosname_basename(char* path)
+{
+    char* result=strrchr(path,'/');
+    if(result==0){
+        result=path;
+    }else{
+        result++;
+    }
+    return(result);
+}//dosname_basename;


 int main(INT32 argc,char** argv)
@@ -223,8 +223,8 @@ int main(INT32 argc,char** argv)
     action_t        action=action_copy;
     int             i;

-    pname=basename(argv[0]);
-    plength=strlen(pname);
+    pname=dosname_basename(argv[0]);
+    plength=(int)strlen(pname);
     i=1;
     while(i<argc){
         if(strcmp(argv[i],"--help")==0){
@@ -345,6 +345,4 @@ int main(INT32 argc,char** argv)
 }//main;


-
-
-/*** dosname.cc                       -- 2003-12-01 05:11:10 -- pascal   ***/
+//// THE END ////
diff --git a/dosname/sources/dosname.hh b/dosname/sources/dosname.hh
index 568d770..fa90709 100644
--- a/dosname/sources/dosname.hh
+++ b/dosname/sources/dosname.hh
@@ -17,7 +17,7 @@ MODIFICATIONS
     1995/01/01
 BUGS
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 2001
+    Copyright Pascal J. Bourguignon 1995 - 2011

     GPL

diff --git a/dosname/sources/names.h b/dosname/sources/names.h
index b35546d..3492508 100644
--- a/dosname/sources/names.h
+++ b/dosname/sources/names.h
@@ -20,7 +20,7 @@ MODIFICATIONS

     1995-10-18 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 2001
+    Copyright Pascal J. Bourguignon 1992 - 2011

     GPL

diff --git a/encoding/sources/bentest.c b/encoding/sources/bentest.c
index 4429bd6..14f8c7c 100644
--- a/encoding/sources/bentest.c
+++ b/encoding/sources/bentest.c
@@ -15,7 +15,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 2003 - 2003
+    Copyright Pascal Bourguignon 2003 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
diff --git a/encoding/sources/encoding.c b/encoding/sources/encoding.c
index b267d72..e77ca5c 100644
--- a/encoding/sources/encoding.c
+++ b/encoding/sources/encoding.c
@@ -87,7 +87,7 @@ MODIFICATIONS
 LEGAL
     GPL

-    Copyright Pascal J. Bourguignon 1991 - 2003
+    Copyright Pascal J. Bourguignon 1991 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -125,26 +125,26 @@ LEGAL
 #include <unistd.h>
 #include <errno.h>
 #else
-    extern int      errno;
-    extern char*    sys_errlist[];
-    extern int      sys_nerr;
+extern int      errno;
+extern char*    sys_errlist[];
+extern int      sys_nerr;
 #endif

-        /* #include <enctypes.h> */
-        /* #include <approxim.h> */
-        /* #include <encascii.h> */
-        /* #include <encisla1.h> */
-        /* #include <encmacos.h> */
-        /* #include <encmsdos.h> */
-        /* #include <encmswin.h> */
-        /* #include <encnxstp.h> */
-        /* #include <encpsstd.h> */
-        /* #include <encsymbl.h> */
-        /* #include <ench2bcd.h> */
-        /* #include <ench6bcd.h> */
-        /* #include <encunifd.h> */
-        /* #include <encibbcd.h> */
-        /* #include <encebcdi.h> */
+/* #include <enctypes.h> */
+/* #include <approxim.h> */
+/* #include <encascii.h> */
+/* #include <encisla1.h> */
+/* #include <encmacos.h> */
+/* #include <encmsdos.h> */
+/* #include <encmswin.h> */
+/* #include <encnxstp.h> */
+/* #include <encpsstd.h> */
+/* #include <encsymbl.h> */
+/* #include <ench2bcd.h> */
+/* #include <ench6bcd.h> */
+/* #include <encunifd.h> */
+/* #include <encibbcd.h> */
+/* #include <encebcdi.h> */

 #include <bjstring.h>
 #include <bjarray.h>
@@ -155,92 +155,92 @@ LEGAL

 #define STR_SWITCH(str)      {const char* str_switch_string=(str);if(0){
 #define STR_CASE(str)        }else if(0==strcmp(str_switch_string,(str))){
-#define STR_CASE2(str1,str2) }else if((0==strcmp(str_switch_string,(str1)))\
-                                    ||(0==strcmp(str_switch_string,(str2)))){
+#define STR_CASE2(str1,str2) }else if((0==strcmp(str_switch_string,(str1))) \
+                                      ||(0==strcmp(str_switch_string,(str2)))){
 #define STR_DEFAULT          }else{
 #define STR_END              }}




-    static void printerr(int err)
-    {
-        fprintf(stderr,"Error: %s (%d)\n",strerror(err),err);
-    }/*printerr*/
+static void printerr(int err)
+{
+    fprintf(stderr,"Error: %s (%d)\n",strerror(err),err);
+}/*printerr*/


-    static void MakeTempName(char* src,char* temp)
-    {
-        strcpy(temp,src);
-        strcat(temp,".nema[ ]");
-    }/*MakeTempName*/
+static void MakeTempName(char* src,char* temp)
+{
+    strcpy(temp,src);
+    strcat(temp,".nema[ ]");
+}/*MakeTempName*/


-    static BOOLEAN ishexadigit(int/*char*/ c)
-    {
-        return((('0'<=c)&&(c<='9'))||
-               (('a'<=c)&&(c<='f'))||(('A'<=c)&&(c<='F')));
-    }/*ishexadigit;*/
+static BOOLEAN ishexadigit(int/*char*/ c)
+{
+    return((('0'<=c)&&(c<='9'))||
+           (('a'<=c)&&(c<='f'))||(('A'<=c)&&(c<='F')));
+}/*ishexadigit;*/


-    static int hexatoint(int/*char*/ c)
-    {
-        if(c<='9'){
-            return(c-'0');
-        }else if(c<='F'){
-            return(c-'A'+10);
-        }else{
-            return(c-'a'+10);
-        }
-    }/*hexatoint;*/
+static int hexatoint(int/*char*/ c)
+{
+    if(c<='9'){
+        return(c-'0');
+    }else if(c<='F'){
+        return(c-'A'+10);
+    }else{
+        return(c-'a'+10);
+    }
+}/*hexatoint;*/



-    static void print_words(FILE* out,bjarray_t* words,unsigned int column,
-                            unsigned int left,unsigned int right)
-        /*
-            PRE:    left<right
-            DO:     Prints words, separated by one space, flowing them
-            from left margin to right margin.
-        */
-    {
-        unsigned int count=bjarray_count(words);
-        unsigned int i=0;
-        while(i<count){
-            bjstring_t* word=bjarray_element_at(words,i++);
-            unsigned int length=bjstring_length(word);
-            if(column<left){
-                fprintf(out,"%*s",left,"");
-                column=left;
-            }else if(column+length>right){
-                fprintf(out,"\n%*s",left,"");
-                column=left;
-            }
-            fprintf(out,"%s ",bjstring_string(word));
-            column+=length+1;
-        }
-    }/*print_words*/
-
-
-    static bjarray_t* make_array_of_string(const char** argv)
-    {
-        bjarray_t* result;
-        unsigned int count=0;
-        unsigned int i;
-        while(argv[count]!=0){
-            count++;
-        }
-        result=bjarray_new(count);
-        for(i=0;i<count;i++){
-            bjarray_set_element_at(result,i,bjstring_new_string(argv[i]));
+static void print_words(FILE* out,bjarray_t* words,unsigned int column,
+                        unsigned int left,unsigned int right)
+/*
+  PRE:    left<right
+  DO:     Prints words, separated by one space, flowing them
+  from left margin to right margin.
+*/
+{
+    unsigned int count=bjarray_count(words);
+    unsigned int i=0;
+    while(i<count){
+        bjstring_t* word=bjarray_element_at(words,i++);
+        unsigned int length=bjstring_length(word);
+        if(column<left){
+            fprintf(out,"%*s",left,"");
+            column=left;
+        }else if(column+length>right){
+            fprintf(out,"\n%*s",left,"");
+            column=left;
         }
-        return(result);
-    }/*make_array_of_string*/
-
-
-    static void usage(const char* pname)
-    {
-        fprintf(
+        fprintf(out,"%s ",bjstring_string(word));
+        column+=length+1;
+    }
+}/*print_words*/
+
+
+static bjarray_t* make_array_of_string(const char** argv)
+{
+    bjarray_t* result;
+    unsigned int count=0;
+    unsigned int i;
+    while(argv[count]!=0){
+        count++;
+    }
+    result=bjarray_new(count);
+    for(i=0;i<count;i++){
+        bjarray_set_element_at(result,i,bjstring_new_string(argv[i]));
+    }
+    return(result);
+}/*make_array_of_string*/
+
+
+static void usage(const char* pname)
+{
+    fprintf(
             stdout,
             "# %s usage:\n"\
             "   %s -from code -to code"\
@@ -253,7 +253,7 @@ LEGAL
             "   %s -A [-t] [-r] [-v] [-xC] file... \n"\
             "   %s -T code \n",
             pname,pname,pname,pname,pname,pname,pname,pname);
-        fprintf(
+    fprintf(
             stdout,
             "\t-t   = dumps the conversion table (no conversion),\n"\
             "\t-T   = dumps the code table (no conversion),\n"\
@@ -262,7 +262,7 @@ LEGAL
             "\t-m   = -from next -to macintosh\n"\
             "\t-e   = replace missing characters in 'to' set with their name,\n"
             );
-        fprintf(
+    fprintf(
             stdout,
             "\t-xC  = replace missing characters in 'to' set with C,\n"\
             "\t-ELR = encasulate missing characters in 'to' set with L and R,\n"\
@@ -270,394 +270,394 @@ LEGAL
             "\t-r   = the files are Rich Text Format files,\n"\
             "\t-A   = filters all remaining 8-ths bits.\n"\
             "# Implemented codes are: \n");
-        print_words(stdout,make_array_of_string(BenEncodingTableNames()),
-                    0,4,72);
-        fprintf(stdout,"\n\n");
-    }/*usage*/
+    print_words(stdout,make_array_of_string(BenEncodingTableNames()),
+                0,4,72);
+    fprintf(stdout,"\n\n");
+}/*usage*/


-    typedef const char*         ConversionTableT[256];
-    static ConversionTableT     Conversion;
-    static BOOLEAN              rtf;
+typedef const char*         ConversionTableT[256];
+static ConversionTableT     Conversion;
+static BOOLEAN              rtf;


-    static int ConvertEncoding(FILE* in,FILE* out)
-    {
-        int             c;
+static int ConvertEncoding(FILE* in,FILE* out)
+{
+    int             c;

-        if(rtf){
-            c=fgetc(in);
-            while(c!=EOF){
-                if(c=='\\'){
-                    c=fgetc(in);
-                    if(c=='\''){
-                        int             h,l;
-                        h=fgetc(in);
-                        l=fgetc(in);
-                        if(ishexadigit(h)&&ishexadigit(l)){
-                            c=hexatoint(h)*16+hexatoint(l);
-                            fputs(Conversion[c],out);
-                            /*** SEE: hexa escapes are not kept!
-                                buffer[i+2]=inttohexa(new/16);
-                                buffer[i+3]=inttohexa(new%16);
-                            ***/
-                        }else{
-                            fputc('\\',out);
-                            fputc('\'',out);
-                            fputc(h,out);
-                            fputc(l,out);
-                        }
+    if(rtf){
+        c=fgetc(in);
+        while(c!=EOF){
+            if(c=='\\'){
+                c=fgetc(in);
+                if(c=='\''){
+                    int             h,l;
+                    h=fgetc(in);
+                    l=fgetc(in);
+                    if(ishexadigit(h)&&ishexadigit(l)){
+                        c=hexatoint(h)*16+hexatoint(l);
+                        fputs(Conversion[c],out);
+                        /*** SEE: hexa escapes are not kept!
+                             buffer[i+2]=inttohexa(new/16);
+                             buffer[i+3]=inttohexa(new%16);
+                        ***/
                     }else{
                         fputc('\\',out);
-                        fputc(c,out);
+                        fputc('\'',out);
+                        fputc(h,out);
+                        fputc(l,out);
                     }
                 }else{
-                    fputs(Conversion[c],out);
+                    fputc('\\',out);
+                    fputc(c,out);
                 }
-                c=fgetc(in);
-            }
-        }else{
-            c=fgetc(in);
-            while(c!=EOF){
+            }else{
                 fputs(Conversion[c],out);
-                c=fgetc(in);
             }
+            c=fgetc(in);
         }
-        return(0);
-    }/*ConvertEncoding*/
+    }else{
+        c=fgetc(in);
+        while(c!=EOF){
+            fputs(Conversion[c],out);
+            c=fgetc(in);
+        }
+    }
+    return(0);
+}/*ConvertEncoding*/


 #define BufSize (128*1024)
-    static int Filter8thBit(FILE* in,FILE* out)
-    {
-        char            buffer[BufSize];
-        int             rlength;
-        int             wlength;
-        int             i;
+static int Filter8thBit(FILE* in,FILE* out)
+{
+    char            buffer[BufSize];
+    int             rlength;
+    int             wlength;
+    int             i;

-        while(!feof(in)){
-            rlength=fread(buffer,1,BufSize,in);
-            i=0;
-            while(i<rlength){
-                buffer[i]=(char)(buffer[i]&0x7F);
-                i++;
-            }
-            if(rlength>0){
-                wlength=fwrite(buffer,1,(unsigned)rlength,out);
-                if(wlength!=rlength){
-                    fprintf(stderr,
-                            "### Written length is different from read length:"
-                            " %d != %d\n",wlength,rlength);
-                }
-            }
+    while(!feof(in)){
+        rlength=(int)fread(buffer,1,BufSize,in);
+        i=0;
+        while(i<rlength){
+            buffer[i]=(char)(buffer[i]&0x7F);
+            i++;
         }
-        return(0);
-    }/*Filter8thBit*/
-
-
-    static const char* escapestr(const char* string)
-    {
-        static char buffer[1024];
-        int i=0;
-        int j=0;
-        while(string[i]!=0){
-            if((string[i]<32)||(126<string[i])){
-                buffer[j++]='\\';
-                sprintf(buffer+j,"%03o",(unsigned char)(string[i]));
-                j+=3;
-            }else if((string[i]=='\\')||(string[i]=='"')){
-                buffer[j++]='\\';
-                buffer[j++]=string[i];
-            }else{
-                buffer[j++]=string[i];
+        if(rlength>0){
+            wlength=(int)fwrite(buffer,1,(unsigned)rlength,out);
+            if(wlength!=rlength){
+                fprintf(stderr,
+                        "### Written length is different from read length:"
+                        " %d != %d\n",wlength,rlength);
             }
-            i++;
         }
-        buffer[j]='\0';
-        return(buffer);
-    }/*escapestr;*/
+    }
+    return(0);
+}/*Filter8thBit*/
+
+
+static const char* escapestr(const char* string)
+{
+    static char buffer[1024];
+    int i=0;
+    int j=0;
+    while(string[i]!=0){
+        if((string[i]<32)||(126<string[i])){
+            buffer[j++]='\\';
+            sprintf(buffer+j,"%03o",(unsigned char)(string[i]));
+            j+=3;
+        }else if((string[i]=='\\')||(string[i]=='"')){
+            buffer[j++]='\\';
+            buffer[j++]=string[i];
+        }else{
+            buffer[j++]=string[i];
+        }
+        i++;
+    }
+    buffer[j]='\0';
+    return(buffer);
+}/*escapestr;*/



-    static BenEncodingTableT* safe_get_enctable(const char* tab_name)
-    {
-        BenEncodingTableT* table=BenEncodingTableNamed(tab_name);
-        if(table==0){
-            fprintf(stderr,"There is no table named '%s'.\n",tab_name);
-            exit(1);
+static BenEncodingTableT* safe_get_enctable(const char* tab_name)
+{
+    BenEncodingTableT* table=BenEncodingTableNamed(tab_name);
+    if(table==0){
+        fprintf(stderr,"There is no table named '%s'.\n",tab_name);
+        exit(1);
+    }
+    return(table);
+}/*safe_get_enctable*/
+
+
+
+int main(int argc,char** argv,char** envp)
+{
+    const char*         pname=basename(argv[0]);
+    FILE*               fin;
+    FILE*               fout;
+    int                 i;
+    int                 err;
+    struct stat         filestatus;
+    char                TempName[256];
+    BOOLEAN             nooption;
+    BOOLEAN             fromIsDetermined;
+    BOOLEAN             toIsDetermined;
+    BOOLEAN             eight2seven;
+    BOOLEAN             dumpTable;
+    BOOLEAN             dumpCode;
+    BenModeT            mode;
+    const char*         from_name="unnamed";
+    const char*         to_name="unnamed";
+    BenEncodingTableT*  from_table=0;
+    BenEncodingTableT*  to_table=0;
+    char                replacement[2]=" "; /* space is default replacement */
+    int (*convert)(FILE*,FILE*);
+
+    bjobject_initialize();
+    rtf=FALSE;
+    nooption=TRUE;
+    fromIsDetermined=FALSE;
+    toIsDetermined=FALSE;
+    eight2seven=FALSE;
+    dumpTable=FALSE;
+    dumpCode=FALSE;
+    mode=BenMode_Normal;
+    i=1;
+    while((i<argc)&&(argv[i][0]=='-')){
+        STR_SWITCH(argv[i])
+        STR_CASE("-n"){
+            nooption=FALSE;
+            from_table=safe_get_enctable(from_name="macintosh");
+            to_table=safe_get_enctable(to_name="nextstep");
+            fromIsDetermined=TRUE;
+            toIsDetermined=TRUE;
         }
-        return(table);
-    }/*safe_get_enctable*/
-
-
-
-    int main(int argc,char** argv,char** envp)
-    {
-        const char*         pname=basename(argv[0]);
-        FILE*               fin;
-        FILE*               fout;
-        int                 i;
-        int                 err;
-        struct stat         filestatus;
-        char                TempName[256];
-        BOOLEAN             nooption;
-        BOOLEAN             fromIsDetermined;
-        BOOLEAN             toIsDetermined;
-        BOOLEAN             eight2seven;
-        BOOLEAN             dumpTable;
-        BOOLEAN             dumpCode;
-        BenModeT            mode;
-        const char*         from_name="unnamed";
-        const char*         to_name="unnamed";
-        BenEncodingTableT*  from_table=0;
-        BenEncodingTableT*  to_table=0;
-        char                replacement[2]=" "; /* space is default replacement */
-        int (*convert)(FILE*,FILE*);
-
-        bjobject_initialize();
-        rtf=FALSE;
-        nooption=TRUE;
-        fromIsDetermined=FALSE;
-        toIsDetermined=FALSE;
-        eight2seven=FALSE;
-        dumpTable=FALSE;
-        dumpCode=FALSE;
-        mode=BenMode_Normal;
-        i=1;
-        while((i<argc)&&(argv[i][0]=='-')){
-            STR_SWITCH(argv[i])
-            STR_CASE("-n"){
-                nooption=FALSE;
-                from_table=safe_get_enctable(from_name="macintosh");
-                to_table=safe_get_enctable(to_name="nextstep");
-                fromIsDetermined=TRUE;
-                toIsDetermined=TRUE;
-            }
-            STR_CASE("-m"){
-                nooption=FALSE;
-                from_table=safe_get_enctable(from_name="nextstep");
-                to_table=safe_get_enctable(to_name="macintosh");
-                fromIsDetermined=TRUE;
-                toIsDetermined=TRUE;
-            }
-            STR_CASE("-t") dumpTable=TRUE;
-            STR_CASE("-a") mode=BenMode_Approximation;
-            STR_CASE("-A"){
-                nooption=FALSE;
-                eight2seven=TRUE;
-            }
-            STR_CASE("-T"){
-                dumpCode=TRUE;
-                i++;
-                if(i<argc){
-                    from_table=BenEncodingTableNamed(from_name=argv[i]);
-                    if(from_table==0){
-                        fprintf(stderr,"### Invalid from table name: '%s'.\n",
-                                argv[i]);
-                        usage(pname);
-                        return(1);
-                    }
-                    fromIsDetermined=TRUE;
-                }else{
-                    fprintf(stderr,
-                            "### A code name is expected following -T option.\n");
-                    usage(pname);
-                    return(1);
-                }}
-            STR_CASE2("-f","--from"){
-                nooption=FALSE;
-                i++;
-                if(i<argc){
-                    from_table=BenEncodingTableNamed(from_name=argv[i]);
-                    if(from_table==0){
-                        fprintf(stderr,"### Invalid from table: '%s'.\n",argv[i]);
-                        usage(pname);
-                        return(1);
-                    }
-                    fromIsDetermined=TRUE;
-                }else{
-                    fprintf(stderr,
-                            "### A code name is expected after -from option.\n");
+        STR_CASE("-m"){
+            nooption=FALSE;
+            from_table=safe_get_enctable(from_name="nextstep");
+            to_table=safe_get_enctable(to_name="macintosh");
+            fromIsDetermined=TRUE;
+            toIsDetermined=TRUE;
+        }
+        STR_CASE("-t") dumpTable=TRUE;
+        STR_CASE("-a") mode=BenMode_Approximation;
+        STR_CASE("-A"){
+            nooption=FALSE;
+            eight2seven=TRUE;
+        }
+        STR_CASE("-T"){
+            dumpCode=TRUE;
+            i++;
+            if(i<argc){
+                from_table=BenEncodingTableNamed(from_name=argv[i]);
+                if(from_table==0){
+                    fprintf(stderr,"### Invalid from table name: '%s'.\n",
+                            argv[i]);
                     usage(pname);
                     return(1);
-                }}
-            STR_CASE2("-t","--to"){
-                nooption=FALSE;
-                i++;
-                if(i<argc){
-                    to_table=BenEncodingTableNamed(to_name=argv[i]);
-                    if(to_table==0){
-                        fprintf(stderr,"### Invalid to table: '%s'.\n",argv[i]);
-                        usage(pname);
-                        return(1);
-                    }
-                    toIsDetermined=TRUE;
-                }else{
-                    fprintf(stderr,
-                            "### A code name is expected following -to option.\n");
+                }
+                fromIsDetermined=TRUE;
+            }else{
+                fprintf(stderr,
+                        "### A code name is expected following -T option.\n");
+                usage(pname);
+                return(1);
+            }}
+        STR_CASE2("-f","--from"){
+            nooption=FALSE;
+            i++;
+            if(i<argc){
+                from_table=BenEncodingTableNamed(from_name=argv[i]);
+                if(from_table==0){
+                    fprintf(stderr,"### Invalid from table: '%s'.\n",argv[i]);
                     usage(pname);
                     return(1);
-                }}
-            STR_CASE("-r")  rtf=TRUE;
-            STR_DEFAULT{
-                if(argv[i][1]=='x'){
-                    replacement[0]=argv[i][2];
-                }else{
-                    fprintf(stderr,"### Bad option: <%s>.\n",argv[i]);
+                }
+                fromIsDetermined=TRUE;
+            }else{
+                fprintf(stderr,
+                        "### A code name is expected after -from option.\n");
+                usage(pname);
+                return(1);
+            }}
+        STR_CASE2("-t","--to"){
+            nooption=FALSE;
+            i++;
+            if(i<argc){
+                to_table=BenEncodingTableNamed(to_name=argv[i]);
+                if(to_table==0){
+                    fprintf(stderr,"### Invalid to table: '%s'.\n",argv[i]);
                     usage(pname);
                     return(1);
-                }}
-            STR_END
-            i++;
-        }/*while*/
-
-
-        if(dumpCode){
-            int ii;
-            int codeSize=256-1;
-            while((codeSize>=0)&&((*from_table)[codeSize]==NULL)){
-                codeSize--;
-            };
-            /* codeSize==-1 || from_table[codeSize]!=NULL.*/
-            codeSize++;
-            /* from_table[codeSize]==NULL, codeSize==0||from_table[codeSize-1]!=NULL*/
-            /* 2^(k-1)<codeSize<=2^k       // 1<<ii = 2^ii*/
-            ii=1;
-            while((ii<8)&&((1<<ii)<codeSize)){
-                ii++;
-            }
-            codeSize=(1<<ii);
-
-            to_table=BenEncodingTableNamed("ascii");
-            BenBuildConversionTable(
-                mode,from_table,to_table,
-                BenApproximationTableNamed(BenApproximationNames()[0]),
-                replacement,&Conversion);
-            convert=ConvertEncoding;
-
-            fprintf(stdout,"+-----+-----+------+-----------"
-                    "-----------------------+\n");
-            fprintf(stdout,"| DEC | HEX | CHR  | %-32s |\n","NAME");
-            fprintf(stdout,"+-----+-----+------+-----------"
-                    "-----------------------+\n");
-            for(ii=0;ii<codeSize;ii++){
-                fprintf(stdout,"| %3d |  %02x | %-4s | %-32s |\n",
-                        ii,ii,escapestr(Conversion[ii]),
-                        (*from_table)[ii]?(*from_table)[ii]:"");
-            }
-            fprintf(stdout,"+-----+-----+------+-----------"
-                    "-----------------------+\n");
-            return(0);
-        }
-
-        if(nooption){
-            fprintf(stderr,"### Either -A or -from and -to is mandatory.\n");
-            usage(pname);
-            return(1);
-        }
-
-        if(eight2seven){
-            if(fromIsDetermined||toIsDetermined||(mode!=BenMode_Normal)){
+                }
+                toIsDetermined=TRUE;
+            }else{
                 fprintf(stderr,
-                        "### -A option is incompatible with -from, -to, -a & -e\n");
+                        "### A code name is expected following -to option.\n");
                 usage(pname);
                 return(1);
-            }
-            convert=Filter8thBit;
-        }else if(fromIsDetermined&&toIsDetermined){
-            BenBuildConversionTable(
-                mode,from_table,to_table,
-                BenApproximationTableNamed(BenApproximationNames()[0]),
-                replacement,&Conversion);
-            convert=ConvertEncoding;
-        }else{
-            fprintf(stderr,"### Both -from and -to are mandatory.\n");
+            }}
+        STR_CASE("-r")  rtf=TRUE;
+        STR_DEFAULT{
+            if(argv[i][1]=='x'){
+                replacement[0]=argv[i][2];
+            }else{
+                fprintf(stderr,"### Bad option: <%s>.\n",argv[i]);
+                usage(pname);
+                return(1);
+            }}
+        STR_END
+        i++;
+    }/*while*/
+
+
+    if(dumpCode){
+        int ii;
+        int codeSize=256-1;
+        while((codeSize>=0)&&((*from_table)[codeSize]==NULL)){
+            codeSize--;
+        };
+        /* codeSize==-1 || from_table[codeSize]!=NULL.*/
+        codeSize++;
+        /* from_table[codeSize]==NULL, codeSize==0||from_table[codeSize-1]!=NULL*/
+        /* 2^(k-1)<codeSize<=2^k       // 1<<ii = 2^ii*/
+        ii=1;
+        while((ii<8)&&((1<<ii)<codeSize)){
+            ii++;
+        }
+        codeSize=(1<<ii);
+
+        to_table=BenEncodingTableNamed("ascii");
+        BenBuildConversionTable(
+                                mode,from_table,to_table,
+                                BenApproximationTableNamed(BenApproximationNames()[0]),
+                                replacement,&Conversion);
+        convert=ConvertEncoding;
+
+        fprintf(stdout,"+-----+-----+------+-----------"
+                "-----------------------+\n");
+        fprintf(stdout,"| DEC | HEX | CHR  | %-32s |\n","NAME");
+        fprintf(stdout,"+-----+-----+------+-----------"
+                "-----------------------+\n");
+        for(ii=0;ii<codeSize;ii++){
+            fprintf(stdout,"| %3d |  %02x | %-4s | %-32s |\n",
+                    ii,ii,escapestr(Conversion[ii]),
+                    (*from_table)[ii]?(*from_table)[ii]:"");
+        }
+        fprintf(stdout,"+-----+-----+------+-----------"
+                "-----------------------+\n");
+        return(0);
+    }
+
+    if(nooption){
+        fprintf(stderr,"### Either -A or -from and -to is mandatory.\n");
+        usage(pname);
+        return(1);
+    }
+
+    if(eight2seven){
+        if(fromIsDetermined||toIsDetermined||(mode!=BenMode_Normal)){
+            fprintf(stderr,
+                    "### -A option is incompatible with -from, -to, -a & -e\n");
             usage(pname);
             return(1);
         }
-
-        if(dumpTable){
-            int ii;
-            fprintf(stdout,"static const char* Conversion_%s_to_%s[256]={\n",
-                    from_name,to_name);
-            for(ii=0;ii<256;ii++){
-                fprintf(stdout,"        /* %3d */ \"%s\",\n",
-                        ii,escapestr(Conversion[ii]));
-            }
-            fprintf(stdout,"    };\n");
-            return(0);
+        convert=Filter8thBit;
+    }else if(fromIsDetermined&&toIsDetermined){
+        BenBuildConversionTable(
+                                mode,from_table,to_table,
+                                BenApproximationTableNamed(BenApproximationNames()[0]),
+                                replacement,&Conversion);
+        convert=ConvertEncoding;
+    }else{
+        fprintf(stderr,"### Both -from and -to are mandatory.\n");
+        usage(pname);
+        return(1);
+    }
+
+    if(dumpTable){
+        int ii;
+        fprintf(stdout,"static const char* Conversion_%s_to_%s[256]={\n",
+                from_name,to_name);
+        for(ii=0;ii<256;ii++){
+            fprintf(stdout,"        /* %3d */ \"%s\",\n",
+                    ii,escapestr(Conversion[ii]));
         }
+        fprintf(stdout,"    };\n");
+        return(0);
+    }


-        if(i<argc){
-            while(i<argc){
-                fin=fopen(argv[i],"r");
-                if(fin==NULL){
+    if(i<argc){
+        while(i<argc){
+            fin=fopen(argv[i],"r");
+            if(fin==NULL){
+                fprintf(stderr,
+                        "### I cannot open the input file \"%s\";"
+                        " skipping it.\n",argv[i]);
+            }else{
+                MakeTempName(argv[i],TempName);
+                fout=fopen(TempName,"w");
+                if(fout==NULL){
                     fprintf(stderr,
-                            "### I cannot open the input file \"%s\";"
-                            " skipping it.\n",argv[i]);
+                            "### I cannot open the output file \"%s\";"
+                            " skipping \"%s\".\n",TempName,argv[i]);
+                    fclose(fin);
                 }else{
-                    MakeTempName(argv[i],TempName);
-                    fout=fopen(TempName,"w");
-                    if(fout==NULL){
-                        fprintf(stderr,
-                                "### I cannot open the output file \"%s\";"
-                                " skipping \"%s\".\n",TempName,argv[i]);
-                        fclose(fin);
-                    }else{
-                        err=convert(fin,fout);
-                        fclose(fin);
-                        fclose(fout);
+                    err=convert(fin,fout);
+                    fclose(fin);
+                    fclose(fout);
+                    if(err==0){
+                        err=rename(argv[i],"temp[nema]");
                         if(err==0){
-                            err=rename(argv[i],"temp[nema]");
+                            err=link(TempName,argv[i]);
                             if(err==0){
-                                err=link(TempName,argv[i]);
+                                err=stat("temp[nema]",&filestatus);
                                 if(err==0){
-                                    err=stat("temp[nema]",&filestatus);
-                                    if(err==0){
-                                        chown(argv[i],filestatus.st_uid,
-                                              filestatus.st_gid);
-                                        chmod(argv[i],filestatus.st_mode);
-                                    }
-                                    unlink("temp[nema]");
-                                }else{
-                                    perror("Error while linking: ");
-                                    fprintf(stderr,
-                                            "### I cannot link the output file "
-                                            "\"%s\" to the input file \"%s\"; "
-                                            "skipping it.\n",TempName,argv[i]);
-                                    rename("temp[nema]",argv[i]);
+                                    int r=chown(argv[i],filestatus.st_uid,
+                                                filestatus.st_gid);
+                                    (void)r;
+                                    chmod(argv[i],filestatus.st_mode);
                                 }
+                                unlink("temp[nema]");
                             }else{
-                                printerr(err);
+                                perror("Error while linking: ");
                                 fprintf(stderr,
-                                        "### I cannot rename the input file \"%s\";"
-                                        " skipping it.\n",argv[i]);
+                                        "### I cannot link the output file "
+                                        "\"%s\" to the input file \"%s\"; "
+                                        "skipping it.\n",TempName,argv[i]);
+                                rename("temp[nema]",argv[i]);
                             }
-                            unlink(TempName);
                         }else{
-                            fprintf(stderr,"error after convert\n");
                             printerr(err);
                             fprintf(stderr,
-                                    "### Error while converting the input file "
-                                    "\"%s\"; skipping it.\n",argv[i]);
+                                    "### I cannot rename the input file \"%s\";"
+                                    " skipping it.\n",argv[i]);
                         }
+                        unlink(TempName);
+                    }else{
+                        fprintf(stderr,"error after convert\n");
+                        printerr(err);
+                        fprintf(stderr,
+                                "### Error while converting the input file "
+                                "\"%s\"; skipping it.\n",argv[i]);
                     }
                 }
-                i++;
-            }
-        }else{
-            err=convert(stdin,stdout);
-            if(err!=0){
-                printerr(err);
-                fprintf(stderr,
-                        "### Error while converting the input file \"%s\";"
-                        " skipping it.\n","stdin");
             }
+            i++;
         }
-        return(0);
-    }/*main*/
-
+    }else{
+        err=convert(stdin,stdout);
+        if(err!=0){
+            printerr(err);
+            fprintf(stderr,
+                    "### Error while converting the input file \"%s\";"
+                    " skipping it.\n","stdin");
+        }
+    }
+    return(0);
+}/*main*/


-/*** encoding.c                       --                     --          ***/
+/**** THE END ****/
diff --git a/environment/sources/environment.c b/environment/sources/environment.c
index 7d3d4a0..796a6f6 100644
--- a/environment/sources/environment.c
+++ b/environment/sources/environment.c
@@ -181,7 +181,7 @@ LEGAL
             short escaped=0;
             char  quote=' ';

-            i=strlen(line)-1;
+            i=(int)strlen(line)-1;
             if(line[i]=='\n'){
                 line[i]='\0';
             }
diff --git a/extractbit1/sources/extractbit1.c b/extractbit1/sources/extractbit1.c
index 36429b2..8dd4802 100644
--- a/extractbit1/sources/extractbit1.c
+++ b/extractbit1/sources/extractbit1.c
@@ -18,7 +18,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1999 - 1999
+    Copyright Pascal Bourguignon 1999 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -38,19 +38,20 @@ LEGAL

 #include <stdio.h>

-    static void extractbit1(FILE* in,FILE* out)
-    {
-        char    outbyte;
-        char    inbyte;
-        int     i;
-        while(!feof(in)){
-            for(i=0;i<8;i++){
-                fread(&inbyte,1,1,in);
-                outbyte=(outbyte<<1)|(inbyte&1);
-            }
-            fwrite(&outbyte,1,1,out);
+static void extractbit1(FILE* in,FILE* out)
+{
+    char    outbyte;
+    char    inbyte;
+    int     i;
+    int r;
+    while(!feof(in)){
+        for(i=0;i<8;i++){
+            r=(int)fread(&inbyte,1,1,in);
+            outbyte=(char)((outbyte<<1)|(inbyte&1));
         }
-    }/*extractbit1*/
+        r=(int)fwrite(&outbyte,1,1,out);
+    }
+}/*extractbit1*/

 int main(void)
 {
@@ -59,4 +60,4 @@ int main(void)
 }/*main*/


-/*** extractbit1.c                    -- 2003-12-02 13:14:23 -- pascal   ***/
+/**** THE EN D****/
diff --git a/filldisk/sources/Makefile b/filldisk/sources/Makefile
index 4ed21c5..2f39f85 100644
--- a/filldisk/sources/Makefile
+++ b/filldisk/sources/Makefile
@@ -12,7 +12,7 @@
 #LEGAL
 #    GPL
 #
-#    Copyright Pascal Bourguignon 1994 - 1999
+#    Copyright Pascal Bourguignon 1994 - 2011
 #
 #    This program is free software; you can redistribute it and/or
 #    modify it under the terms of the GNU General Public License
diff --git a/formats/binhexlib/interfaces/BinHex4Stream.hh b/formats/binhexlib/interfaces/BinHex4Stream.hh
index 539435f..f55418c 100644
--- a/formats/binhexlib/interfaces/BinHex4Stream.hh
+++ b/formats/binhexlib/interfaces/BinHex4Stream.hh
@@ -17,7 +17,7 @@ AUTHOR
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhexlib/interfaces/CheckSumStream.hh b/formats/binhexlib/interfaces/CheckSumStream.hh
index 26d813f..db0d3d7 100644
--- a/formats/binhexlib/interfaces/CheckSumStream.hh
+++ b/formats/binhexlib/interfaces/CheckSumStream.hh
@@ -13,7 +13,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhexlib/interfaces/RunLengthStream.hh b/formats/binhexlib/interfaces/RunLengthStream.hh
index 9d74d71..dee8794 100644
--- a/formats/binhexlib/interfaces/RunLengthStream.hh
+++ b/formats/binhexlib/interfaces/RunLengthStream.hh
@@ -10,7 +10,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhexlib/interfaces/SeqStream.hh b/formats/binhexlib/interfaces/SeqStream.hh
index 010d39c..78e981c 100644
--- a/formats/binhexlib/interfaces/SeqStream.hh
+++ b/formats/binhexlib/interfaces/SeqStream.hh
@@ -10,7 +10,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhexlib/interfaces/SevenStream.hh b/formats/binhexlib/interfaces/SevenStream.hh
index 45c559c..4ba0a6d 100644
--- a/formats/binhexlib/interfaces/SevenStream.hh
+++ b/formats/binhexlib/interfaces/SevenStream.hh
@@ -11,7 +11,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhexlib/interfaces/StdIOStream.hh b/formats/binhexlib/interfaces/StdIOStream.hh
index ae27dcd..ac2d350 100644
--- a/formats/binhexlib/interfaces/StdIOStream.hh
+++ b/formats/binhexlib/interfaces/StdIOStream.hh
@@ -10,7 +10,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhexlib/sources/BinHex4Stream.cc b/formats/binhexlib/sources/BinHex4Stream.cc
index c143d3b..2f58d4e 100644
--- a/formats/binhexlib/sources/BinHex4Stream.cc
+++ b/formats/binhexlib/sources/BinHex4Stream.cc
@@ -17,7 +17,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhexlib/sources/CheckSumStream.cc b/formats/binhexlib/sources/CheckSumStream.cc
index f8123ef..980442e 100644
--- a/formats/binhexlib/sources/CheckSumStream.cc
+++ b/formats/binhexlib/sources/CheckSumStream.cc
@@ -13,7 +13,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhexlib/sources/RunLengthStream.cc b/formats/binhexlib/sources/RunLengthStream.cc
index 0fbd056..400f6fa 100644
--- a/formats/binhexlib/sources/RunLengthStream.cc
+++ b/formats/binhexlib/sources/RunLengthStream.cc
@@ -10,7 +10,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
@@ -23,172 +23,171 @@ LEGAL
 #include <BcImplementation.h>


-    CONSTRUCTOR(RunLengthStream)
-    {
-        length=0;
-        byte=0;
-    }//RunLengthStream;
+CONSTRUCTOR(RunLengthStream)
+{
+    length=0;
+    byte=0;
+}//RunLengthStream;


-    DESTRUCTOR(RunLengthStream)
-    {
-        // NOP
-    }//~RunLengthStream;
+DESTRUCTOR(RunLengthStream)
+{
+    // NOP
+}//~RunLengthStream;


-    METHOD(RunLengthStream,reset,(SeqStream* nSubstream),SeqStream*)
-    {
-        RunLengthStream_SUPER::reset(nSubstream);
-        length=0;
-        byte=0;
-        return(this);
-    }//reset;
+METHOD(RunLengthStream,reset,(SeqStream* nSubstream),SeqStream*)
+{
+    RunLengthStream_SUPER::reset(nSubstream);
+    length=0;
+    byte=0;
+    return(this);
+}//reset;


-    METHOD(RunLengthStream,rewrite,(SeqStream* nSubstream),SeqStream*)
-    {
-        RunLengthStream_SUPER::rewrite(nSubstream);
-        length=0;
-        byte=0;
-        return(this);
-    }//rewrite;
+METHOD(RunLengthStream,rewrite,(SeqStream* nSubstream),SeqStream*)
+{
+    RunLengthStream_SUPER::rewrite(nSubstream);
+    length=0;
+    byte=0;
+    return(this);
+}//rewrite;


-    METHOD(RunLengthStream,close,(void),void)
-    {
-        switch(operation){
-        case SeqStream_Operation_write:
-            if(length>1){
-                do{
-                    if((byte==(CARD8)0x90)||(length>3)){
-                        if(!theSubstream->put((CARD8)0x90)){ continue; }
-                        if(!theSubstream->put((CARD8)(length))){
-                            continue;
-                        }
-                    }else{
-                        do{
-                            if(!theSubstream->put(byte)){ continue; }
-                            DEC(length);
-                        }while(length>1);
+METHOD(RunLengthStream,close,(void),void)
+{
+    switch(operation){
+    case SeqStream_Operation_write:
+        if(length>1){
+            do{
+                if((byte==(CARD8)0x90)||(length>3)){
+                    if(!theSubstream->put((CARD8)0x90)){ continue; }
+                    if(!theSubstream->put((CARD8)(length))){
+                        continue;
                     }
-                }while(FALSE);//once
-            }
-            RunLengthStream_SUPER::close();
-            break;
-        case SeqStream_Operation_read:
-            RunLengthStream_SUPER::close();
-            // no error <=> (length==0);
-            break;
-        default:
-            // error: already closed
-            break;
+                }else{
+                    do{
+                        if(!theSubstream->put(byte)){ continue; }
+                        DEC(length);
+                    }while(length>1);
+                }
+            }while(FALSE);//once
         }
-    }//close;
+        RunLengthStream_SUPER::close();
+        break;
+    case SeqStream_Operation_read:
+        RunLengthStream_SUPER::close();
+        // no error <=> (length==0);
+        break;
+    default:
+        // error: already closed
+        break;
+    }
+}//close;


-    METHOD(RunLengthStream,get,(CARD8* bbyte),BOOLEAN)
-    {
-        CARD8 code;
+METHOD(RunLengthStream,get,(CARD8* bbyte),BOOLEAN)
+{
+    CARD8 code;

-        if(operation!=SeqStream_Operation_read){
-            return(FALSE);
-        }
-        if(length>0){
-            DEC(length);
-            (*bbyte)=this->byte;
-        }else{
-            if(!theSubstream->get(&code)){ return(FALSE); }
-            if(code==(CARD8)0x90){
-                if(!theSubstream->get(&length)){ return(FALSE); }
-                if(length==0){
-                    this->byte=code;
-                    (*bbyte)=code;
-                }else{
-                    DECR(length,2);
-                    (*bbyte)=this->byte;
-                }
-            }else{
+    if(operation!=SeqStream_Operation_read){
+        return(FALSE);
+    }
+    if(length>0){
+        DEC(length);
+        (*bbyte)=this->byte;
+    }else{
+        if(!theSubstream->get(&code)){ return(FALSE); }
+        if(code==(CARD8)0x90){
+            if(!theSubstream->get(&length)){ return(FALSE); }
+            if(length==0){
                 this->byte=code;
                 (*bbyte)=code;
+            }else{
+                DECR(length,2);
+                (*bbyte)=this->byte;
             }
+        }else{
+            this->byte=code;
+            (*bbyte)=code;
         }
-        return(TRUE);
-    }//get;
+    }
+    return(TRUE);
+}//get;


-    METHOD(RunLengthStream,put,(CARD8 nbyte),BOOLEAN)
-    {
-        if(operation!=SeqStream_Operation_write){
-            return(FALSE);
+METHOD(RunLengthStream,put,(CARD8 nbyte),BOOLEAN)
+{
+    if(operation!=SeqStream_Operation_write){
+        return(FALSE);
+    }
+    switch(length){
+    case 0:
+        if(!theSubstream->put(nbyte)){ return(FALSE); }
+        if(nbyte==(CARD8)0x90){
+            if(!theSubstream->put((CARD8)0x00)){ return(FALSE); }
         }
-        switch(length){
-        case 0:
+        /* going to 1 */
+        length=1;
+        this->byte=nbyte;
+        break;
+    case 1:
+        if(nbyte==this->byte){
+            INC(length);
+            /* going to >1 */
+        }else{
+            /* put the new byte */
             if(!theSubstream->put(nbyte)){ return(FALSE); }
             if(nbyte==(CARD8)0x90){
                 if(!theSubstream->put((CARD8)0x00)){ return(FALSE); }
             }
-            /* going to 1 */
-            length=1;
+            /* staying in 1 */
             this->byte=nbyte;
-            break;
-        case 1:
-            if(nbyte==this->byte){
-                INC(length);
-                /* going to >1 */
+        }
+        break;
+    default:
+        if(nbyte==this->byte){
+            if(length==254){
+                if(!theSubstream->put((CARD8)0x90)){ return(FALSE); }
+                if(!theSubstream->put((CARD8)255)){ return(FALSE); }
+                /* going to 0 */
+                length=0;
             }else{
-                /* put the new byte */
-                if(!theSubstream->put(nbyte)){ return(FALSE); }
-                if(nbyte==(CARD8)0x90){
-                    if(!theSubstream->put((CARD8)0x00)){ return(FALSE); }
-                }
-                /* staying in 1 */
-                this->byte=nbyte;
+                INC(length);
+                /* staying in >1 */
             }
-            break;
-        default:
-            if(nbyte==this->byte){
-                if(length==254){
-                    if(!theSubstream->put((CARD8)0x90)){ return(FALSE); }
-                    if(!theSubstream->put((CARD8)255)){ return(FALSE); }
-                    /* going to 0 */
-                    length=0;
-                }else{
-                    INC(length);
-                    /* staying in >1 */
+        }else{
+            if((this->byte==(CARD8)0x90)||(length>3)){
+                if(!theSubstream->put((CARD8)0x90)){ return(FALSE); }
+                if(!theSubstream->put((CARD8)(length))){
+                    return(FALSE);
                 }
             }else{
-                if((this->byte==(CARD8)0x90)||(length>3)){
-                    if(!theSubstream->put((CARD8)0x90)){ return(FALSE); }
-                    if(!theSubstream->put((CARD8)(length))){
-                        return(FALSE);
-                    }
-                }else{
-                    do{
-                        if(!theSubstream->put(this->byte)){ return(FALSE); }
-                        DEC(length);
-                    }while(length>1);
-                }
-                /* put the new nbyte */
-                if(!theSubstream->put(nbyte)){ return(FALSE); }
-                if(nbyte==(CARD8)0x90){
-                    if(!theSubstream->put((CARD8)0x00)){ return(FALSE); }
-                }
-                /* going to 1 */
-                length=1;
-                this->byte=nbyte;
+                do{
+                    if(!theSubstream->put(this->byte)){ return(FALSE); }
+                    DEC(length);
+                }while(length>1);
+            }
+            /* put the new nbyte */
+            if(!theSubstream->put(nbyte)){ return(FALSE); }
+            if(nbyte==(CARD8)0x90){
+                if(!theSubstream->put((CARD8)0x00)){ return(FALSE); }
             }
-            break;
+            /* going to 1 */
+            length=1;
+            this->byte=nbyte;
         }
-        return(TRUE);
-    }//put
+        break;
+    }
+    return(TRUE);
+}//put
 /*
-    9090909090
-    909005
-    9090
-    90009000
-    909002
+  9090909090
+  909005
+  9090
+  90009000
+  909002
 */

-//END RunLengthStream;

-/*** RunLengthStream.cc               -- 2003-12-01 05:15:53 -- pascal   ***/
+//// THE END ////
diff --git a/formats/binhexlib/sources/SeqStream.cc b/formats/binhexlib/sources/SeqStream.cc
index 5896854..17e0cc6 100644
--- a/formats/binhexlib/sources/SeqStream.cc
+++ b/formats/binhexlib/sources/SeqStream.cc
@@ -10,7 +10,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhexlib/sources/SevenStream.cc b/formats/binhexlib/sources/SevenStream.cc
index 85f3896..913b1ad 100644
--- a/formats/binhexlib/sources/SevenStream.cc
+++ b/formats/binhexlib/sources/SevenStream.cc
@@ -11,7 +11,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
@@ -23,187 +23,183 @@ LEGAL
 #include <SevenStream.hh>
 #include <BcImplementation.h>

-    CHAR        Seven_Table[65]=
-        "!\"#$%&\'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr";
+CHAR        Seven_Table[65]=
+  "!\"#$%&\'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr";

-    static
-    PROCEDURE(CharTo6bit,(CHAR c),CARD8)
-        /*
-            RETURN:     64 if c is not a valid encoded value,
-                        [0..63] the value encoded in c.
-        */
-    {
-            CARD16      index;
-        index=0;
-        while((index<64)&&(Seven_Table[index]!=c)){
-            INC(index);
-        }
-        return((CARD8)index);
-    }//CharTo6bit
+static
+PROCEDURE(CharTo6bit,(CHAR c),CARD8)
+/*
+  RETURN:     64 if c is not a valid encoded value,
+  [0..63] the value encoded in c.
+*/
+{
+    CARD16      index;
+    index=0;
+    while((index<64)&&(Seven_Table[index]!=c)){
+        INC(index);
+    }
+    return((CARD8)index);
+}//CharTo6bit


-    static
-    PROCEDURE(CharFrom6bit,(CARD8 bits),CHAR)
-        /*
-            PRE:        bits:[0..63];
-            RETURN:     the encoded CHAR representing bits.
-        */
-    {
-        return(Seven_Table[bits]);
-    }//CharFrom6bit
+static
+PROCEDURE(CharFrom6bit,(CARD8 bits),CHAR)
+/*
+  PRE:        bits:[0..63];
+  RETURN:     the encoded CHAR representing bits.
+*/
+{
+    return(Seven_Table[bits]);
+}//CharFrom6bit


-    CONSTRUCTOR(SevenStream)
-    {
-        lastok=0;
-        index=0;
-    }//SevenStream;
+CONSTRUCTOR(SevenStream)
+{
+    lastok=0;
+    index=0;
+}//SevenStream;


-    DESTRUCTOR(SevenStream)
-    {
-        // NOP
-    }//~SevenStream;
+DESTRUCTOR(SevenStream)
+{
+    // NOP
+}//~SevenStream;


-    METHOD(SevenStream,reset,(SeqStream* nSubstream),SeqStream*)
-    {
-        SevenStream_SUPER::reset(nSubstream);
-        index=0;
-        lastok=-1;
-        return(this);
-    }//reset;
+METHOD(SevenStream,reset,(SeqStream* nSubstream),SeqStream*)
+{
+    SevenStream_SUPER::reset(nSubstream);
+    index=0;
+    lastok=-1;
+    return(this);
+}//reset;


-    METHOD(SevenStream,rewrite,(SeqStream* nSubstream),SeqStream*)
-    {
-        SevenStream_SUPER::rewrite(nSubstream);
-        index=0;
-        lastok=-1;
-        return(this);
-    }//rewrite;
+METHOD(SevenStream,rewrite,(SeqStream* nSubstream),SeqStream*)
+{
+    SevenStream_SUPER::rewrite(nSubstream);
+    index=0;
+    lastok=-1;
+    return(this);
+}//rewrite;


-    METHOD(SevenStream,close,(void),void)
-    {
-            CHAR                c;
+METHOD(SevenStream,close,(void),void)
+{
+    CHAR                c;

-        switch(operation){
-        case SeqStream_Operation_write:
-            if(index>0){
-                while(index<3){
-                    buffer[index]=0;
-                    INC(index);
-                }
-                index=0;
-        // SEE: do we really need to flush the whole buffer ?
-                do{
-                    c=CharFrom6bit((buffer[0]&0xfc)>>2);
-                    if(!theSubstream->put(c)){ continue; }
-                    c=CharFrom6bit(((buffer[0]&0x03)<<4)
-                                    |((buffer[1]&0xf0)>>4));
-                    if(!theSubstream->put(c)){ continue; }
-                    c=CharFrom6bit(((buffer[1]&0x0f)<<2)
-                                    |((buffer[2]&0xc0)>>6));
-                    if(!theSubstream->put(c)){ continue; }
-                    c=CharFrom6bit(buffer[2]&0x3f);
-                    if(!theSubstream->put(c)){ continue; }
-                }while(FALSE);//once
+    switch(operation){
+    case SeqStream_Operation_write:
+        if(index>0){
+            while(index<3){
+                buffer[index]=0;
+                INC(index);
             }
-            SevenStream_SUPER::close();
-            break;
-        case SeqStream_Operation_read:
-            SevenStream_SUPER::close();
-            break;
-        default:
-            break;
-        }
-    }//close;
-
-
-    METHOD(SevenStream,get,(CARD8* byte),BOOLEAN)
-    {
-        if(operation!=SeqStream_Operation_read){
-            return(FALSE);
-        }
-        if(index==0){
+            index=0;
+            // SEE: do we really need to flush the whole buffer ?
             do{
-                    CARD8       c;
-
-                if(!theSubstream->get(&c)){ lastok=-1; continue; }
-                buffer[0]=CharTo6bit(c);
-                if(buffer[0]==65){ return(FALSE); }
-                if(!theSubstream->get(&c)){ lastok=0; continue; }
-                buffer[1]=CharTo6bit(c);
-                if(buffer[1]==65){ return(FALSE); }
-                if(!theSubstream->get(&c)){ lastok=1; continue; }
-                buffer[2]=CharTo6bit(c);
-                if(buffer[2]==65){ return(FALSE); }
-                if(!theSubstream->get(&c)){ lastok=2; continue; }
-                buffer[3]=CharTo6bit(c);
-                if(buffer[3]==65){ return(FALSE); }
-                lastok=3;
+                c=CharFrom6bit((buffer[0]&0xfc)>>2);
+                if(!theSubstream->put(c)){ continue; }
+                c=CharFrom6bit((CARD8)(((buffer[0]&0x03)<<4)|((buffer[1]&0xf0)>>4)));
+                if(!theSubstream->put(c)){ continue; }
+                c=CharFrom6bit((CARD8)(((buffer[1]&0x0f)<<2)|((buffer[2]&0xc0)>>6)));
+                if(!theSubstream->put(c)){ continue; }
+                c=CharFrom6bit((CARD8)(buffer[2]&0x3f));
+                if(!theSubstream->put(c)){ continue; }
             }while(FALSE);//once
         }
-/*
-    4 6-bit bytes   ->      3 8-bit bytes
-    -------------           --------------
-    lastok          ->      index : [0..2]
-        -1                      < -1    none
-         0                      <  0    none
-         1                      <  1    [0..0]
-         2                      <  2    [0..1]
-         3                      <  3    [0..2]
-*/
-        if(index<lastok){
-            switch(index){
-            case 0:
-                (*byte)=((buffer[0]&0x3f)<<2)|((buffer[1]&0x30)>>4);
-                break;
-            case 1:
-                (*byte)=((buffer[1]&0x0f)<<4)|((buffer[2]&0x3c)>>2);
-                break;
-            case 2:
-                (*byte)=((buffer[2]&0x03)<<6)|(buffer[3]&0x3f);
-                break;
-            default:
-                break;
-            }
-            INC(index);
-            if(index>2){
-                index=0;
-            }
-            return(TRUE);
-        }else{
-            return(FALSE);
-        }
-    }//get;
+        SevenStream_SUPER::close();
+        break;
+    case SeqStream_Operation_read:
+        SevenStream_SUPER::close();
+        break;
+    default:
+        break;
+    }
+}//close;


-    METHOD(SevenStream,put,(CARD8  byte),BOOLEAN)
-    {
-            CHAR                c;
-
-        if(operation!=SeqStream_Operation_write){
-            return(FALSE);
+METHOD(SevenStream,get,(CARD8* byte),BOOLEAN)
+{
+    if(operation!=SeqStream_Operation_read){
+        return(FALSE);
+    }
+    if(index==0){
+        do{
+            CARD8       c;
+
+            if(!theSubstream->get(&c)){ lastok=-1; continue; }
+            buffer[0]=CharTo6bit(c);
+            if(buffer[0]==65){ return(FALSE); }
+            if(!theSubstream->get(&c)){ lastok=0; continue; }
+            buffer[1]=CharTo6bit(c);
+            if(buffer[1]==65){ return(FALSE); }
+            if(!theSubstream->get(&c)){ lastok=1; continue; }
+            buffer[2]=CharTo6bit(c);
+            if(buffer[2]==65){ return(FALSE); }
+            if(!theSubstream->get(&c)){ lastok=2; continue; }
+            buffer[3]=CharTo6bit(c);
+            if(buffer[3]==65){ return(FALSE); }
+            lastok=3;
+        }while(FALSE);//once
+    }
+    /*
+      4 6-bit bytes   ->      3 8-bit bytes
+      -------------           --------------
+      lastok          ->      index : [0..2]
+      -1                      < -1    none
+      0                      <  0    none
+      1                      <  1    [0..0]
+      2                      <  2    [0..1]
+      3                      <  3    [0..2]
+    */
+    if(index<lastok){
+        switch(index){
+        case 0:
+            (*byte)=(CARD8)(((buffer[0]&0x3f)<<2)|((buffer[1]&0x30)>>4));
+            break;
+        case 1:
+            (*byte)=(CARD8)(((buffer[1]&0x0f)<<4)|((buffer[2]&0x3c)>>2));
+            break;
+        case 2:
+            (*byte)=(CARD8)(((buffer[2]&0x03)<<6)|(buffer[3]&0x3f));
+            break;
+        default:
+            break;
         }
-        buffer[index]=byte;
         INC(index);
-        if(index>=3){
+        if(index>2){
             index=0;
-            c=CharFrom6bit((buffer[0]&0xfc)>>2);
-            if(!theSubstream->put(c)){ return(FALSE); }
-            c=CharFrom6bit(((buffer[0]&0x03)<<4)
-                            |((buffer[1]&0xf0)>>4));
-            if(!theSubstream->put(c)){ return(FALSE); }
-            c=CharFrom6bit(((buffer[1]&0x0f)<<2)
-                            |((buffer[2]&0xc0)>>6));
-            if(!theSubstream->put(c)){ return(FALSE); }
-            c=CharFrom6bit(buffer[2]&0x3f);
-            if(!theSubstream->put(c)){ return(FALSE); }
         }
-        return(TRUE);
-    }//put;
+        return(TRUE);
+    }else{
+        return(FALSE);
+    }
+}//get;
+
+
+METHOD(SevenStream,put,(CARD8  byte),BOOLEAN)
+{
+    CHAR                c;
+
+    if(operation!=SeqStream_Operation_write){
+        return(FALSE);
+    }
+    buffer[index]=byte;
+    INC(index);
+    if(index>=3){
+        index=0;
+        c=CharFrom6bit((buffer[0]&0xfc)>>2);
+        if(!theSubstream->put(c)){ return(FALSE); }
+        c=CharFrom6bit((CARD8)(((buffer[0]&0x03)<<4)|((buffer[1]&0xf0)>>4)));
+        if(!theSubstream->put(c)){ return(FALSE); }
+        c=CharFrom6bit((CARD8)(((buffer[1]&0x0f)<<2)|((buffer[2]&0xc0)>>6)));
+        if(!theSubstream->put(c)){ return(FALSE); }
+        c=CharFrom6bit((CARD8)(buffer[2]&0x3f));
+        if(!theSubstream->put(c)){ return(FALSE); }
+    }
+    return(TRUE);
+}//put;


-//END SevenStream.
+//// THE END ////
diff --git a/formats/binhexlib/sources/StdIOStream.cc b/formats/binhexlib/sources/StdIOStream.cc
index c39ce70..713e4ae 100644
--- a/formats/binhexlib/sources/StdIOStream.cc
+++ b/formats/binhexlib/sources/StdIOStream.cc
@@ -10,7 +10,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/01 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhextools/sources/BinHex.c b/formats/binhextools/sources/BinHex.c
index ea8c8cb..2c0f71c 100644
--- a/formats/binhextools/sources/BinHex.c
+++ b/formats/binhextools/sources/BinHex.c
@@ -11,7 +11,7 @@ MODIFICATIONS
     1992/05/13 <PJB> Creation.
     1993/04/28 <PJB> Updated.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1993
+    Copyright Pascal J. Bourguignon 1992 - 2011
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
     purpose, provided that this header is always included.
@@ -858,4 +858,4 @@ LEGAL



-//end binhex
\ No newline at end of file
+//end binhex
diff --git a/formats/binhextools/sources/BinHex.h b/formats/binhextools/sources/BinHex.h
index c3da852..107d6ba 100644
--- a/formats/binhextools/sources/BinHex.h
+++ b/formats/binhextools/sources/BinHex.h
@@ -11,7 +11,7 @@ MODIFICATIONS
     1992/05/13 <PJB> Creation.
     1993/04/28 <PJB> Updated.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1993
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/binhextools/sources/bh.c b/formats/binhextools/sources/bh.c
index 5d40321..dc70051 100644
--- a/formats/binhextools/sources/bh.c
+++ b/formats/binhextools/sources/bh.c
@@ -55,7 +55,7 @@ MODIFICATIONS
 BUGS
     bh -t  reads the whole hqx file.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1993
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
@@ -139,7 +139,7 @@ PROCEDURE(main,(int argc,char** random_argv),int)
                 switch(argv[i][1]){
                 case 'c':
                     create=TRUE;
-                    j=i+1;
+                    j=(CARD16)(i+1);
                     if(j<argc){
                         fname=argv[j];
                     }else{
@@ -151,7 +151,7 @@ PROCEDURE(main,(int argc,char** random_argv),int)
                     break;
                 case 'x':
                     extract=TRUE;
-                    j=i+1;
+                    j=(CARD16)(i+1);
                     if(j<argc){
                         if(argv[j][0]!='-'){
                             fname=argv[j];
@@ -186,7 +186,7 @@ PROCEDURE(main,(int argc,char** random_argv),int)
                                     "after -c\n%s",Usage);
                     return(1);
                 }
-                j=i+1;
+                j=(CARD16)(i+1);
                 if(j<argc){
                     if(strlen((char*)(argv[j]))!=4){
                         fprintf(stderr,"### -T or -C must be followed by "
@@ -223,7 +223,7 @@ PROCEDURE(main,(int argc,char** random_argv),int)
                                     "only once\n%s",Usage);
                     return(1);
                 }
-                j=i+1;
+                j=(CARD16)(i+1);
                 if(j<argc){
                     hqxname=argv[j];
                 }else{
@@ -271,10 +271,10 @@ PROCEDURE(main,(int argc,char** random_argv),int)
         printf("fname=%s ",fname);
         printf("%s ",seven?"seven":"eight");
         if(typeSet){
-            printf("type=%08lx ",type);
+            printf("type=%08"FMT_CARD32_HEX" ",type);
         }
         if(creatorSet){
-            printf("creator=%08lx ",creator);
+            printf("creator=%08"FMT_CARD32_HEX" ",creator);
         }
     }
     if(extract){
diff --git a/formats/binhextools/sources/runlength.cc b/formats/binhextools/sources/runlength.cc
index 722b882..d5d2f13 100644
--- a/formats/binhextools/sources/runlength.cc
+++ b/formats/binhextools/sources/runlength.cc
@@ -12,7 +12,7 @@ AUTHORS
 MODIFICATIONS
     1993/04/28 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
     purpose, provided that this header is always included.
diff --git a/formats/binhextools/sources/seven.cc b/formats/binhextools/sources/seven.cc
index 9b5f27e..88b6165 100644
--- a/formats/binhextools/sources/seven.cc
+++ b/formats/binhextools/sources/seven.cc
@@ -12,7 +12,7 @@ AUTHOR
 MODIFICATIONS
     1993/04/28 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1993
+    Copyright Pascal J. Bourguignon 1992 - 2011
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
     purpose, provided that this header is always included.
diff --git a/formats/macbinary/sources/mb.c b/formats/macbinary/sources/mb.c
index b8b07b8..7093fcc 100644
--- a/formats/macbinary/sources/mb.c
+++ b/formats/macbinary/sources/mb.c
@@ -49,7 +49,7 @@ AUTHORS
 MODIFICATIONS
     1993/05/04 <PJB> Creation. (From bh.c).
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1993
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
@@ -69,90 +69,90 @@ LEGAL

 #ifdef __BIG_ENDIAN__

-    static PROCEDURE(fromCARD16,(unsigned int /*CARD16*/ from,CARD8* to),void)
-    {
-        to[0]=from>>8;
-        to[1]=from&0xff;
-    }/*fromCARD16;*/
+static PROCEDURE(fromCARD16,(unsigned int /*CARD16*/ from,CARD8* to),void)
+{
+    to[0]=from>>8;
+    to[1]=from&0xff;
+}/*fromCARD16;*/


-    static PROCEDURE(toCARD16,(CARD8* from),CARD16)
-    {
-        return((((CARD16)(from[0]))<<8)|(CARD16)(from[1]));
-    }/*toCARD16;*/
+static PROCEDURE(toCARD16,(CARD8* from),CARD16)
+{
+    return((((CARD16)(from[0]))<<8)|(CARD16)(from[1]));
+}/*toCARD16;*/


-    static PROCEDURE(fromCARD32,(CARD32 from,CARD8* to),void)
-    {
-        to[0]=from>>24;
-        to[1]=(from>>16)&0xff;
-        to[2]=(from>>8)&0xff;
-        to[3]=from&0xff;
-    }/*fromCARD16;  */
+static PROCEDURE(fromCARD32,(CARD32 from,CARD8* to),void)
+{
+    to[0]=from>>24;
+    to[1]=(from>>16)&0xff;
+    to[2]=(from>>8)&0xff;
+    to[3]=from&0xff;
+}/*fromCARD16;  */


-    static PROCEDURE(toCARD32,(CARD8* from),CARD32)
-    {
-        return((((CARD32)(from[0]))<<24)
-                |(((CARD32)(from[1]))<<16)
-                |(((CARD32)(from[2]))<<8)
-                |(CARD32)(from[3]));
-    }/*toCARD16;*/
+static PROCEDURE(toCARD32,(CARD8* from),CARD32)
+{
+    return((((CARD32)(from[0]))<<24)
+           |(((CARD32)(from[1]))<<16)
+           |(((CARD32)(from[2]))<<8)
+           |(CARD32)(from[3]));
+}/*toCARD16;*/

 #else

-    static PROCEDURE(fromCARD16,(unsigned int /*CARD16*/  from,CARD8* to),void)
-    {
-        to[1]=from>>8;
-        to[0]=from&0xff;
-    }/*fromCARD16;*/
+static PROCEDURE(fromCARD16,(unsigned int /*CARD16*/  from,CARD8* to),void)
+{
+    to[1]=(CARD8)(from>>8);
+    to[0]=(CARD8)(from&0xff);
+}/*fromCARD16;*/


-    static PROCEDURE(toCARD16,(CARD8* from),CARD16)
-    {
-        return((((CARD16)(from[1]))<<8)|(CARD16)(from[0]));
-    }/*toCARD16;*/
+static PROCEDURE(toCARD16,(CARD8* from),CARD16)
+{
+    return((CARD16)((from[1]<<8)|from[0]));
+}/*toCARD16;*/


-    static PROCEDURE(fromCARD32,(CARD32 from,CARD8* to),void)
-    {
-        to[3]=from>>24;
-        to[2]=(from>>16)&0xff;
-        to[1]=(from>>8)&0xff;
-        to[0]=from&0xff;
-    }/*fromCARD32;  */
+static PROCEDURE(fromCARD32,(CARD32 from,CARD8* to),void)
+{
+    to[3]=(CARD8)(from>>24);
+    to[2]=(CARD8)((from>>16)&0xff);
+    to[1]=(CARD8)((from>>8)&0xff);
+    to[0]=(CARD8)(from&0xff);
+}/*fromCARD32;  */

-    static PROCEDURE(toCARD32,(CARD8* from),CARD32)
-    {
-        return((((CARD32)(from[3]))<<24)
-                |(((CARD32)(from[2]))<<16)
-                |(((CARD32)(from[1]))<<8)
-                |(CARD32)(from[0]));
-    }/*toCARD32;*/
+static PROCEDURE(toCARD32,(CARD8* from),CARD32)
+{
+    return((CARD32)((from[3]<<24)
+                    |(from[2]<<16)
+                    |(from[1]<<8)
+                    |from[0]));
+}/*toCARD32;*/

 #endif

 #if 0

-    static PROCEDURE(blockclear,(CARD8* memory,CARD32 size),void)
-    {
-        while(size>0){
-            (*memory)=0;
-            memory++;
-            size--;
-        }
-    }/*blockclear;*/
+static PROCEDURE(blockclear,(CARD8* memory,CARD32 size),void)
+{
+    while(size>0){
+        (*memory)=0;
+        memory++;
+        size--;
+    }
+}/*blockclear;*/


-    static PROCEDURE(blockcopy,(CARD8* from,CARD8* to,CARD32 size),void)
-    {
-        while(size>0){
-            (*to)=(*from);
-            to++;
-            from++;
-            size--;
-        }
-    }/*blockcopy;*/
+static PROCEDURE(blockcopy,(CARD8* from,CARD8* to,CARD32 size),void)
+{
+    while(size>0){
+        (*to)=(*from);
+        to++;
+        from++;
+        size--;
+    }
+}/*blockcopy;*/

 #else
 #define blockclear  bzero
@@ -162,586 +162,582 @@ LEGAL
 /*////////////////////////////////////////////////////////////////*/


-    typedef struct {
-        CHAR                name[64];   /* C string, strlen(name) in [1..63]*/
-        /* Finder Info:                 // Macintosh encoding.*/
-        CARD8               type[4];
-        CARD8               creator[4];
-        CARD16              finderFlags;
-        CARD16              vertical;
-        CARD16              horizontal;
-        CARD16              folderId;
-        /* End of Finder Info.*/
-        CARD8               filler;
-        CARD8               protectedBit;   /* low-bit.*/
-        CARD32              creationDate;
-        CARD32              modificationDate;
-        CARD32              dataSize;       /* in the MacBinary file.*/
-        CARD32              resourceSize;   /* in the MacBinary file.*/
-        CARD32              totalSize;      /* as decompressed Macintosh file.*/
-        CARD16              commentSize;
-        CARD16              headerSize;
-    }                   MacBinary_FileInfoT;
-
-    typedef struct {
-        CARD8               version0;       /* =0*/
-        CARD8               nameLength;
-        CHAR                name[63];
-        CHAR                type[4];
-        CHAR                creator[4];
-        CARD8               finderFlagH;
-        CARD8               filler74;       /* =0*/
-        CARD8               vertical[2];    /* file's position in its window*/
-        CARD8               horizontal[2];
-        CARD8               folderId[2];
-        CARD8               protectedBit;
-        CARD8               filler82;       /* =0*/
-        CARD8               dataSize[4];
-        CARD8               resourceSize[4];
-        CARD8               creationDate[4];
-        CARD8               modificationDate[4];
-        CARD8               commentSize[2]; /* MB2*/
-        CARD8               finderFlagL;    /* MB2*/
-        CARD8               filler102[14];  /* MB2*/
-        CARD32              totalSize;      /* MB2*/
-        CARD16              headerSize;     /* MB2*/
-        CARD8               writerVersion;  /* MB2*/
-        CARD8               readerVersion;  /* MB2*/
-        CARD16              checksum;       /* MB2*/
-        CARD8               computerType;   /* =0*/
-        CARD8               OSID;           /* =0*/
-    }                   MacBinary_HeaderT;
+typedef struct {
+    CHAR                name[64];   /* C string, strlen(name) in [1..63]*/
+    /* Finder Info:                 // Macintosh encoding.*/
+    CARD8               type[4];
+    CARD8               creator[4];
+    CARD16              finderFlags;
+    CARD16              vertical;
+    CARD16              horizontal;
+    CARD16              folderId;
+    /* End of Finder Info.*/
+    CARD8               filler;
+    CARD8               protectedBit;   /* low-bit.*/
+    CARD32              creationDate;
+    CARD32              modificationDate;
+    CARD32              dataSize;       /* in the MacBinary file.*/
+    CARD32              resourceSize;   /* in the MacBinary file.*/
+    CARD32              totalSize;      /* as decompressed Macintosh file.*/
+    CARD16              commentSize;
+    CARD16              headerSize;
+}                   MacBinary_FileInfoT;
+
+typedef struct {
+    CARD8               version0;       /* =0*/
+    CARD8               nameLength;
+    CHAR                name[63];
+    CHAR                type[4];
+    CHAR                creator[4];
+    CARD8               finderFlagH;
+    CARD8               filler74;       /* =0*/
+    CARD8               vertical[2];    /* file's position in its window*/
+    CARD8               horizontal[2];
+    CARD8               folderId[2];
+    CARD8               protectedBit;
+    CARD8               filler82;       /* =0*/
+    CARD8               dataSize[4];
+    CARD8               resourceSize[4];
+    CARD8               creationDate[4];
+    CARD8               modificationDate[4];
+    CARD8               commentSize[2]; /* MB2*/
+    CARD8               finderFlagL;    /* MB2*/
+    CARD8               filler102[14];  /* MB2*/
+    CARD32              totalSize;      /* MB2*/
+    CARD16              headerSize;     /* MB2*/
+    CARD8               writerVersion;  /* MB2*/
+    CARD8               readerVersion;  /* MB2*/
+    CARD16              checksum;       /* MB2*/
+    CARD8               computerType;   /* =0*/
+    CARD8               OSID;           /* =0*/
+}                   MacBinary_HeaderT;

-    /* secondary header                     // MB2*/
-    /* data fork*/
-    /* resource fork*/
-    /* comment                              // MB2*/
+/* secondary header                     // MB2*/
+/* data fork*/
+/* resource fork*/
+/* comment                              // MB2*/

-    /* ((headerSize=127)/128)*128       */
+/* ((headerSize=127)/128)*128       */



-    static PROCEDURE(MacBinary_CheckSum,(MacBinary_HeaderT* header),CARD16)
-    {
-            CARD8*          h;
-            CARD16          sum;
-            CARD16          i;
+static PROCEDURE(MacBinary_CheckSum,(MacBinary_HeaderT* header),CARD16)
+{
+    CARD8*          h;
+    CARD16          sum;
+    CARD16          i;

-        h=(CARD8*)header;
-        sum=0;
-        i=126;
-        while(i>0){
-            sum+=(CARD16)(*h);
-            h++;
-            i--;
-        }
-        return(sum);
-    }/*MacBinary_CheckSum;*/
+    h=(CARD8*)header;
+    sum=0;
+    i=126;
+    while(i>0){
+        INCR(sum,(*h));
+        h++;
+        i--;
+    }
+    return(sum);
+}/*MacBinary_CheckSum;*/


-    static PROCEDURE(MacBinary_HeaderFormat,(MacBinary_HeaderT* header),CARD16)
-    {
-        if((header->version0==0)&&(header->filler74==0)){
-            if(header->checksum==MacBinary_CheckSum(header)){
-                /* this is a MacBinary 2 header.*/
-                return(2);
-            }else if(header->filler82==0){
-                /* this is a MacBinary 1 header.*/
-                return(1);
-                /* all bytes from finderFlagL to checksum should be 0.*/
-                /* namelength in [1..63].*/
-                /* dataSize and resourceSize in [0..$7fffff].*/
-            }else{
-                /* this is not a valid MacBinary header.*/
-                return(0);
-            }
+static PROCEDURE(MacBinary_HeaderFormat,(MacBinary_HeaderT* header),CARD16)
+{
+    if((header->version0==0)&&(header->filler74==0)){
+        if(header->checksum==MacBinary_CheckSum(header)){
+            /* this is a MacBinary 2 header.*/
+            return(2);
+        }else if(header->filler82==0){
+            /* this is a MacBinary 1 header.*/
+            return(1);
+            /* all bytes from finderFlagL to checksum should be 0.*/
+            /* namelength in [1..63].*/
+            /* dataSize and resourceSize in [0..$7fffff].*/
         }else{
             /* this is not a valid MacBinary header.*/
             return(0);
         }
-    }/*MacBinary_HeaderFormat;*/
+    }else{
+        /* this is not a valid MacBinary header.*/
+        return(0);
+    }
+}/*MacBinary_HeaderFormat;*/


-    static PROCEDURE(MacBinary_BuildHeader,
-        (MacBinary_HeaderT* header,MacBinary_FileInfoT* finfo),void)
-    {
-            CARD8       finderFlag[2];
+static PROCEDURE(MacBinary_BuildHeader,
+                 (MacBinary_HeaderT* header,MacBinary_FileInfoT* finfo),void)
+{
+    CARD8       finderFlag[2];

-        header->version0=0;
-        fromCARD16(finfo->finderFlags,&(finderFlag[0]));
-        blockclear(&(header->name[0]),sizeof(header->name));
-        header->nameLength=strlen((char*)(finfo->name));
-        strcpy((char*)(header->name),(char*)(finfo->name));
-        /* SEE: following two lines assume sizeof(CARD8)=1*/
-        blockcopy(&(finfo->type[0]),&(header->type[0]),sizeof(header->type));
-        blockcopy(&(finfo->creator[0]),&(header->creator[0]),
-                sizeof(header->creator));
-        header->finderFlagH=finderFlag[0];
-        header->filler74=0;
-        fromCARD16(finfo->vertical,&(header->vertical[0]));
-        fromCARD16(finfo->horizontal,&(header->horizontal[0]));
-        fromCARD16(finfo->folderId,&(header->folderId[0]));
-        header->protectedBit=finfo->protectedBit;
-        header->filler82=0;
-        fromCARD32(finfo->dataSize,&(header->dataSize[0]));
-        fromCARD32(finfo->resourceSize,&(header->resourceSize[0]));
-        fromCARD32(finfo->creationDate,(CARD8*)(&(header->creationDate)));
-        fromCARD32(finfo->modificationDate,
-                                    (CARD8*)(&(header->modificationDate)));
-        fromCARD16(finfo->commentSize,(CARD8*)(&(header->commentSize)));
-        fromCARD32(finfo->totalSize,(CARD8*)(&(header->totalSize)));
-        fromCARD16(finfo->headerSize,(CARD8*)(&(header->headerSize)));
-        header->finderFlagL=finderFlag[1];
-        header->writerVersion=129;
-        header->readerVersion=129;
-        /* checksum is only for byte preceding checksum*/
-        header->checksum=MacBinary_CheckSum(header);
-        header->computerType=0;
-        header->OSID=0;
-    }/*MacBinary_BuildHeader;*/
+    header->version0=0;
+    fromCARD16(finfo->finderFlags,&(finderFlag[0]));
+    blockclear(&(header->name[0]),sizeof(header->name));
+    header->nameLength=(CARD8)strlen((char*)(finfo->name));
+    strcpy((char*)(header->name),(char*)(finfo->name));
+    /* SEE: following two lines assume sizeof(CARD8)=1*/
+    blockcopy(&(finfo->type[0]),&(header->type[0]),sizeof(header->type));
+    blockcopy(&(finfo->creator[0]),&(header->creator[0]),
+              sizeof(header->creator));
+    header->finderFlagH=finderFlag[0];
+    header->filler74=0;
+    fromCARD16(finfo->vertical,&(header->vertical[0]));
+    fromCARD16(finfo->horizontal,&(header->horizontal[0]));
+    fromCARD16(finfo->folderId,&(header->folderId[0]));
+    header->protectedBit=finfo->protectedBit;
+    header->filler82=0;
+    fromCARD32(finfo->dataSize,&(header->dataSize[0]));
+    fromCARD32(finfo->resourceSize,&(header->resourceSize[0]));
+    fromCARD32(finfo->creationDate,(CARD8*)(&(header->creationDate)));
+    fromCARD32(finfo->modificationDate,
+               (CARD8*)(&(header->modificationDate)));
+    fromCARD16(finfo->commentSize,(CARD8*)(&(header->commentSize)));
+    fromCARD32(finfo->totalSize,(CARD8*)(&(header->totalSize)));
+    fromCARD16(finfo->headerSize,(CARD8*)(&(header->headerSize)));
+    header->finderFlagL=finderFlag[1];
+    header->writerVersion=129;
+    header->readerVersion=129;
+    /* checksum is only for byte preceding checksum*/
+    header->checksum=MacBinary_CheckSum(header);
+    header->computerType=0;
+    header->OSID=0;
+}/*MacBinary_BuildHeader;*/


-    static PROCEDURE(MacBinary_HeaderToInfo,
-        (MacBinary_HeaderT* header,MacBinary_FileInfoT* finfo),void)
-    {
-            CARD8       finderFlag[2];
-
-        blockclear(&(finfo->name[0]),sizeof(finfo->name));
-        strcpy((char*)(finfo->name),(char*)(header->name));
-        blockcopy(&(header->type[0]),&(finfo->type[0]),sizeof(finfo->type));
-        blockcopy(&(header->creator[0]),&(finfo->creator[0]),
-                sizeof(finfo->creator));
-        finderFlag[0]=header->finderFlagH;
-        finderFlag[1]=header->finderFlagL;
-        finfo->finderFlags=toCARD16(&(finderFlag[0]));
-        finfo->vertical=toCARD16(&(header->vertical[0]));
-        finfo->horizontal=toCARD16(&(header->horizontal[0]));
-        finfo->folderId=toCARD16(&(header->folderId[0]));
-        finfo->filler=0;
-        finfo->protectedBit=header->protectedBit;
-        finfo->creationDate=toCARD32(&(header->creationDate[0]));
-        finfo->modificationDate=toCARD32(&(header->modificationDate[0]));
-        finfo->dataSize=toCARD32(&(header->dataSize[0]));
-        finfo->resourceSize=toCARD32(&(header->resourceSize[0]));
-        finfo->commentSize=toCARD16((CARD8*)(&(header->commentSize)));
-        finfo->totalSize=toCARD32((CARD8*)(&(header->totalSize)));
-        finfo->headerSize=toCARD16((CARD8*)(&(header->headerSize)));
-    }/*MacBinary_HeaderToInfo;*/
+static PROCEDURE(MacBinary_HeaderToInfo,
+                 (MacBinary_HeaderT* header,MacBinary_FileInfoT* finfo),void)
+{
+    CARD8       finderFlag[2];
+
+    blockclear(&(finfo->name[0]),sizeof(finfo->name));
+    strcpy((char*)(finfo->name),(char*)(header->name));
+    blockcopy(&(header->type[0]),&(finfo->type[0]),sizeof(finfo->type));
+    blockcopy(&(header->creator[0]),&(finfo->creator[0]),
+              sizeof(finfo->creator));
+    finderFlag[0]=header->finderFlagH;
+    finderFlag[1]=header->finderFlagL;
+    finfo->finderFlags=toCARD16(&(finderFlag[0]));
+    finfo->vertical=toCARD16(&(header->vertical[0]));
+    finfo->horizontal=toCARD16(&(header->horizontal[0]));
+    finfo->folderId=toCARD16(&(header->folderId[0]));
+    finfo->filler=0;
+    finfo->protectedBit=header->protectedBit;
+    finfo->creationDate=toCARD32(&(header->creationDate[0]));
+    finfo->modificationDate=toCARD32(&(header->modificationDate[0]));
+    finfo->dataSize=toCARD32(&(header->dataSize[0]));
+    finfo->resourceSize=toCARD32(&(header->resourceSize[0]));
+    finfo->commentSize=toCARD16((CARD8*)(&(header->commentSize)));
+    finfo->totalSize=toCARD32((CARD8*)(&(header->totalSize)));
+    finfo->headerSize=toCARD16((CARD8*)(&(header->headerSize)));
+}/*MacBinary_HeaderToInfo;*/



-    static PROCEDURE(MacBinary_CopyFork,
-            (FILE* from,FILE* to,CARD32 size,
-             BOOLEAN readPadding,BOOLEAN writePadding),BOOLEAN)
-        /*
-            RETURN:     TRUE = no error, FALSE = error.
-        */
-    {
-            CARD8       buffer[BUFFERSIZE];
-            CARD32      padding;
-            CARD32      count;
+static PROCEDURE(MacBinary_CopyFork,
+                 (FILE* from,FILE* to,CARD32 size,
+                  BOOLEAN readPadding,BOOLEAN writePadding),BOOLEAN)
+/*
+  RETURN:     TRUE = no error, FALSE = error.
+*/
+{
+    CARD8       buffer[BUFFERSIZE];
+    CARD32      padding;
+    CARD32      count;

-        padding=(readPadding||writePadding)?(roundup(size,128)-size):(0);
-        while(size>=BUFFERSIZE){
-            count=fread(buffer,sizeof(CARD8),BUFFERSIZE,from);
-            if(count!=BUFFERSIZE){ return(FALSE); }
-            count=fwrite(buffer,sizeof(CARD8),BUFFERSIZE,to);
-            if(count!=BUFFERSIZE){ return(FALSE); }
-            size-=BUFFERSIZE;
-        }
-        if(size>0){
-            count=fread(buffer,sizeof(CARD8),size,from);
-            if(count!=size){ return(FALSE); }
-            count=fwrite(buffer,sizeof(CARD8),size,to);
-            if(count!=size){ return(FALSE); }
+    padding=(readPadding||writePadding)?(roundup(size,128)-size):(0);
+    while(size>=BUFFERSIZE){
+        count=(CARD32)fread(buffer,sizeof(CARD8),BUFFERSIZE,from);
+        if(count!=BUFFERSIZE){ return(FALSE); }
+        count=(CARD32)fwrite(buffer,sizeof(CARD8),BUFFERSIZE,to);
+        if(count!=BUFFERSIZE){ return(FALSE); }
+        size-=BUFFERSIZE;
+    }
+    if(size>0){
+        count=(CARD32)fread(buffer,sizeof(CARD8),size,from);
+        if(count!=size){ return(FALSE); }
+        count=(CARD32)fwrite(buffer,sizeof(CARD8),size,to);
+        if(count!=size){ return(FALSE); }
+    }
+    if(padding>0){
+        if(readPadding){
+            count=(CARD32)fread(buffer,sizeof(CARD8),padding,from);
+            if(count!=padding){ return(FALSE); }
         }
-        if(padding>0){
-            if(readPadding){
-                count=fread(buffer,sizeof(CARD8),padding,from);
-                if(count!=padding){ return(FALSE); }
-            }
-            if(writePadding){
-                blockclear(buffer,padding);
-                count=fwrite(buffer,sizeof(CARD8),padding,to);
-                if(count!=padding){ return(FALSE); }
-            }
+        if(writePadding){
+            blockclear(buffer,padding);
+            count=(CARD32)fwrite(buffer,sizeof(CARD8),padding,to);
+            if(count!=padding){ return(FALSE); }
         }
-        return(TRUE);
-    }/*MacBinary_CopyFork;*/
+    }
+    return(TRUE);
+}/*MacBinary_CopyFork;*/


-    static PROCEDURE(MacBinary_Skip,
-            (FILE* from,CARD32 size,BOOLEAN readPadding),BOOLEAN)
-    {
-            CARD8       buffer[BUFFERSIZE];
-            CARD32      padding;
-            CARD32      count;
+static PROCEDURE(MacBinary_Skip,
+                 (FILE* from,CARD32 size,BOOLEAN readPadding),BOOLEAN)
+{
+    CARD8       buffer[BUFFERSIZE];
+    CARD32      padding;
+    CARD32      count;

-        padding=(readPadding)?(roundup(size,128)-size):(0);
-        while(size>=BUFFERSIZE){
-            count=fread(buffer,sizeof(CARD8),BUFFERSIZE,from);
-            if(count!=BUFFERSIZE){ return(FALSE); }
-            size-=BUFFERSIZE;
-        }
-        if(size>0){
-            count=fread(buffer,sizeof(CARD8),size,from);
-            if(count!=size){ return(FALSE); }
-        }
-        if(padding>0){
-            count=fread(buffer,sizeof(CARD8),padding,from);
-            if(count!=size){ return(FALSE); }
-        }
-        return(TRUE);
-    }/*MacBinary_Skip;*/
+    padding=(readPadding)?(roundup(size,128)-size):(0);
+    while(size>=BUFFERSIZE){
+        count=(CARD32)fread(buffer,sizeof(CARD8),BUFFERSIZE,from);
+        if(count!=BUFFERSIZE){ return(FALSE); }
+        size-=BUFFERSIZE;
+    }
+    if(size>0){
+        count=(CARD32)fread(buffer,sizeof(CARD8),size,from);
+        if(count!=size){ return(FALSE); }
+    }
+    if(padding>0){
+        count=(CARD32)fread(buffer,sizeof(CARD8),padding,from);
+        if(count!=size){ return(FALSE); }
+    }
+    return(TRUE);
+}/*MacBinary_Skip;*/



-    static const char*      Macintosh_to_Next[256]=
-        {
-            "\000","\001","\002","\003","\004","\005","\006","\007",
-            "\010","\011","\012","\013","\014","\015","\016","\017",
-            "\020","\021","\022","\023","\024","\025","\026","\027",
-            "\030","\031","\032","\033","\034","\035","\036","\037",
-            " ","!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/",
-            "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?",
-            "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
-            "P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_",
-            "`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",
-            "p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","\177",
-            "","","","","","","","","","","","","","","","",
-            "","","","","","","","","","","","","","","","",
-            "","","","","","","","","","",NIL,"","",NIL,"","",
-            NIL,"",NIL,NIL,"","","",NIL,NIL,NIL,NIL,"","",NIL,"","",
-            "","","",NIL,"",NIL,NIL,"","","","","","","","","",
-            "","","","","`","'","",NIL,"",NIL,"","","","","","",
-            "","","","","","","","","","","","","","","","",
-            NIL,"","","","","","","","","","","","","","",""
-        };
+static const char*      Macintosh_to_Next[256]=
+    {
+        "\000","\001","\002","\003","\004","\005","\006","\007",
+        "\010","\011","\012","\013","\014","\015","\016","\017",
+        "\020","\021","\022","\023","\024","\025","\026","\027",
+        "\030","\031","\032","\033","\034","\035","\036","\037",
+        " ","!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/",
+        "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?",
+        "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
+        "P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_",
+        "`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",
+        "p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","\177",
+        "","","","","","","","","","","","","","","","",
+        "","","","","","","","","","","","","","","","",
+        "","","","","","","","","","",NIL,"","",NIL,"","",
+        NIL,"",NIL,NIL,"","","",NIL,NIL,NIL,NIL,"","",NIL,"","",
+        "","","",NIL,"",NIL,NIL,"","","","","","","","","",
+        "","","","","`","'","",NIL,"",NIL,"","","","","","",
+        "","","","","","","","","","","","","","","","",
+        NIL,"","","","","","","","","","","","","","",""
+    };


 #if 0
-    static const char*      Next_to_Macintosh[256]=
-        {
-            "\000","\001","\002","\003","\004","\005","\006","\007",
-            "\010","\011","\012","\013","\014","\015","\016","\017",
-            "\020","\021","\022","\023","\024","\025","\026","\027",
-            "\030","\031","\032","\033","\034","\035","\036","\037",
-            " ","!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/",
-            "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?",
-            "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
-            "P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_",
-            "`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",
-            "p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","\177",
-            "","","","","","","","","","","","","","","","",
-            NIL,"","","","","","","","","","",NIL,NIL,"",NIL,"",
-            "","","","","","","","","","'","","","","","","",
-            "","","","","",NIL,"","","","","","","","","","",
-            NIL,"","","","","","","","",NIL,"","",NIL,"","","",
-            "","",NIL,NIL,NIL,"","","","","","","","","","","",
-            "","","","","","","","",NIL,"","","","","","","",
-            "","","","","","","",NIL,NIL,"","","",NIL,"",NIL,NIL
-        };
-
-    static PROCEDURE(FName_NextToMac,(CHAR* fname),void)
+static const char*      Next_to_Macintosh[256]=
     {
-        CARD16      i;
-        const CHAR* c;
+        "\000","\001","\002","\003","\004","\005","\006","\007",
+        "\010","\011","\012","\013","\014","\015","\016","\017",
+        "\020","\021","\022","\023","\024","\025","\026","\027",
+        "\030","\031","\032","\033","\034","\035","\036","\037",
+        " ","!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/",
+        "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?",
+        "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O",
+        "P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_",
+        "`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",
+        "p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","\177",
+        "","","","","","","","","","","","","","","","",
+        NIL,"","","","","","","","","","",NIL,NIL,"",NIL,"",
+        "","","","","","","","","","'","","","","","","",
+        "","","","","",NIL,"","","","","","","","","","",
+        NIL,"","","","","","","","",NIL,"","",NIL,"","","",
+        "","",NIL,NIL,NIL,"","","","","","","","","","","",
+        "","","","","","","","",NIL,"","","","","","","",
+        "","","","","","","",NIL,NIL,"","","",NIL,"",NIL,NIL
+    };
+
+static PROCEDURE(FName_NextToMac,(CHAR* fname),void)
+{
+    CARD16      i;
+    const CHAR* c;

-        i=0;
-        while(fname[i]!=(CHAR)0){
-            c=Next_to_Macintosh[fname[i]];
-            fname[i]=(c==NIL)?('_'):(*c);
-            if(fname[i]<' '){
-                fname[i]='_';
-            }else if(fname[i]==':'){
-                fname[i]='/';
-            }
-            i++;
-        }
-        if(fname[0]=='.'){
-            fname[0]='_';
-        }
-    }/*FName_NextToMac;*/
+    i=0;
+    while(fname[i]!=(CHAR)0){
+        c=Next_to_Macintosh[fname[i]];
+        fname[i]=(c==NIL)?('_'):(*c);
+        if(fname[i]<' '){
+            fname[i]='_';
+        }else if(fname[i]==':'){
+            fname[i]='/';
+        }
+        i++;
+    }
+    if(fname[0]=='.'){
+        fname[0]='_';
+    }
+}/*FName_NextToMac;*/
 #endif

-    static PROCEDURE(FName_MacToNext,(CHAR* fname),void)
-    {
-        CARD16      i;
-        const CHAR* c;
+static PROCEDURE(FName_MacToNext,(CHAR* fname),void)
+{
+    CARD16      i;
+    const CHAR* c;

-        i=0;
-        while(fname[i]!=(CHAR)0){
-            c=(const CHAR*)Macintosh_to_Next[fname[i]];
-            fname[i]=(c==NIL)?('_'):(*c);
-            if(fname[i]<=' '){
-                fname[i]='_';
-            }else if(fname[i]=='/'){
-                fname[i]=':';
-            }
-            i++;
-        }
-    }/*FName_MacToNext;*/
+    i=0;
+    while(fname[i]!=(CHAR)0){
+        c=(const CHAR*)Macintosh_to_Next[fname[i]];
+        fname[i]=(CHAR)((c==NIL)?('_'):(*c));
+        if(fname[i]<=' '){
+            fname[i]='_';
+        }else if(fname[i]=='/'){
+            fname[i]=':';
+        }
+        i++;
+    }
+}/*FName_MacToNext;*/


-    static PROCEDURE(forkopen,
-            (const CHAR* fork,const CHAR* fname,
-             const CHAR* extension,const CHAR* mode,
-             BOOLEAN mandatory),FILE*)
-    {
-            CHAR        name[1024];
-            FILE*       file;
+static PROCEDURE(forkopen,
+                 (const CHAR* fork,const CHAR* fname,
+                  const CHAR* extension,const CHAR* mode,
+                  BOOLEAN mandatory),FILE*)
+{
+    CHAR        name[1024];
+    FILE*       file;

-        strcpy((char*)(name),(const char*)(fname));
-        strcat((char*)(name),(const char*)(extension));
-        file=fopen((char*)(name),(const char*)mode);
-        if((file==NIL)&&(mandatory)){
-            fprintf(stderr,"Error while opening %s fork (%s)\n",fork,name);
-        }
-        return(file);
-    }/*forkopen;*/
+    strcpy((char*)(name),(const char*)(fname));
+    strcat((char*)(name),(const char*)(extension));
+    file=fopen((char*)(name),(const char*)mode);
+    if((file==NIL)&&(mandatory)){
+        fprintf(stderr,"Error while opening %s fork (%s)\n",fork,name);
+    }
+    return(file);
+}/*forkopen;*/


-    static PROCEDURE(MacBinary_Create,
-        (FILE* fmbin,const CHAR* fname,
-         const CARD8* type,const CARD8* creator,BOOLEAN verbose),BOOLEAN)
-    {
-            MacBinary_HeaderT       header;
-            MacBinary_FileInfoT     info;
+static PROCEDURE(MacBinary_Create,
+                 (FILE* fmbin,const CHAR* fname,
+                  const CARD8* type,const CARD8* creator,BOOLEAN verbose),BOOLEAN)
+{
+    MacBinary_HeaderT       header;
+    MacBinary_FileInfoT     info;

-            FILE*                   fdata;
-            FILE*                   frsrc;
-            FILE*                   finfo;
+    FILE*                   fdata;
+    FILE*                   frsrc;
+    FILE*                   finfo;

-            CARD32                  count;
+    CARD32                  count;

-        blockclear((CARD8*)(&info),sizeof(info));
-        finfo=forkopen((const CHAR*)"information",fname,
-                       (const CHAR*)".mbinfo",(const CHAR*)"r",FALSE);
-        if(finfo!=NIL){
-            count=fread(&info,1,sizeof(info),finfo);
-            if(count!=sizeof(info)){
-                blockclear((CARD8*)(&info),sizeof(info));
-            }
+    blockclear((CARD8*)(&info),sizeof(info));
+    finfo=forkopen((const CHAR*)"information",fname,
+                   (const CHAR*)".mbinfo",(const CHAR*)"r",FALSE);
+    if(finfo!=NIL){
+        count=(CARD32)fread(&info,1,sizeof(info),finfo);
+        if(count!=sizeof(info)){
+            blockclear((CARD8*)(&info),sizeof(info));
         }
+    }

-        fdata=forkopen((const CHAR*)"data",fname,
-                       (const CHAR*)"",(const CHAR*)"r",FALSE);
-        if(fdata==NIL){
-            info.dataSize=0;
-        }else{
-            fseek(fdata,0,SEEK_END);
-            info.dataSize=ftell(fdata);
-            fseek(fdata,0,SEEK_SET);
-        }
+    fdata=forkopen((const CHAR*)"data",fname,
+                   (const CHAR*)"",(const CHAR*)"r",FALSE);
+    if(fdata==NIL){
+        info.dataSize=0;
+    }else{
+        fseek(fdata,0,SEEK_END);
+        info.dataSize=(CARD32)ftell(fdata);
+        fseek(fdata,0,SEEK_SET);
+    }

-        frsrc=forkopen((const CHAR*)"resource",fname,
-                       (const CHAR*)".rsrc",(const CHAR*)"r",FALSE);
-        if(frsrc==NIL){
-            info.resourceSize=0;
-        }else{
-            fseek(frsrc,0,SEEK_END);
-            info.resourceSize=ftell(frsrc);
-            fseek(frsrc,0,SEEK_SET);
-        }
+    frsrc=forkopen((const CHAR*)"resource",fname,
+                   (const CHAR*)".rsrc",(const CHAR*)"r",FALSE);
+    if(frsrc==NIL){
+        info.resourceSize=0;
+    }else{
+        fseek(frsrc,0,SEEK_END);
+        info.resourceSize=(CARD32)ftell(frsrc);
+        fseek(frsrc,0,SEEK_SET);
+    }

-        if((finfo==NIL)&&(fdata==NIL)&&(frsrc==NIL)){
-            fprintf(stderr,"# There is no data fork named %s\n",fname);
-            return(FALSE);
-        }
+    if((finfo==NIL)&&(fdata==NIL)&&(frsrc==NIL)){
+        fprintf(stderr,"# There is no data fork named %s\n",fname);
+        return(FALSE);
+    }

-        /* SEE: should set creationDate and modificationDate.*/
-        /* SEE: should set other Finder info.*/
+    /* SEE: should set creationDate and modificationDate.*/
+    /* SEE: should set other Finder info.*/

-        strcpy((char*)(info.name),(const char*)(fname));
-        if(type!=NIL){
-            blockcopy(type,&(info.type),sizeof(info.type));
-        }
-        if(creator!=NIL){
-            blockcopy(creator,&(info.creator),sizeof(info.creator));
-        }
+    strcpy((char*)(info.name),(const char*)(fname));
+    if(type!=NIL){
+        blockcopy(type,&(info.type),sizeof(info.type));
+    }
+    if(creator!=NIL){
+        blockcopy(creator,&(info.creator),sizeof(info.creator));
+    }

-        MacBinary_BuildHeader(&header,&info);
+    MacBinary_BuildHeader(&header,&info);

-        count=fwrite(&header,1,sizeof(header),fmbin);
-        if(count!=sizeof(header)){ return(FALSE); }
+    count=(CARD32)fwrite(&header,1,sizeof(header),fmbin);
+    if(count!=sizeof(header)){ return(FALSE); }

-        if(info.dataSize>0){
-            if(!MacBinary_CopyFork(fdata,fmbin,info.dataSize,FALSE,TRUE)){
-                return(FALSE);
-            }
+    if(info.dataSize>0){
+        if(!MacBinary_CopyFork(fdata,fmbin,info.dataSize,FALSE,TRUE)){
+            return(FALSE);
         }
+    }

-        if(info.resourceSize>0){
-            if(!MacBinary_CopyFork(frsrc,fmbin,info.resourceSize,FALSE,TRUE)){
-                return(FALSE);
-            }
+    if(info.resourceSize>0){
+        if(!MacBinary_CopyFork(frsrc,fmbin,info.resourceSize,FALSE,TRUE)){
+            return(FALSE);
         }
+    }

-        return(TRUE);
-    }/*MacBinary_Create; */
+    return(TRUE);
+}/*MacBinary_Create; */


-    static PROCEDURE(PrintInfo,(FILE* output,MacBinary_FileInfoT* info),void)
-    {
-        fprintf(output,"                 name = %s\n",info->name);
-        fprintf(output,"                 type = %08lx\n",
-                                                *(CARD32*)&(info->type));
-        fprintf(output,"              creator = %08lx\n",
-                                                *(CARD32*)&(info->creator));
-        fprintf(output,"         finder flags = %04x\n",
-                                                (info->finderFlags));
-        fprintf(output,"             vertical = %d\n",info->vertical);
-        fprintf(output,"           horizontal = %d\n",info->horizontal);
-        fprintf(output,"             folderId = %d\n",info->folderId);
-        fprintf(output,"            protected = %u\n",
-                                            (info->protectedBit));
-        fprintf(output,"        creation date = %lu\n",info->creationDate);
-        fprintf(output,"    modification date = %lu\n",info->modificationDate);
-        fprintf(output,"            data size = %lu\n",info->dataSize);
-        fprintf(output,"        resource size = %lu\n",info->resourceSize);
-        fprintf(output,"           total size = %lu\n",info->totalSize);
-        fprintf(output,"         comment size = %d\n",info->commentSize);
-        fprintf(output,"secondary header size = %d\n",info->headerSize);
-    }/*PrintInfo;*/
+static PROCEDURE(PrintInfo,(FILE* output,MacBinary_FileInfoT* info),void)
+{
+    fprintf(output,"                 name = %s\n",info->name);
+    fprintf(output,"                 type = %08"FMT_CARD32_HEX"\n",*(CARD32*)&(info->type));
+    fprintf(output,"              creator = %08"FMT_CARD32_HEX"\n",*(CARD32*)&(info->creator));
+    fprintf(output,"         finder flags = %04"FMT_CARD16_HEX"\n",(info->finderFlags));
+    fprintf(output,"             vertical = %"FMT_CARD16"\n",info->vertical);
+    fprintf(output,"           horizontal = %"FMT_CARD16"\n",info->horizontal);
+    fprintf(output,"             folderId = %"FMT_CARD16"\n",info->folderId);
+    fprintf(output,"            protected = %"FMT_CARD16"\n",(info->protectedBit));
+    fprintf(output,"        creation date = %"FMT_CARD32"\n",info->creationDate);
+    fprintf(output,"    modification date = %"FMT_CARD32"\n",info->modificationDate);
+    fprintf(output,"            data size = %"FMT_CARD32"\n",info->dataSize);
+    fprintf(output,"        resource size = %"FMT_CARD32"\n",info->resourceSize);
+    fprintf(output,"           total size = %"FMT_CARD32"\n",info->totalSize);
+    fprintf(output,"         comment size = %"FMT_CARD16"\n",info->commentSize);
+    fprintf(output,"secondary header size = %"FMT_CARD16"\n",info->headerSize);
+}/*PrintInfo;*/


-    static PROCEDURE(MacBinary_GetInfo,
-            (FILE* fmbin,BOOLEAN verbose,
-             MacBinary_FileInfoT* info),BOOLEAN)
-    {
-            MacBinary_HeaderT       header;
-            CARD32                  count;
-            CARD16                  format;
+static PROCEDURE(MacBinary_GetInfo,
+                 (FILE* fmbin,BOOLEAN verbose,
+                  MacBinary_FileInfoT* info),BOOLEAN)
+{
+    MacBinary_HeaderT       header;
+    CARD32                  count;
+    CARD16                  format;

-        count=fread(&header,sizeof(CARD8),sizeof(header),fmbin);
-        if(count!=sizeof(header)){
-            fprintf(stderr,"Cannot read the header.\n");
-            return(FALSE);
-        }
-        format=MacBinary_HeaderFormat(&header);
-        switch(format){
-        case 1:
-            if(verbose){
-                fprintf(stderr,"Header format: MacBinary 1 format.\n");
-            }
-            break;
-        case 2:
-            if(verbose){
-                fprintf(stderr,"Header format: MacBinary 2 format,\n"
-                        "   writer version= %u\n"
-                        "   reader version= %u\n",
-                        (header.writerVersion),
-                        (header.readerVersion));
-            }
-            if(header.readerVersion>129){
-                fprintf(stderr,"I cannot read this version (%d).\n",
+    count=(CARD32)fread(&header,sizeof(CARD8),sizeof(header),fmbin);
+    if(count!=sizeof(header)){
+        fprintf(stderr,"Cannot read the header.\n");
+        return(FALSE);
+    }
+    format=MacBinary_HeaderFormat(&header);
+    switch(format){
+    case 1:
+        if(verbose){
+            fprintf(stderr,"Header format: MacBinary 1 format.\n");
+        }
+        break;
+    case 2:
+        if(verbose){
+            fprintf(stderr,"Header format: MacBinary 2 format,\n"
+                    "   writer version= %u\n"
+                    "   reader version= %u\n",
+                    (header.writerVersion),
+                    (header.readerVersion));
+        }
+        if(header.readerVersion>129){
+            fprintf(stderr,"I cannot read this version (%d).\n",
                     (CARD16)(header.readerVersion));
-                return(FALSE);
-            }
-            break;
-        default:
-            fprintf(stderr,"It is not a MacBinary header.\n");
             return(FALSE);
         }
-        MacBinary_HeaderToInfo(&header,info);
-        return(TRUE);
-    }/*MacBinary_GetInfo;*/
+        break;
+    default:
+        fprintf(stderr,"It is not a MacBinary header.\n");
+        return(FALSE);
+    }
+    MacBinary_HeaderToInfo(&header,info);
+    return(TRUE);
+}/*MacBinary_GetInfo;*/


-    static PROCEDURE(MacBinary_Extract,
-            (FILE* fmbin,const CHAR* fname,BOOLEAN verbose),BOOLEAN)
-    {
-        MacBinary_FileInfoT     info;
-        CARD32                  count;
-        BOOLEAN                 dontoverride=FALSE; /* useless.*/
-        FILE*                   fdata;
-        FILE*                   frsrc;
-        FILE*                   finfo;
-
-        if(!MacBinary_GetInfo(fmbin,verbose,&info)){
-            return(FALSE);
+static PROCEDURE(MacBinary_Extract,
+                 (FILE* fmbin,const CHAR* fname,BOOLEAN verbose),BOOLEAN)
+{
+    MacBinary_FileInfoT     info;
+    CARD32                  count;
+    BOOLEAN                 dontoverride=FALSE; /* useless.*/
+    FILE*                   fdata;
+    FILE*                   frsrc;
+    FILE*                   finfo;
+
+    if(!MacBinary_GetInfo(fmbin,verbose,&info)){
+        return(FALSE);
+    }
+    if(fname==NIL){
+        fname=info.name;
+        FName_MacToNext(info.name);
+        dontoverride=TRUE;
+        if(verbose){
+            fprintf(stderr,"Using file name found in header: %s "
+                    "(converted to NeXT encoding)\n",fname);
         }
-        if(fname==NIL){
-            fname=info.name;
-            FName_MacToNext(info.name);
-            dontoverride=TRUE;
-            if(verbose){
-                fprintf(stderr,"Using file name found in header: %s "
-                            "(converted to NeXT encoding)\n",fname);
-            }
-        }else{
-            if(verbose){
-                fprintf(stderr,"Using given file name: %s\n",fname);
-            }
-        }
-        if(info.headerSize>0){
-            if(!MacBinary_Skip(fmbin,info.headerSize,TRUE)){
-                fprintf(stderr,"Error while skipping secondary header.\n");
-                return(FALSE);
-            }
+    }else{
+        if(verbose){
+            fprintf(stderr,"Using given file name: %s\n",fname);
         }
-        if(info.dataSize>0){
-            fdata=forkopen((const CHAR*)"data",fname,
-                           (const CHAR*)"",(const CHAR*)"w",TRUE);
-            if(fdata==NIL){
-                return(FALSE);
-            }
-        }else{
-            fdata=NIL;
+    }
+    if(info.headerSize>0){
+        if(!MacBinary_Skip(fmbin,info.headerSize,TRUE)){
+            fprintf(stderr,"Error while skipping secondary header.\n");
+            return(FALSE);
         }
-        if(info.resourceSize>0){
-            frsrc=forkopen((const CHAR*)"resource",fname,
-                           (const CHAR*)".rsrc",(const CHAR*)"w",TRUE);
-            if(frsrc==NIL){
-                return(FALSE);
-            }
-        }else{
-            frsrc=NIL;
+    }
+    if(info.dataSize>0){
+        fdata=forkopen((const CHAR*)"data",fname,
+                       (const CHAR*)"",(const CHAR*)"w",TRUE);
+        if(fdata==NIL){
+            return(FALSE);
         }
-        finfo=forkopen((const CHAR*)"information",fname,
-                       (const CHAR*)".mbinfo",
-                       (const CHAR*)"w",TRUE);
-        if(fdata!=NIL){
-            if(!MacBinary_CopyFork(fmbin,fdata,info.dataSize,TRUE,FALSE)){
-                fprintf(stderr,"Error while copying the data fork.\n");
-                return(FALSE);
-            }
+    }else{
+        fdata=NIL;
+    }
+    if(info.resourceSize>0){
+        frsrc=forkopen((const CHAR*)"resource",fname,
+                       (const CHAR*)".rsrc",(const CHAR*)"w",TRUE);
+        if(frsrc==NIL){
+            return(FALSE);
         }
-        if(frsrc!=NIL){
-            if(!MacBinary_CopyFork(fmbin,frsrc,info.resourceSize,TRUE,FALSE)){
-                fprintf(stderr,"Error while copying the resource fork.\n");
-                return(FALSE);
-            }
+    }else{
+        frsrc=NIL;
+    }
+    finfo=forkopen((const CHAR*)"information",fname,
+                   (const CHAR*)".mbinfo",
+                   (const CHAR*)"w",TRUE);
+    if(fdata!=NIL){
+        if(!MacBinary_CopyFork(fmbin,fdata,info.dataSize,TRUE,FALSE)){
+            fprintf(stderr,"Error while copying the data fork.\n");
+            return(FALSE);
         }
-        count=fwrite(&info,1,sizeof(info),finfo);
-        if(count!=sizeof(info)){
-            fprintf(stderr,"Error while writting information fork.\n");
+    }
+    if(frsrc!=NIL){
+        if(!MacBinary_CopyFork(fmbin,frsrc,info.resourceSize,TRUE,FALSE)){
+            fprintf(stderr,"Error while copying the resource fork.\n");
             return(FALSE);
         }
-        /* forgetting the comment.*/
-        /* SEE: could update the creation and modification dates.*/
-        return(TRUE);
-    }/*MacBinary_Extract; */
-
-
-    static CHAR Usage[]=
-                    "### Usage:\n#\tmb "
-                    "(-c fname [-T type] [-C crea]|-x [fname]|-t [-F]) \n"
-                    "#\t\t[-v] [-f mbfile]\n"
-                    "#\tmbinfo   <=> mb -t\n"
-                    "#\tmbencode <=> mb -c\n"
-                    "#\tmbdecode <=> mb -x\n";
+    }
+    count=(CARD32)fwrite(&info,1,sizeof(info),finfo);
+    if(count!=sizeof(info)){
+        fprintf(stderr,"Error while writting information fork.\n");
+        return(FALSE);
+    }
+    /* forgetting the comment.*/
+    /* SEE: could update the creation and modification dates.*/
+    return(TRUE);
+}/*MacBinary_Extract; */
+
+
+static CHAR Usage[]=
+  "### Usage:\n#\tmb "
+  "(-c fname [-T type] [-C crea]|-x [fname]|-t [-F]) \n"
+  "#\t\t[-v] [-f mbfile]\n"
+  "#\tmbinfo   <=> mb -t\n"
+  "#\tmbencode <=> mb -c\n"
+  "#\tmbdecode <=> mb -x\n";

 /*
-    ( -c fname [ -T type ] [ -C crea ] | -x [ fname ] | -t )
-         [ -v ] [ -f mbfile ]
-
--c fname -f mb      input (fname.data,fname.rsrc,fname.mbinfo) output mb
--c fname > mb       input (fname.data,fname.rsrc,fname.mbinfo) output stdout
--x fname -f mb      input mb    output (fname.data,fname.rsrc,fname.mbinfo)
--x fname < mb       input stdin output (fname.data,fname.rsrc,fname.mbinfo)
--x -f mb            input mb    output (fnmb.data,fnmb.rsrc,fnmb.mbinfo)
--x < mb             input stdin output (fnmb.data,fnmb.rsrc,fnmb.mbinfo)
+  ( -c fname [ -T type ] [ -C crea ] | -x [ fname ] | -t )
+  [ -v ] [ -f mbfile ]
+
+  -c fname -f mb      input (fname.data,fname.rsrc,fname.mbinfo) output mb
+  -c fname > mb       input (fname.data,fname.rsrc,fname.mbinfo) output stdout
+  -x fname -f mb      input mb    output (fname.data,fname.rsrc,fname.mbinfo)
+  -x fname < mb       input stdin output (fname.data,fname.rsrc,fname.mbinfo)
+  -x -f mb            input mb    output (fnmb.data,fnmb.rsrc,fnmb.mbinfo)
+  -x < mb             input stdin output (fnmb.data,fnmb.rsrc,fnmb.mbinfo)

 */

@@ -749,20 +745,20 @@ LEGAL
 PROCEDURE(main,(int argc,char** random_argv),int)
 {
     CHAR** argv=(CHAR**)random_argv;
-        FILE*                   fmbin;
+    FILE*                   fmbin;

-        BOOLEAN     nooption=TRUE;      /* -c or -x or -t mandatory!*/
-        BOOLEAN     create=FALSE;       /* -c*/
-        CARD8*      type=NIL;
-        CARD8*      creator=NIL;
-        BOOLEAN     extract=FALSE;      /* -x*/
-        CHAR*       fname=NIL;          /* (NIL or fname)*/
-        BOOLEAN     getinfo=FALSE;      /* -t*/
-        BOOLEAN     verbose=FALSE;      /* -v*/
-        CHAR*       mbname=NIL;         /* -f (NIL or mbname)*/
-        BOOLEAN     force=FALSE;        /* -F force dump info.*/
-        CARD16      i;
-        CARD16      j;
+    BOOLEAN     nooption=TRUE;      /* -c or -x or -t mandatory!*/
+    BOOLEAN     create=FALSE;       /* -c*/
+    CARD8*      type=NIL;
+    CARD8*      creator=NIL;
+    BOOLEAN     extract=FALSE;      /* -x*/
+    CHAR*       fname=NIL;          /* (NIL or fname)*/
+    BOOLEAN     getinfo=FALSE;      /* -t*/
+    BOOLEAN     verbose=FALSE;      /* -v*/
+    CHAR*       mbname=NIL;         /* -f (NIL or mbname)*/
+    BOOLEAN     force=FALSE;        /* -F force dump info.*/
+    CARD16      i;
+    CARD16      j;

     i=1;
     while(i<argc){
@@ -777,26 +773,26 @@ PROCEDURE(main,(int argc,char** random_argv),int)
             case 't':
                 if(!nooption){
                     fprintf(stderr,"### Only one option from {-c, -x, -t} "
-                                    "at once.\n%s",Usage);
+                            "at once.\n%s",Usage);
                     return(1);
                 }
                 nooption=FALSE;
                 switch(argv[i][1]){
                 case 'c':
                     create=TRUE;
-                    j=i+1;
+                    j=(CARD16)(i+1);
                     if(j<argc){
                         fname=argv[j];
                     }else{
                         fprintf(stderr,"### -c must be followed by the "
-                                        "file name\n%s",Usage);
+                                "file name\n%s",Usage);
                         return(1);
                     }
                     i=j;
                     break;
                 case 'x':
                     extract=TRUE;
-                    j=i+1;
+                    j=(CARD16)(i+1);
                     if(j<argc){
                         if(argv[j][0]!='-'){
                             fname=argv[j];
@@ -813,34 +809,34 @@ PROCEDURE(main,(int argc,char** random_argv),int)
             case 'C':
                 if(!create){
                     fprintf(stderr,"### -T or -C can only be used "
-                                    "after -c\n%s",Usage);
+                            "after -c\n%s",Usage);
                     return(1);
                 }
-                j=i+1;
+                j=(CARD16)(i+1);
                 if(j<argc){
                     if(strlen((char*)(argv[j]))!=4){
                         fprintf(stderr,"### -T or -C must be followed by "
-                                        "a four-character string\n%s",Usage);
+                                "a four-character string\n%s",Usage);
                         return(1);
                     }
                     if(argv[i][1]=='T'){
                         if(type!=NIL){
                             fprintf(stderr,"### -T may be specified "
-                                            "only once\n%s",Usage);
+                                    "only once\n%s",Usage);
                             return(1);
                         }
                         type=argv[j];
                     }else{
                         if(creator!=NIL){
                             fprintf(stderr,"### -T may be specified "
-                                            "only once\n%s",Usage);
+                                    "only once\n%s",Usage);
                             return(1);
                         }
                         creator=argv[j];
                     }
                 }else{
                     fprintf(stderr,"### -T or -C must be followed by a type "
-                                    " or a creator (4 char)\n%s",Usage);
+                            " or a creator (4 char)\n%s",Usage);
                     return(1);
                 }
                 i=j;
@@ -848,15 +844,15 @@ PROCEDURE(main,(int argc,char** random_argv),int)
             case 'f':
                 if(mbname!=NIL){
                     fprintf(stderr,"### -f may be specified "
-                                    "only once\n%s",Usage);
+                            "only once\n%s",Usage);
                     return(1);
                 }
-                j=i+1;
+                j=(CARD16)(i+1);
                 if(j<argc){
                     mbname=argv[j];
                 }else{
                     fprintf(stderr,"### -f must be followed by the mb "
-                                    "file name\n%s",Usage);
+                            "file name\n%s",Usage);
                     return(1);
                 }
                 i=j;
@@ -867,7 +863,7 @@ PROCEDURE(main,(int argc,char** random_argv),int)
             case 'v':
                 if(verbose){
                     fprintf(stderr,"### -v may be specified "
-                                    "only once\n%s",Usage);
+                            "only once\n%s",Usage);
                     return(1);
                 }
                 verbose=TRUE;
@@ -881,7 +877,7 @@ PROCEDURE(main,(int argc,char** random_argv),int)
     }
     if(nooption){
         fprintf(stderr,"### At least one of {-c, -x, -t} must be "
-                        "specified.\n%s",Usage);
+                "specified.\n%s",Usage);
         return(1);
     }

@@ -913,7 +909,7 @@ PROCEDURE(main,(int argc,char** random_argv),int)
                 return(1);
             }
         }else if(getinfo){
-                MacBinary_FileInfoT     info;
+            MacBinary_FileInfoT     info;

             if(!force&&!MacBinary_GetInfo(fmbin,verbose,&info)){
                 return(1);
@@ -922,7 +918,7 @@ PROCEDURE(main,(int argc,char** random_argv),int)
             return(0);
         }else{
             fprintf(stderr,"!!! Internal error: at least one of "
-                            "-c -x -t is mandatory.\n");
+                    "-c -x -t is mandatory.\n");
             return(1);
         }
     }
@@ -933,31 +929,31 @@ PROCEDURE(main,(int argc,char** random_argv),int)

 /***
     if(create){
-        printf("create ");
-        printf("fname=%s ",fname);
-        if(type!=NIL){
-            printf("type=%08lx ",*(CARD32*)type);
-        }
-        if(creator!=NIL){
-            printf("creator=%08lx ",*(CARD32*)creator);
-        }
+    printf("create ");
+    printf("fname=%s ",fname);
+    if(type!=NIL){
+    printf("type=%08lx ",*(CARD32*)type);
+    }
+    if(creator!=NIL){
+    printf("creator=%08lx ",*(CARD32*)creator);
+    }
     }
     if(extract){
-        printf("extract ");
-        if(fname!=NIL){
-            printf("fname=%s ",fname);
-        }
+    printf("extract ");
+    if(fname!=NIL){
+    printf("fname=%s ",fname);
+    }
     }
     if(getinfo){
-        printf("getinfo ");
+    printf("getinfo ");
     }
     if(verbose){
-        printf("verbose ");
+    printf("verbose ");
     }
     if(mbname){
-        printf("mbname=%s ",mbname);
+    printf("mbname=%s ",mbname);
     }
     printf("\n");
 ***/

-/*** mb.c                             --                     --          ***/
+/**** THE END ****/
diff --git a/formats/macbinary_to_triple/MacBinary.c b/formats/macbinary_to_triple/MacBinary.c
index 2b616cc..6f8aa63 100644
--- a/formats/macbinary_to_triple/MacBinary.c
+++ b/formats/macbinary_to_triple/MacBinary.c
@@ -16,7 +16,7 @@ MODIFICATIONS
 BUGS
     Not up-to-date to BcInterface/BcTypes/BcImplementation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1992
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/macbinary_to_triple/MacBinary.h b/formats/macbinary_to_triple/MacBinary.h
index 2cb2858..2f6a5b8 100644
--- a/formats/macbinary_to_triple/MacBinary.h
+++ b/formats/macbinary_to_triple/MacBinary.h
@@ -12,7 +12,7 @@ MODIFICATIONS
 BUGS
     Not up-to-date to BcInterface/BcTypes/BcImplementation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1992
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/macbinary_to_triple/mb2t.c b/formats/macbinary_to_triple/mb2t.c
index cc264c7..8354134 100644
--- a/formats/macbinary_to_triple/mb2t.c
+++ b/formats/macbinary_to_triple/mb2t.c
@@ -17,7 +17,7 @@ MODIFICATIONS
                         buffered routines.
     1992/04/18 <PJB> Addapted from s2d.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1992
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/single_to_double/Makefile b/formats/single_to_double/Makefile
index 665f0ed..f05ffe0 100644
--- a/formats/single_to_double/Makefile
+++ b/formats/single_to_double/Makefile
@@ -13,7 +13,7 @@
 #LEGAL
 #    GPL
 #
-#    Copyright Pascal Bourguignon 1992 - 2003
+#    Copyright Pascal Bourguignon 1992 - 2011
 #
 #    This program is free software; you can redistribute it and/or
 #    modify it under the terms of the GNU General Public License
@@ -34,6 +34,10 @@
 CSOURCES= s2d.c
 OTHERS = setfile is type
 PROGRAMS = s2d
+INCLUDES=\
+	-I.\
+	-I$(PREFIX)/lib \
+	-I$(PREFIX)/lib/bclib/interfaces

 s2d_OBJECTS=s2d.o
 s2d_LIBRARIES=
diff --git a/formats/single_to_double/encours/ASSegment.h b/formats/single_to_double/encours/ASSegment.h
index d4a7160..a2a00c2 100644
--- a/formats/single_to_double/encours/ASSegment.h
+++ b/formats/single_to_double/encours/ASSegment.h
@@ -10,7 +10,7 @@ AUTHORS
 MODIFICATIONS
     1992/03/25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1992
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/single_to_double/encours/ASSegment.m b/formats/single_to_double/encours/ASSegment.m
index 142f0ab..4432414 100644
--- a/formats/single_to_double/encours/ASSegment.m
+++ b/formats/single_to_double/encours/ASSegment.m
@@ -10,7 +10,7 @@ AUTHORS
 MODIFICATIONS
     1992/03/25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1992
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/single_to_double/encours/AppleSingle.h b/formats/single_to_double/encours/AppleSingle.h
index 7382efb..d1d1371 100644
--- a/formats/single_to_double/encours/AppleSingle.h
+++ b/formats/single_to_double/encours/AppleSingle.h
@@ -10,7 +10,7 @@ AUTHORS
 MODIFICATIONS
     1992/03/25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1992
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/single_to_double/encours/AppleSingle.m b/formats/single_to_double/encours/AppleSingle.m
index e890d59..8996c15 100644
--- a/formats/single_to_double/encours/AppleSingle.m
+++ b/formats/single_to_double/encours/AppleSingle.m
@@ -10,7 +10,7 @@ AUTHORS
 MODIFICATIONS
     1992/03/25 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1992
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
diff --git a/formats/single_to_double/s2d.c b/formats/single_to_double/s2d.c
index 5b23591..b82aa11 100644
--- a/formats/single_to_double/s2d.c
+++ b/formats/single_to_double/s2d.c
@@ -17,7 +17,7 @@ MODIFICATIONS
     1992/03/27 <PJB> Replaced the use of raw UNIX I/O routines by that of stdio
                         buffered routines.
 LEGAL
-    Copyright Pascal J. Bourguignon 1992 - 1992
+    Copyright Pascal J. Bourguignon 1992 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
@@ -26,7 +26,7 @@ LEGAL
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-        /* #include <unistd.h> */
+/* #include <unistd.h> */
 #include <sys/file.h>
 #include <sys/errno.h>
 #include <sys/types.h>
@@ -34,6 +34,7 @@ LEGAL
 #include <sys/types.h>
 #include <unistd.h>

+#include <BcTypes.h>

 #ifndef SEEK_SET
 #define SEEK_SET 0      /* arguments to fseek function */
@@ -44,653 +45,645 @@ LEGAL



-        /*
-            s2d src dst
-        */
+/*
+  s2d src dst
+*/

 #define     ASCII_BS    (8)
 #define     ASCII_LF    (10)
 #define     ASCII_CR    (13)
 #define     ASCII_DEL   (127)

-    typedef long int    int32;
-    typedef short int   int16;
-    typedef char        boolean;
-#define true        ((boolean)(0==0))
-#define false       ((boolean)(1==0))
-#define nil         (0)
-
-
-
-


-    typedef struct {
-        int32           magic;
-        int32           version;
-        int32           filler[4];
-        int16           entryCount;
-    }       AppleSD_HeaderT;
+typedef struct {
+    INT32           magic;
+    INT32           version;
+    INT32           filler[4];
+    INT16           entryCount;
+}       AppleSD_HeaderT;

-    typedef struct {
-        int32           id;
-        int32           offset;
-        int32           length;
-    }       AppleSD_EntryT;
+typedef struct {
+    INT32           id;
+    INT32           offset;
+    INT32           length;
+}       AppleSD_EntryT;

 #define AppleSD_Single_Magic        (0x00051600)
 #define AppleSD_Double_Magic        (0x00051607)
 #define AppleSD_Version_2           (0x00020000)

-    AppleSD_HeaderT     header;
-
-    typedef enum {
-        Segm_DataFork=          1,
-        Segm_ResourceFork=      2,
-        Segm_RealName=          3,
-        Segm_Comment=           4,
-        Segm_BWIcon=            5,
-        Segm_ColorIcon=         6,
-        Segm_FileDateInfo=      8,
-        Segm_FinderInfo=        9,
-        Segm_MacintoshFileInfo= 10,
-        Segm_ProDOSFileInfo=    11,
-        Segm_MSDOSFileInfo=     12,
-        Segm_AFPShortName=      13,
-        Segm_AFPFileInfo=       14,
-        Segm_AFPDirectoryId=    15
-    }                   SegmT;
-
-    typedef char    OSType[4];
-    typedef struct {
-        int16   h,v;
-    }               Point;
-
-    struct FInfo {
-        OSType fdType;                  /*the type of the file*/
-        OSType fdCreator;               /*file's creator*/
-        unsigned short fdFlags;         /*flags ex. hasbundle,invisible,locked, etc.*/
-        Point fdLocation;               /*file's location in folder*/
-        short fdFldr;                   /*folder containing file*/
-    };
-    typedef struct FInfo FInfo;
+AppleSD_HeaderT     header;
+
+typedef enum {
+    Segm_DataFork=          1,
+    Segm_ResourceFork=      2,
+    Segm_RealName=          3,
+    Segm_Comment=           4,
+    Segm_BWIcon=            5,
+    Segm_ColorIcon=         6,
+    Segm_FileDateInfo=      8,
+    Segm_FinderInfo=        9,
+    Segm_MacintoshFileInfo= 10,
+    Segm_ProDOSFileInfo=    11,
+    Segm_MSDOSFileInfo=     12,
+    Segm_AFPShortName=      13,
+    Segm_AFPFileInfo=       14,
+    Segm_AFPDirectoryId=    15
+}                   SegmT;
+
+typedef char    OSType[4];
+typedef struct {
+    INT16   h,v;
+}               Point;
+
+struct FInfo {
+    OSType fdType;                  /*the type of the file*/
+    OSType fdCreator;               /*file's creator*/
+    unsigned short fdFlags;         /*flags ex. hasbundle,invisible,locked, etc.*/
+    Point fdLocation;               /*file's location in folder*/
+    short fdFldr;                   /*folder containing file*/
+};
+typedef struct FInfo FInfo;

 #if 0
-    static char     SegmentNameStrings[16][32]={
-        "Segment #%d",
-        "DataFork",
-        "ResourceFork",
-        "RealName",
-        "Comment",
-        "BWIcon",
-        "ColorIcon",
-        "Segment #7",
-        "FileDateInfo",
-        "FinderInfo",
-        "MacintoshFileInfo",
-        "ProDOSFileInfo",
-        "MSDOSFileInfo",
-        "AFPShortName",
-        "AFPFileInfo",
-        "AFPDirectoryId"
-    };
-
-    static void GetSegmentName(int id,char* name)
-    {
-        if((id<=0)||(Segm_AFPDirectoryId<id)){
-            sprintf(name,SegmentNameStrings[0],id);
-        }else{
-            strcpy(name,SegmentNameStrings[id]);
-        }
-    }/*GetSegmentName*/
+static char     SegmentNameStrings[16][32]={
+    "Segment #%d",
+    "DataFork",
+    "ResourceFork",
+    "RealName",
+    "Comment",
+    "BWIcon",
+    "ColorIcon",
+    "Segment #7",
+    "FileDateInfo",
+    "FinderInfo",
+    "MacintoshFileInfo",
+    "ProDOSFileInfo",
+    "MSDOSFileInfo",
+    "AFPShortName",
+    "AFPFileInfo",
+    "AFPDirectoryId"
+};
+
+static void GetSegmentName(int id,char* name)
+{
+    if((id<=0)||(Segm_AFPDirectoryId<id)){
+        sprintf(name,SegmentNameStrings[0],id);
+    }else{
+        strcpy(name,SegmentNameStrings[id]);
+    }
+}/*GetSegmentName*/
 #endif

-    static boolean AppleSD_IsSingle(FILE* fd)
-    {
+static BOOLEAN AppleSD_IsSingle(FILE* fd)
+{

-        int32       size;
+    INT32       size;

-        if(0!=fseek(fd,0,SEEK_SET)){
-            exit(20);
-        }
-        size=fread(&header,1,sizeof(header),fd);
-        if(size==sizeof(header)){
-            return((header.magic==AppleSD_Single_Magic));
-        }else{
-            exit(21);
-        }
-    }/*AppleSD_IsSingle*/
-
-
-    static boolean AppleSD_IsDouble(FILE* fd)
-    {
-        AppleSD_HeaderT     hdr;
-        int32               size;
+    if(0!=fseek(fd,0,SEEK_SET)){
+        exit(20);
+    }
+    size=(INT32)fread(&header,1,sizeof(header),fd);
+    if(size==sizeof(header)){
+        return((header.magic==AppleSD_Single_Magic));
+    }else{
+        exit(21);
+    }
+}/*AppleSD_IsSingle*/
+
+
+static BOOLEAN AppleSD_IsDouble(FILE* fd)
+{
+    AppleSD_HeaderT     hdr;
+    INT32               size;

-        if(0!=fseek(fd,0,SEEK_SET)){
-            exit(22);
-        }
-        size=fread(&hdr,1,sizeof(hdr),fd);
-        if(size==sizeof(hdr)){
-            return((hdr.magic==AppleSD_Double_Magic));
-        }else{
-            exit(23);
-        }
-    }/*AppleSD_IsDouble*/
-
-
-        /*****
-            {
-            char    name[32];
-            GetSegmentName(entry->id,name);
-            fprintf(stderr,"entry[%d]: offset=%lx, length=%lx, id=%d (%s)\n",i,entry->offset,entry->length,entry->id,name);
-            }
-        *****/
-
-    static boolean AppleSD_GetEntry(FILE* fd,int32 id, AppleSD_EntryT* entry)
-    {
-        int32       i;
-        int32       size;
+    if(0!=fseek(fd,0,SEEK_SET)){
+        exit(22);
+    }
+    size=(INT32)fread(&hdr,1,sizeof(hdr),fd);
+    if(size==sizeof(hdr)){
+        return((hdr.magic==AppleSD_Double_Magic));
+    }else{
+        exit(23);
+    }
+}/*AppleSD_IsDouble*/
+
+
+/*****
+      {
+      char    name[32];
+      GetSegmentName(entry->id,name);
+      fprintf(stderr,"entry[%d]: offset=%lx, length=%lx, id=%d (%s)\n",i,entry->offset,entry->length,entry->id,name);
+      }
+*****/
+
+static BOOLEAN AppleSD_GetEntry(FILE* fd,INT32 id, AppleSD_EntryT* entry)
+{
+    INT32       i;
+    INT32       size;

-        if(0!=fseek(fd,sizeof(AppleSD_HeaderT),SEEK_SET)){
-            exit(24);
+    if(0!=fseek(fd,sizeof(AppleSD_HeaderT),SEEK_SET)){
+        exit(24);
+    }
+    i=0;
+    while(i<header.entryCount){
+        size=(INT32)fread(entry,1,sizeof(AppleSD_EntryT),fd);
+        if(size==sizeof(AppleSD_EntryT)&&(entry->id==id)){
+            return(TRUE);
         }
-        i=0;
-        while(i<header.entryCount){
-            size=fread(entry,1,sizeof(AppleSD_EntryT),fd);
-            if(size==sizeof(AppleSD_EntryT)&&(entry->id==id)){
-                return(true);
-            }
-            i++;
-        }
-        return(false);
-    }/*AppleSD_GetEntry*/
+        i++;
+    }
+    return(FALSE);
+}/*AppleSD_GetEntry*/


-    static boolean AppleSD_GetType(FILE* fd,char* type)
-    {
-        AppleSD_EntryT      entry;
-        FInfo               finfo;
-        int                 size;
+static BOOLEAN AppleSD_GetType(FILE* fd,char* type)
+{
+    AppleSD_EntryT      entry;
+    FInfo               finfo;
+    int                 size;

-        if(AppleSD_GetEntry(fd,Segm_FinderInfo,&entry)){
-            if(0!=fseek(fd,entry.offset,SEEK_SET)){
-                /*fprintf(stderr,"Cannot fseek.\n");*/
-                return(false);
-            }
-            size=fread(&finfo,1,sizeof(FInfo),fd);
-            type[0]=finfo.fdType[0];
-            type[1]=finfo.fdType[1];
-            type[2]=finfo.fdType[2];
-            type[3]=finfo.fdType[3];
-            /*if(size!=sizeof(FInfo)){ fprintf(stderr,"Bad size for Segm_FinderInfo:%d.\n",size); }*/
-            return(size==sizeof(FInfo));
-        }else{
-            /*fprintf(stderr,"AppleSD_GetEntry returned false.\n");*/
-            return(false);
+    if(AppleSD_GetEntry(fd,Segm_FinderInfo,&entry)){
+        if(0!=fseek(fd,entry.offset,SEEK_SET)){
+            /*fprintf(stderr,"Cannot fseek.\n");*/
+            return(FALSE);
         }
-    }/*AppleSD_GetType*/
-
-
-
-    static void AppleSD_CopyData(FILE* filefd,FILE* datafd)
-    {
-        AppleSD_EntryT  entry;
-        char            buffer[4096];
-        int32           actual;
+        size=(INT32)fread(&finfo,1,sizeof(FInfo),fd);
+        type[0]=finfo.fdType[0];
+        type[1]=finfo.fdType[1];
+        type[2]=finfo.fdType[2];
+        type[3]=finfo.fdType[3];
+        /*if(size!=sizeof(FInfo)){ fprintf(stderr,"Bad size for Segm_FinderInfo:%d.\n",size); }*/
+        return(size==sizeof(FInfo));
+    }else{
+        /*fprintf(stderr,"AppleSD_GetEntry returned FALSE.\n");*/
+        return(FALSE);
+    }
+}/*AppleSD_GetType*/
+
+
+
+static void AppleSD_CopyData(FILE* filefd,FILE* datafd)
+{
+    AppleSD_EntryT  entry;
+    char            buffer[4096];
+    INT32           actual;

-        if(AppleSD_GetEntry(filefd,1,&entry)){
-            if(0!=fseek(filefd,entry.offset,SEEK_SET)){
-                exit(28);
-            }else{
-                while((unsigned)(entry.length)>=sizeof(buffer)){
-                    actual=fread(&buffer,1,sizeof(buffer),filefd);
-                    if(actual!=sizeof(buffer)){
-                        exit(1);
-                    }
-                    actual=fwrite(&buffer,1,sizeof(buffer),datafd);
-                    if(actual!=sizeof(buffer)){
-                        exit(2);
-                    }
-                    entry.length-=sizeof(buffer);
+    if(AppleSD_GetEntry(filefd,1,&entry)){
+        if(0!=fseek(filefd,entry.offset,SEEK_SET)){
+            exit(28);
+        }else{
+            while((unsigned)(entry.length)>=sizeof(buffer)){
+                actual=(INT32)fread(&buffer,1,sizeof(buffer),filefd);
+                if(actual!=sizeof(buffer)){
+                    exit(1);
                 }
-                if(entry.length>0){
-                    actual=fread(&buffer,1,(unsigned)(entry.length),filefd);
-                    if(actual!=entry.length){
-                        exit(3);
-                    }
-                    actual=fwrite(&buffer,1,(unsigned)(entry.length) ,datafd);
-                    if(actual!=entry.length){
-                        exit(4);
-                    }
+                actual=(INT32)fwrite(&buffer,1,sizeof(buffer),datafd);
+                if(actual!=sizeof(buffer)){
+                    exit(2);
+                }
+                entry.length-=(INT32)sizeof(buffer);
+            }
+            if(entry.length>0){
+                actual=(INT32)fread(&buffer,1,(unsigned)(entry.length),filefd);
+                if(actual!=entry.length){
+                    exit(3);
+                }
+                actual=(INT32)fwrite(&buffer,1,(unsigned)(entry.length) ,datafd);
+                if(actual!=entry.length){
+                    exit(4);
                 }
             }
         }
-    }/*AppleSD_CopyData*/
+    }
+}/*AppleSD_CopyData*/


-    static void AppleSD_SetDouble(FILE* fd)
-    {
-        AppleSD_HeaderT     hdr;
-        int32               size;
+static void AppleSD_SetDouble(FILE* fd)
+{
+    AppleSD_HeaderT     hdr;
+    INT32               size;

-        if(0!=fseek(fd,0,SEEK_SET)){
-            exit(26);
-        }
-        size=fread(&hdr,1,sizeof(hdr),fd);
-        if(size!=sizeof(hdr)){
-            exit(36);
-        }
-        hdr.magic=AppleSD_Double_Magic;
-        if(0!=fseek(fd,0,SEEK_SET)){
-            exit(29);
-        }
-        size=fwrite(&hdr,1,sizeof(hdr),fd);
-        if(size!=sizeof(hdr)){
-            fprintf(stderr,"error on fwrite sizeof(hdr)=%d, size=%ld\n",
-                    (int)(sizeof(hdr)),size);
-            exit(37);
-        }
-    }/*AppleSD_SetDouble*/
-
-
-
-    static boolean AppleSD_ClearEntry(FILE* filefd,int32 id)
-    {
-        int32               i;
-        int32               size;
-        AppleSD_EntryT      entry;
+    if(0!=fseek(fd,0,SEEK_SET)){
+        exit(26);
+    }
+    size=(INT32)fread(&hdr,1,sizeof(hdr),fd);
+    if(size!=sizeof(hdr)){
+        exit(36);
+    }
+    hdr.magic=AppleSD_Double_Magic;
+    if(0!=fseek(fd,0,SEEK_SET)){
+        exit(29);
+    }
+    size=(INT32)fwrite(&hdr,1,sizeof(hdr),fd);
+    if(size!=sizeof(hdr)){
+        fprintf(stderr,"error on fwrite sizeof(hdr)=%d, size=%"FMT_INT32"\n",
+                (int)(sizeof(hdr)),size);
+        exit(37);
+    }
+}/*AppleSD_SetDouble*/
+
+
+
+static BOOLEAN AppleSD_ClearEntry(FILE* filefd,INT32 id)
+{
+    INT32               i;
+    INT32               size;
+    AppleSD_EntryT      entry;

-        if(0!=fseek(filefd,sizeof(AppleSD_HeaderT),SEEK_SET)){
-            exit(25);
-        }
-        i=0;
-        while(i<header.entryCount){
-            size=fread(&entry,1,sizeof(AppleSD_EntryT),filefd);
-            if((size==sizeof(AppleSD_EntryT))&&(entry.id==id)){
-                if(0!=fseek(filefd,-(signed)sizeof(AppleSD_EntryT),SEEK_CUR)){
-                    exit(27);
+    if(0!=fseek(filefd,sizeof(AppleSD_HeaderT),SEEK_SET)){
+        exit(25);
+    }
+    i=0;
+    while(i<header.entryCount){
+        size=(INT32)fread(&entry,1,sizeof(AppleSD_EntryT),filefd);
+        if((size==sizeof(AppleSD_EntryT))&&(entry.id==id)){
+            if(0!=fseek(filefd,-(signed)sizeof(AppleSD_EntryT),SEEK_CUR)){
+                exit(27);
+            }else{
+                entry.id+=(INT32)0x80000000;
+                size=(INT32)fwrite(&entry,1,sizeof(AppleSD_EntryT),filefd);
+                if(size==sizeof(AppleSD_EntryT)){
+                    return(TRUE);
                 }else{
-                    entry.id+=0x80000000;
-                    size=fwrite(&entry,1,sizeof(AppleSD_EntryT),filefd);
-                    if(size==sizeof(AppleSD_EntryT)){
-                        return(true);
-                    }else{
-                        exit(35);
-                    }
+                    exit(35);
                 }
             }
-            i++;
         }
-        return(false);
-    }/*AppleSD_ClearEntry*/
+        i++;
+    }
+    return(FALSE);
+}/*AppleSD_ClearEntry*/


-    static void AppleSD_CopyOther(FILE* srcfd,FILE* dstfd)
-    {
-        char            buffer[4096];
-        int32           actual;
-        int32           fsize;
+static void AppleSD_CopyOther(FILE* srcfd,FILE* dstfd)
+{
+    char            buffer[4096];
+    INT32           actual;
+    INT32           fsize;

-        if(0!=fseek(srcfd,0,SEEK_END)){
-            exit(6);
-        }
-        fsize=ftell(srcfd);
-        if(0!=fseek(srcfd,0,SEEK_SET)){
-            exit(30);
-        }else{
-            while((unsigned)fsize>=sizeof(buffer)){
-                actual=fread(&buffer,1,sizeof(buffer),srcfd);
-                if(actual!=sizeof(buffer)){
-                    exit(7);
-                }
-                actual=fwrite(&buffer,1,sizeof(buffer),dstfd);
-                if(actual!=sizeof(buffer)){
-                    exit(8);
-                }
-                fsize-=sizeof(buffer);
+    if(0!=fseek(srcfd,0,SEEK_END)){
+        exit(6);
+    }
+    fsize=(INT32)ftell(srcfd);
+    if(0!=fseek(srcfd,0,SEEK_SET)){
+        exit(30);
+    }else{
+        while((unsigned)fsize>=sizeof(buffer)){
+            actual=(INT32)fread(&buffer,1,sizeof(buffer),srcfd);
+            if(actual!=sizeof(buffer)){
+                exit(7);
             }
-            if(fsize>0){
-                actual=fread(&buffer,1,(unsigned)fsize,srcfd);
-                if(actual!=fsize){
-                    exit(9);
-                }
-                actual=fwrite(&buffer,1,(unsigned)fsize,dstfd);
-                if(actual!=fsize){
-                    exit(10);
-                }
+            actual=(INT32)fwrite(&buffer,1,sizeof(buffer),dstfd);
+            if(actual!=sizeof(buffer)){
+                exit(8);
             }
+            fsize-=(INT32)sizeof(buffer);
         }
-        AppleSD_SetDouble(dstfd);
-        if(AppleSD_ClearEntry(dstfd,1)){
-            return;
-        }else{
-            exit(11);
+        if(fsize>0){
+            actual=(INT32)fread(&buffer,1,(unsigned)fsize,srcfd);
+            if(actual!=fsize){
+                exit(9);
+            }
+            actual=(INT32)fwrite(&buffer,1,(unsigned)fsize,dstfd);
+            if(actual!=fsize){
+                exit(10);
+            }
         }
-    }/*AppleSD_CopyOther*/
+    }
+    AppleSD_SetDouble(dstfd);
+    if(AppleSD_ClearEntry(dstfd,1)){
+        return;
+    }else{
+        exit(11);
+    }
+}/*AppleSD_CopyOther*/


-    static void AppleSD_Single_to_Double(FILE* filefd,FILE* datafd,FILE* rsrcfd)
-    {
-        AppleSD_CopyData(filefd,datafd);
-        AppleSD_CopyOther(filefd,rsrcfd);
-    }/*AppleSD_Single_to_Double*/
+static void AppleSD_Single_to_Double(FILE* filefd,FILE* datafd,FILE* rsrcfd)
+{
+    AppleSD_CopyData(filefd,datafd);
+    AppleSD_CopyOther(filefd,rsrcfd);
+}/*AppleSD_Single_to_Double*/






-    static void usage(char* upname)
+static void usage(char* upname)

-    {
-        printf("WARNING: Not all these options are implemented! "\
-               "Read the source, Luke!\n");
-        printf("# %s usage:\n",upname);
-        printf("#   setfile -t TYPE -c CREA unix_data_file ...\n");
-        printf("#   dcat < apple_single_file > data_fork\n");
-        printf("#   rcat < apple_single_file > resource_fork\n");
-        printf("#   dcat apple_single_file ... > data_forks\n");
-        printf("#   rcat apple_single_file ... > resource_forks\n");
-        printf("#   rcat = s2d -r\n");
-        printf("#   dcat = s2d -d\n");
-        printf("#   s2d [ -i signature_dictionary ] file ... # replace file by (file.ext, file.ext)\n");
-    }/*usage*/
+{
+    printf("WARNING: Not all these options are implemented! "\
+           "Read the source, Luke!\n");
+    printf("# %s usage:\n",upname);
+    printf("#   setfile -t TYPE -c CREA unix_data_file ...\n");
+    printf("#   dcat < apple_single_file > data_fork\n");
+    printf("#   rcat < apple_single_file > resource_fork\n");
+    printf("#   dcat apple_single_file ... > data_forks\n");
+    printf("#   rcat apple_single_file ... > resource_forks\n");
+    printf("#   rcat = s2d -r\n");
+    printf("#   dcat = s2d -d\n");
+    printf("#   s2d [ -i signature_dictionary ] file ... # replace file by (file.ext, file.ext)\n");
+}/*usage*/


 #if 0
-    static void printerr(int err)
-    {
-        fprintf(stderr,"Error: %d\n",err);
-    }/*printerr*/
+static void printerr(int err)
+{
+    fprintf(stderr,"Error: %d\n",err);
+}/*printerr*/


-    static void MakeTempName(char*src,char*temp)
-    {
-        strcpy(temp,src);
-        strcat(temp,".lc[ ]");
-    }/*MakeTempName*/
+static void MakeTempName(char*src,char*temp)
+{
+    strcpy(temp,src);
+    strcat(temp,".lc[ ]");
+}/*MakeTempName*/
 #endif

-    static void basename(char* src,char* dst)
-    {
-        char*       lastslash;
-        char*       current;
+static void basename(char* src,char* dst)
+{
+    char*       lastslash;
+    char*       current;

-        current=src;
-        lastslash=src;
-        while((*current)!=0){
-            if((*current)=='/'){
-                current++;
-                lastslash=current;
-            }else{
-                current++;
-            }
-        }
-        while((*lastslash)!=0){
-            (*dst)=(*lastslash);
-            lastslash++;
-            dst++;
+    current=src;
+    lastslash=src;
+    while((*current)!=0){
+        if((*current)=='/'){
+            current++;
+            lastslash=current;
+        }else{
+            current++;
         }
+    }
+    while((*lastslash)!=0){
         (*dst)=(*lastslash);
-    }/*basename*/
+        lastslash++;
+        dst++;
+    }
+    (*dst)=(*lastslash);
+}/*basename*/


-    static int32 makeresourcefilename(char* data,char* rsrc)
-    {
-        char*       lastslash;
-        char*       start;
+static INT32 makeresourcefilename(char* data,char* rsrc)
+{
+    char*       lastslash;
+    char*       start;

-        start=rsrc;
-        lastslash=rsrc;
-        while((*data)!=0){
-            (*rsrc)=(*data);
-            rsrc++;
-            if((*data)=='/'){
-                lastslash=rsrc;
-            }
-            data++;
-        }
-        data-=(rsrc-lastslash);
-        rsrc=lastslash;
-        (*rsrc)='%';
+    start=rsrc;
+    lastslash=rsrc;
+    while((*data)!=0){
+        (*rsrc)=(*data);
         rsrc++;
-        while((*data)!=0){
-            (*rsrc)=(*data);
-            rsrc++;
-            data++;
+        if((*data)=='/'){
+            lastslash=rsrc;
         }
+        data++;
+    }
+    data-=(rsrc-lastslash);
+    rsrc=lastslash;
+    (*rsrc)='%';
+    rsrc++;
+    while((*data)!=0){
         (*rsrc)=(*data);
-        return(rsrc-start);
-    }/*makeresourcefilename*/
-
-
-    static char PrintingChar(int/*char*/ c)
-    {
-        if((' '<=c)&&(c<=0x7e)){
-            return(c);
-        }else{
-            return('?');
-        }
-    }/*PrintingChar*/
-
-
-    int main(int argc,char** argv)
-    {
-        int         err;
+        rsrc++;
+        data++;
+    }
+    (*rsrc)=(*data);
+    return((INT32)(rsrc-start));
+}/*makeresourcefilename*/
+
+
+static char PrintingChar(int/*char*/ c)
+{
+    if((' '<=c)&&(c<=0x7e)){
+        return((char)c);
+    }else{
+        return('?');
+    }
+}/*PrintingChar*/
+
+
+int main(int argc,char** argv)
+{
+    int         err;

-        struct stat filestatus;
+    struct stat filestatus;

-        FILE*   filefd;
-        FILE*   datafd;
-        FILE*   rsrcfd;
+    FILE*   filefd;
+    FILE*   datafd;
+    FILE*   rsrcfd;

-        char        rdestination[1024];
-        char        type[8];
-        int         i;
+    char        rdestination[1024];
+    char        type[8];
+    int         i;

-        basename(argv[0],rdestination);
-        if((strcmp(rdestination,"is")==0)&&(argc==2)){
-            filefd=fopen(argv[1],"r");
-            if(filefd==nil){
-                fprintf(stderr,"I cannot open %s.\n",argv[1]);
-                exit(2);
-            }
-            if(AppleSD_IsSingle(filefd)){
-                fclose(filefd);
-                exit(0);
-            }
+    basename(argv[0],rdestination);
+    if((strcmp(rdestination,"is")==0)&&(argc==2)){
+        filefd=fopen(argv[1],"r");
+        if(filefd==NIL){
+            fprintf(stderr,"I cannot open %s.\n",argv[1]);
+            exit(2);
+        }
+        if(AppleSD_IsSingle(filefd)){
             fclose(filefd);
-            exit(31);
-        }else if(strcmp(rdestination,"type")==0){
-            i=1;
-            while(i<argc){
-                filefd=fopen(argv[i],"r");
-                if(filefd==nil){
-                    fprintf(stderr,"I cannot open %s.\n",argv[i]);
-                }else{
-                    if(AppleSD_IsSingle(filefd)||AppleSD_IsDouble(filefd)){
-                        if(AppleSD_GetType(filefd,type)){
-                            printf("%c%c%c%c %s\n",PrintingChar(type[0]),PrintingChar(type[1]),PrintingChar(type[2]),PrintingChar(type[3]),argv[i]);
-                        }else{
-                            fprintf(stderr,"I cannot get type of %s.\n",argv[i]);
-                        }
+            exit(0);
+        }
+        fclose(filefd);
+        exit(31);
+    }else if(strcmp(rdestination,"type")==0){
+        i=1;
+        while(i<argc){
+            filefd=fopen(argv[i],"r");
+            if(filefd==NIL){
+                fprintf(stderr,"I cannot open %s.\n",argv[i]);
+            }else{
+                if(AppleSD_IsSingle(filefd)||AppleSD_IsDouble(filefd)){
+                    if(AppleSD_GetType(filefd,type)){
+                        printf("%c%c%c%c %s\n",PrintingChar(type[0]),PrintingChar(type[1]),PrintingChar(type[2]),PrintingChar(type[3]),argv[i]);
                     }else{
-                        printf("%s is not Apple-single nor Apple-double.\n",argv[i]);
+                        fprintf(stderr,"I cannot get type of %s.\n",argv[i]);
                     }
-                    fclose(filefd);
+                }else{
+                    printf("%s is not Apple-single nor Apple-double.\n",argv[i]);
                 }
-                i++;
+                fclose(filefd);
             }
-            exit(0);
-        }else if(strcmp(rdestination,"setfile")==0){
-            struct {
-                AppleSD_HeaderT     header;
-                AppleSD_EntryT      entries[16]; /* only one used.*/
-                FInfo               finfo;
-            }                   ffork;
-            char                fname[2048];
-
-            ffork.header.magic=AppleSD_Double_Magic;
-            ffork.header.version=AppleSD_Version_2;
-            ffork.header.filler[0]=0;
-            ffork.header.filler[1]=0;
-            ffork.header.filler[2]=0;
-            ffork.header.filler[3]=0;
-            ffork.header.entryCount=1;
-            ffork.entries[0].id=Segm_FinderInfo;
-            ffork.entries[0].offset=((int32)(&(ffork.finfo))-(int32)(&(ffork)));
-            ffork.entries[0].length=sizeof(ffork.finfo);
-            i=1;
-            while(i<16){
-                ffork.entries[i].id=0;
-                ffork.entries[i].offset=0;
-                ffork.entries[i].length=0;
+            i++;
+        }
+        exit(0);
+    }else if(strcmp(rdestination,"setfile")==0){
+        struct {
+            AppleSD_HeaderT     header;
+            AppleSD_EntryT      entries[16]; /* only one used.*/
+            FInfo               finfo;
+        }                   ffork;
+        char                fname[2048];
+
+        ffork.header.magic=AppleSD_Double_Magic;
+        ffork.header.version=AppleSD_Version_2;
+        ffork.header.filler[0]=0;
+        ffork.header.filler[1]=0;
+        ffork.header.filler[2]=0;
+        ffork.header.filler[3]=0;
+        ffork.header.entryCount=1;
+        ffork.entries[0].id=Segm_FinderInfo;
+        ffork.entries[0].offset=(INT32)((INTPTR)(&(ffork.finfo))-(INTPTR)(&(ffork)));
+        ffork.entries[0].length=sizeof(ffork.finfo);
+        i=1;
+        while(i<16){
+            ffork.entries[i].id=0;
+            ffork.entries[i].offset=0;
+            ffork.entries[i].length=0;
+            i++;
+        }
+        strncpy(ffork.finfo.fdType,"TEXT",4);
+        strncpy(ffork.finfo.fdCreator,"UNIX",4);
+        ffork.finfo.fdFlags=0;
+        ffork.finfo.fdLocation.h=0;
+        ffork.finfo.fdLocation.v=0;
+        ffork.finfo.fdFldr=0;
+        i=1;
+        while(i<argc){
+            if(strcmp(argv[i],"-t")==0){
                 i++;
-            }
-            strncpy(ffork.finfo.fdType,"TEXT",4);
-            strncpy(ffork.finfo.fdCreator,"UNIX",4);
-            ffork.finfo.fdFlags=0;
-            ffork.finfo.fdLocation.h=0;
-            ffork.finfo.fdLocation.v=0;
-            ffork.finfo.fdFldr=0;
-            i=1;
-            while(i<argc){
-                if(strcmp(argv[i],"-t")==0){
-                    i++;
-                    if(i<argc){
-                        ffork.finfo.fdType[0]=argv[i][0];
-                        ffork.finfo.fdType[1]=argv[i][1];
-                        ffork.finfo.fdType[2]=argv[i][2];
-                        ffork.finfo.fdType[3]=argv[i][3];
-                    }else{
-                        usage(argv[0]);
-                        exit(1);
-                    }
-                }else if(strcmp(argv[i],"-c")==0){
-                    i++;
-                    if(i<argc){
-                        ffork.finfo.fdCreator[0]=argv[i][0];
-                        ffork.finfo.fdCreator[1]=argv[i][1];
-                        ffork.finfo.fdCreator[2]=argv[i][2];
-                        ffork.finfo.fdCreator[3]=argv[i][3];
-                    }else{
-                        usage(argv[0]);
-                        exit(1);
-                    }
+                if(i<argc){
+                    ffork.finfo.fdType[0]=argv[i][0];
+                    ffork.finfo.fdType[1]=argv[i][1];
+                    ffork.finfo.fdType[2]=argv[i][2];
+                    ffork.finfo.fdType[3]=argv[i][3];
                 }else{
-                    int32   actual;
-
-                    makeresourcefilename(argv[i],fname);
-                    rsrcfd=fopen(fname,"w+");
-                    if(rsrcfd==nil){
-                        fprintf(stderr,"I cannot create '%s'.\n",fname);
-                        exit(16);
-                    }
-                    actual=fwrite(&ffork,1,sizeof(ffork),rsrcfd);
-                    if(actual!=sizeof(ffork)){
-                        exit(2);
-                    }
-                    fclose(rsrcfd);
+                    usage(argv[0]);
+                    exit(1);
                 }
+            }else if(strcmp(argv[i],"-c")==0){
                 i++;
+                if(i<argc){
+                    ffork.finfo.fdCreator[0]=argv[i][0];
+                    ffork.finfo.fdCreator[1]=argv[i][1];
+                    ffork.finfo.fdCreator[2]=argv[i][2];
+                    ffork.finfo.fdCreator[3]=argv[i][3];
+                }else{
+                    usage(argv[0]);
+                    exit(1);
+                }
+            }else{
+                INT32   actual;
+
+                makeresourcefilename(argv[i],fname);
+                rsrcfd=fopen(fname,"w+");
+                if(rsrcfd==NIL){
+                    fprintf(stderr,"I cannot create '%s'.\n",fname);
+                    exit(16);
+                }
+                actual=(INT32)fwrite(&ffork,1,sizeof(ffork),rsrcfd);
+                if(actual!=sizeof(ffork)){
+                    exit(2);
+                }
+                fclose(rsrcfd);
             }
-            exit(0);
+            i++;
         }
+        exit(0);
+    }

-        if(argc!=3){
-            usage(argv[0]);
-            exit(12);
-        }
+    if(argc!=3){
+        usage(argv[0]);
+        exit(12);
+    }

-        makeresourcefilename(argv[2],rdestination);
+    makeresourcefilename(argv[2],rdestination);

-        filefd=fopen(argv[1],"r");
-        if(filefd==nil){
-            fprintf(stderr,"I cannot open '%s'.\n",argv[1]);
-            exit(13);
-        }
-
-        if(!AppleSD_IsSingle(filefd)){
-            fclose(filefd);
-            exit(0);
-        }
-
-        datafd=fopen(argv[2],"r");
-        if(datafd!=nil){
-            printf("file '%s' already exists.",argv[2]);
-            fclose(filefd);
-            fclose(datafd);
-            exit(14);
-        }
-        datafd=fopen(argv[2],"w+");
-        if(datafd==nil){
-            fprintf(stderr,"I cannot create '%s'.\n",argv[2]);
-            fclose(filefd);
-            exit(15);
-        }
+    filefd=fopen(argv[1],"r");
+    if(filefd==NIL){
+        fprintf(stderr,"I cannot open '%s'.\n",argv[1]);
+        exit(13);
+    }

-        rsrcfd=fopen(rdestination,"w+");
-        if(rsrcfd==nil){
-            fprintf(stderr,"I cannot create '%s'.\n", rdestination);
-            fclose(datafd);
-            fclose(filefd);
-            exit(16);
-        }
+    if(!AppleSD_IsSingle(filefd)){
+        fclose(filefd);
+        exit(0);
+    }

-        AppleSD_Single_to_Double(filefd,datafd,rsrcfd);
+    datafd=fopen(argv[2],"r");
+    if(datafd!=NIL){
+        printf("file '%s' already exists.",argv[2]);
+        fclose(filefd);
+        fclose(datafd);
+        exit(14);
+    }
+    datafd=fopen(argv[2],"w+");
+    if(datafd==NIL){
+        fprintf(stderr,"I cannot create '%s'.\n",argv[2]);
+        fclose(filefd);
+        exit(15);
+    }

+    rsrcfd=fopen(rdestination,"w+");
+    if(rsrcfd==NIL){
+        fprintf(stderr,"I cannot create '%s'.\n", rdestination);
         fclose(datafd);
-        fclose(rsrcfd);
         fclose(filefd);
+        exit(16);
+    }
+
+    AppleSD_Single_to_Double(filefd,datafd,rsrcfd);

-        err=stat(argv[1],&filestatus);
-        if(err==0){
-            chown(argv[2],filestatus.st_uid,filestatus.st_gid);
-            chmod(argv[2],(mode_t)(filestatus.st_mode));
-            chown(rdestination,filestatus.st_uid,filestatus.st_gid);
-            chmod(rdestination,(mode_t)(filestatus.st_mode));
-        }
+    fclose(datafd);
+    fclose(rsrcfd);
+    fclose(filefd);
+
+    err=stat(argv[1],&filestatus);
+    if(err==0){
+        int r;
+        r=chown(argv[2],filestatus.st_uid,filestatus.st_gid);
+        chmod(argv[2],(mode_t)(filestatus.st_mode));
+        r=chown(rdestination,filestatus.st_uid,filestatus.st_gid);
+        chmod(rdestination,(mode_t)(filestatus.st_mode));
+        (void)r;
+    }

-        exit(0);
-    }/*main*/
+    exit(0);
+}/*main*/



 /*
-    setfile -t TYPE -c CREA unix_data_file ...
-        create a file named '%unix_data_file' with the signature and type.
-    dcat < apple_single_file > data_fork
-    rcat < apple_single_file > resource_fork
-    dcat apple_single_file ... > data_forks
-    rcat apple_single_file ... > resource_forks
-    rcat = s2d -r
-    dcat = s2d -d
-    s2d [ -i signature_dictionary ] file ...
-            # replace file by (file.ext,%file.ext)
-    signature_dictionary file format
-        sig_file    ::= line
-        sig_file    ::= line sig_file
-        line        ::= signature <.> extension <RC>
-        signature   ::= <'> <caractere> <caractere> <caractere> <caractere> <'>
-        signature   ::= hexa hexa hexa hexa hexa hexa hexa hexa
-        hexa        ::= <0|1>|<2>|<3>|<4>|<5>|<6>|<7>|<8>|<9>|<A>|<B>|<C>|<D>|<E>|<F>
-        extension   ::= <caractere>
-        extension   ::= <caractere> | extension
-
-
-    printf("# %s usage:\n",pname);
-    printf("#   setfile -t TYPE -c CREA unix_data_file ...\n");
-    printf("#   dcat < apple_single_file > data_fork\n");
-    printf("#   rcat < apple_single_file > resource_fork\n");
-    printf("#   dcat apple_single_file ... > data_forks\n");
-    printf("#   rcat apple_single_file ... > resource_forks\n");
-    printf("#   rcat = s2d -r\n");
-    printf("#   dcat = s2d -d\n");
-    printf("#   s2d [ -i signature_dictionary ] file ... # replace file by (file.ext, %file.ext)\n");
+  setfile -t TYPE -c CREA unix_data_file ...
+  create a file named '%unix_data_file' with the signature and type.
+  dcat < apple_single_file > data_fork
+  rcat < apple_single_file > resource_fork
+  dcat apple_single_file ... > data_forks
+  rcat apple_single_file ... > resource_forks
+  rcat = s2d -r
+  dcat = s2d -d
+  s2d [ -i signature_dictionary ] file ...
+  # replace file by (file.ext,%file.ext)
+  signature_dictionary file format
+  sig_file    ::= line
+  sig_file    ::= line sig_file
+  line        ::= signature <.> extension <RC>
+  signature   ::= <'> <caractere> <caractere> <caractere> <caractere> <'>
+  signature   ::= hexa hexa hexa hexa hexa hexa hexa hexa
+  hexa        ::= <0|1>|<2>|<3>|<4>|<5>|<6>|<7>|<8>|<9>|<A>|<B>|<C>|<D>|<E>|<F>
+  extension   ::= <caractere>
+  extension   ::= <caractere> | extension
+
+
+  printf("# %s usage:\n",pname);
+  printf("#   setfile -t TYPE -c CREA unix_data_file ...\n");
+  printf("#   dcat < apple_single_file > data_fork\n");
+  printf("#   rcat < apple_single_file > resource_fork\n");
+  printf("#   dcat apple_single_file ... > data_forks\n");
+  printf("#   rcat apple_single_file ... > resource_forks\n");
+  printf("#   rcat = s2d -r\n");
+  printf("#   dcat = s2d -d\n");
+  printf("#   s2d [ -i signature_dictionary ] file ... # replace file by (file.ext, %file.ext)\n");

 */



-/*** s2d.c                            --                     --          ***/
+/**** THE END ****/
diff --git a/geturls/sources/geturls.c b/geturls/sources/geturls.c
index e637043..d42b00c 100644
--- a/geturls/sources/geturls.c
+++ b/geturls/sources/geturls.c
@@ -22,7 +22,7 @@ MODIFICATIONS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1998 - 1998
+    Copyright Pascal Bourguignon 1998 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -46,80 +46,80 @@ LEGAL
 #include <limits.h>


-    const char* starts[]={
-        "ftp://",
-        "http://",
-        "https://",
-        "mailto:",
-        "news:",
-        "telnet:",
-        0};
+const char* starts[]={
+    "ftp://",
+    "http://",
+    "https://",
+    "mailto:",
+    "news:",
+    "telnet:",
+    0};

-    static int isUrlChar(int/*char*/ token)
-    {
-        return((' '<token)&&(token<='~')
-            &&(token!=',')&&(token!='<')&&(token!='>'));
-    }/*isUrlChar*/
+static int isUrlChar(int/*char*/ token)
+{
+    return((' '<token)&&(token<='~')
+           &&(token!=',')&&(token!='<')&&(token!='>'));
+}/*isUrlChar*/


-    static int  numOfEntries;
-    static int  maxLength;
-    static int* lengths;
+static int  numOfEntries;
+static int  maxLength;
+static int* lengths;

-    static void deallocStringArray(char** strings)
-    {
-        int i;
-        if(strings!=0){
-            i=0;
-            while(strings[i]!=0){
-                free(strings[i]);
-                i++;
-            }
-            free(strings);
+static void deallocStringArray(char** strings)
+{
+    int i;
+    if(strings!=0){
+        i=0;
+        while(strings[i]!=0){
+            free(strings[i]);
+            i++;
         }
-    }/*deallocStringArray*/
+        free(strings);
+    }
+}/*deallocStringArray*/


-    static int maximumOfIntArray(const int integers[],int size)
-    {
-        int maximum=0;
-        int i;
-        for(i=0;i<size;i++){
-            if(maximum<integers[i]){
-                maximum=integers[i];
-            }
+static int maximumOfIntArray(const int integers[],int size)
+{
+    int maximum=0;
+    int i;
+    for(i=0;i<size;i++){
+        if(maximum<integers[i]){
+            maximum=integers[i];
         }
-        return(maximum);
-    }/*maximumOfIntArray*/
+    }
+    return(maximum);
+}/*maximumOfIntArray*/


-    static int  sizeOfStringArray(const char* strings[])
-    {
-        int n;
-        n=0;
-        while(strings[n]!=0){
-            n++;
-        }
-        return(n);
-    }/*sizeOfStringArray*/
+static int  sizeOfStringArray(const char* strings[])
+{
+    int n;
+    n=0;
+    while(strings[n]!=0){
+        n++;
+    }
+    return(n);
+}/*sizeOfStringArray*/


-    static int* computeLengths(const char* strings[])
-    {
-        int* lens;
-        int i;
-        int n=sizeOfStringArray(strings);
-        lens=(int*)malloc(sizeof(int)*n);
-        for(i=0;i<n;i++){
-            lens[i]=strlen(strings[i]);
-        }
-        return(lens);
-    }/*computeLengths*/
+static int* computeLengths(const char* strings[])
+{
+    int* lens;
+    int i;
+    int n=sizeOfStringArray(strings);
+    lens=(int*)malloc(sizeof(int)*(size_t)n);
+    for(i=0;i<n;i++){
+        lens[i]=(int)strlen(strings[i]);
+    }
+    return(lens);
+}/*computeLengths*/


-    static void printHeader(FILE* out)
-    {
-        fprintf(out,
+static void printHeader(FILE* out)
+{
+    fprintf(out,
             "<html>\n"
             "<body>\n"
             "<bookmarkInfo scrollbarPercentage=0 annotationHeight=168>\n"
@@ -127,144 +127,143 @@ LEGAL
             "<li><a>URLs</a>\n"
             "<ul>\n"
             );
-    }/*printHeader*/
+}/*printHeader*/


-    static void printUrls(FILE* out,char** urls)
-    {
-        if(urls!=0){
-            int i=0;
-            while(urls[i]!=0){
-                fprintf(stderr,"%s\n",urls[i]);
-                fprintf(out,
+static void printUrls(FILE* out,char** urls)
+{
+    if(urls!=0){
+        int i=0;
+        while(urls[i]!=0){
+            fprintf(stderr,"%s\n",urls[i]);
+            fprintf(out,
                     "<li><a href=\"%s\" checkFrequency=never>%s</a>\n",
                     urls[i],urls[i]);
-                i++;
-            }
+            i++;
         }
-    }/*printUrls*/
+    }
+}/*printUrls*/


-    static void printTrailer(FILE* out)
-    {
-        fprintf(out,
+static void printTrailer(FILE* out)
+{
+    fprintf(out,
             "</ul>\n"
             "</ul>\n"
             "</body>\n"
             "</html>\n"
             );
-    }/*printTrailer*/
+}/*printTrailer*/


-    static void addUrl(char*** urls,int* allocatedUrls,int* numOfUrls,
-            const char* url,int lengthOfUrl)
-    {
-        if((*urls)==0){
-            (*allocatedUrls)=8;
-            (*urls)=(char**)malloc(sizeof(char*)*(*allocatedUrls));
-        }
-        if((*allocatedUrls)<=(*numOfUrls)+1){
-            int i;
-            char** oldUrls=(*urls);
-            (*allocatedUrls)*=2;
-            (*urls)=(char**)malloc(sizeof(char*)*(*allocatedUrls));
-            for(i=0;i<(*numOfUrls);i++){
-                (*urls)[i]=oldUrls[i];
-            }
-            free(oldUrls);
+static void addUrl(char*** urls,int* allocatedUrls,int* numOfUrls,
+                   const char* url,int lengthOfUrl)
+{
+    if((*urls)==0){
+        (*allocatedUrls)=8;
+        (*urls)=(char**)malloc(sizeof(char*)*(size_t)(*allocatedUrls));
+    }
+    if((*allocatedUrls)<=(*numOfUrls)+1){
+        int i;
+        char** oldUrls=(*urls);
+        (*allocatedUrls)*=2;
+        (*urls)=(char**)malloc(sizeof(char*)*(size_t)(*allocatedUrls));
+        for(i=0;i<(*numOfUrls);i++){
+            (*urls)[i]=oldUrls[i];
         }
-        (*urls)[(*numOfUrls)]=(char*)malloc(sizeof(char)*(lengthOfUrl+1));
-        strncpy((*urls)[(*numOfUrls)],url,(unsigned)lengthOfUrl);
-        (*urls)[(*numOfUrls)][lengthOfUrl]='\0';
-        (*numOfUrls)++;
-        (*urls)[(*numOfUrls)]=0;
-    }/*addUrl*/
+        free(oldUrls);
+    }
+    (*urls)[(*numOfUrls)]=(char*)malloc(sizeof(char)*(size_t)(lengthOfUrl+1));
+    strncpy((*urls)[(*numOfUrls)],url,(unsigned)lengthOfUrl);
+    (*urls)[(*numOfUrls)][lengthOfUrl]='\0';
+    (*numOfUrls)++;
+    (*urls)[(*numOfUrls)]=0;
+}/*addUrl*/


-    static char** searchUrlsInBuffer(const char* buffer,
-                                           int size,int* scannedSize)
-    {
-        char** urls=0;
-        int    allocatedUrls=0;
-        int    numOfUrls=0;
-        int    i=0;
-        int    max=size-maxLength;
+static char** searchUrlsInBuffer(const char* buffer,
+                                 int size,int* scannedSize)
+{
+    char** urls=0;
+    int    allocatedUrls=0;
+    int    numOfUrls=0;
+    int    i=0;
+    int    max=size-maxLength;

-        while(i<max){
-            int s=0;
-            while((s<numOfEntries)
-            &&(strncmp(buffer+i,starts[s],(unsigned)(lengths[s]))!=0)){
-                s++;
+    while(i<max){
+        int s=0;
+        while((s<numOfEntries)
+              &&(strncmp(buffer+i,starts[s],(unsigned)(lengths[s]))!=0)){
+            s++;
+        }
+        if(s<numOfEntries){
+            int l=i;
+            while((l<size)&&(isUrlChar(buffer[l]))){
+                l++;
             }
-            if(s<numOfEntries){
-                int l=i;
-                while((l<size)&&(isUrlChar(buffer[l]))){
-                    l++;
-                }
-                if(l<size){
-                    addUrl(&urls,&allocatedUrls,&numOfUrls,buffer+i,l-i);
-                    i=l;
-                }else{
-                    (*scannedSize)=i;
-                    return(urls);
-                }
+            if(l<size){
+                addUrl(&urls,&allocatedUrls,&numOfUrls,buffer+i,l-i);
+                i=l;
             }else{
-                i++;
+                (*scannedSize)=i;
+                return(urls);
             }
+        }else{
+            i++;
         }
-        (*scannedSize)=i;
-        return(urls);
-    }/*searchUrlsInBuffer*/
+    }
+    (*scannedSize)=i;
+    return(urls);
+}/*searchUrlsInBuffer*/


-    static void filterUrls(FILE* in,FILE* out)
-    {
-        const size_t  BufferSize=10240;
-        char*         inputBuffer=(char*)malloc(sizeof(char)*(BufferSize+1));
-        size_t        readSize;
-        int           inputBufferSize=0;
-        int           scannedSize;
-        char**        urls;
+static void filterUrls(FILE* in,FILE* out)
+{
+    const size_t  BufferSize=10240;
+    char*         inputBuffer=(char*)malloc(sizeof(char)*(BufferSize+1));
+    int           readSize;
+    int           inputBufferSize=0;
+    int           scannedSize;
+    char**        urls;

-        lengths=computeLengths(starts);
-        numOfEntries=sizeOfStringArray(starts);
-        maxLength=maximumOfIntArray(lengths,numOfEntries);
+    lengths=computeLengths(starts);
+    numOfEntries=sizeOfStringArray(starts);
+    maxLength=maximumOfIntArray(lengths,numOfEntries);

-        printHeader(out);
-        while(!feof(in)){
-            readSize=fread(inputBuffer+inputBufferSize,
-                        sizeof(char),BufferSize-inputBufferSize,in);
-            if(readSize>0){
-                inputBufferSize+=readSize;
-                urls=searchUrlsInBuffer(inputBuffer,inputBufferSize,
-                        &scannedSize);
-                printUrls(out,urls);
-                deallocStringArray(urls);
-                if((maxLength<=inputBufferSize)
-                &&(inputBufferSize-maxLength<scannedSize)){
-                    scannedSize=inputBufferSize-maxLength;
-                }
-                if(scannedSize<inputBufferSize){
-                    memcpy(inputBuffer,inputBuffer+scannedSize,
-                            (unsigned)(inputBufferSize-scannedSize));
-                    inputBufferSize=inputBufferSize-scannedSize;
-                }else{
-                    inputBufferSize=0;
-                }
-            }
-        }
-        if(0<inputBufferSize){
-            inputBuffer[inputBufferSize]='\0';
-            inputBufferSize++;
+    printHeader(out);
+    while(!feof(in)){
+        readSize=(int)fread(inputBuffer+inputBufferSize,sizeof(char),(size_t)((int)BufferSize-inputBufferSize),in);
+        if(readSize>0){
+            inputBufferSize+=(int)readSize;
             urls=searchUrlsInBuffer(inputBuffer,inputBufferSize,
                                     &scannedSize);
             printUrls(out,urls);
             deallocStringArray(urls);
-        }
-        printTrailer(out);
-        free(inputBuffer);
-        free(lengths);
-    }/*filterUrls*/
+            if((maxLength<=inputBufferSize)
+               &&(inputBufferSize-maxLength<scannedSize)){
+                scannedSize=inputBufferSize-maxLength;
+            }
+            if(scannedSize<inputBufferSize){
+                memcpy(inputBuffer,inputBuffer+scannedSize,
+                       (unsigned)(inputBufferSize-scannedSize));
+                inputBufferSize=inputBufferSize-scannedSize;
+            }else{
+                inputBufferSize=0;
+            }
+        }
+    }
+    if(0<inputBufferSize){
+        inputBuffer[inputBufferSize]='\0';
+        inputBufferSize++;
+        urls=searchUrlsInBuffer(inputBuffer,inputBufferSize,
+                                &scannedSize);
+        printUrls(out,urls);
+        deallocStringArray(urls);
+    }
+    printTrailer(out);
+    free(inputBuffer);
+    free(lengths);
+}/*filterUrls*/

 int main(void)
 {
@@ -273,4 +272,4 @@ int main(void)
     return(0);
 }/*main*/

-/*** geturls.c                        -- 2003-12-02 11:52:12 -- pascal   ***/
+/**** THE END ****/
diff --git a/line-utilities/sources/arguments.c b/line-utilities/sources/arguments.c
index fe79767..d8f2987 100644
--- a/line-utilities/sources/arguments.c
+++ b/line-utilities/sources/arguments.c
@@ -12,7 +12,7 @@ MODIFICATIONS
 BUGS
     Please report them to <pjb@informatimago.com>
 LEGAL
-    Copyright Pascal J. Bourguignon 2000 - 2000
+    Copyright Pascal J. Bourguignon 2000 - 2011

     GPL
     This file is part of the lgetvalue utility.
diff --git a/line-utilities/sources/arguments.h b/line-utilities/sources/arguments.h
index 9a1bc7e..0b052a6 100644
--- a/line-utilities/sources/arguments.h
+++ b/line-utilities/sources/arguments.h
@@ -12,7 +12,7 @@ MODIFICATIONS
 BUGS
     Please report them to <pjb@informatimago.com>
 LEGAL
-    Copyright Pascal J. Bourguignon 2000 - 2000
+    Copyright Pascal J. Bourguignon 2000 - 2011

     GPL
     This file is part of the lgetvalue utility.
diff --git a/line-utilities/sources/fdiff.c b/line-utilities/sources/fdiff.c
index 3c72af4..420c46c 100644
--- a/line-utilities/sources/fdiff.c
+++ b/line-utilities/sources/fdiff.c
@@ -22,7 +22,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 2003 - 2003
+    Copyright Pascal Bourguignon 2003 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -65,7 +65,7 @@ LEGAL
         char buffer2[BUFFER_SIZE];
         char key1[BUFFER_SIZE];
         char key2[BUFFER_SIZE];
-        short success;
+        int success;

         success=(NULL!=fgets(buffer1,BUFFER_SIZE,file1));
         success&=(NULL!=fgets(buffer2,BUFFER_SIZE,file2));
diff --git a/line-utilities/sources/fields.c b/line-utilities/sources/fields.c
index ff478c6..aa2f42f 100644
--- a/line-utilities/sources/fields.c
+++ b/line-utilities/sources/fields.c
@@ -12,7 +12,7 @@ MODIFICATIONS
 BUGS
     Please report them to <pjb@informatimago.com>
 LEGAL
-    Copyright Pascal J. Bourguignon 2000 - 2000
+    Copyright Pascal J. Bourguignon 2000 - 2011

     GPL
     This file is part of the lgetvalue utility.
@@ -44,8 +44,8 @@ LEGAL
         if(field_index<=0){
             strcpy(field,record);
         }else{
-            unsigned int start=0;
-            unsigned int stop=0;
+            size_t start=0;
+            size_t stop=0;
             while(0<field_index){
                 const char* separator;
                 field_index--;
@@ -53,7 +53,7 @@ LEGAL
                 if(separator==NULL){
                     stop=strlen(record);
                 }else{
-                    stop=separator-record;
+                    stop=(size_t)(separator-record);
                 }
                 start=stop+1;
             }
diff --git a/line-utilities/sources/fields.h b/line-utilities/sources/fields.h
index 2b0fed7..febe33f 100644
--- a/line-utilities/sources/fields.h
+++ b/line-utilities/sources/fields.h
@@ -12,7 +12,7 @@ MODIFICATIONS
 BUGS
     Please report them to <pjb@informatimago.com>
 LEGAL
-    Copyright Pascal J. Bourguignon 2000 - 2000
+    Copyright Pascal J. Bourguignon 2000 - 2011

     GPL
     This file is part of the lgetvalue utility.
diff --git a/line-utilities/sources/lcat.c b/line-utilities/sources/lcat.c
index 9c54cd2..17e2305 100644
--- a/line-utilities/sources/lcat.c
+++ b/line-utilities/sources/lcat.c
@@ -30,7 +30,7 @@ MODIFICATIONS
 BUGS
     lines from input file may be no longer than 4*BUFSIZ.
 LEGAL
-    Copyright Pascal J. Bourguignon 1993 - 1993
+    Copyright Pascal J. Bourguignon 1993 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
@@ -53,19 +53,19 @@ LEGAL

 int main(int argc,char** argv)
 {
-        int             i;
-        int             ffirst;
-        int             flast;
-        int             ocount;
-        typedef struct {
-            FILE*           file;
-            char            dosep;
-            char            separator;
-        }               FDescT;
-        FDescT*         input;
-        char            buffer[linesize];
+    int             i;
+    int             ffirst;
+    int             flast;
+    int             ocount;
+    typedef struct {
+        FILE*           file;
+        char            dosep;
+        char            separator;
+    }               FDescT;
+    FDescT*         input;
+    char            buffer[linesize];

-    input=malloc(sizeof(FDescT)*(argc+1));
+    input=malloc(sizeof(FDescT)*(size_t)(argc+1));
     if(input==NULL){
         sprintf(buffer,"%s fatal error: allocating argument descriptors:",
                 argv[0]);
@@ -137,7 +137,7 @@ int main(int argc,char** argv)
                     input[i].file=NULL;
                     ocount--;
                 }else{
-                    int l=strlen(buffer);
+                    size_t l=strlen(buffer);
                     if(buffer[l-1]=='\n'){
                         buffer[l-1]='\0';
                     }
diff --git a/line-utilities/sources/ldiff.c b/line-utilities/sources/ldiff.c
index e37dd15..fd10ae6 100644
--- a/line-utilities/sources/ldiff.c
+++ b/line-utilities/sources/ldiff.c
@@ -20,7 +20,7 @@ MODIFICATIONS
 LEGAL
     GPL

-    Copyright Pascal J. Bourguignon 1992 - 2005
+    Copyright Pascal J. Bourguignon 1992 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
diff --git a/line-utilities/sources/lgetvalue.c b/line-utilities/sources/lgetvalue.c
index 4daa04a..cf66474 100644
--- a/line-utilities/sources/lgetvalue.c
+++ b/line-utilities/sources/lgetvalue.c
@@ -26,7 +26,7 @@ MODIFICATIONS
 BUGS
     Please report them to <pjb@informatimago.com>
 LEGAL
-    Copyright Pascal J. Bourguignon 2000 - 2000
+    Copyright Pascal J. Bourguignon 2000 - 2011

     GPL
     This file is part of the lgetvalue utility.
@@ -76,7 +76,7 @@ LEGAL
         char buffer2[BUFFER_SIZE];
         char key[BUFFER_SIZE];
         char value[BUFFER_SIZE];
-        short success;
+        int success;

 #ifdef DEBUG
         fprintf(stderr,"FS=\"%c\"; KF=%d; VF=%d;\n",
@@ -135,7 +135,7 @@ LEGAL

     void usage(const char* pname)
     {
-        int plen=strlen(pname);
+        size_t plen=strlen(pname);
         fprintf(stderr,"%s usage:\n",pname);
         fprintf(stderr,
                 "  %s [-h|--help|--field-separator=C|-tC\n"\
@@ -144,7 +144,7 @@ LEGAL
                 "\n"\
                 " The default separator is '|', the default key position is 1,"\
                 " and the default value position is 2 (counting from 1).\n",
-                pname,plen," ",plen," ");
+                pname,(int)plen," ",(int)plen," ");
     }/*usage*/


diff --git a/line-utilities/sources/lines.c b/line-utilities/sources/lines.c
index 65b9835..204d091 100644
--- a/line-utilities/sources/lines.c
+++ b/line-utilities/sources/lines.c
@@ -13,7 +13,7 @@ BUGS
     Please report them to <pjb@informatimago.com>
     - Implementation of write_string is shamefull.
 LEGAL
-    Copyright Pascal J. Bourguignon 2000 - 2000
+    Copyright Pascal J. Bourguignon 2000 - 2011

     GPL
     This file is part of the lgetvalue utility.
@@ -57,7 +57,7 @@ LEGAL

     void chop_nl(char* line)
     {
-        int i=strlen(line);
+        size_t i=strlen(line);
         while((i>0)&&((line[i-1]=='\n')||(line[i-1]=='\r'))){
             i--;
         }
diff --git a/line-utilities/sources/lines.h b/line-utilities/sources/lines.h
index 00e9c82..eac1dcc 100644
--- a/line-utilities/sources/lines.h
+++ b/line-utilities/sources/lines.h
@@ -13,7 +13,7 @@ BUGS
     Please report them to <pjb@informatimago.com>
     - Implementation of write_string is shamefull.
 LEGAL
-    Copyright Pascal J. Bourguignon 2000 - 2000
+    Copyright Pascal J. Bourguignon 2000 - 2011

     GPL
     This file is part of the lgetvalue utility.
diff --git a/line-utilities/sources/lmax.c b/line-utilities/sources/lmax.c
index e7bcd95..a180217 100644
--- a/line-utilities/sources/lmax.c
+++ b/line-utilities/sources/lmax.c
@@ -18,7 +18,7 @@ MODIFICATIONS
 BUGS
     lines from input file may be no longer than 4*BUFSIZ.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 1995
+    Copyright Pascal J. Bourguignon 1995 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
@@ -28,60 +28,68 @@ LEGAL
 #include <stdio.h>
 #include <stdlib.h>

-    static void usage(char* name)
-    {
-        printf("%s usage:\n\t%s  limit\n",name,name);
-    }/*usage;*/
+static void usage(char* name)
+{
+    printf("%s usage:\n\t%s  limit\n",name,name);
+}/*usage;*/

 #define linesize    (4*BUFSIZ)

-    static int lmax(FILE* file,int limit)
-    {
-            char            buffer[linesize];
-            int             result;
-            int             len;
+static void check_error(void* res){
+    if(res==0){
+        perror("got an error");
+        exit(1);
+    }
+}
+
+
+static int lmax(FILE* file,int limit)
+{
+    char            buffer[linesize];
+    int             result;
+    size_t          len;

-        result=0;
-        while(!feof(file)){
-            fgets(buffer,linesize,file);
-            len=strlen(buffer);
-            if(len<=limit){
-                while((!feof(file))&&(len<=limit)){
-                    fgets(buffer,linesize,file);
-                    len=strlen(buffer);
-                }
-                if(feof(file)){
-                    return(0);
-                }else{
-                    while(!feof(file)){
-                        fgets(buffer,linesize,file);
-                    }
-                    return(1);
-                }
+    result=0;
+    while(!feof(file)){
+        check_error(fgets(buffer,linesize,file));
+        len=strlen(buffer);
+        if(len<=limit){
+            while((!feof(file))&&(len<=limit)){
+                check_error(fgets(buffer,linesize,file));
+                len=strlen(buffer);
+            }
+            if(feof(file)){
+                return(0);
             }else{
-                while((!feof(file))&&(len>limit)){
-                    fgets(buffer,linesize,file);
-                    len=strlen(buffer);
+                while(!feof(file)){
+                    check_error(fgets(buffer,linesize,file));
                 }
-                if(feof(file)){
-                    return(2);
-                }else{
-                    while(!feof(file)){
-                        fgets(buffer,linesize,file);
-                    }
-                    return(1);
+                return(1);
+            }
+        }else{
+            while((!feof(file))&&(len>limit)){
+                check_error(fgets(buffer,linesize,file));
+                len=strlen(buffer);
+            }
+            if(feof(file)){
+                return(2);
+            }else{
+                while(!feof(file)){
+                    check_error(fgets(buffer,linesize,file));
                 }
+                return(1);
             }
         }
-        return(result);
-    }/*lmax*/
+    }
+    return(result);
+}/*lmax*/


 int main(int argc,char** argv)
 {
-        int             i;
-        int             limit=0;
-        int             (*test)(FILE*,int);
+    int             i;
+    int             limit=0;
+    int             (*test)(FILE*,int);

     i=1;
     while(i<argc){
diff --git a/line-utilities/sources/lrev.c b/line-utilities/sources/lrev.c
index 2eb3fde..0200784 100644
--- a/line-utilities/sources/lrev.c
+++ b/line-utilities/sources/lrev.c
@@ -14,7 +14,7 @@ AUTHORS
 MODIFICATIONS
     1995/10/11 <PJB> Creation.
 LEGAL
-    Copyright Pascal J. Bourguignon 1995 - 1995
+    Copyright Pascal J. Bourguignon 1995 - 2011
     All rights reserved.
     This program or any part of it may not be included in any commercial
     product without the author written permission. It may be used freely for
diff --git a/mpa/sources/make-person-aliases.c b/mpa/sources/make-person-aliases.c
index 71be413..a89253e 100644
--- a/mpa/sources/make-person-aliases.c
+++ b/mpa/sources/make-person-aliases.c
@@ -28,7 +28,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1995 - 1996
+    Copyright Pascal Bourguignon 1995 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -50,519 +50,518 @@ LEGAL
 #include <string.h>
 #include <ctype.h>

-    static char*        pname;
+static char*        pname;


-    static char* newstr(const char* str)
-    {
-        char* result=malloc(strlen(str)+1);
-        strcpy(result,str);
-        return(result);
-    }
+static char* newstr(const char* str)
+{
+    char* result=malloc(strlen(str)+1);
+    strcpy(result,str);
+    return(result);
+}

-    static const char* cseparators[]={"","-","_",".",0};
-    static char* separators[sizeof(cseparators)/sizeof(char*)];
-    static void init_separators(void)
-    {
-        unsigned int i;
-        for(i=0;cseparators[i];i++){
-            separators[i]=newstr(cseparators[i]);
-        }
-        separators[i]=0;
+static const char* cseparators[]={"","-","_",".",0};
+static char* separators[sizeof(cseparators)/sizeof(char*)];
+static void init_separators(void)
+{
+    unsigned int i;
+    for(i=0;cseparators[i];i++){
+        separators[i]=newstr(cseparators[i]);
     }
+    separators[i]=0;
+}


-    static void usage(const char* upname)
-    {
-        fprintf(stderr,
+static void usage(const char* upname)
+{
+    fprintf(stderr,
             "Usage: %s Firstname Secondname ... Lastname : username\n",
             upname);
-    }/*usage*/
+}/*usage*/



-    static void* checkmalloc(unsigned int size)
-    {
-        void* b=malloc(size);
-        if(b==NULL){
-            perror(pname);
-            exit(1);
-        }
-        return(b);
-    }/*checkmalloc*/
+static void* checkmalloc(size_t size)
+{
+    void* b=malloc(size);
+    if(b==NULL){
+        perror(pname);
+        exit(1);
+    }
+    return(b);
+}/*checkmalloc*/


 /* list of string data type: */

-    typedef struct string {
-        char*       string;
-        struct string*  next;
-    }               string_t;
-    typedef struct {
-        string_t*       head;
-        string_t*       tail;
-        int             count;
-    }               string_list_t;
+typedef struct string {
+    char*       string;
+    struct string*  next;
+}               string_t;
+typedef struct {
+    string_t*       head;
+    string_t*       tail;
+    int             count;
+}               string_list_t;


-    static string_list_t* string_list_new(void)
-    {
-            string_list_t*  list;
-        list=(string_list_t*)checkmalloc(sizeof(string_list_t));
-        list->head=NULL;
-        list->tail=NULL;
-        list->count=0;
-        return(list);
-    }/*string_list_new*/
+static string_list_t* string_list_new(void)
+{
+    string_list_t*  list;
+    list=(string_list_t*)checkmalloc(sizeof(string_list_t));
+    list->head=NULL;
+    list->tail=NULL;
+    list->count=0;
+    return(list);
+}/*string_list_new*/


-    static void string_list_addstring(string_list_t* list,char* string)
-    {
-            string_t*   node;
-        node=(string_t*)checkmalloc(sizeof(string_t));
-        node->string=string;
-        node->next=NULL;
-        if(list->tail==NULL){
-            list->head=node;
-        }else{
-            list->tail->next=node;
-        }
-        list->tail=node;
-        list->count++;
-    }/*string_list_addstring*/
+static void string_list_addstring(string_list_t* list,char* string)
+{
+    string_t*   node;
+    node=(string_t*)checkmalloc(sizeof(string_t));
+    node->string=string;
+    node->next=NULL;
+    if(list->tail==NULL){
+        list->head=node;
+    }else{
+        list->tail->next=node;
+    }
+    list->tail=node;
+    list->count++;
+}/*string_list_addstring*/


 #if 0
-    static void string_list_print(string_list_t* list)
-    {
-            string_t*   node;
-        node=list->head;
-        while(node!=NULL){
-            printf("%s\n",node->string);
-            node=node->next;
-        }
-    }/*string_list_print*/
+static void string_list_print(string_list_t* list)
+{
+    string_t*   node;
+    node=list->head;
+    while(node!=NULL){
+        printf("%s\n",node->string);
+        node=node->next;
+    }
+}/*string_list_print*/
 #endif

-    static char** string_list_to_vector(string_list_t* list)
-    {
-            char**      vector;
-            int         i;
-            string_t*   node;
+static char** string_list_to_vector(string_list_t* list)
+{
+    char**      vector;
+    int         i;
+    string_t*   node;

-        vector=(char**)checkmalloc(sizeof(char*)*(list->count+1));
-        for(i=0,node=list->head;i<list->count;i++,node=node->next){
-            vector[i]=node->string;
-        }
-        vector[i]=NULL;
-        return(vector);
-    }/*string_list_to_vector*/
+    vector=(char**)checkmalloc((sizeof(char*)*(size_t)(list->count+1)));
+    for(i=0,node=list->head;i<list->count;i++,node=node->next){
+        vector[i]=node->string;
+    }
+    vector[i]=NULL;
+    return(vector);
+}/*string_list_to_vector*/


-    static int string_list_count(string_list_t* list)
-    {
-        return(list->count);
-    }/*string_list_count*/
+static int string_list_count(string_list_t* list)
+{
+    return(list->count);
+}/*string_list_count*/


 /* array of binary digits data type: */
 #if 0
-    static char* binarray_new(unsigned int size)
-    {
-        char*   n;
-        unsigned int     i;
+static char* binarray_new(unsigned int size)
+{
+    char*   n;
+    unsigned int     i;

-        n=(char*)checkmalloc(size+1);
-        for(i=0;i<size;i++){
-            n[i]=0;
-        }
-        n[i]=2;
-        return(n);
-    }/*binarray_new*/
+    n=(char*)checkmalloc(size+1);
+    for(i=0;i<size;i++){
+        n[i]=0;
+    }
+    n[i]=2;
+    return(n);
+}/*binarray_new*/


-    static void binarray_increment(char* n)
-    {
-        while(*n==1){
-            *n=0;
-            n++;
-        }
-        if(*n==0){
-            *n=1;
-        }
-    }/*binarray_increment*/
+static void binarray_increment(char* n)
+{
+    while(*n==1){
+        *n=0;
+        n++;
+    }
+    if(*n==0){
+        *n=1;
+    }
+}/*binarray_increment*/


-    static int binarray_is_max(char* n)
-    {
-        while(*n==1){
-            n++;
-        }
-        return(*n==2);
-    }/*binarray_is_max*/
+static int binarray_is_max(char* n)
+{
+    while(*n==1){
+        n++;
+    }
+    return(*n==2);
+}/*binarray_is_max*/
 #endif

 /* string combinator: */

-    typedef struct {
-        unsigned int        base; /* = number of values */
-        char**              values;
-        unsigned int        size; /* = number of digits */
-        unsigned int*       digits;
-        unsigned int        overflow; /* or underflow */
-        char**              currentVector;
-    }                   combinator_t;
+typedef struct {
+    unsigned int        base; /* = number of values */
+    char**              values;
+    unsigned int        size; /* = number of digits */
+    unsigned int*       digits;
+    unsigned int        overflow; /* or underflow */
+    char**              currentVector;
+}                   combinator_t;


-    static void combinator_reset(combinator_t* comb)
-    {
-        unsigned int i;
-        for(i=0;i<comb->size;i++){
-            comb->digits[i]=0;
-        }
-        comb->overflow=0;
-    }/*combinator_reset*/
+static void combinator_reset(combinator_t* comb)
+{
+    unsigned int i;
+    for(i=0;i<comb->size;i++){
+        comb->digits[i]=0;
+    }
+    comb->overflow=0;
+}/*combinator_reset*/


-    static combinator_t* combinator_new(char** values,unsigned int size)
-    {
-        combinator_t*   comb;
-        unsigned int    i;
-        comb=(combinator_t*)checkmalloc(sizeof(combinator_t));
-        i=0;
-        while(values[i]!=0){
-            i++;
-        }
-        comb->base=i;
-        comb->values=values;
-        comb->size=size;
-        comb->digits=checkmalloc(sizeof(comb->digits[0])*comb->size);
-        combinator_reset(comb);
-        comb->currentVector=(char**)checkmalloc(sizeof(char*)*(comb->size+1));
-        return(comb);
-    }/*combinator_new*/
+static combinator_t* combinator_new(char** values,unsigned int size)
+{
+    combinator_t*   comb;
+    unsigned int    i;
+    comb=(combinator_t*)checkmalloc(sizeof(combinator_t));
+    i=0;
+    while(values[i]!=0){
+        i++;
+    }
+    comb->base=i;
+    comb->values=values;
+    comb->size=size;
+    comb->digits=checkmalloc((sizeof(comb->digits[0])*comb->size));
+    combinator_reset(comb);
+    comb->currentVector=(char**)checkmalloc((sizeof(char*)*comb->size+1));
+    return(comb);
+}/*combinator_new*/


 #if 0
-    static void combinator_delete(combinator_t* comb)
-    {
-        free(comb->digits);
-        free(comb->currentVector);
-        free(comb);
-    }/*combinator_delete*/
+static void combinator_delete(combinator_t* comb)
+{
+    free(comb->digits);
+    free(comb->currentVector);
+    free(comb);
+}/*combinator_delete*/
 #endif

-    static unsigned int combinator_overflow(combinator_t* comb)
-    {
-        return(comb->overflow);
-    }/*combinator_overflow*/
+static unsigned int combinator_overflow(combinator_t* comb)
+{
+    return(comb->overflow);
+}/*combinator_overflow*/


-    static void combinator_increment(combinator_t* comb)
-    {
-        unsigned int i;
-        i=comb->size-1;
+static void combinator_increment(combinator_t* comb)
+{
+    unsigned int i;
+    i=comb->size-1;
+    comb->digits[i]++;
+    while((i>0)&&(comb->digits[i]>=comb->base)){
+        comb->digits[i]=0;
+        i--;
         comb->digits[i]++;
-        while((i>0)&&(comb->digits[i]>=comb->base)){
-            comb->digits[i]=0;
-            i--;
-            comb->digits[i]++;
-        }
-        if((i==0/*optimization*/)&&(comb->digits[0]>=comb->base)){
-            comb->digits[0]=0;
-            comb->overflow=1;
-        }else{
-            comb->overflow=0;
-        }
-    }/*combinator_increment*/
+    }
+    if((i==0/*optimization*/)&&(comb->digits[0]>=comb->base)){
+        comb->digits[0]=0;
+        comb->overflow=1;
+    }else{
+        comb->overflow=0;
+    }
+}/*combinator_increment*/


-    static char** combinator_vector(combinator_t* comb)
-    {
-        unsigned int i;
-        for(i=0;i<comb->size;i++){
-            comb->currentVector[i]=comb->values[comb->digits[i]];
-        }
-        comb->currentVector[comb->size]=0;
-        return(comb->currentVector);
-    }/*combinator_vector*/
+static char** combinator_vector(combinator_t* comb)
+{
+    unsigned int i;
+    for(i=0;i<comb->size;i++){
+        comb->currentVector[i]=comb->values[comb->digits[i]];
+    }
+    comb->currentVector[comb->size]=0;
+    return(comb->currentVector);
+}/*combinator_vector*/



 /* vector of strings data type: */

-    static unsigned int vector_count(char** vector)
-    {
-        unsigned int i;
-        i=0;
-        while(*vector++!=0){
-            i++;
-        }
-        return(i);
-    }/*vector_count*/
+static unsigned int vector_count(char** vector)
+{
+    unsigned int i;
+    i=0;
+    while(*vector++!=0){
+        i++;
+    }
+    return(i);
+}/*vector_count*/


-    static char** vector_intersperse(char** a,char** b)
-        /*
-            PRE:    vector_count(a)=vector_count(b)+1
-        */
-    {
-        char** result=(char**)checkmalloc(sizeof(char*)*
-                                          (vector_count(a)+vector_count(b)+1));
-        char** r;
-        r=result;
-        while((*a!=0)&&(*b!=0)){
-            (*r++)=(*a++);
-            (*r++)=(*b++);
-        }
-        while(*a!=0){   /* normaly there's only one element remaining */
-            (*r++)=(*a++);
-        }
-        while(*b!=0){   /* just in case */
-            (*r++)=(*b++);
-        }
-        *r=0;
-        return(result);
-    }/*vector_intersperse*/
+static char** vector_intersperse(char** a,char** b)
+/*
+  PRE:    vector_count(a)=vector_count(b)+1
+*/
+{
+    char** result=(char**)checkmalloc((sizeof(char*)*(vector_count(a)+vector_count(b)+1)));
+    char** r;
+    r=result;
+    while((*a!=0)&&(*b!=0)){
+        (*r++)=(*a++);
+        (*r++)=(*b++);
+    }
+    while(*a!=0){   /* normaly there's only one element remaining */
+        (*r++)=(*a++);
+    }
+    while(*b!=0){   /* just in case */
+        (*r++)=(*b++);
+    }
+    *r=0;
+    return(result);
+}/*vector_intersperse*/


-    static char* vector_concatenate(char** vector)
-    {
-        char* string;
-        int len;
-        char** v;
-        char* s;
+static char* vector_concatenate(char** vector)
+{
+    char* string;
+    int len;
+    char** v;
+    char* s;

-        len=0;
-        v=vector;
-        while(*v!=0){
-            len+=strlen(*v++);
-        }
-        string=(char*)checkmalloc(sizeof(char)*(len+1));
-        v=vector;
-        s=string;
-        while(*v!=0){   /* for each word */
-            char* f=*v;
-            while(*f!=0){ /* for each character */
-                (*s++)=(*f++);
-            }
-            v++;
-        }
-        *s=0;
-        return(string);
-    }/*vector_concatenate*/
+    len=0;
+    v=vector;
+    while(*v!=0){
+        len+=(int)strlen(*v++);
+    }
+    string=(char*)checkmalloc(sizeof(char)*(size_t)(len+1));
+    v=vector;
+    s=string;
+    while(*v!=0){   /* for each word */
+        char* f=*v;
+        while(*f!=0){ /* for each character */
+            (*s++)=(*f++);
+        }
+        v++;
+    }
+    *s=0;
+    return(string);
+}/*vector_concatenate*/


 #if 0
-    static void vector_print(const char** vector)
-    {
-        while(*vector!=NULL){
-            printf("%s\n",*vector++);
-        }
-    }/*vector_print*/
+static void vector_print(const char** vector)
+{
+    while(*vector!=NULL){
+        printf("%s\n",*vector++);
+    }
+}/*vector_print*/
 #endif

 /* string data type: */

-    static void string_tolower(char* word)
-    {
-        while(*word!='\0'){
-            if(isupper(*word)){
-                *word=tolower(*word);
-            }
-            word++;
+static void string_tolower(char* word)
+{
+    while(*word!='\0'){
+        if(isupper(*word)){
+            *word=tolower(*word);
         }
-    }/*string_tolower*/
+        word++;
+    }
+}/*string_tolower*/


-    static void string_capitalize(char* word)
-    {
-        if(islower(*word)){
-            *word=toupper(*word);
-        }
-        string_tolower(word+1);
-    }/*string_capitalize*/
+static void string_capitalize(char* word)
+{
+    if(islower(*word)){
+        *word=toupper(*word);
+    }
+    string_tolower(word+1);
+}/*string_capitalize*/


 /* make person aliases procedures: */

-    static void addname(string_list_t* list,char* name)
-        /*
-            DO: add each word in name to the list. A word is a sequence
-                of alphabetic characters. Non-alphabetic characters in
-                name are forgotten.
-        */
-    {
-            char*       nextword;
+static void addname(string_list_t* list,char* name)
+/*
+  DO: add each word in name to the list. A word is a sequence
+  of alphabetic characters. Non-alphabetic characters in
+  name are forgotten.
+*/
+{
+    char*       nextword;

-        /*
-            STOP CONDITION:
-                *nextword=='\0'
+    /*
+      STOP CONDITION:
+      *nextword=='\0'

-            INVARIANT:
-                (isalpha(*nextword) || (*nextword=='\0'))
-                && (isalpha(*name) || (*name=='\0'))
-                foreach char in name, isalpha(char)
-                foreach char in [name+strlen(name) .. nextword-1],
-                    !isalpha(char)
+      INVARIANT:
+      (isalpha(*nextword) || (*nextword=='\0'))
+      && (isalpha(*name) || (*name=='\0'))
+      foreach char in name, isalpha(char)
+      foreach char in [name+strlen(name) .. nextword-1],
+      !isalpha(char)

-            INCREMENT:
-                while(isalpha(*nextword)){
-                    nextword++;
-                }
-                if(*nextword!='\0'){
-                    *nextword='\0';
-                    nextword++;
-                }
-                string_list_addstring(list,name);
-                while((*nextword!='\0')&&(!isalpha(*nextword))){
-                    nextword++;
-                }
-            INITIALISATION:
-                while((*name!='\0')&&(!isalpha(*name))){
-                    name++;
-                }
-                nextword=name;
-        */
+      INCREMENT:
+      while(isalpha(*nextword)){
+      nextword++;
+      }
+      if(*nextword!='\0'){
+      *nextword='\0';
+      nextword++;
+      }
+      string_list_addstring(list,name);
+      while((*nextword!='\0')&&(!isalpha(*nextword))){
+      nextword++;
+      }
+      INITIALISATION:
+      while((*name!='\0')&&(!isalpha(*name))){
+      name++;
+      }
+      nextword=name;
+    */

-        while((*name!='\0')&&(!isalpha(*name))){
-            name++;
+    while((*name!='\0')&&(!isalpha(*name))){
+        name++;
+    }
+    nextword=name;
+    while(*nextword!='\0'){
+        while(isalpha(*nextword)){
+            nextword++;
         }
-        nextword=name;
-        while(*nextword!='\0'){
-            while(isalpha(*nextword)){
-                nextword++;
-            }
-            if(*nextword!='\0'){
-                *nextword='\0';
-                nextword++;
-            }
-            string_list_addstring(list,name);
-            while((*nextword!='\0')&&(!isalpha(*nextword))){
-                nextword++;
-            }
-            name=nextword;
+        if(*nextword!='\0'){
+            *nextword='\0';
+            nextword++;
+        }
+        string_list_addstring(list,name);
+        while((*nextword!='\0')&&(!isalpha(*nextword))){
+            nextword++;
         }
-    }/*addname*/
+        name=nextword;
+    }
+}/*addname*/


-    static char** make_person_aliases(char** names,char** seps)
-    {
-            string_list_t*      aliases;  /* the result: list of all aliases */
+static char** make_person_aliases(char** names,char** seps)
+{
+    string_list_t*      aliases;  /* the result: list of all aliases */

-            string_list_t*      words;    /* the words in the names */
-            char**              wordsvector;
+    string_list_t*      words;    /* the words in the names */
+    char**              wordsvector;

-            unsigned int        sepcount;
-            unsigned int        maxseplen;
-            unsigned int        aliaslen; /* the maximum length for an alias */
+    unsigned int        sepcount;
+    unsigned int        maxseplen;
+    unsigned int        aliaslen; /* the maximum length for an alias */

-            combinator_t*       counter;
+    combinator_t*       counter;

     /* make the aliases list */
-        aliases=string_list_new();
+    aliases=string_list_new();

     /* make the vector of words in the person's name */
-        {
-                int i;
-            words=string_list_new();
-            i=0;
-            while(names[i]!=NULL){
-                addname(words,names[i]);
-                i++;
-            }
-            wordsvector=string_list_to_vector(words);
+    {
+        int i;
+        words=string_list_new();
+        i=0;
+        while(names[i]!=NULL){
+            addname(words,names[i]);
+            i++;
         }
+        wordsvector=string_list_to_vector(words);
+    }

     /* compute the length of the biggest separator (for aliaslen) */
-        {
-            char** sep=seps;
-            maxseplen=0;
-            while(*sep!=0){
-                unsigned int seplen=strlen(*sep++);
-                if(seplen>maxseplen){
-                    maxseplen=seplen;
-                }
+    {
+        char** sep=seps;
+        maxseplen=0;
+        while(*sep!=0){
+            unsigned int seplen=(unsigned int)strlen(*sep++);
+            if(seplen>maxseplen){
+                maxseplen=seplen;
             }
         }
+    }

     /* compute the maximum length for an alias, */
     /* and beautify the words in the name */
-        {
-            char** w;
-            aliaslen=0;
-            w=wordsvector;
-            while(*w!=NULL){
-                string_capitalize(*w);
-                aliaslen+=strlen(*w++);
-            }
-            sepcount=string_list_count(words)-1;
-            aliaslen+=sepcount*maxseplen;
-        }
+    {
+        char** w;
+        aliaslen=0;
+        w=wordsvector;
+        while(*w!=NULL){
+            string_capitalize(*w);
+            aliaslen+=(unsigned int)strlen(*w++);
+        }
+        sepcount=(unsigned int)(string_list_count(words)-1);
+        aliaslen+=sepcount*maxseplen;
+    }


     /* generate all aliases by taking each word in the name and */
     /* interspersing all combinaisons of seps */

-        counter=combinator_new(seps,sepcount);
-        combinator_reset(counter);
-        while(!combinator_overflow(counter)){
-            char** aliasvector=vector_intersperse(wordsvector,
-                                                  combinator_vector(counter));
-            char* alias=vector_concatenate(aliasvector);
-            string_list_addstring(aliases,alias);
-            combinator_increment(counter);
-        }
+    counter=combinator_new(seps,sepcount);
+    combinator_reset(counter);
+    while(!combinator_overflow(counter)){
+        char** aliasvector=vector_intersperse(wordsvector,
+                                              combinator_vector(counter));
+        char* alias=vector_concatenate(aliasvector);
+        string_list_addstring(aliases,alias);
+        combinator_increment(counter);
+    }

     /* beautify in another way the words in the name */
-        {
-            char** w;
-            w=wordsvector;
-            while(*w!=NULL){
-                string_tolower(*w++);
-            }
+    {
+        char** w;
+        w=wordsvector;
+        while(*w!=NULL){
+            string_tolower(*w++);
         }
+    }

     /* truncate all the names but the last to its initial */
-        {
-            char** w=wordsvector;
-            while(*(w+1)!=NULL){ /* don't truncate the lastname */
-                (*w)[1]='\0'; /* truncate the current name */
-                string_list_addstring(aliases,
-                                        vector_concatenate(wordsvector));
-                w++;
-            }
+    {
+        char** w=wordsvector;
+        while(*(w+1)!=NULL){ /* don't truncate the lastname */
+            (*w)[1]='\0'; /* truncate the current name */
+            string_list_addstring(aliases,
+                                  vector_concatenate(wordsvector));
+            w++;
         }
+    }
 #if 0
     /*
-        We no longer use the firstname alone;
-        this is usually the username, or else it would be too ambiguous.
+       We no longer use the firstname alone;
+       this is usually the username, or else it would be too ambiguous.
     */
     /* first name */
-            char*               firstname;
-        firstname=(char*)checkmalloc(aliaslen+1);
-        strcpy(firstname,*wordsvector);
-        string_list_addstring(aliases,firstname);
+    char*               firstname;
+    firstname=(char*)checkmalloc(aliaslen+1);
+    strcpy(firstname,*wordsvector);
+    string_list_addstring(aliases,firstname);
 #endif

-        return(string_list_to_vector(aliases));
-    }/*make_person_aliases*/
+    return(string_list_to_vector(aliases));
+}/*make_person_aliases*/


-    static void printaliases(char** aliases,const char* username)
-    {
-        while(*aliases!=NULL){
-            printf("%s:%s\n",*aliases++,username);
-        }
-    }/*printaliases*/
+static void printaliases(char** aliases,const char* username)
+{
+    while(*aliases!=NULL){
+        printf("%s:%s\n",*aliases++,username);
+    }
+}/*printaliases*/


 int main(int argc,char** argv)
 {
-        char**      names;
-        char**      aliases;
-        char*       username;
-        int         i;
+    char**      names;
+    char**      aliases;
+    char*       username;
+    int         i;

     pname=argv[0];

@@ -576,7 +575,7 @@ int main(int argc,char** argv)
     }
     username=argv[argc-1];

-    names=(char**)checkmalloc(sizeof(char*)*argc);
+    names=(char**)checkmalloc((sizeof(char*)*(size_t)argc));
     for(i=1;i<argc-2;i++){
         names[i-1]=argv[i];
     }
@@ -587,4 +586,4 @@ int main(int argc,char** argv)
 }/*main*/


-/*** make-person-aliases.c            -- 2003-12-03 20:10:16 -- pascal   ***/
+/**** THE END ****/
diff --git a/network/sources/network.c b/network/sources/network.c
index 87a9ed7..0eb50ae 100644
--- a/network/sources/network.c
+++ b/network/sources/network.c
@@ -19,7 +19,7 @@ MODIFICATIONS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1991 - 1992
+    Copyright Pascal Bourguignon 1991 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
diff --git a/newmoon/sources/newmoon.c b/newmoon/sources/newmoon.c
index c6ea0fe..1a603af 100644
--- a/newmoon/sources/newmoon.c
+++ b/newmoon/sources/newmoon.c
@@ -281,7 +281,7 @@ char buf[MAXSIZE];
         offset = (((long)year*365+(long)julian)*24+(long)hour)*60+(long)minute;
         difference = offset-base;

-        phaselength = (double)( (29*24 + 12)*60 + 44.05 );
+        phaselength = (long)((29.0*24.0+12.0)*60.0+44.05);
         phase = difference-difference/phaselength*phaselength;
         *fraction = (double)phase / (double)phaselength;
         phaselength = phaselength/4;
@@ -289,9 +289,9 @@ char buf[MAXSIZE];
         strcpy(string, phrases[phase]);
         difference = difference-difference/phaselength*phaselength;
         hourdiff = difference/60;
-        *ominute = difference-hourdiff*60;
-        *oday = hourdiff/24;
-        *ohour = hourdiff-*oday*24;
+        *ominute = (int)(difference-hourdiff*60);
+        *oday = (int)(hourdiff/24);
+        *ohour = (int)(hourdiff-*oday*24);
     } /* pom */


@@ -332,7 +332,7 @@ char buf[MAXSIZE];
     {
         int i;

-        i = x*xscale+0.5;
+        i = (int)(x*xscale+0.5);
         i = i+xoffset;
         return(i<1 ? 1 : i);
     }/* charpos */
@@ -375,7 +375,7 @@ char buf[MAXSIZE];
         initscr();
         clear();
         refresh();
-        namemod = strlen(name);
+        namemod = (int)strlen(name);

         /* 3 is # of lines used by text under moon */
         moonhgt = LINES - LOPTHT - 3;
diff --git a/newton/sources/newton-ps.c b/newton/sources/newton-ps.c
index 2ba30a3..de5db1c 100644
--- a/newton/sources/newton-ps.c
+++ b/newton/sources/newton-ps.c
@@ -15,7 +15,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1991 - 1992
+    Copyright Pascal Bourguignon 1991 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -39,30 +39,31 @@ LEGAL


 /*
-    F=K*M*m/d/d
-    a0=K*m1/d/d
-    a1=K*m0/d/d
+  F=K*M*m/d/d
+  a0=K*m1/d/d
+  a1=K*m0/d/d
 */

 static double get_double(void)
 {
-            float   m;
+    float   m;

-        scanf("%e",&m);
-        return((double)m);
+    int r=scanf("%e",&m);
+    (void)r;
+    return((double)m);
 }/*get_double*/

 int main(void)
 {
-            double  m0,r0;
-            double  m1;
-            double  x0,yy0,vx0,vyy0;
-            double  x1,yy1,vx1,vyy1;
-            double  d,a,t,dt;
-            double  ax0,ayy0,ax1,ayy1,ux,uyy;
-            double  coef;
-            double  it0,it1,ia;
-            int     i;
+    double  m0,r0;
+    double  m1;
+    double  x0,yy0,vx0,vyy0;
+    double  x1,yy1,vx1,vyy1;
+    double  d,a,t,dt;
+    double  ax0,ayy0,ax1,ayy1,ux,uyy;
+    double  coef;
+    double  it0,it1,ia;
+    int     i;

     fprintf(stderr,"Max X=");
     coef=300.0/get_double();
@@ -98,20 +99,20 @@ int main(void)
     dt=get_double();

     fprintf(stdout,
-        "/myywind 100 100 600 600 Retained window def \n"
-        "Above 0 myywind orderwindow \n"
-        "myywind windowdeviceround \n"
-        "0.0 setgrayy 0 1 599 599 rectstroke \n"
-        "300 300 translate \n"
-        "0.666 setgrayy \n"
-        "%g %g %g 0 360 arc fill \n"
-        "0.0 setgrayy \n"
-        "%g %g moveto \n",
-        x0*coef,yy0*coef,r0*coef,
-        x1*coef,yy1*coef
-    );
+            "/myywind 100 100 600 600 Retained window def \n"
+            "Above 0 myywind orderwindow \n"
+            "myywind windowdeviceround \n"
+            "0.0 setgrayy 0 1 599 599 rectstroke \n"
+            "300 300 translate \n"
+            "0.666 setgrayy \n"
+            "%g %g %g 0 360 arc fill \n"
+            "0.0 setgrayy \n"
+            "%g %g moveto \n",
+            x0*coef,yy0*coef,r0*coef,
+            x1*coef,yy1*coef
+            );
     fprintf(stderr,"%g\n%g %g\n%g\n%g %g\n%g %g\n%g %g %g\n%g\n",
-        300.0/coef,m0,r0,m1,x1,yy1,vx1,vyy1,it0,it1,ia,dt);
+            300.0/coef,m0,r0,m1,x1,yy1,vx1,vyy1,it0,it1,ia,dt);

     t=0.0;
     i=0;
@@ -143,41 +144,41 @@ int main(void)

         if(i==10){
             fprintf(stderr,"%14f:  %14g %14g    %14g %14g  %14g %14g  %14g %14g\n",
-                            t,x0,yy0,x1,yy1,vx1,vyy1,ax1,ayy1);
+                    t,x0,yy0,x1,yy1,vx1,vyy1,ax1,ayy1);
             i=0;
         }else{
             i++;
         }
         fprintf(stdout,"%g %g lineto stroke %g %g moveto \n",
-                        x1*coef,yy1*coef,x1*coef,yy1*coef);
+                x1*coef,yy1*coef,x1*coef,yy1*coef);
         t+=dt;
     }
     return(0);
 }
 /*
-45000000.0
-5.975e24 6400000
-200000
-0 7046000
-1000 0
-43600 43700 1.2
-10
-
-160e9
-2e32 1.391e6
-5.975e24
-0 152e9
-30000 0
-0 1 0
-3600
-
-1.8e+08
-2e+30 1.391e+06
-5.975e+24
-0 1.5e+08
-30000 0
-0 1 0
-360
+  45000000.0
+  5.975e24 6400000
+  200000
+  0 7046000
+  1000 0
+  43600 43700 1.2
+  10
+
+  160e9
+  2e32 1.391e6
+  5.975e24
+  0 152e9
+  30000 0
+  0 1 0
+  3600
+
+  1.8e+08
+  2e+30 1.391e+06
+  5.975e+24
+  0 1.5e+08
+  30000 0
+  0 1 0
+  360



diff --git a/newton/sources/newton.c b/newton/sources/newton.c
index 2f790f3..9591180 100644
--- a/newton/sources/newton.c
+++ b/newton/sources/newton.c
@@ -14,7 +14,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1991 - 1991
+    Copyright Pascal Bourguignon 1991 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -37,17 +37,18 @@ LEGAL
 #include <math.h>

 /*
-    F=K*M*m/d/d
-    a0=K*m1/d/d
-    a1=K*m0/d/d
+  F=K*M*m/d/d
+  a0=K*m1/d/d
+  a1=K*m0/d/d
 */

 static double get_double(void)
 {
     float m;

-  scanf("%e",&m);
-  return((double)m);
+    int r=scanf("%e",&m);
+    (void)r;
+    return((double)m);
 }/*get_double*/

 int main(void)
@@ -59,53 +60,53 @@ int main(void)
     double d,a,t,dt;
     double ax0,ayy0,ax1,ayy1,ux,uy;

-  printf("Mass of the planet=");
-  m0=get_double();
-  x0=0.0;
-  yy0=0.0;
-  vx0=0.0;
-  vyy0=0.0;
+    printf("Mass of the planet=");
+    m0=get_double();
+    x0=0.0;
+    yy0=0.0;
+    vx0=0.0;
+    vyy0=0.0;

-  printf("Mass of the satellite=");
-  m1=get_double();
+    printf("Mass of the satellite=");
+    m1=get_double();

-  printf("Position of the satellite (x y)=");
-  x1=get_double();
-  yy1=get_double();
+    printf("Position of the satellite (x y)=");
+    x1=get_double();
+    yy1=get_double();

-  printf("Speed of the satellite (vx vy)=");
-  vx1=get_double();
-  vyy1=get_double();
+    printf("Speed of the satellite (vx vy)=");
+    vx1=get_double();
+    vyy1=get_double();

-  printf("delta-t=");
-  dt=get_double();
-  t=0.0;
-  while(1){
-    ux=(x1-x0);
-    uy=(yy1-yy0);
-    d=sqrt(ux*ux+uy*uy);
-    ux=ux/d;
-    uy=uy/d;
+    printf("delta-t=");
+    dt=get_double();
+    t=0.0;
+    while(1){
+        ux=(x1-x0);
+        uy=(yy1-yy0);
+        d=sqrt(ux*ux+uy*uy);
+        ux=ux/d;
+        uy=uy/d;

-    a=1.0/(11e11)/d/d;
-    ax0=ux*a*m1;
-    ayy0=uy*a*m1;
-    ax1=(-ux)*a*m0;
-    ayy1=(-uy)*a*m0;
+        a=1.0/(11e11)/d/d;
+        ax0=ux*a*m1;
+        ayy0=uy*a*m1;
+        ax1=(-ux)*a*m0;
+        ayy1=(-uy)*a*m0;

-    vx0+=ax0*dt;
-    vyy0+=ayy0*dt;
-    x0+=vx0*dt;
-    yy0+=vyy0*dt;
-    vx1+=ax1*dt;
-    vyy1+=ayy1*dt;
-    x1+=vx1*dt;
-    yy1+=vyy1*dt;
+        vx0+=ax0*dt;
+        vyy0+=ayy0*dt;
+        x0+=vx0*dt;
+        yy0+=vyy0*dt;
+        vx1+=ax1*dt;
+        vyy1+=ayy1*dt;
+        x1+=vx1*dt;
+        yy1+=vyy1*dt;

-    printf("%3f:  %g %g    %g %g  %g %g  %g %g\n",t,x0,yy0,x1,yy1,vx1,vyy1,ax1,ayy1);
-    t+=dt;
-  }
-  return(0);
+        printf("%3f:  %g %g    %g %g  %g %g  %g %g\n",t,x0,yy0,x1,yy1,vx1,vyy1,ax1,ayy1);
+        t+=dt;
+    }
+    return(0);
 }

 /*** newton.c                         -- 2003-12-02 15:34:45 -- pascal   ***/
diff --git a/objc-tools/sources/Makefile b/objc-tools/sources/Makefile
index 446d831..11e5400 100644
--- a/objc-tools/sources/Makefile
+++ b/objc-tools/sources/Makefile
@@ -12,7 +12,7 @@
 #LEGAL
 #    GPL
 #
-#    Copyright Pascal Bourguignon 1994 - 1994
+#    Copyright Pascal Bourguignon 1994 - 2011
 #
 #    This program is free software; you can redistribute it and/or
 #    modify it under the terms of the GNU General Public License
diff --git a/objc-tools/sources/objc-make-accessors.c b/objc-tools/sources/objc-make-accessors.c
index 13eb4ac..eb2a892 100644
--- a/objc-tools/sources/objc-make-accessors.c
+++ b/objc-tools/sources/objc-make-accessors.c
@@ -16,7 +16,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1995 - 1995
+    Copyright Pascal Bourguignon 1995 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -173,7 +173,7 @@ int main(void)
     attribute_list_initialize(&list);
     while(fgets(line,sizeof(line)-1,stdin)!=0){
         {
-            int len=strlen(line);
+            int len=(int)strlen(line);
             if((len>0)&&('\n'==line[len-1])){
                 line[len-1]='\0';
             }
diff --git a/od-tools/sources/odhv2hex.c b/od-tools/sources/odhv2hex.c
index c19645c..6343bbb 100644
--- a/od-tools/sources/odhv2hex.c
+++ b/od-tools/sources/odhv2hex.c
@@ -20,7 +20,7 @@ MODIFICATIONS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1993 - 1993
+    Copyright Pascal Bourguignon 1993 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
diff --git a/od-tools/sources/postodax.c b/od-tools/sources/postodax.c
index d3c980a..4c029ce 100644
--- a/od-tools/sources/postodax.c
+++ b/od-tools/sources/postodax.c
@@ -21,7 +21,7 @@ MODIFICATIONS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1993 - 1993
+    Copyright Pascal Bourguignon 1993 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
diff --git a/primes/sources/Makefile b/primes/sources/Makefile
index 93071f8..44d0a24 100644
--- a/primes/sources/Makefile
+++ b/primes/sources/Makefile
@@ -16,7 +16,7 @@
 #LEGAL
 #    GPL
 #
-#    Copyright Pascal Bourguignon 1993 - 2003
+#    Copyright Pascal Bourguignon 1993 - 2011
 #
 #    This program is free software; you can redistribute it and/or
 #    modify it under the terms of the GNU General Public License
@@ -38,6 +38,8 @@ CSOURCES = primes.c

 INCLUDES = \
 	-I../sources \
+	-I$(PREFIX)/lib \
+	-I$(PREFIX)/lib/bclib/interfaces \
 	$(TARGET_INCLUDES)

 PROGRAMS = primes
diff --git a/primes/sources/primes.c b/primes/sources/primes.c
index c44d47b..5cc6102 100644
--- a/primes/sources/primes.c
+++ b/primes/sources/primes.c
@@ -14,7 +14,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1993 - 1993
+    Copyright Pascal Bourguignon 1993 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -36,225 +36,228 @@ LEGAL
 #include <stdio.h>
 #include <libgen.h>

-typedef long int    integer;
-static const long int max_integer=0x7fffffff;
+#include <BcTypes.h>

-    static integer          debug=0;
+typedef INT32    integer;
+static const INT32 max_integer=MAX_INT32;
+#define FMT_integer FMT_INT32
+
+static integer          debug=0;


 #define round4k(s)  ((((s)+4095)/4096)*4096)
 #define bits_per_char       (8)
-#define bits_per_integer    (sizeof(integer)*bits_per_char)
+#define bits_per_integer    ((integer)(sizeof(integer)*bits_per_char))

-    static integer* ComputePrimesTo(integer n)
-    {
-            integer         bitsmax;
-            integer*        bits;       /* set of odd numbers.*/
-            integer*        curbits;
-            integer         i;
-            integer         curprime;
-            integer         primecount;
-            integer         bit;
-            integer         halfn;
-            integer*        primes;
-            integer*        curnum;
+static integer* ComputePrimesTo(integer n)
+{
+    integer         bitsmax;
+    integer*        bits;       /* set of odd numbers.*/
+    integer*        curbits;
+    integer         i;
+    integer         curprime;
+    integer         primecount;
+    integer         bit;
+    integer         halfn;
+    integer*        primes;
+    integer*        curnum;


-        n+=2;
-        bitsmax=(n/2+bits_per_integer-1)/bits_per_integer;
-        n=2*bitsmax*bits_per_integer;
-        halfn=n/2;
-        bits=malloc(round4k(bitsmax*sizeof(integer)));
-            /* SEE: seems to be a bug for large allocation sizes ?*/
+    n+=2;
+    bitsmax=(n/2+bits_per_integer-1)/bits_per_integer;
+    n=2*bitsmax*bits_per_integer;
+    halfn=n/2;
+    bits=malloc((size_t)round4k((size_t)bitsmax*sizeof(integer)));
+    /* SEE: seems to be a bug for large allocation sizes ?*/

-        /* set the bitset to full bits;*/
-        curbits=bits;
-        i=bitsmax-1;
-        while(i-->=0){
-            *curbits++=(~0);
-        }
-        /* reset the last bit as watchdog for searching next prime.*/
-        bits[bitsmax-1]=~(1<<(bits_per_integer-1));
-        /*bits[(halfn-1)/bits_per_integer]&=~(1<<((n-1)%bits_per_integer));*/
+    /* set the bitset to full bits;*/
+    curbits=bits;
+    i=bitsmax-1;
+    while(i-->=0){
+        *curbits++=(~0);
+    }
+    /* reset the last bit as watchdog for searching next prime.*/
+    bits[bitsmax-1]=~(1<<(bits_per_integer-1));
+    /*bits[(halfn-1)/bits_per_integer]&=~(1<<((n-1)%bits_per_integer));*/

-        primecount=2;
-        curprime=3;
-        while(curprime<n){
-            bit=(curprime-3)/2+curprime;
-            while(bit<halfn){
-if(debug){printf("exclude bit %ld\n",bit);}
-                bits[bit/bits_per_integer]&=~(1<<(bit%bits_per_integer));
-                bit+=curprime;
-            }
-            bit=(curprime-3)/2+1;
-            while(!(bits[bit/bits_per_integer]&(1<<(bit%bits_per_integer)))){
-                bit++;
-            }
-            curprime=2*bit+3;
-if(debug){printf("found prime %ld\n",curprime);}
-            primecount++;
+    primecount=2;
+    curprime=3;
+    while(curprime<n){
+        bit=(curprime-3)/2+curprime;
+        while(bit<halfn){
+            if(debug){printf("exclude bit %"FMT_integer"\n",bit);}
+            bits[bit/bits_per_integer]&=~(1<<(bit%bits_per_integer));
+            bit+=curprime;
         }
-if(debug){printf("primecount %ld\n",primecount);}
+        bit=(curprime-3)/2+1;
+        while(!(bits[bit/bits_per_integer]&(1<<(bit%bits_per_integer)))){
+            bit++;
+        }
+        curprime=2*bit+3;
+        if(debug){printf("found prime %"FMT_integer"\n",curprime);}
+        primecount++;
+    }
+    if(debug){printf("primecount %"FMT_integer"\n",primecount);}

-        primes=malloc(round4k((primecount+1)*sizeof(integer)));
-if(debug){printf("primes=%p\n",(void*)primes);}
-if(debug){printf("after last primes=%p\n",(void*)(primes+(primecount+1)));}
-        curnum=primes;
-        *curnum++=2;
-        curprime=3;
-        bit=0;
-        while(curprime<n){
+    primes=malloc((size_t)round4k((size_t)(primecount+1)*sizeof(integer)));
+    if(debug){printf("primes=%p\n",(void*)primes);}
+    if(debug){printf("after last primes=%p\n",(void*)(primes+(primecount+1)));}
+    curnum=primes;
+    *curnum++=2;
+    curprime=3;
+    bit=0;
+    while(curprime<n){
+        bit++;
+        while(!(bits[bit/bits_per_integer]&(1<<(bit%bits_per_integer)))){
+            if(debug){printf("skipped bit %"FMT_integer"\n",bit);}
             bit++;
-            while(!(bits[bit/bits_per_integer]&(1<<(bit%bits_per_integer)))){
-if(debug){printf("skipped bit %ld\n",bit);}
-                bit++;
-            }
-            curprime=2*bit+3;
-if(debug){printf("found prime %ld\n",curprime);}
-            *curnum++=curprime;
         }
-        *curnum++=0;
-if(debug){printf("curnum=%p\n",(void*)curnum);}
-        free(bits);
-        return(primes);
-    }/*ComputePrimesTo;*/
+        curprime=2*bit+3;
+        if(debug){printf("found prime %"FMT_integer"\n",curprime);}
+        *curnum++=curprime;
+    }
+    *curnum++=0;
+    if(debug){printf("curnum=%p\n",(void*)curnum);}
+    free(bits);
+    return(primes);
+}/*ComputePrimesTo;*/



-    static integer* ComputeOnePrimeFrom(integer from)
-    {
-        integer         bitsmax;
-        integer*        bits;       /* set of odd numbers.*/
-        integer*        curbits;
-        integer         i;
-        integer         curprime;
-        integer         primecount;
-        integer         bit;
-        integer         halfn;
-        integer*        primes;
-        integer         n=max_integer;
+static integer* ComputeOnePrimeFrom(integer from)
+{
+    integer         bitsmax;
+    integer*        bits;       /* set of odd numbers.*/
+    integer*        curbits;
+    integer         i;
+    integer         curprime;
+    integer         primecount;
+    integer         bit;
+    integer         halfn;
+    integer*        primes;
+    integer         n=max_integer;

-        if(from<n/4){
-            integer four_from=from*4;
-            while(n>four_from){
-                n/=2;
-            }
+    if(from<n/4){
+        integer four_from=from*4;
+        while(n>four_from){
+            n/=2;
         }
+    }

-        bitsmax=(n/2+bits_per_integer-1)/bits_per_integer;
-        n=2*bitsmax*bits_per_integer;
-        halfn=n/2;
-        bits=malloc(round4k(bitsmax*sizeof(integer)));
-            /* SEE: seems to be a bug for large allocation sizes ?*/
+    bitsmax=(n/2+bits_per_integer-1)/bits_per_integer;
+    n=2*bitsmax*bits_per_integer;
+    halfn=n/2;
+    bits=malloc((size_t)round4k((size_t)bitsmax*sizeof(integer)));
+    /* SEE: seems to be a bug for large allocation sizes ?*/

-        /* set the bitset to full bits;*/
-        curbits=bits;
-        i=bitsmax-1;
-        while(i-->=0){
-            *curbits++=(~0);
-        }
-        /* reset the last bit as watchdog for searching next prime.*/
-        bits[bitsmax-1]=~(1<<(bits_per_integer-1));
-        /*bits[(halfn-1)/bits_per_integer]&=~(1<<((n-1)%bits_per_integer));*/
+    /* set the bitset to full bits;*/
+    curbits=bits;
+    i=bitsmax-1;
+    while(i-->=0){
+        *curbits++=(~0);
+    }
+    /* reset the last bit as watchdog for searching next prime.*/
+    bits[bitsmax-1]=~(1<<(bits_per_integer-1));
+    /*bits[(halfn-1)/bits_per_integer]&=~(1<<((n-1)%bits_per_integer));*/

-        primecount=2;
-        curprime=3;
-        while(curprime<=from){
-            bit=(curprime-3)/2+curprime;
-            while(bit<halfn){
-if(debug){printf("exclude bit %ld\n",bit);}
-                bits[bit/bits_per_integer]&=~(1<<(bit%bits_per_integer));
-                bit+=curprime;
-            }
-            bit=(curprime-3)/2+1;
-            while(!(bits[bit/bits_per_integer]&(1<<(bit%bits_per_integer)))){
-                bit++;
-            }
-            curprime=2*bit+3;
-if(debug){printf("found prime %ld\n",curprime);}
-            primecount++;
+    primecount=2;
+    curprime=3;
+    while(curprime<=from){
+        bit=(curprime-3)/2+curprime;
+        while(bit<halfn){
+            if(debug){printf("exclude bit %"FMT_integer"\n",bit);}
+            bits[bit/bits_per_integer]&=~(1<<(bit%bits_per_integer));
+            bit+=curprime;
         }
-if(debug){printf("primecount %ld\n",primecount);}
+        bit=(curprime-3)/2+1;
+        while(!(bits[bit/bits_per_integer]&(1<<(bit%bits_per_integer)))){
+            bit++;
+        }
+        curprime=2*bit+3;
+        if(debug){printf("found prime %"FMT_integer"\n",curprime);}
+        primecount++;
+    }
+    if(debug){printf("primecount %"FMT_integer"\n",primecount);}

-        primes=malloc(2*sizeof(integer));
-if(debug){printf("next prime=%ld\n",curprime);}
-        primes[0]=curprime;
-        primes[1]=0;
-        free(bits);
-        return(primes);
-    }/*ComputeOnePrimeFrom;*/
+    primes=malloc(2*sizeof(integer));
+    if(debug){printf("next prime=%"FMT_integer"\n",curprime);}
+    primes[0]=curprime;
+    primes[1]=0;
+    free(bits);
+    return(primes);
+}/*ComputeOnePrimeFrom;*/



-    static integer* Factorize(integer n,integer* primes)
-    {
-            integer         primecount;
-            integer*        exponents;
-            integer         expo;
-            integer         prime;
-            integer*        curexponent;
+static integer* Factorize(integer n,integer* primes)
+{
+    integer         primecount;
+    integer*        exponents;
+    integer         expo;
+    integer         prime;
+    integer*        curexponent;

-        primecount=0;
-        while(primes[primecount++]>0){
-        }
+    primecount=0;
+    while(primes[primecount++]>0){
+    }

-        exponents=malloc(round4k(sizeof(integer)*(primecount+1)));
-        curexponent=exponents+1;
+    exponents=malloc((size_t)round4k((size_t)(primecount+1)*sizeof(integer)));
+    curexponent=exponents+1;

-        prime=2;
-        while((primecount-->0)&&(n>1)){
-            expo=0;
-            while(n%prime==0){
-                expo++;
-                n/=prime;
-            }
-            *curexponent++=expo;
-            prime=*primes++;
+    prime=2;
+    while((primecount-->0)&&(n>1)){
+        expo=0;
+        while(n%prime==0){
+            expo++;
+            n/=prime;
         }
-        *curexponent++=0;
-        *exponents=n;
-        return(exponents);
-    }/*Factorize;*/
+        *curexponent++=expo;
+        prime=*primes++;
+    }
+    *curexponent++=0;
+    *exponents=n;
+    return(exponents);
+}/*Factorize;*/


-    static void PrintNumbers(integer* list)
-    {
-        while(*list>0){
-            printf("%ld\n",*list++);
-        }
-    }/*PrintNumbers;*/
+static void PrintNumbers(integer* list)
+{
+    while(*list>0){
+        printf("%"FMT_integer"\n",*list++);
+    }
+}/*PrintNumbers;*/


-    static void PrintFactorization(integer* exponent,integer* primes)
-    {
-            integer     remainder=*exponent++;
+static void PrintFactorization(integer* exponent,integer* primes)
+{
+    integer     remainder=*exponent++;

-        while(*exponent>=0){
-            if(*exponent>0){
-                printf("%12ld ^ %ld *\n",*primes,*exponent);
-            }
-            primes++;
-            exponent++;
+    while(*exponent>=0){
+        if(*exponent>0){
+            printf("%12"FMT_integer" ^ %"FMT_integer" *\n",*primes,*exponent);
         }
-        printf("%12c   %ld\n",' ',remainder);
-    }/*PrintFactorization;*/
+        primes++;
+        exponent++;
+    }
+    printf("%12c   %"FMT_integer"\n",' ',remainder);
+}/*PrintFactorization;*/


-    static void usage(const char* pname)
-    {
-        fprintf(stderr,"%s usage :\n"
+static void usage(const char* pname)
+{
+    fprintf(stderr,"%s usage :\n"
             "%s --next-from | next-from  n  # prints one prime greater than n.\n"
             "%s --to        | to         n  # prints all primes less than n.\n"
             "%s --factorize | factorize  n  # prints the factorization of n.\n",
             pname,pname,pname,pname);
-    }/*usage;*/
+}/*usage;*/


 int main(int argc,char** argv)
 {
-        integer     n;
-        integer*    primelist;
-        integer*    exponentlist;
+    integer     n;
+    integer*    primelist;
+    integer*    exponentlist;

     debug=(0==strcmp(argv[0],"debug"));
     if(argc!=3){
@@ -264,7 +267,7 @@ int main(int argc,char** argv)
     n=atoi(argv[2]);
     if(n<2){
         fprintf(stderr,"%s: the integer argument must be greater than 2.\n",
-            argv[0]);
+                argv[0]);
         return(2);
     }
     if((strcmp(argv[1],"to")||(strcmp(argv[1],"--to")==0))==0){
@@ -286,7 +289,7 @@ int main(int argc,char** argv)
         return(1);
     }
     return(0);
-}/*main.*/
+}/*main*/


-/*** primes.c                         --                     --          ***/
+/**** THE END ****/
diff --git a/random-stat/sources/random-stat.cc b/random-stat/sources/random-stat.cc
index e54675d..eee1b95 100644
--- a/random-stat/sources/random-stat.cc
+++ b/random-stat/sources/random-stat.cc
@@ -15,7 +15,7 @@ BUGS
 LEGAL
     GPL

-    Copyright Pascal Bourguignon 1999 - 1999
+    Copyright Pascal Bourguignon 1999 - 2011

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -35,8 +35,9 @@ LEGAL

 extern "C"{
 #include <stdio.h>
+#include <values.h>
 }
-#define BIT_PER_BYTE    (8)
+#define BIT_PER_BYTE    (CHARBITS)

 // typedef char bool;
 #define true ((bool)(0==0))
@@ -55,10 +56,10 @@ public:
     virtual short getBit(void);
     virtual void close(void);

-/*
-    virtual long read(void* bitbuf,short bitoffset,long bitcount);
-    virtual long write(const void* bitbuf,short bitoffset,long bitcount);
-*/
+    /*
+      virtual long read(void* bitbuf,short bitoffset,long bitcount);
+      virtual long write(const void* bitbuf,short bitoffset,long bitcount);
+    */

 protected:
     FILE*           _file;
@@ -70,116 +71,115 @@ protected:
 };//BitFile;


-    BitFile::BitFile(void)
-    {
-        _file=NULL;
-        _buffer=0;
-        _bitMask=0;
-        _currentBit=0;
-        _fileIsMine=false;
-        _isOpen=false;
-    }//BitFile;
+BitFile::BitFile(void)
+{
+    _file=NULL;
+    _buffer=0;
+    _bitMask=0;
+    _currentBit=0;
+    _fileIsMine=false;
+    _isOpen=false;
+}//BitFile;


-    BitFile::~BitFile(void)
-    {
-        close();
-    }//~BitFile;
+BitFile::~BitFile(void)
+{
+    close();
+}//~BitFile;



-    bool BitFile::isOpen(void)
-    {
-        return(_isOpen);
-    }//isOpen;
+bool BitFile::isOpen(void)
+{
+    return(_isOpen);
+}//isOpen;


-    bool BitFile::isAtEof(void)
-    {
-        return((!_isOpen)||(feof(_file)&&(_currentBit==0)));
-    }//isAtEof;
+bool BitFile::isAtEof(void)
+{
+    return((!_isOpen)||(feof(_file)&&(_currentBit==0)));
+}//isAtEof;


-    void BitFile::open(const char* fname,const char* mode)
-    {
-        close();
-        _file=fopen(fname,mode);
-        _fileIsMine=(_file!=NULL);
-        _isOpen=(_file!=NULL);
-        _bitMask=0;
-        _currentBit=0;
-    }//open;
+void BitFile::open(const char* fname,const char* mode)
+{
+    close();
+    _file=fopen(fname,mode);
+    _fileIsMine=(_file!=NULL);
+    _isOpen=(_file!=NULL);
+    _bitMask=0;
+    _currentBit=0;
+}//open;


-    void BitFile::assign(FILE* file)
-    {
-        close();
-        _file=file;
-        _fileIsMine=false;
-        _isOpen=true;
-        _bitMask=0;
-        _currentBit=0;
-    }//assign;
+void BitFile::assign(FILE* file)
+{
+    close();
+    _file=file;
+    _fileIsMine=false;
+    _isOpen=true;
+    _bitMask=0;
+    _currentBit=0;
+}//assign;


-    short BitFile::getBit(void)
-    {
-        if(_isOpen){
-            if(_currentBit==0){
-                if(feof(_file)){
+short BitFile::getBit(void)
+{
+    if(_isOpen){
+        if(_currentBit==0){
+            if(feof(_file)){
+                return(-1);
+            }else{
+                // 111111111111 32
+                // 111111111110 31
+                // 111111111100 30
+                // 111111111000 29
+                // ...
+                // 110000000000  2
+                // 100000000000  1
+                // 000000000000  0
+                _bitMask=(~0)<<(BIT_PER_BYTE*(sizeof(_buffer)-fread(&_buffer,1,sizeof(_buffer),_file)));
+                if(_bitMask==0){
+                    // DEBUG printf("\n_bitMask   =%0lx\n",_bitMask);
+                    // DEBUG printf("\n_currentBit=%0lx\n",_currentBit);
+                    _currentBit=0;
                     return(-1);
                 }else{
-                    // 111111111111 32
-                    // 111111111110 31
-                    // 111111111100 30
-                    // 111111111000 29
-                    // ...
-                    // 110000000000  2
-                    // 100000000000  1
-                    // 000000000000  0
-                    _bitMask=(~0)<<(BIT_PER_BYTE*(sizeof(_buffer)
-                        -fread(&_buffer,1,sizeof(_buffer),_file)));
-                    if(_bitMask==0){
-// DEBUG printf("\n_bitMask   =%0lx\n",_bitMask);
-// DEBUG printf("\n_currentBit=%0lx\n",_currentBit);
-                        _currentBit=0;
-                        return(-1);
-                    }else{
-                        _currentBit=1<<(BIT_PER_BYTE*sizeof(_buffer)-1);
-                    }
+                    _currentBit=((unsigned long)1)<<(BIT_PER_BYTE*sizeof(_buffer)-1);
                 }
             }
-// DEBUG printf("\n");
-// DEBUG printf("_bitMask   =%08lx\n",_bitMask);
-// DEBUG printf("_currentBit=%08lx\n",_currentBit);
-// DEBUG printf("_buffer    =%08lx\n",_buffer);
-            if(_currentBit&_buffer){
-                _currentBit=(_currentBit>>1)&_bitMask;
-                return(1);
-            }else{
-                _currentBit=(_currentBit>>1)&_bitMask;
-                return(0);
-            }
+        }
+        // DEBUG printf("\n");
+        // DEBUG printf("_bitMask   =%08lx\n",_bitMask);
+        // DEBUG printf("_currentBit=%08lx\n",_currentBit);
+        // DEBUG printf("_buffer    =%08lx\n",_buffer);
+        if(_currentBit&_buffer){
+            _currentBit=(_currentBit>>1)&_bitMask;
+            return(1);
         }else{
-            return(-1);
+            _currentBit=(_currentBit>>1)&_bitMask;
+            return(0);
         }
-    }//getBit;
+    }else{
+        return(-1);
+    }
+}//getBit;


-    void BitFile::close(void)
-    {
-        if(_isOpen){
-            fclose(_file);
-            _isOpen=false;
-            _fileIsMine=false;
-        }
-    }//close;
+void BitFile::close(void)
+{
+    if(_isOpen){
+        fclose(_file);
+        _isOpen=false;
+        _fileIsMine=false;
+    }
+}//close;


 /*
-    Compter:
-        Les sequences de 1 classees par taille
-        Les sequences de 0 classees par taille
+  Compter:
+  Les sequences de 1 classees par taille
+  Les sequences de 0 classees par taille
 */
 class SequenceCounter
 {
@@ -197,95 +197,95 @@ protected:
 };//SequenceCounter;


-    SequenceCounter::SequenceCounter(void)
-    {
-        _lastBit=-1;
-        _currentLength=0;
-        _maxLength=0;
-        _lengthCounts[0]=NULL;
-        _lengthCounts[1]=NULL;
-    }//SequenceCounter;
-
-
-    SequenceCounter::~SequenceCounter(void)
-    {
-        if(_lengthCounts[0]!=NULL){
-            delete _lengthCounts[0];
-            delete _lengthCounts[1];
+SequenceCounter::SequenceCounter(void)
+{
+    _lastBit=-1;
+    _currentLength=0;
+    _maxLength=0;
+    _lengthCounts[0]=NULL;
+    _lengthCounts[1]=NULL;
+}//SequenceCounter;
+
+
+SequenceCounter::~SequenceCounter(void)
+{
+    if(_lengthCounts[0]!=NULL){
+        delete _lengthCounts[0];
+        delete _lengthCounts[1];
+    }
+}//~SequenceCounter;
+
+
+void SequenceCounter::reset(long maxlength)
+{
+    int i,k;
+    _lastBit=-1;
+    _currentLength=0;
+    _maxLength=maxlength;
+    for(k=0;k<2;k++){
+        if(_lengthCounts[k]!=NULL){
+            delete _lengthCounts[k];
         }
-    }//~SequenceCounter;
-
-
-    void SequenceCounter::reset(long maxlength)
-    {
-            int i,k;
-        _lastBit=-1;
-        _currentLength=0;
-        _maxLength=maxlength;
-        for(k=0;k<2;k++){
-            if(_lengthCounts[k]!=NULL){
-                delete _lengthCounts[k];
-            }
-            _lengthCounts[k]=new long[_maxLength];
-            for(i=0;i<_maxLength;i++){
-                _lengthCounts[k][i]=0;
-            }
+        _lengthCounts[k]=new long[_maxLength];
+        for(i=0;i<_maxLength;i++){
+            _lengthCounts[k][i]=0;
         }
-    }//reset;
+    }
+}//reset;


-    void SequenceCounter::process(short bit)
-    {
-        if(bit==_lastBit){
-            _currentLength++;
-        }else{
-            if(_lastBit>=0){
-                if(_currentLength>=_maxLength){
-                    long*   newCounts;
-                    int     i,k;
-                    for(k=0;k<2;k++){
-                        newCounts=new long[_currentLength];
-                        for(i=0;i<_maxLength;i++){
-                            newCounts[i]=_lengthCounts[k][i];
-                        }
-                        for(;i<_currentLength;i++){
-                            newCounts[i]=0;
-                        }
-                        delete _lengthCounts[k];
-                        _lengthCounts[k]=newCounts;
+void SequenceCounter::process(short bit)
+{
+    if(bit==_lastBit){
+        _currentLength++;
+    }else{
+        if(_lastBit>=0){
+            if(_currentLength>=_maxLength){
+                long*   newCounts;
+                int     i,k;
+                for(k=0;k<2;k++){
+                    newCounts=new long[_currentLength];
+                    for(i=0;i<_maxLength;i++){
+                        newCounts[i]=_lengthCounts[k][i];
                     }
+                    for(;i<_currentLength;i++){
+                        newCounts[i]=0;
+                    }
+                    delete _lengthCounts[k];
+                    _lengthCounts[k]=newCounts;
                 }
-                (_lengthCounts[_lastBit][_currentLength])++;
             }
-            _lastBit=(bit&1);
-            _currentLength=1;
+            (_lengthCounts[_lastBit][_currentLength])++;
         }
-    }//process;
+        _lastBit=(bit&1);
+        _currentLength=1;
+    }
+}//process;


-    void SequenceCounter::print(FILE* out)
-    {
-            int i,m;
-        m=_maxLength-1;
-        while(_lengthCounts[0][m]+_lengthCounts[1][m]==0){
-            m--;
-        }
-        fprintf(out,":-------:--------:--------:\n");
-        fprintf(out,": size  : 0-seq  : 1-seq  :\n");
-        fprintf(out,":-------:--------:--------:\n");
-        for(i=1;i<=m;i++){
-            fprintf(out,":%6d : %6ld : %6ld :\n",
-                        i,_lengthCounts[0][i],_lengthCounts[1][i]);
-        }
-        fprintf(out,":-------:--------:--------:\n");
-    }//print;
+void SequenceCounter::print(FILE* out)
+{
+    int i,m;
+    m=(int)(_maxLength-1);
+    while(_lengthCounts[0][m]+_lengthCounts[1][m]==0){
+        m--;
+    }
+    fprintf(out,":-------:--------:--------:\n");
+    fprintf(out,": size  : 0-seq  : 1-seq  :\n");
+    fprintf(out,":-------:--------:--------:\n");
+    for(i=1;i<=m;i++){
+        fprintf(out,":%6d : %6ld : %6ld :\n",
+                i,_lengthCounts[0][i],_lengthCounts[1][i]);
+    }
+    fprintf(out,":-------:--------:--------:\n");
+}//print;



 int main(void)
 {
-        BitFile*            file;
-        SequenceCounter*    counter;
+    BitFile*            file;
+    SequenceCounter*    counter;

     file=new BitFile;
     file->assign(stdin);
@@ -302,5 +302,4 @@ int main(void)
 }/*main*/


-
-/*** random_stat.cc                   -- 2003-11-23 02:21:39 -- pascal   ***/
+/**** THE END ****/
diff --git a/random-stat/sources/test-charbits.cc b/random-stat/sources/test-charbits.cc
new file mode 100644
index 0000000..c9a05f8
--- /dev/null
+++ b/random-stat/sources/test-charbits.cc
@@ -0,0 +1,20 @@
+extern "C"{
+#include <stdio.h>
+#include <values.h>
+}
+#define BIT_PER_BYTE    (CHARBITS)
+
+    unsigned long   _buffer;
+    unsigned long   _bitMask;
+    unsigned long   _currentBit;
+
+int main(){
+    printf("bit per byte                        = %lu\n",BIT_PER_BYTE);
+    printf("sizeof(_buffer)                     = %lu\n",sizeof(_buffer));
+    printf("sizeof(_currentBit)                 = %lu\n",sizeof(_currentBit));
+    printf("(BIT_PER_BYTE*sizeof(_buffer)-1)    = %lu\n",(BIT_PER_BYTE*sizeof(_buffer)-1));
+    printf("1<<(BIT_PER_BYTE*sizeof(_buffer)-1) = %llu\n",1ULL<<(BIT_PER_BYTE*sizeof(_buffer)-1));
+    printf("1<<(BIT_PER_BYTE*sizeof(_buffer)-1) = %llx\n",1ULL<<(BIT_PER_BYTE*sizeof(_buffer)-1));
+    return(0);
+}
+
diff --git a/romain/sources/romain.c b/romain/sources/romain.c
index 7fa2990..f959d1a 100644
--- a/romain/sources/romain.c
+++ b/romain/sources/romain.c
@@ -18,7 +18,7 @@ MODIFICATIONS
 BUGS
 LEGAL
     GPL
-    Copyright Pascal J. Bourguignon 2000 - 2000
+    Copyright Pascal J. Bourguignon 2000 - 2011

     This file is part of the romain tool.

@@ -47,86 +47,86 @@ typedef enum {false,true} boolean;

 #define toobig  "HORS-LIMITE"

-    static boolean to_roman(int n,char* r)
-    {
-                                /*0101010*/
-                                /*0 1 2 3*/
-                                /*1234567*/
-            const char  digits[]="IVXLCDM";
-            int         u,d;
-            int         j,k2;
+static boolean to_roman(int n,char* r)
+{
+    /*0101010*/
+    /*0 1 2 3*/
+    /*1234567*/
+    const char  digits[]="IVXLCDM";
+    int         u,d;
+    int         j,k2;

-        if((n<1)||(n>=5000)){
-            strcpy(r,toobig);
-            return(false);
-        }
-        for(u=1000,k2=6;k2>=0;u/=10,k2-=2){
-            d=(n/u)%10;
-            switch(d){
-            case 5:
+    if((n<1)||(n>=5000)){
+        strcpy(r,toobig);
+        return(false);
+    }
+    for(u=1000,k2=6;k2>=0;u/=10,k2-=2){
+        d=(n/u)%10;
+        switch(d){
+        case 5:
+            (*r++)=digits[k2+1];
+            break;
+        case 9:
+            if(k2<2){
+                (*r++)=digits[k2];
+                (*r++)=digits[k2+2];
+            }else{
+                /* digits[6] here crashes the NeXTSTEP 3.0 cc compiler. */
+                (*r++)=digits[k2+1];
+                (*r++)=digits[k2];
+                (*r++)=digits[k2];
+                (*r++)=digits[k2];
+                (*r++)=digits[k2];
+            }
+            break;
+        case 4:
+            if(k2<6){
+                (*r++)=digits[k2];
                 (*r++)=digits[k2+1];
                 break;
-            case 9:
-                if(k2<2){
-                    (*r++)=digits[k2];
-                    (*r++)=digits[k2+2];
-                }else{
-                    /* digits[6] here crashes the NeXTSTEP 3.0 cc compiler. */
-                    (*r++)=digits[k2+1];
-                    (*r++)=digits[k2];
-                    (*r++)=digits[k2];
-                    (*r++)=digits[k2];
-                    (*r++)=digits[k2];
-                }
-                break;
-            case 4:
-                if(k2<6){
-                    (*r++)=digits[k2];
-                    (*r++)=digits[k2+1];
-                    break;
-                }
-                /*fall thru*/
-            default:
-                if(d>=5){
-                    (*r++)=digits[k2+1];
-                    d-=5;
-                }
-                for(j=1;j<=d;j++){
-                    (*r++)=digits[k2];
-                }
-                break;
             }
+            /*fall thru*/
+        default:
+            if(d>=5){
+                (*r++)=digits[k2+1];
+                d-=5;
+            }
+            for(j=1;j<=d;j++){
+                (*r++)=digits[k2];
+            }
+            break;
         }
-        (*r++)='\0';
-        return(true);
-    }/*to_roman*/
+    }
+    (*r++)='\0';
+    return(true);
+}/*to_roman*/

 #if 0

 /*
-    Rgles d'criture des nombres romains :
-    Les chiffres M, C, X, I ne peuvent pas tre rpts plus de quatre fois.
-    Les chiffres D, L, V ne peuvent pas tre rpts.
-    Les chiffres doivent tre cris dans l'ordre : M, D, C, L, X, V, I ;
-    sauf que un I peut prcder V, X, L, ou C, et un X peut prcder L ou C.
+  Rgles d'criture des nombres romains :
+  Les chiffres M, C, X, I ne peuvent pas tre rpts plus de quatre fois.
+  Les chiffres D, L, V ne peuvent pas tre rpts.
+  Les chiffres doivent tre cris dans l'ordre : M, D, C, L, X, V, I ;
+  sauf que un I peut prcder V, X, L, ou C, et un X peut prcder L ou C.
 */

-    static boolean roman_chiffre(const char* r,int* i,int* n,char* erreur,
-                            int chiffre,int value,int maxcount)
-    {
-            int     m=0;
-        while(r[*i]=='M'){
-            (*i)++;m++;
-        }
-        if(m>maxcount){
-            sprintf(erreur,"Il ne doit pas y avoir plus de %d '%c'.",
-                        maxcount,chiffre);
-            return(false);
-        }else{
-            (*n)+=m*value;
-            return(true);
-        }
-    }/*roman_chiffre*/
+static boolean roman_chiffre(const char* r,int* i,int* n,char* erreur,
+                             int chiffre,int value,int maxcount)
+{
+    int     m=0;
+    while(r[*i]=='M'){
+        (*i)++;m++;
+    }
+    if(m>maxcount){
+        sprintf(erreur,"Il ne doit pas y avoir plus de %d '%c'.",
+                maxcount,chiffre);
+        return(false);
+    }else{
+        (*n)+=m*value;
+        return(true);
+    }
+}/*roman_chiffre*/


 #define roman_millier(r,i,n,e)      roman_chiffre(r,i,n,e,'M',1000,4)
@@ -137,88 +137,88 @@ typedef enum {false,true} boolean;
 #define roman_unites(r,i,n,e)       roman_chiffre(r,i,n,e,'I',1,3)


-    static boolean roman_dizaines(const char* r,int* i,int* n,char* erreur);
+static boolean roman_dizaines(const char* r,int* i,int* n,char* erreur);

-    static boolean roman_centaines(const char* r,int* i,int* n,char* erreur)
-    {
-        if((r[*i]=='I')&&(r[(*i)+1]=='C')){
-            (*i)+=2;
-            (*n)+=99;
-            return(true);
-        }
-        if(r[*i]=='D'){
-            (*i)++;
-            (*n)+=500;
-        }
-        if(roman_centaine4(r,i,n,erreur)){
-            return(roman_dizaines(r,i,n,erreur));
+static boolean roman_centaines(const char* r,int* i,int* n,char* erreur)
+{
+    if((r[*i]=='I')&&(r[(*i)+1]=='C')){
+        (*i)+=2;
+        (*n)+=99;
+        return(true);
+    }
+    if(r[*i]=='D'){
+        (*i)++;
+        (*n)+=500;
+    }
+    if(roman_centaine4(r,i,n,erreur)){
+        return(roman_dizaines(r,i,n,erreur));
+    }else{
+        return(false);
+    }
+}/*roman_centaines*/
+
+
+static boolean roman_dizaines(const char* r,int* i,int* n,char* erreur)
+{
+    if((r[*i]=='I')&&(r[(*i)+1]=='X')){
+        (*i)+=2;
+        (*n)+=9;
+        return(true);
+    }else if((r[*i]=='I')&&(r[(*i)+1]=='L')){
+        (*i)+=2;
+        (*n)+=49;
+        return(true);
+    }else if(r[*i]=='L'){
+        (*i)++;
+        (*n)+=50;
+        if(roman_dizaine3(r,i,n,erreur)){
+            return(roman_unites(r,i,n,erreur));
         }else{
             return(false);
         }
-    }/*roman_centaines*/
-
-
-    static boolean roman_dizaines(const char* r,int* i,int* n,char* erreur)
-    {
-        if((r[*i]=='I')&&(r[(*i)+1]=='X')){
-            (*i)+=2;
-            (*n)+=9;
-            return(true);
-        }else if((r[*i]=='I')&&(r[(*i)+1]=='L')){
-            (*i)+=2;
-            (*n)+=49;
-            return(true);
-        }else if(r[*i]=='L'){
-            (*i)++;
-            (*n)+=50;
-            if(roman_dizaine3(r,i,n,erreur)){
-                return(roman_unites(r,i,n,erreur));
-            }else{
-                return(false);
-            }
+    }else{
+        if(roman_dizaine4(r,i,n,erreur)){
+            return(roman_unites(r,i,n,erreur));
         }else{
-            if(roman_dizaine4(r,i,n,erreur)){
-                return(roman_unites(r,i,n,erreur));
-            }else{
-                return(false);
-            }
+            return(false);
         }
-    }/*roman_dizaines*/
+    }
+}/*roman_dizaines*/


 /*
-    romain : milliers centaines .
-    milliers : | M | M M | M M M | M M M M .
-    centaines : centaine4 dizaines | D centaine4 dizaines | I C .
-    centaine4 : | C | C C | C C C | C C C C .
-    dizaines : dizaine4 unites | L dizaine3 unites | I L | I X .
-    dizaine4 : dizaine3 | X L .
-    dizaine3 : | X | X X | X X X .
-    unites : unite4 | V unite3 .
-    unite4 : unite3 | I V .
-    unite3 : | I | I I | I I I .
+  romain : milliers centaines .
+  milliers : | M | M M | M M M | M M M M .
+  centaines : centaine4 dizaines | D centaine4 dizaines | I C .
+  centaine4 : | C | C C | C C C | C C C C .
+  dizaines : dizaine4 unites | L dizaine3 unites | I L | I X .
+  dizaine4 : dizaine3 | X L .
+  dizaine3 : | X | X X | X X X .
+  unites : unite4 | V unite3 .
+  unite4 : unite3 | I V .
+  unite3 : | I | I I | I I I .
 */

-    static boolean from_roman(int* n,const char* r,char* erreur)
-    {
-        int     i=0;
-        (*n)=0;
-        if(roman_millier(r,&i,n,erreur)){
-            if(roman_centaines(r,&i,n,erreur)){
-                if(r[i]=='\0'){
-                    return(true);
-                }else{
-                    sprintf(erreur,"Il y a des caractres invalides ou "
-                            "des chiffres en trop : %s",r+i);
-                    return(false);
-                }
+static boolean from_roman(int* n,const char* r,char* erreur)
+{
+    int     i=0;
+    (*n)=0;
+    if(roman_millier(r,&i,n,erreur)){
+        if(roman_centaines(r,&i,n,erreur)){
+            if(r[i]=='\0'){
+                return(true);
             }else{
+                sprintf(erreur,"Il y a des caractres invalides ou "
+                        "des chiffres en trop : %s",r+i);
                 return(false);
             }
         }else{
             return(false);
         }
-    }/*from_roman*/
+    }else{
+        return(false);
+    }
+}/*from_roman*/
 #endif

 int main(void)
@@ -227,7 +227,7 @@ int main(void)
     char r[64];
     for(i=0;i<=5000;i++){
         to_roman(i,r);
-        k=strlen(r);
+        k=(int)strlen(r);
         if(k>l){ m=i; l=k; }
         printf("%4d = %s\n",i,r);
     }
@@ -238,4 +238,4 @@ int main(void)
 }/*main*/


-/*** romain.c                         --                     --          ***/
+/**** THE END ****/
diff --git a/segment/sources/join.c b/segment/sources/join.c
index ea850e4..c0f03b9 100644
--- a/segment/sources/join.c
+++ b/segment/sources/join.c
@@ -21,7 +21,7 @@ MODIFICATIONS
     1990/04/28 <PJB> Creation.
     1993/12/18 <PJB> Updated.
 LEGAL
-    Copyright Pascal J. Bourguignon 1990 - 1993
+    Copyright Pascal J. Bourguignon 1990 - 2011
     All rights reserved.
     This program may not be included in any commercial product without the
     author written permission. It may be used freely for any non-commercial
@@ -54,11 +54,11 @@ static void MakeSegName(char* wholename,CARD32 n,char* segname){
     CARD16      len;

     strcpy(segname,wholename);
-    len=strlen(segname);
+    len=(CARD16)strlen(segname);
     if(len>FileNameSize-4){
         len=FileNameSize-4;
     }
-    sprintf(num,"%03lu",n);
+    sprintf(num,"%03"FMT_CARD32"",n);
     segname[len]='.';       len++;
     segname[len]=num[0];    len++;
     segname[len]=num[1];    len++;
@@ -99,10 +99,11 @@ static void Join(char* wholename,BOOLEAN rmflag,BOOLEAN progress,BOOLEAN debug){
             clearerr(segfile);
             segsize=0;
             while(!feof(segfile)){
-                csize=fread(buffer,1,BufferSize,segfile);
+                size_t r;
+                csize=(CARD32)fread(buffer,1,BufferSize,segfile);
                 if(debug){
                     fprintf(stdout,"$ in while\n");
-                    fprintf(stdout,"$ csize=%lu\n",csize);
+                    fprintf(stdout,"$ csize=%"FMT_CARD32"\n",csize);
                     fflush(stdout);
                 }
                 if(ferror(segfile)){
@@ -111,7 +112,7 @@ static void Join(char* wholename,BOOLEAN rmflag,BOOLEAN progress,BOOLEAN debug){
                     fclose(segfile);
                     break;
                 }
-                fwrite(buffer,1,csize,wholefile);
+                r=fwrite(buffer,1,csize,wholefile);
                 if(ferror(segfile)){
                     fprintf(stderr,"### Write error on %s: skipping.\n",wholename);
                     fflush(stderr);
@@ -121,14 +122,14 @@ static void Join(char* wholename,BOOLEAN rmflag,BOOLEAN progress,BOOLEAN debug){
                 fflush(wholefile);
                 segsize+=csize;
                 if(debug){
-                    fprintf(stdout,"$ csize=%lu\n",csize);
-                    fprintf(stdout,"$ segsize=%lu\n",segsize);
+                    fprintf(stdout,"$ csize=%"FMT_CARD32"\n",csize);
+                    fprintf(stdout,"$ segsize=%"FMT_CARD32"\n",segsize);
                     fflush(stdout);
                 }
             }
             fclose(segfile);
             if(progress){
-                fprintf(stdout,"# %s contains %lu bytes.\n",segname,segsize);
+                fprintf(stdout,"# %s contains %"FMT_CARD32" bytes.\n",segname,segsize);
                 fflush(stdout);
             }
             wholesize+=segsize;
@@ -151,7 +152,7 @@ static void Join(char* wholename,BOOLEAN rmflag,BOOLEAN progress,BOOLEAN debug){
         }/*while*/
         fclose(wholefile);
         if(progress){
-            fprintf(stdout,"# %s contains %lu bytes.\n",wholename,wholesize);
+            fprintf(stdout,"# %s contains %"FMT_CARD32" bytes.\n",wholename,wholesize);
             fflush(stdout);
         }
     }
@@ -200,14 +201,14 @@ int main(int argc, char *argv[])

     param=1;
     while((param<argc)&&(!file)){
-        length=strlen(argv[param]);
+        length=(CARD16)strlen(argv[param]);
         if(*argv[param] != '-'){
             /* file ... */
             file=TRUE;
             break;
         }

-        length=strlen(argv[param]);
+        length=(CARD16)strlen(argv[param]);
         if(length!=2){
           illegal_option:
             fprintf(stderr,
diff --git a/segment/sources/segment.c b/segment/sources/segment.c
index 3a5f3ab..863f306 100644
--- a/segment/sources/segment.c
+++ b/segment/sources/segment.c
@@ -86,7 +86,7 @@ MODIFICATIONS

 LEGAL
     GPL
-    Copyright Pascal J. Bourguignon 1990 - 2002
+    Copyright Pascal J. Bourguignon 1990 - 2011

     This  program is  free software;  you can  redistribute  it and/or
     modify it  under the  terms of the  GNU General Public  License as
@@ -113,57 +113,7 @@ LEGAL
 #include <sysexits.h>
 #include <stdarg.h>

-
-/* 32-bit */
-
-    typedef long int                INT32;
-    typedef short int               INT16;
-    typedef char                    INT8;
-    typedef unsigned long int       CARD32;
-    typedef unsigned short int      CARD16;
-    typedef unsigned char           CARD8;
-    typedef int                     SignT;  /* [ -1, 0,  +1 ] */
-    typedef unsigned char           CHAR;
-    typedef CARD16                  UNICODE;
-    typedef double                  DECIMAL;
-    typedef void*                   ADDRESS;
-
-#define MIN_INT32           ((INT32)0x80000000)
-#define MAX_INT32           ((INT32)0x7fffffff)
-#define MAX_CARD32          ((CARD32)0xffffffff)
-#define MIN_INT16           ((INT32)0x8000)
-#define MAX_INT16           ((INT32)0x7fff)
-#define MAX_CARD16          ((CARD32)0xffff)
-#define MIN_INT8            ((INT32)0x80)
-#define MAX_INT8            ((INT32)0x7f)
-#define MAX_CARD8           ((CARD32)0xff)
-
-
-#ifdef NIL
-#undef NIL
-#endif
-#define NIL                 (0) /*((void*)(0))*/
-
-#ifdef __cplusplus
-#undef  BOOLEAN
-#undef  TRUE
-#undef  FALSE
-#define BOOLEAN bool
-#define TRUE    true
-#define FALSE   false
-#else
-    typedef int   BOOLEAN;
-/* Redefining such a common macro prevents the use of precompiled headers. */
-#ifndef TRUE
-#define TRUE        ((BOOLEAN)(0==0))
-#endif
-#ifndef FALSE
-#define FALSE       ((BOOLEAN)(0!=0))
-#endif
-#endif
-
-
-
+#include <BcTypes.h>


 #define min(a,b)    ((a)<(b)?(a):(b))
@@ -174,158 +124,158 @@ LEGAL
 #define BufferSize      (256*1024)
 #endif

-    const char segment_id[]="$Id";
-    static BOOLEAN      progress=       FALSE;
-    static BOOLEAN      debug=          FALSE;
-    static const char*        pname;
+const char segment_id[]="$Id";
+static BOOLEAN      progress=       FALSE;
+static BOOLEAN      debug=          FALSE;
+static const char*        pname;

-#ifdef __WORDSIZE
-#if __WORDSIZE != 32
-#error "We were assuming a 32bit wordsize!"
-#endif
-#endif
+/* #ifdef __WORDSIZE */
+/* #if __WORDSIZE != 32 */
+/* #error "We were assuming a 32bit wordsize!" */
+/* #endif */
+/* #endif */

-    static int fseek64(FILE* stream,long offset,int whence)
-    {
-        long   max=LONG_MAX;
-        long   hop=1024*1024*1024;
-        long   small_offset;
-        int    res;
-        switch(whence){
-        case SEEK_SET:
-            res=fseek(stream,0,SEEK_SET);
-            if((res==0)&&(offset>0)){
-                return(fseek64(stream,offset,SEEK_CUR));
-            }else{
-                return(res);
-            }
+static int fseek64(FILE* stream,long offset,int whence)
+{
+    long   max=LONG_MAX;
+    long   hop=1024*1024*1024;
+    long   small_offset;
+    int    res;
+    switch(whence){
+    case SEEK_SET:
+        res=fseek(stream,0,SEEK_SET);
+        if((res==0)&&(offset>0)){
+            return(fseek64(stream,offset,SEEK_CUR));
+        }else{
+            return(res);
+        }

-        case SEEK_CUR:
-            res=0;
-            if(offset<0){
-                hop=(-hop);
-                max=(-max);
-                while(max>=offset){
-                    res=fseek(stream,hop,SEEK_CUR);
-                    if(res!=0){
-                        return(res);
-                    }
-                    offset-=hop;
+    case SEEK_CUR:
+        res=0;
+        if(offset<0){
+            hop=(-hop);
+            max=(-max);
+            while(max>=offset){
+                res=fseek(stream,hop,SEEK_CUR);
+                if(res!=0){
+                    return(res);
                 }
-                if(0>offset){
-                    small_offset=offset;
-                    res=fseek(stream,small_offset,SEEK_CUR);
-                }
-            }else{
-                while(max<=offset){
-                    res=fseek(stream,hop,SEEK_CUR);
-                    if(res!=0){
-                        return(res);
-                    }
-                    offset-=hop;
-                }
-                if(0<offset){
-                    small_offset=offset;
-                    res=fseek(stream,small_offset,SEEK_CUR);
+                offset-=hop;
+            }
+            if(0>offset){
+                small_offset=offset;
+                res=fseek(stream,small_offset,SEEK_CUR);
+            }
+        }else{
+            while(max<=offset){
+                res=fseek(stream,hop,SEEK_CUR);
+                if(res!=0){
+                    return(res);
                 }
+                offset-=hop;
             }
-            return(res);
-
-        case SEEK_END:
-            res=fseek(stream,0,SEEK_END);
-            if(res==0){
-                return(fseek64(stream,offset,SEEK_CUR));
-            }else{
-                return(res);
+            if(0<offset){
+                small_offset=offset;
+                res=fseek(stream,small_offset,SEEK_CUR);
             }
-
-        default:
-            return(EINVAL);
         }
-    }/*fseek64*/
+        return(res);
+
+    case SEEK_END:
+        res=fseek(stream,0,SEEK_END);
+        if(res==0){
+            return(fseek64(stream,offset,SEEK_CUR));
+        }else{
+            return(res);
+        }
+
+    default:
+        return(EINVAL);
+    }
+}/*fseek64*/



-    static void MakeSegName(char* segname,char* format,int/*INT16*/ fcase,
-                            char* w,CARD32 n)
-    {
-        switch(fcase){
-        case  0:    sprintf(segname,format,w,w,w,w,w,w);    break;
-        case  1:    sprintf(segname,format,w,w,w,w,w,n);    break;
-        case  2:    sprintf(segname,format,w,w,w,w,n,w);    break;
-        case  3:    sprintf(segname,format,w,w,w,w,n,n);    break;
-        case  4:    sprintf(segname,format,w,w,w,n,w,w);    break;
-        case  5:    sprintf(segname,format,w,w,w,n,w,n);    break;
-        case  6:    sprintf(segname,format,w,w,w,n,n,w);    break;
-        case  7:    sprintf(segname,format,w,w,w,n,n,n);    break;
-        case  8:    sprintf(segname,format,w,w,n,w,w,w);    break;
-        case  9:    sprintf(segname,format,w,w,n,w,w,n);    break;
-        case 10:    sprintf(segname,format,w,w,n,w,n,w);    break;
-        case 11:    sprintf(segname,format,w,w,n,w,n,n);    break;
-        case 12:    sprintf(segname,format,w,w,n,n,w,w);    break;
-        case 13:    sprintf(segname,format,w,w,n,n,w,n);    break;
-        case 14:    sprintf(segname,format,w,w,n,n,n,w);    break;
-        case 15:    sprintf(segname,format,w,w,n,n,n,n);    break;
-        case 16:    sprintf(segname,format,w,n,w,w,w,w);    break;
-        case 17:    sprintf(segname,format,w,n,w,w,w,n);    break;
-        case 18:    sprintf(segname,format,w,n,w,w,n,w);    break;
-        case 19:    sprintf(segname,format,w,n,w,w,n,n);    break;
-        case 20:    sprintf(segname,format,w,n,w,n,w,w);    break;
-        case 21:    sprintf(segname,format,w,n,w,n,w,n);    break;
-        case 22:    sprintf(segname,format,w,n,w,n,n,w);    break;
-        case 23:    sprintf(segname,format,w,n,w,n,n,n);    break;
-        case 24:    sprintf(segname,format,w,n,n,w,w,w);    break;
-        case 25:    sprintf(segname,format,w,n,n,w,w,n);    break;
-        case 26:    sprintf(segname,format,w,n,n,w,n,w);    break;
-        case 27:    sprintf(segname,format,w,n,n,w,n,n);    break;
-        case 28:    sprintf(segname,format,w,n,n,n,w,w);    break;
-        case 29:    sprintf(segname,format,w,n,n,n,w,n);    break;
-        case 30:    sprintf(segname,format,w,n,n,n,n,w);    break;
-        case 31:    sprintf(segname,format,w,n,n,n,n,n);    break;
-        case 32:    sprintf(segname,format,n,w,w,w,w,w);    break;
-        case 33:    sprintf(segname,format,n,w,w,w,w,n);    break;
-        case 34:    sprintf(segname,format,n,w,w,w,n,w);    break;
-        case 35:    sprintf(segname,format,n,w,w,w,n,n);    break;
-        case 36:    sprintf(segname,format,n,w,w,n,w,w);    break;
-        case 37:    sprintf(segname,format,n,w,w,n,w,n);    break;
-        case 38:    sprintf(segname,format,n,w,w,n,n,w);    break;
-        case 39:    sprintf(segname,format,n,w,w,n,n,n);    break;
-        case 40:    sprintf(segname,format,n,w,n,w,w,w);    break;
-        case 41:    sprintf(segname,format,n,w,n,w,w,n);    break;
-        case 42:    sprintf(segname,format,n,w,n,w,n,w);    break;
-        case 43:    sprintf(segname,format,n,w,n,w,n,n);    break;
-        case 44:    sprintf(segname,format,n,w,n,n,w,w);    break;
-        case 45:    sprintf(segname,format,n,w,n,n,w,n);    break;
-        case 46:    sprintf(segname,format,n,w,n,n,n,w);    break;
-        case 47:    sprintf(segname,format,n,w,n,n,n,n);    break;
-        case 48:    sprintf(segname,format,n,n,w,w,w,w);    break;
-        case 49:    sprintf(segname,format,n,n,w,w,w,n);    break;
-        case 50:    sprintf(segname,format,n,n,w,w,n,w);    break;
-        case 51:    sprintf(segname,format,n,n,w,w,n,n);    break;
-        case 52:    sprintf(segname,format,n,n,w,n,w,w);    break;
-        case 53:    sprintf(segname,format,n,n,w,n,w,n);    break;
-        case 54:    sprintf(segname,format,n,n,w,n,n,w);    break;
-        case 55:    sprintf(segname,format,n,n,w,n,n,n);    break;
-        case 56:    sprintf(segname,format,n,n,n,w,w,w);    break;
-        case 57:    sprintf(segname,format,n,n,n,w,w,n);    break;
-        case 58:    sprintf(segname,format,n,n,n,w,n,w);    break;
-        case 59:    sprintf(segname,format,n,n,n,w,n,n);    break;
-        case 60:    sprintf(segname,format,n,n,n,n,w,w);    break;
-        case 61:    sprintf(segname,format,n,n,n,n,w,n);    break;
-        case 62:    sprintf(segname,format,n,n,n,n,n,w);    break;
-        case 63:    sprintf(segname,format,n,n,n,n,n,n);    break;
-        default:    sprintf(segname,"%s.%03lu",w,n);         break;
-        }/*switch*/
-    }/*MakeSegName*/
+static void MakeSegName(char* segname,char* format,int/*INT16*/ fcase,
+                        char* w,CARD32 n)
+{
+    switch(fcase){
+    case  0:    sprintf(segname,format,w,w,w,w,w,w);    break;
+    case  1:    sprintf(segname,format,w,w,w,w,w,n);    break;
+    case  2:    sprintf(segname,format,w,w,w,w,n,w);    break;
+    case  3:    sprintf(segname,format,w,w,w,w,n,n);    break;
+    case  4:    sprintf(segname,format,w,w,w,n,w,w);    break;
+    case  5:    sprintf(segname,format,w,w,w,n,w,n);    break;
+    case  6:    sprintf(segname,format,w,w,w,n,n,w);    break;
+    case  7:    sprintf(segname,format,w,w,w,n,n,n);    break;
+    case  8:    sprintf(segname,format,w,w,n,w,w,w);    break;
+    case  9:    sprintf(segname,format,w,w,n,w,w,n);    break;
+    case 10:    sprintf(segname,format,w,w,n,w,n,w);    break;
+    case 11:    sprintf(segname,format,w,w,n,w,n,n);    break;
+    case 12:    sprintf(segname,format,w,w,n,n,w,w);    break;
+    case 13:    sprintf(segname,format,w,w,n,n,w,n);    break;
+    case 14:    sprintf(segname,format,w,w,n,n,n,w);    break;
+    case 15:    sprintf(segname,format,w,w,n,n,n,n);    break;
+    case 16:    sprintf(segname,format,w,n,w,w,w,w);    break;
+    case 17:    sprintf(segname,format,w,n,w,w,w,n);    break;
+    case 18:    sprintf(segname,format,w,n,w,w,n,w);    break;
+    case 19:    sprintf(segname,format,w,n,w,w,n,n);    break;
+    case 20:    sprintf(segname,format,w,n,w,n,w,w);    break;
+    case 21:    sprintf(segname,format,w,n,w,n,w,n);    break;
+    case 22:    sprintf(segname,format,w,n,w,n,n,w);    break;
+    case 23:    sprintf(segname,format,w,n,w,n,n,n);    break;
+    case 24:    sprintf(segname,format,w,n,n,w,w,w);    break;
+    case 25:    sprintf(segname,format,w,n,n,w,w,n);    break;
+    case 26:    sprintf(segname,format,w,n,n,w,n,w);    break;
+    case 27:    sprintf(segname,format,w,n,n,w,n,n);    break;
+    case 28:    sprintf(segname,format,w,n,n,n,w,w);    break;
+    case 29:    sprintf(segname,format,w,n,n,n,w,n);    break;
+    case 30:    sprintf(segname,format,w,n,n,n,n,w);    break;
+    case 31:    sprintf(segname,format,w,n,n,n,n,n);    break;
+    case 32:    sprintf(segname,format,n,w,w,w,w,w);    break;
+    case 33:    sprintf(segname,format,n,w,w,w,w,n);    break;
+    case 34:    sprintf(segname,format,n,w,w,w,n,w);    break;
+    case 35:    sprintf(segname,format,n,w,w,w,n,n);    break;
+    case 36:    sprintf(segname,format,n,w,w,n,w,w);    break;
+    case 37:    sprintf(segname,format,n,w,w,n,w,n);    break;
+    case 38:    sprintf(segname,format,n,w,w,n,n,w);    break;
+    case 39:    sprintf(segname,format,n,w,w,n,n,n);    break;
+    case 40:    sprintf(segname,format,n,w,n,w,w,w);    break;
+    case 41:    sprintf(segname,format,n,w,n,w,w,n);    break;
+    case 42:    sprintf(segname,format,n,w,n,w,n,w);    break;
+    case 43:    sprintf(segname,format,n,w,n,w,n,n);    break;
+    case 44:    sprintf(segname,format,n,w,n,n,w,w);    break;
+    case 45:    sprintf(segname,format,n,w,n,n,w,n);    break;
+    case 46:    sprintf(segname,format,n,w,n,n,n,w);    break;
+    case 47:    sprintf(segname,format,n,w,n,n,n,n);    break;
+    case 48:    sprintf(segname,format,n,n,w,w,w,w);    break;
+    case 49:    sprintf(segname,format,n,n,w,w,w,n);    break;
+    case 50:    sprintf(segname,format,n,n,w,w,n,w);    break;
+    case 51:    sprintf(segname,format,n,n,w,w,n,n);    break;
+    case 52:    sprintf(segname,format,n,n,w,n,w,w);    break;
+    case 53:    sprintf(segname,format,n,n,w,n,w,n);    break;
+    case 54:    sprintf(segname,format,n,n,w,n,n,w);    break;
+    case 55:    sprintf(segname,format,n,n,w,n,n,n);    break;
+    case 56:    sprintf(segname,format,n,n,n,w,w,w);    break;
+    case 57:    sprintf(segname,format,n,n,n,w,w,n);    break;
+    case 58:    sprintf(segname,format,n,n,n,w,n,w);    break;
+    case 59:    sprintf(segname,format,n,n,n,w,n,n);    break;
+    case 60:    sprintf(segname,format,n,n,n,n,w,w);    break;
+    case 61:    sprintf(segname,format,n,n,n,n,w,n);    break;
+    case 62:    sprintf(segname,format,n,n,n,n,n,w);    break;
+    case 63:    sprintf(segname,format,n,n,n,n,n,n);    break;
+    default:    sprintf(segname,"%s.%03"FMT_CARD32,w,n);break;
+    }/*switch*/
+}/*MakeSegName*/


-    typedef struct CutS {
-        struct CutS*        next;
-        const char*         cutstr;
-        BOOLEAN             after;
-        CARD32              cutlen;
-        CARD32              count;
-    }                   CutT;
+typedef struct CutS {
+    struct CutS*        next;
+    const char*         cutstr;
+    BOOLEAN             after;
+    CARD32              cutlen;
+    CARD32              count;
+}                   CutT;

 static const char* print_format(int size){
     /* if(sizeof(off_t)==sizeof(long long)){ */
@@ -365,609 +315,607 @@ static const char* concat(const char* strings,...){
             return(buffer);
         }}}

-    static CutT* Cut_Alloc(const char* str,BOOLEAN after)
-    {
-        CutT*   cut;
-        cut=malloc(sizeof(CutT));
-        if(cut==NIL){
-            const char* format_string=concat("%s: malloc(",print_format(sizeof(sizeof(CutT))),") returned NIL.\n",0);
-            fprintf(stderr,format_string,pname,sizeof(CutT));
-            exit(EX_UNAVAILABLE);
-        }
-        cut->next=NIL;
-        cut->cutstr=str;
-        cut->after=after;
-        cut->cutlen=strlen(str);
-        return(cut);
-    }/*Cut_Alloc*/
+static CutT* Cut_Alloc(const char* str,BOOLEAN after)
+{
+    CutT*   cut;
+    cut=malloc(sizeof(CutT));
+    if(cut==NIL){
+        const char* format_string=concat("%s: malloc(",print_format(sizeof(sizeof(CutT))),") returned NIL.\n",0);
+        fprintf(stderr,format_string,pname,sizeof(CutT));
+        exit(EX_UNAVAILABLE);
+    }
+    cut->next=NIL;
+    cut->cutstr=str;
+    cut->after=after;
+    cut->cutlen=(CARD32)strlen(str);
+    return(cut);
+}/*Cut_Alloc*/


-    static void Cut_AddObject(CutT** list,CutT* obj)
-    {
-        obj->next=(*list);
-        (*list)=obj;
-    }/*Cut_AddObject*/
+static void Cut_AddObject(CutT** list,CutT* obj)
+{
+    obj->next=(*list);
+    (*list)=obj;
+}/*Cut_AddObject*/




-    static CARD32 Segment_Copy(FILE* src,FILE* dst,CARD32 size,
-                               const char* srcname,CARD32* srcsize,
-                               const char* dstname)
-        /*
-
-            DOES:       Copies at most `size' bytes from `src' stream
-                        to the `dst' stream.
-                        May copy less when EOF is encountered in `src'.
-            RETURNS:    The number of byte written.
-        */
-    {
-        char        buffer[BufferSize];
-        CARD32      segsize;    /* dst size */
-        CARD32      bsize;      /* buffer  size */
-        CARD32      csize;      /* current size */
-
-        clearerr(dst);
-        if(size>BufferSize){
-            bsize=BufferSize;
-        }else{
-            bsize=size;
+static CARD32 Segment_Copy(FILE* src,FILE* dst,CARD32 size,
+                           const char* srcname,CARD32* srcsize,
+                           const char* dstname)
+/*
+
+  DOES:       Copies at most `size' bytes from `src' stream
+  to the `dst' stream.
+  May copy less when EOF is encountered in `src'.
+  RETURNS:    The number of byte written.
+*/
+{
+    char        buffer[BufferSize];
+    CARD32      segsize;    /* dst size */
+    CARD32      bsize;      /* buffer  size */
+    CARD32      csize;      /* current size */
+
+    clearerr(dst);
+    if(size>BufferSize){
+        bsize=BufferSize;
+    }else{
+        bsize=size;
+    }
+    segsize=0;
+    if(debug){
+        fprintf(stdout,"$ bsize=%"FMT_CARD32"\n",bsize);
+        fflush(stdout);
+    }
+    while((segsize<size)&&(!feof(src))){
+        size_t r;
+        if(bsize>size-segsize){
+            bsize=size-segsize;
         }
-        segsize=0;
+        csize=(CARD32)fread(buffer,1,bsize,src);
+        (*srcsize)+=csize;
         if(debug){
-            fprintf(stdout,"$ bsize=%lu\n",bsize);
+            fprintf(stdout,"$ in while\n");
+            fprintf(stdout,"$ bsize=%"FMT_CARD32"\n",bsize);
+            fprintf(stdout,"$ csize=%"FMT_CARD32"\n",csize);
             fflush(stdout);
         }
-        while((segsize<size)&&(!feof(src))){
-            if(bsize>size-segsize){
-                bsize=size-segsize;
-            }
-            csize=fread(buffer,1,bsize,src);
-            (*srcsize)+=csize;
-            if(debug){
-                fprintf(stdout,"$ in while\n");
-                fprintf(stdout,"$ bsize=%lu\n",bsize);
-                fprintf(stdout,"$ csize=%lu\n",csize);
-                fflush(stdout);
-            }
-            if(ferror(src)){
-                fprintf(stderr,"### Read error: skipping %s.\n",
-                        srcname);
-                fflush(stderr);
-                fclose(dst);
-                break;
-            }
-            fwrite(buffer,1,csize,dst);
-            if(ferror(dst)){
-                fprintf(stderr,"### Write error on %s: skipping %s.\n",
-                        dstname,srcname);
-                fflush(stderr);
-                fclose(dst);
-                break;
-            }
-            fflush(dst);
-            segsize+=csize;
-            if(debug){
-                fprintf(stdout,"$ csize=%lu\n",csize);
-                fprintf(stdout,"$ segsize=%lu\n",segsize);
-                fflush(stdout);
-            }
+        if(ferror(src)){
+            fprintf(stderr,"### Read error: skipping %s.\n",
+                    srcname);
+            fflush(stderr);
+            fclose(dst);
+            break;
+        }
+        r=fwrite(buffer,1,csize,dst);
+        if(ferror(dst)){
+            fprintf(stderr,"### Write error on %s: skipping %s.\n",
+                    dstname,srcname);
+            fflush(stderr);
+            fclose(dst);
+            break;
+        }
+        fflush(dst);
+        segsize+=csize;
+        if(debug){
+            fprintf(stdout,"$ csize=%"FMT_CARD32"\n",csize);
+            fprintf(stdout,"$ segsize=%"FMT_CARD32"\n",segsize);
+            fflush(stdout);
         }
-        return(segsize);
-    }/*Segment_Copy*/
+    }
+    return(segsize);
+}/*Segment_Copy*/


-    static void Segment_Size(char* format,int/*INT16*/ fcase,char* wholename,
-                             CARD32 size,INT32 number)
-        /*
-            DOES:       Segments the input file by size.
-                        If number<0, then segments the file as usual.
-                        If number>=0, then only the segment `number'
-                        is written out.
-        */
-    {
-        FILE*       wholefile;
-        FILE*       segfile;
-        INT32       segcount;
-        char        segname[FileNameSize];
-        CARD32      wholesize;  /* wholefile size */
-        CARD32      segsize;    /* the written size */
+static void Segment_Size(char* format,int/*INT16*/ fcase,char* wholename,
+                         CARD32 size,INT32 number)
+/*
+  DOES:       Segments the input file by size.
+  If number<0, then segments the file as usual.
+  If number>=0, then only the segment `number'
+  is written out.
+*/
+{
+    FILE*       wholefile;
+    FILE*       segfile;
+    INT32       segcount;
+    char        segname[FileNameSize];
+    CARD32      wholesize;  /* wholefile size */
+    CARD32      segsize;    /* the written size */
+
+    if(progress){
+        fprintf(stdout,"# segmenting %s\n",wholename);
+        fflush(stdout);
+    }
+    wholefile=fopen(wholename,"rb");
+    if(wholefile==NIL){
+        fprintf(stderr,"### Cannot open the file %s: skipping.\n",
+                wholename);
+        fflush(stderr);
+        fclose(wholefile);
+        return;
+    }

-        if(progress){
-            fprintf(stdout,"# segmenting %s\n",wholename);
-            fflush(stdout);
-        }
-        wholefile=fopen(wholename,"rb");
-        if(wholefile==NIL){
-            fprintf(stderr,"### Cannot open the file %s: skipping.\n",
-                    wholename);
-            fflush(stderr);
+    if(number>=0){
+        long offset=((long)size)*number;
+        clearerr(wholefile);
+        if(0!=fseek64(wholefile,offset,SEEK_SET)){
+            perror("fseek64:");
             fclose(wholefile);
             return;
         }

-        if(number>=0){
-            long offset=((long)size)*number;
-            clearerr(wholefile);
-            if(0!=fseek64(wholefile,offset,SEEK_SET)){
-                perror("fseek64:");
-                fclose(wholefile);
-                return;
-            }
+        MakeSegName(segname,format,fcase,wholename,(unsigned)number);
+        segfile=fopen(segname,"wb");
+        if(segfile==NIL){
+            fprintf(stderr,"### Cannot open the file %s: skipping %s.\n",
+                    segname,wholename);
+            fflush(stderr);
+            return;
+        }
+        segsize=Segment_Copy(wholefile,segfile,size,
+                             wholename,&wholesize,segname);
+        fclose(segfile);

-            MakeSegName(segname,format,fcase,wholename,(unsigned)number);
-            segfile=fopen(segname,"wb");
-            if(segfile==NIL){
-                fprintf(stderr,"### Cannot open the file %s: skipping %s.\n",
-                        segname,wholename);
-                fflush(stderr);
-                return;
+        if(segsize==0){
+            remove(segname);
+        }else{
+            if(progress){
+                fprintf(stdout,"# %s contains %"FMT_CARD32" bytes.\n",segname,segsize);
+                fflush(stdout);
             }
-            segsize=Segment_Copy(wholefile,segfile,size,
-                                 wholename,&wholesize,segname);
-            fclose(segfile);
+        }

-            if(segsize==0){
-                remove(segname);
-            }else{
-                if(progress){
-                    fprintf(stdout,"# %s contains %lu bytes.\n",
-                            segname,segsize);
-                    fflush(stdout);
-                }
-            }
+        fclose(wholefile);
+        return;
+    }

+    segcount=0;
+    wholesize=0;
+    clearerr(wholefile);
+    while(!feof(wholefile)){
+        MakeSegName(segname,format,fcase,wholename,(unsigned)segcount);
+        segfile=fopen(segname,"wb");
+        if(segfile==NIL){
+            fprintf(stderr,"### Cannot open the file %s: skipping %s.\n",
+                    segname,wholename);
+            fflush(stderr);
             fclose(wholefile);
             return;
         }
-
-        segcount=0;
-        wholesize=0;
-        clearerr(wholefile);
-        while(!feof(wholefile)){
-            MakeSegName(segname,format,fcase,wholename,(unsigned)segcount);
-            segfile=fopen(segname,"wb");
-            if(segfile==NIL){
-                fprintf(stderr,"### Cannot open the file %s: skipping %s.\n",
-                        segname,wholename);
-                fflush(stderr);
-                fclose(wholefile);
-                return;
-            }
-            segsize=Segment_Copy(wholefile,segfile,size,
-                                 wholename,&wholesize,segname);
-            fclose(segfile);
-            if(segsize==0){
-                remove(segname);
-            }else{
-                if(progress){
-                    fprintf(stdout,"# %s contains %lu bytes.\n",
-                            segname,segsize);
-                    fflush(stdout);
-                }
+        segsize=Segment_Copy(wholefile,segfile,size,
+                             wholename,&wholesize,segname);
+        fclose(segfile);
+        if(segsize==0){
+            remove(segname);
+        }else{
+            if(progress){
+                fprintf(stdout,"# %s contains %"FMT_CARD32" bytes.\n",segname,segsize);
+                fflush(stdout);
             }
-            segcount++;
-        }/*while*/
-        fclose(wholefile);
-        if(progress){
-            fprintf(stdout,"# %s contains %lu bytes.\n",wholename,wholesize);
-            fflush(stdout);
         }
-    }/*Segment_Size*/
+        segcount++;
+    }/*while*/
+    fclose(wholefile);
+    if(progress){
+        fprintf(stdout,"# %s contains %"FMT_CARD32" bytes.\n",wholename,wholesize);
+        fflush(stdout);
+    }
+}/*Segment_Size*/


-    static void Cut_ResetCount(CutT* list,CARD32 count)
-    {
-        while(list!=NIL){
-            list->count=count+((list->after)?0:1);
-            list=list->next;
-        }
-    }/*Cut_ResetCount*/
+static void Cut_ResetCount(CutT* list,CARD32 count)
+{
+    while(list!=NIL){
+        list->count=count+((list->after)?0:1);
+        list=list->next;
+    }
+}/*Cut_ResetCount*/


-    static BOOLEAN Cut_GetSlice(CutT* list,const char* line,CARD32* slice)
-    {
-        CutT*       current;
-        CARD32      cutlen;
-        CARD32      curcut;
-        const char* s;
-        BOOLEAN     found;
-        BOOLEAN     result=FALSE;
-        if(debug){
-            fprintf(stderr,"Cut_GetSlice \n>>%s",line);
-        }
+static BOOLEAN Cut_GetSlice(CutT* list,const char* line,CARD32* slice)
+{
+    CutT*       current;
+    CARD32      cutlen;
+    CARD32      curcut;
+    const char* s;
+    BOOLEAN     found;
+    BOOLEAN     result=FALSE;
+    if(debug){
+        fprintf(stderr,"Cut_GetSlice \n>>%s",line);
+    }

-        cutlen=strlen(line);
-        current=list;
-        while(current!=NIL){
-            s=line;
-            found=TRUE;
-            while(found&&(current->count>0)){
-                s=strstr(s,current->cutstr);
-                if(s==NULL){
-                    found=FALSE;
-                }else{
-                    found=TRUE;
-                    s+=current->cutlen; /* INC */
-                    (current->count)--;
-                }
-            }
-            if(current->count<=0){
-                result=TRUE;
-                curcut=s-line;
-                if(!(current->after)){
-                    /* if before then undo line INC */
-                    curcut-=current->cutlen;
-                }
-                if(curcut<cutlen){
-                    cutlen=curcut;
-                }
+    cutlen=(CARD32)strlen(line);
+    current=list;
+    while(current!=NIL){
+        s=line;
+        found=TRUE;
+        while(found&&(current->count>0)){
+            s=strstr(s,current->cutstr);
+            if(s==NULL){
+                found=FALSE;
+            }else{
+                found=TRUE;
+                s+=current->cutlen; /* INC */
+                (current->count)--;
             }
-            current=current->next;
         }
-        if(debug){
-            fprintf(stderr,"GetSlice=%s cutlen=%lu \n",
-                    result?"TRUE ":"FALSE",cutlen);
+        if(current->count<=0){
+            result=TRUE;
+            curcut=(CARD32)(s-line);
+            if(!(current->after)){
+                /* if before then undo line INC */
+                curcut-=current->cutlen;
+            }
+            if(curcut<cutlen){
+                cutlen=curcut;
+            }
         }
-        (*slice)=cutlen;
-        return(result);
-    }/*Cut_GetSlice*/
+        current=current->next;
+    }
+    if(debug){
+        fprintf(stderr,"GetSlice=%s cutlen=%"FMT_CARD32"\n",result?"TRUE ":"FALSE",cutlen);
+    }
+    (*slice)=cutlen;
+    return(result);
+}/*Cut_GetSlice*/


-    typedef struct {
-        char            save[2];
-    }               CutStateT;
+typedef struct {
+    char            save[2];
+}               CutStateT;


-    static void CutBuffer(char* buffer,CARD32 pos,CutStateT* state)
-    {
-        if(buffer[pos-1]=='\n'){
-            state->save[0]='\0';
-            state->save[1]=buffer[pos];
-            buffer[pos]='\0';
-        }else{
-            state->save[0]=buffer[pos];
-            state->save[1]=buffer[pos+1];
-            buffer[pos]='\n';
-            buffer[pos+1]='\0';
-        }
-    }/*CutBuffer*/
+static void CutBuffer(char* buffer,CARD32 pos,CutStateT* state)
+{
+    if(buffer[pos-1]=='\n'){
+        state->save[0]='\0';
+        state->save[1]=buffer[pos];
+        buffer[pos]='\0';
+    }else{
+        state->save[0]=buffer[pos];
+        state->save[1]=buffer[pos+1];
+        buffer[pos]='\n';
+        buffer[pos+1]='\0';
+    }
+}/*CutBuffer*/


-    static void UncutBuffer(char* buffer,CARD32 pos,CutStateT* state)
-    {
-        if(state->save[0]=='\0'){
-            buffer[pos]=state->save[1];
-        }else{
-            buffer[pos]=state->save[0];
-            buffer[pos+1]=state->save[1];
-        }
-    }/*UncutBuffer*/
+static void UncutBuffer(char* buffer,CARD32 pos,CutStateT* state)
+{
+    if(state->save[0]=='\0'){
+        buffer[pos]=state->save[1];
+    }else{
+        buffer[pos]=state->save[0];
+        buffer[pos+1]=state->save[1];
+    }
+}/*UncutBuffer*/


-    static FILE* sopen(const char* fname,const char* mode)
-    {
-        FILE*       file;
-        file=fopen(fname,mode);
-        if(file==NIL){
-            fprintf(stderr,"### Cannot open the file '%s'.\n",fname);
-            fflush(stderr);
-        }
-        return(file);
-    }/*sopen*/
+static FILE* sopen(const char* fname,const char* mode)
+{
+    FILE*       file;
+    file=fopen(fname,mode);
+    if(file==NIL){
+        fprintf(stderr,"### Cannot open the file '%s'.\n",fname);
+        fflush(stderr);
+    }
+    return(file);
+}/*sopen*/


-    static void sclose(FILE* file)
-    {
-        fclose(file);
-    }/*sclose*/
+static void sclose(FILE* file)
+{
+    fclose(file);
+}/*sclose*/

 #if 0
-    static BOOLEAN sread(FILE* file,char* buffer,int size)
-    {
-        int         count;
-        char        message[BUFSIZ];
+static BOOLEAN sread(FILE* file,char* buffer,int size)
+{
+    int         count;
+    char        message[BUFSIZ];

-        if(feof(file)){
-            return(FALSE);
-        }
-        clearerr(file);
-        while(size>0){
-            count=fread(buffer,sizeof(char),size,file);
-            if(count<=0){
-                switch(ferror(file)){
-                case EAGAIN:
-                case EINTR:
-                    continue;
-                default:
-                    sprintf(message,"%s: error while reading",pname);
-                    perror(message);
-                    return(FALSE);
-                }
-            }else{
-                buffer+=count;
-                size-=count;
+    if(feof(file)){
+        return(FALSE);
+    }
+    clearerr(file);
+    while(size>0){
+        count=fread(buffer,sizeof(char),size,file);
+        if(count<=0){
+            switch(ferror(file)){
+            case EAGAIN:
+            case EINTR:
+                continue;
+            default:
+                sprintf(message,"%s: error while reading",pname);
+                perror(message);
+                return(FALSE);
             }
+        }else{
+            buffer+=count;
+            size-=count;
         }
-        return(TRUE);
-    }/*sread*/
+    }
+    return(TRUE);
+}/*sread*/


-    static BOOLEAN swrite(FILE* file,char* buffer,int size)
-    {
-        int         count;
-        char        message[BUFSIZ];
+static BOOLEAN swrite(FILE* file,char* buffer,int size)
+{
+    int         count;
+    char        message[BUFSIZ];

-        if(feof(file)){
-            return(FALSE);
-        }
-        clearerr(file);
-        while(size>0){
-            count=fwrite(buffer,sizeof(char),size,file);
-            if(count<=0){
-                switch(ferror(file)){
-                case EAGAIN:
-                case EINTR:
-                    continue;
-                default:
-                    sprintf(message,"%s: error while writting",pname);
-                    perror(message);
-                    return(FALSE);
-                }
-            }else{
-                buffer+=count;
-                size-=count;
+    if(feof(file)){
+        return(FALSE);
+    }
+    clearerr(file);
+    while(size>0){
+        count=fwrite(buffer,sizeof(char),size,file);
+        if(count<=0){
+            switch(ferror(file)){
+            case EAGAIN:
+            case EINTR:
+                continue;
+            default:
+                sprintf(message,"%s: error while writting",pname);
+                perror(message);
+                return(FALSE);
             }
+        }else{
+            buffer+=count;
+            size-=count;
         }
-        return(TRUE);
-    }/*swrite*/
+    }
+    return(TRUE);
+}/*swrite*/
 #endif

-    static BOOLEAN sgets(char* buffer,int size,FILE* file)
-    {
-        char        message[BUFSIZ];
-
-        if(feof(file)){
-            return(FALSE);
-        }
-        clearerr(file);
-        fgets(buffer,size,file);
-        if(ferror(file)!=0){
-            sprintf(message,"%s: error while reading",pname);
-            perror(message);
-            return(FALSE);
-        }else{
-            return(TRUE);
-        }
-    }/*sgets*/
+static BOOLEAN sgets(char* buffer,int size,FILE* file)
+{
+    char        message[BUFSIZ];
+    char* r;
+    if(feof(file)){
+        return(FALSE);
+    }
+    clearerr(file);
+    r=fgets(buffer,size,file);
+    if(ferror(file)!=0){
+        sprintf(message,"%s: error while reading",pname);
+        perror(message);
+        return(FALSE);
+    }else{
+        return(TRUE);
+    }
+}/*sgets*/



-    static BOOLEAN sputs(char* buffer,FILE* file)
-    {
-        char        message[BUFSIZ];
+static BOOLEAN sputs(char* buffer,FILE* file)
+{
+    char        message[BUFSIZ];

-        if(feof(file)){
-            return(FALSE);
-        }
-        clearerr(file);
-        fputs(buffer,file);
-        if(ferror(file)!=0){
-            sprintf(message,"%s: error while writting",pname);
-            perror(message);
-            return(FALSE);
-        }else{
-            return(TRUE);
-        }
-    }/*sputs*/
+    if(feof(file)){
+        return(FALSE);
+    }
+    clearerr(file);
+    fputs(buffer,file);
+    if(ferror(file)!=0){
+        sprintf(message,"%s: error while writting",pname);
+        perror(message);
+        return(FALSE);
+    }else{
+        return(TRUE);
+    }
+}/*sputs*/


-    static void copystring(char* src,char* dst,int cnt)
-    {
-        /* strncpy does not guarantee anything when src and dst overlap */
-        while(((*src)!='\0')&&(cnt-->0)){
-            (*dst++)=(*src++);
-        }
-        (*dst)='\0';
-    }/*copystring*/
-
-
-    static void Segment_CutFile(FILE* wholefile,FILE* segfile,
-                                CutT* cuts,CARD32 repcnt)
-    {
-        static char         buffer[BufferSize]