Skip to content

Commit c9b1229

Browse files
committed
nad: matching types or explicit type conversion
1 parent 0a1fe88 commit c9b1229

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

bin/nad/nad_cp.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static int copy(const char *path,
448448
base += 1;
449449
}
450450
} else {
451-
base = strlen(path);
451+
base = (int) strlen(path);
452452
}
453453
}
454454

@@ -598,9 +598,9 @@ static int copy(const char *path,
598598
ad_setname(&ad, utompath(dvolume.vol, basename(to.p_path)));
599599
}
600600

601-
ad_setdate(&ad, AD_DATE_CREATE | AD_DATE_UNIX, st.st_mtime);
602-
ad_setdate(&ad, AD_DATE_MODIFY | AD_DATE_UNIX, st.st_mtime);
603-
ad_setdate(&ad, AD_DATE_ACCESS | AD_DATE_UNIX, st.st_mtime);
601+
ad_setdate(&ad, AD_DATE_CREATE | AD_DATE_UNIX, (uint32_t) st.st_mtime);
602+
ad_setdate(&ad, AD_DATE_MODIFY | AD_DATE_UNIX, (uint32_t) st.st_mtime);
603+
ad_setdate(&ad, AD_DATE_ACCESS | AD_DATE_UNIX, (uint32_t) st.st_mtime);
604604
ad_setdate(&ad, AD_DATE_BACKUP, AD_DATE_START);
605605
ad_flush(&ad);
606606
ad_close(&ad, ADFLAGS_HF);
@@ -686,9 +686,9 @@ static int copy(const char *path,
686686
ad_setname(&ad, utompath(dvolume.vol, basename(to.p_path)));
687687
}
688688

689-
ad_setdate(&ad, AD_DATE_CREATE | AD_DATE_UNIX, st.st_mtime);
690-
ad_setdate(&ad, AD_DATE_MODIFY | AD_DATE_UNIX, st.st_mtime);
691-
ad_setdate(&ad, AD_DATE_ACCESS | AD_DATE_UNIX, st.st_mtime);
689+
ad_setdate(&ad, AD_DATE_CREATE | AD_DATE_UNIX, (uint32_t) st.st_mtime);
690+
ad_setdate(&ad, AD_DATE_MODIFY | AD_DATE_UNIX, (uint32_t) st.st_mtime);
691+
ad_setdate(&ad, AD_DATE_ACCESS | AD_DATE_UNIX, (uint32_t) st.st_mtime);
692692
ad_setdate(&ad, AD_DATE_BACKUP, AD_DATE_START);
693693
ad_flush(&ad);
694694
ad_close(&ad, ADFLAGS_HF);
@@ -877,7 +877,7 @@ static int ftw_copy_file(const struct FTW *entp _U_,
877877

878878
wtotal = 0;
879879

880-
while ((rcount = read(from_fd, buf, bufsize)) > 0) {
880+
while ((rcount = (int) read(from_fd, buf, bufsize)) > 0) {
881881
for (bufp = buf, wresid = rcount; ;
882882
bufp += wcount, wresid -= wcount) {
883883
wcount = write(to_fd, bufp, wresid);
@@ -938,7 +938,7 @@ static int ftw_copy_link(const struct FTW *p _U_,
938938
int len;
939939
char llink[PATH_MAX];
940940

941-
if ((len = readlink(spath, llink, sizeof(llink) - 1)) == -1) {
941+
if ((len = (int) readlink(spath, llink, sizeof(llink) - 1)) == -1) {
942942
SLOG("readlink: %s: %s", spath, strerror(errno));
943943
return 1;
944944
}

bin/nad/nad_util.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ int convert_dots_encoding(const afpvol_t *svol, const afpvol_t *dvol,
216216
static charset_t from = (charset_t) -1;
217217
static char buf[MAXPATHLEN + 2];
218218
char *bname = stripped_slashes_basename(path);
219-
int pos = bname - path;
219+
long pos = bname - path;
220220
uint16_t flags = 0;
221221

222222
if (! svol->vol->v_path) {
@@ -230,12 +230,12 @@ int convert_dots_encoding(const afpvol_t *svol, const afpvol_t *dvol,
230230
from = svol->vol->v_volcharset;
231231
}
232232

233-
int len = convert_charset(from,
234-
dvol->vol->v_volcharset,
235-
dvol->vol->v_maccharset,
236-
bname, strlen(bname),
237-
buf, MAXPATHLEN,
238-
&flags);
233+
size_t len = convert_charset(from,
234+
dvol->vol->v_volcharset,
235+
dvol->vol->v_maccharset,
236+
bname, strlen(bname),
237+
buf, MAXPATHLEN,
238+
&flags);
239239

240240
if (len == -1) {
241241
return -1;

0 commit comments

Comments
 (0)