...
 
......@@ -103,6 +103,7 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
int ret, differs= 0, r1, r2, fd1= -1, fd2= -1, i, done;
char buf1[4096], buf2[4096], a[4096], ttx1[40], ttx2[40];
off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1;
double dcount;
ret= lstat(adr1, &s1);
if(ret==-1) {
......@@ -241,9 +242,13 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
if(diffcount>0 || r1count!=r2count) {
if(first_diff<0)
first_diff= (r1count>r2count ? r2count : r1count);
if(r1count > r2count)
dcount= diffcount + (r1count - r2count);
else
dcount= diffcount + (r2count - r1count);
printf("%s : %s : differs by at least %.f bytes. First at %.f\n", a,
(s1.st_mtime==s2.st_mtime ? "CONTENT":"content"),
(double) (diffcount + abs(r1count-r2count)), (double) first_diff);
dcount, (double) first_diff);
differs= 1;
}
}
......
This diff is collapsed.
......@@ -1189,7 +1189,7 @@ int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job,
ret= 1;
} else if(action==18) { /* add_missing */
ret= Xorriso_compare_2_files(xorriso, abs_path, iso_path, abs_path+dpl,
&compare_result, 4|(1<<31));
&compare_result, 4|(1u<<31));
if(ret<xorriso->find_compare_result)
xorriso->find_compare_result= ret;
if(ret==0) {
......
......@@ -360,7 +360,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
}
if(flag&1)
if(xorriso->image_start_mode&(1<<31)) /* used up setting */
if(xorriso->image_start_mode&(1u<<31)) /* used up setting */
xorriso->image_start_mode= 0; /* no need to perform auto setting */
if(flag & 1)
xorriso->indev_is_exclusive= xorriso->drives_exclusive;
......@@ -380,7 +380,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
state= isoburn_disc_get_status(drive);
Xorriso_process_msg_queues(xorriso,0);
if(flag&1) {
if(xorriso->image_start_mode&(1<<31)) /* used up setting */
if(xorriso->image_start_mode&(1u<<31)) /* used up setting */
xorriso->image_start_mode&= ~0xffff; /* perform auto setting */
if((xorriso->image_start_mode&(1<<30))) { /* if enabled at all */
adr_pt= xorriso->image_start_value;
......@@ -410,10 +410,10 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
!!(xorriso->image_start_mode & (1<<16)));
if(ret<=0)
goto ex;
if(xorriso->image_start_mode&(1<<31))
if(xorriso->image_start_mode&(1u<<31))
xorriso->image_start_mode= 0; /* disable msc1 setting completely */
else
xorriso->image_start_mode|= (1<<31); /* mark as used up */
xorriso->image_start_mode|= (1u<<31); /* mark as used up */
}
}
if(flag&1) {
......
......@@ -1782,7 +1782,7 @@ illegal_c:;
/* Memorize command until all pathspecs are processed */
delay_opt_list[delay_opt_count++]= i;
if(argv[i] != argpt)
delay_opt_list[delay_opt_count - 1]|= 1<<31;
delay_opt_list[delay_opt_count - 1]|= 1u<<31;
i+= arg_count;
} else if(strcmp(argpt, "-hfsplus") == 0) {
/* was already handled in first argument scan */;
......@@ -1936,7 +1936,7 @@ not_enough_args:;
strcmp(argpt, "-part_like_isohybrid")==0) {
delay_opt_list[delay_opt_count++]= i;
if(argv[i] != argpt)
delay_opt_list[delay_opt_count - 1]|= 1<<31;
delay_opt_list[delay_opt_count - 1]|= 1u<<31;
} else if(strcmp(argpt, "-b") == 0 ||
strcmp(argpt, "-eltorito-boot") == 0 ||
strcmp(argpt, "-eltorito-platform") == 0 ||
......@@ -1966,7 +1966,7 @@ not_enough_args:;
goto not_enough_args;
delay_opt_list[delay_opt_count++]= i;
if(argv[i] != argpt)
delay_opt_list[delay_opt_count - 1]|= 1<<31;
delay_opt_list[delay_opt_count - 1]|= 1u<<31;
i++;
} else if(strncmp(argpt, "--modification-date=", 20)==0) {
ret= Xorriso_option_volume_date(xorriso, "uuid", argpt + 20, 0);
......@@ -2442,8 +2442,8 @@ problem_handler_2:;
/* After all pathspecs are added: perform delayed options, mostly boot related
*/
for(j= 0; j < delay_opt_count; j++) {
i= delay_opt_list[j] & ~(1 << 31);
if(delay_opt_list[j] & (1 << 31))
i= delay_opt_list[j] & ~(1u << 31);
if(delay_opt_list[j] & (1u << 31))
argpt= argv[i] + 1;
else
argpt= argv[i];
......
......@@ -1584,7 +1584,7 @@ ex:;
if(sub_path!=NULL)
free(sub_path);
Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter,
&node_array, &node_count, &node_idx, &node, (1<<31));
&node_array, &node_count, &node_idx, &node, (1u<<31));
return(ret);
}
......@@ -2582,7 +2582,7 @@ cannot_iter:;
}
}
if(flag&(1<<31)) {
if(flag&(1u<<31)) {
if(*node_count>=0 && *node_array!=NULL) {
for(i= 0; i<*node_count; i++)
iso_node_unref((*node_array)[i]);
......@@ -2597,7 +2597,7 @@ cannot_iter:;
}
}
if(flag&(1|(1<<31)))
if(flag&(1|(1u<<31)))
return(1);
if(*node_count>=0) {
/* return next node_array element */
......@@ -3545,7 +3545,7 @@ ex:;
Xorriso_process_msg_queues(xorriso,0);
Xorriso_findi_iter(xorriso, dir_node, &mem, &iter, &node_array, &node_count,
&node_idx, &node, (1<<31));
&node_idx, &node, (1u<<31));
if(ret<=0)
return(ret);
if(deleted)
......
......@@ -694,7 +694,7 @@ int Xorriso_option_rollback(struct XorrisO *xorriso, int flag)
ret= Xorriso_give_up_drive(xorriso, 1|8);
if(ret<=0)
goto ex;
xorriso->image_start_mode&= ~(1<<31); /* reactivate eventual -load address */
xorriso->image_start_mode&= ~(1u<<31); /* reactivate eventual -load address */
ret= Xorriso_option_dev(xorriso, indev, 1|4);
ex:;
Xorriso_free_meM(indev);
......
......@@ -1509,7 +1509,7 @@ ex:
if(link_target!=NULL)
free(link_target);
Xorriso_findi_iter(xorriso, dir, &mem, &iter, &node_array, &node_count,
&node_idx, &node, (1<<31));
&node_idx, &node, (1u<<31));
Xorriso_process_msg_queues(xorriso,0);
......
#define Xorriso_timestamP "2019.07.24.141555"
#define Xorriso_timestamP "2019.08.12.190808"