Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix type errors

  • Loading branch information...
commit 264675a1af451647f967dcb2692bba7cc61e65ca 1 parent a94a0ac
Koen Holtman authored

Showing 3 changed files with 18 additions and 14 deletions. Show diff stats Hide diff stats

  1. +4 0 HISTORY
  2. +11 11 afio.c
  3. +3 3 afio.h
4 HISTORY
@@ -988,3 +988,7 @@ reported by Ian Campbell. Closes Debian bug #686613.
988 988
989 989 Added d letter for the -1 option.
990 990
  991 +Fixed two compiler errors (as reported by recent gcc) due to
  992 +discrepancies between function declarations in afio.h and afio.c.
  993 +Problem reported by Jari Aalto. Added some more size_t and ssize_t.
  994 +
22 afio.c
@@ -924,8 +924,8 @@ void mail(char *who,int vol,char *archive)
924 924 STATIC VOIDFN
925 925 copyin (char **av)
926 926 {
927   - reg int got;
928   - reg uint have;
  927 + reg ssize_t got;
  928 + reg ssize_t have;
929 929
930 930 if (*av)
931 931 fatal (*av, "Extraneous argument");
@@ -1080,7 +1080,7 @@ fatal (char *what, char *why)
1080 1080 * about write() elsewhere.
1081 1081 */
1082 1082 STATIC
1083   -int writeall(int fd, const char *buf, size_t count)
  1083 +ssize_t writeall(int fd, const char *buf, size_t count)
1084 1084 {
1085 1085 ssize_t put;
1086 1086 size_t totalput;
@@ -1553,12 +1553,12 @@ indata (fd, size, name)
1553 1553 reg off_t size;
1554 1554 char *name;
1555 1555 {
1556   - reg uint chunk;
  1556 + reg size_t chunk;
1557 1557 reg char *oops;
1558   - reg int sparse;
  1558 + reg ssize_t sparse;
1559 1559 reg int corrupt;
1560 1560 auto char *buf;
1561   - auto uint avail;
  1561 + auto size_t avail;
1562 1562
1563 1563 corrupt = sparse = 0;
1564 1564 oops = NULL;
@@ -4247,8 +4247,8 @@ passdata (from, ifd, to, ofd)
4247 4247 char *to;
4248 4248 reg int ofd;
4249 4249 {
4250   - reg int got;
4251   - reg int sparse;
  4250 + reg ssize_t got;
  4251 + reg ssize_t sparse;
4252 4252 auto char block[FSBUF];
4253 4253
4254 4254 if (ifd)
@@ -4262,7 +4262,7 @@ passdata (from, ifd, to, ofd)
4262 4262 VOID warn (got < 0 ? from : to, syserr ());
4263 4263 else if (sparse > 0
4264 4264 && (lseek (ofd, (off_t) - sparse, 1) < 0
4265   - || writeall (ofd, block, (uint) sparse) != sparse))
  4265 + || writeall (ofd, block, sparse) != sparse))
4266 4266 VOID warn (to, syserr ());
4267 4267 }
4268 4268 VOID close (ofd);
@@ -4523,11 +4523,11 @@ rmdir (name)
4523 4523 * 0 if the block was written, the given length for a sparse
4524 4524 * block or -1 if unsuccessful.
4525 4525 */
4526   -STATIC int
  4526 +STATIC ssize_t
4527 4527 fswrite (fd, buf, len)
4528 4528 int fd;
4529 4529 char *buf;
4530   - uint len;
  4530 + size_t len;
4531 4531 {
4532 4532 reg char *bidx;
4533 4533 reg char *bend;
6 afio.h
@@ -446,7 +446,7 @@ int openotty (char *, Stat *, Link *, int, int);
446 446 int openqtty (void);
447 447 int options (int, char **, char *);
448 448 VOIDFN out (char **);
449   -void outalloc (uint);
  449 +void outalloc (size_t);
450 450 size_t outavail (char **);
451 451 int outdata (int, char*, off_t);
452 452
@@ -481,7 +481,7 @@ int rmdir (char *);
481 481 #if !defined (linux) && !defined(__FreeBSD__) && !defined(sun) && !defined(__CYGWIN32__)
482 482 VOIDFN (*signal ())();
483 483 #endif
484   - int fswrite (int, char*, uint);
  484 + ssize_t fswrite (int, char*, size_t);
485 485 char *syserr (void);
486 486 VOIDFN toc (char **);
487 487 void tocentry (char *, Stat *);
@@ -497,7 +497,7 @@ VOIDFN (*signal ())();
497 497 int xwait (int, char *, int);
498 498 void mail(char *who,int vol,char *archive);
499 499
500   -int writeall(int, const char*, unsigned int);
  500 +ssize_t writeall(int, const char*, size_t);
501 501 int incheckentry(char *, Stat *);
502 502 int incheckdata (int fd, off_t size, char *name, Stat *asb, int comp);
503 503 Link * linkinode16 (dev_t dev, ino_t ino);

0 comments on commit 264675a

Please sign in to comment.
Something went wrong with that request. Please try again.