i just compiled CVS under plan 9's ansi/posix environment
and found a number of very minor problems.

first, a fair bit of the code assumes that unsigned and
signed characters are the same; of course it doesn't
help that gcc can't tell them apart.

second, the concepts of mknod and rdev are foreign to
plan 9.  you might want to make an ST_RDEV() macro
to handle the latter; i'm happy if you don't handle the former:
i can always define a null one.

third, lib/savecvd.c includes <fcntl.h> but forgets to include <sys/types.h> first.
you will probably want more #ifdef's than i used.

the changes i made are below.  < is me, > is original.

enjoy!
russ

diff diff/util.c ../cvs-1.10.8/diff/util.c
385,386c385,386
<             sprintf ((char*)buf, "%d", num);
<             (*callbacks->write_output) ((char*)buf, strlen ((char*)buf));
---
>             sprintf (buf, "%d", num);
>             (*callbacks->write_output) (buf, strlen (buf));
391c391
<             (*callbacks->write_output) ((char*)buf, 1);
---
>             (*callbacks->write_output) (buf, 1);
diff src/client.c ../cvs-1.10.8/src/client.c
1847c1847
<                   if (gunzip_and_write (fd, short_pathname, (unsigned char*)buf, 
size))
---
>                   if (gunzip_and_write (fd, short_pathname, buf, size))
diff src/error.c ../cvs-1.10.8/src/error.c
125c125
<       char buf[100];
---
>       unsigned char buf[100];
diff src/filesubr.c ../cvs-1.10.8/src/filesubr.c
56c56
< //    mknod (to, sb.st_mode, sb.st_rdev);
---
>       mknod (to, sb.st_mode, sb.st_rdev);
623,625c623,625
< //    if (sb1.st_rdev == sb2.st_rdev)
< //        return 0;
< //    else
---
>       if (sb1.st_rdev == sb2.st_rdev)
>           return 0;
>       else
diff src/import.c ../cvs-1.10.8/src/import.c
1212c1212
<                                    (unsigned long) 0 /*sb.st_rdev*/) < 0)
---
>                                    (unsigned long) sb.st_rdev) < 0)
1263c1263
<                                        (unsigned long) 0/*sb.st_rdev*/) < 0)
---
>                                        (unsigned long) sb.st_rdev) < 0)
diff src/rcs.c ../cvs-1.10.8/src/rcs.c
4675,4677c4675,4677
< //    if (mknod (dest, special_file, devnum) < 0)
< //        error (1, errno, "could not create special file %s",
< //               dest);
---
>       if (mknod (dest, special_file, devnum) < 0)
>           error (1, errno, "could not create special file %s",
>                  dest);
5279c5279
<                            (unsigned long) 0/*sb.st_rdev*/);
---
>                            (unsigned long) sb.st_rdev);
diff src/update.c ../cvs-1.10.8/src/update.c
2623c2623
<               rev1_dev = 0; /*sb.st_rdev;*/
---
>               rev1_dev = sb.st_rdev;
2696c2696
<               rev2_dev = 0; /*sb.st_rdev;*/
---
>               rev2_dev = sb.st_rdev;
diff src/zlib.c ../cvs-1.10.8/src/zlib.c
470c470
<       pos += strlen ((char*)buf + pos) + 1;
---
>       pos += strlen (buf + pos) + 1;
472c472
<       pos += strlen ((char*)buf + pos) + 1;
---
>       pos += strlen (buf + pos) + 1;
diff lib/savecwd.c ../cvs-1.10.8/lib/savecwd.c
15,16d14
< #include <sys/types.h>
< 

Reply via email to