X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/cd87e2f59abe075139af21039dd857fd90849fa5..45d8bfe09e10cecb49b030767d4bfc995d42b903:/flist.c diff --git a/flist.c b/flist.c index 8e543a63..325c101f 100644 --- a/flist.c +++ b/flist.c @@ -396,8 +396,7 @@ static void send_file_entry(struct file_struct *file, int f) flags |= XMIT_TOP_DIR; if ((flags & 0xFF00) || !flags) { flags |= XMIT_EXTENDED_FLAGS; - write_byte(f, flags); - write_byte(f, flags >> 8); + write_shortint(f, flags); } else write_byte(f, flags); } else { @@ -455,8 +454,8 @@ static void send_file_entry(struct file_struct *file, int f) if (file->link_u.idev) { if (protocol_version < 26) { /* 32-bit dev_t and ino_t */ - write_int(f, dev); - write_int(f, file->F_INODE); + write_int(f, (int32)dev); + write_int(f, (int32)file->F_INODE); } else { /* 64-bit dev_t and ino_t */ if (!(flags & XMIT_SAME_DEV)) @@ -467,7 +466,7 @@ static void send_file_entry(struct file_struct *file, int f) #endif if (always_checksum && (S_ISREG(mode) || protocol_version < 28)) { - char *sum; + const char *sum; if (S_ISREG(mode)) sum = file->u.sum; else { @@ -719,7 +718,7 @@ static struct file_struct *receive_file_entry(struct file_list *flist, * statting directories if we're not recursing, but this is not a very * important case. Some systems may not have d_type. **/ -struct file_struct *make_file(char *fname, struct file_list *flist, +struct file_struct *make_file(const char *fname, struct file_list *flist, STRUCT_STAT *stp, unsigned short flags, int filter_level) { @@ -794,7 +793,7 @@ struct file_struct *make_file(char *fname, struct file_list *flist, return NULL; } - /* We only care about directories because we need to avoid recursing + /* -x only affects directories because we need to avoid recursing * into a mount-point directory, not to avoid copying a symlinked * file if -L (or similar) was specified. */ if (one_file_system && st.st_dev != filesystem_dev @@ -1450,10 +1449,10 @@ int flist_find(struct file_list *flist, struct file_struct *f) if (mid_up > high) { /* If there's nothing left above us, set high to * a non-empty entry below us and continue. */ - high = mid - flist->files[mid]->length; + high = mid - (int)flist->files[mid]->length; if (!flist->files[high]->basename) { do { - high -= flist->files[high]->length; + high -= (int)flist->files[high]->length; } while (!flist->files[high]->basename); flist->files[mid]->length = mid - high; } @@ -1505,8 +1504,7 @@ struct file_list *flist_new(int with_hlink, char *msg) memset(flist, 0, sizeof (struct file_list)); - if (!(flist->file_pool = pool_create(FILE_EXTENT, 0, - out_of_memory, POOL_INTERN))) + if (!(flist->file_pool = pool_create(FILE_EXTENT, 0, out_of_memory, POOL_INTERN))) out_of_memory(msg); #ifdef SUPPORT_HARD_LINKS