|
80 | 80 | #include <fcntl.h>
|
81 | 81 | #include <inttypes.h>
|
82 | 82 | #include <stdbool.h>
|
| 83 | +#include <stdint.h> |
83 | 84 | #include <stdio.h>
|
84 | 85 | #include <stdlib.h>
|
85 | 86 | #include <string.h>
|
@@ -536,7 +537,7 @@ cocofs_parse_fname(char *fname, char name[8], char ext[3],
|
536 | 537 | return true;
|
537 | 538 | }
|
538 | 539 |
|
539 |
| -static unsigned int |
| 540 | +static uint16_t |
540 | 541 | cocofs_dir_lastbytes(const uint8_t *lastbytes)
|
541 | 542 | {
|
542 | 543 | return (lastbytes[0] << 8) | lastbytes[1];
|
@@ -770,7 +771,7 @@ cocofs_stat(const struct cocofs *fs, const struct cocofs_dirent *dir,
|
770 | 771 | }
|
771 | 772 |
|
772 | 773 | if (last_nsec) {
|
773 |
| - unsigned int lastsec_bytes; |
| 774 | + uint16_t lastsec_bytes; |
774 | 775 |
|
775 | 776 | size += last_nsec * COCOFS_BYTES_PER_SEC;
|
776 | 777 |
|
@@ -819,7 +820,7 @@ cocofs_enumerate_directory(struct cocofs *fs, bool do_dump)
|
819 | 820 | unsigned int di;
|
820 | 821 | unsigned int free_granules = COCOFS_NGRANULES;
|
821 | 822 | unsigned int loopcnt;
|
822 |
| - unsigned int lastbytes; |
| 823 | + uint16_t lastbytes; |
823 | 824 | uint8_t g, gn;
|
824 | 825 |
|
825 | 826 | uint8_t gmap_shadow[COCOFS_NGRANULES];
|
@@ -945,7 +946,7 @@ cocofs_copyout(const struct cocofs *fs, const struct cocofs_dirent *dir,
|
945 | 946 | {
|
946 | 947 | unsigned int loopcnt;
|
947 | 948 | unsigned int last_nsec = 0;
|
948 |
| - unsigned int last_nbytes; |
| 949 | + uint16_t last_nbytes; |
949 | 950 | unsigned int offset;
|
950 | 951 | unsigned int gi;
|
951 | 952 | ssize_t rv;
|
@@ -1135,10 +1136,10 @@ cocofs_copyin(struct cocofs *fs, const char *infile, const char name[8],
|
1135 | 1136 | * each granule has been marked as allocated in the Granule
|
1136 | 1137 | * Map.
|
1137 | 1138 | */
|
1138 |
| - unsigned int resid, cursz; |
| 1139 | + ssize_t resid, cursz; |
1139 | 1140 | ssize_t rv;
|
1140 | 1141 | uint8_t *buf;
|
1141 |
| - for (gi = 0, resid = (unsigned int)sb.st_size; |
| 1142 | + for (gi = 0, resid = (ssize_t)sb.st_size; |
1142 | 1143 | resid != 0; gi++, resid -= cursz) {
|
1143 | 1144 | cursz = resid;
|
1144 | 1145 | if (cursz > COCOFS_BYTES_PER_GRANULE) {
|
|
0 commit comments