Browse Source

Changed all occurences of (1<<31) to (1u<<31). Thanks Eliska Svobodova.

master
Thomas Schmitt 3 years ago
parent
commit
56a596208c
  1. 64
      xorriso/cmp_update.c
  2. 2
      xorriso/disk_ops.c
  3. 8
      xorriso/drive_mgt.c
  4. 10
      xorriso/emulators.c
  5. 8
      xorriso/iso_manip.c
  6. 2
      xorriso/opts_p_z.c
  7. 2
      xorriso/read_run.c
  8. 2
      xorriso/xorriso_timestamp.h

64
xorriso/cmp_update.c

@ -74,7 +74,7 @@ int Xorriso_compare_2_contents(struct XorrisO *xorriso, char *common_adr,
sprintf(respt, "- %s (DISK) : cannot open() : %s\n",
disk_adr, strerror(errno));
cannot_address:;
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 2048;
{ret= 0; goto ex;}
@ -106,7 +106,7 @@ cannot_address:;
ret= Xorriso_iso_file_open(xorriso, iso_adr, NULL, &stream2, 0);
if(ret<=0) {
sprintf(respt, "- %s (ISO) : cannot open() file in ISO image\n",iso_adr);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
close(fd1);
(*result)|= 4096;
@ -156,7 +156,7 @@ cannot_address:;
if(disk_size > r1count + r1 + offset) {
sprintf(respt, "- %s (DISK) : early EOF after %.f bytes\n",
disk_adr, (double) r1count);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 8196;
}
@ -169,7 +169,7 @@ cannot_address:;
if(iso_size > r2count + r2) {
sprintf(respt, "- %s (ISO) : early EOF after %.f bytes\n",
iso_adr, (double) r2count);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= (1<<14);
}
@ -180,7 +180,7 @@ cannot_address:;
if(disk_size > r1count + r1 + offset) {
sprintf(respt, "- %s (DISK) : early EOF after %.f bytes\n",
disk_adr, (double) r1count);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 8196;
}
@ -205,7 +205,7 @@ cannot_address:;
if(!(flag&(1<<29))) {
xorriso->pacifier_count+= r1;
xorriso->pacifier_byte_count+= r1;
if(flag&(1<<31))
if(flag&(1u<<31))
Xorriso_pacifier_callback(xorriso, "content bytes read",
xorriso->pacifier_count, 0, "", 8);
else
@ -229,7 +229,7 @@ cannot_address:;
sprintf(offset_text, "%.f+", (double) offset);
sprintf(respt, "%s %s : differs by MD5 sums.\n",
common_adr, (flag&1 ? "CONTENT": "content"));
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= (1<<15);
}
@ -246,7 +246,7 @@ cannot_address:;
sprintf(respt, "%s %s : differs by at least %.f bytes. First at %s%.f\n",
common_adr, (flag&1 ? "CONTENT": "content"),
dcount, offset_text, (double) first_diff);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= (1<<15);
}
@ -339,7 +339,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
Text_shellsafe(disk_adr, respt, 1);
sprintf(respt + strlen(respt), " (DISK) : exluded by %s\n",
(ret==1 ? "-not_paths" : "-not_leaf"));
if(! (flag & ((1 << 31) | (1 << 26))))
if(! (flag & ((1u << 31) | (1 << 26))))
Xorriso_result(xorriso,0);
missing= 1;
(*result)|= 1;
@ -355,7 +355,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
Text_shellsafe(disk_adr, respt, 1);
sprintf(respt + strlen(respt),
" (DISK) : cannot lstat() : %s\n", strerror(errno));
if(! (flag & ((1 << 31) | (1 << 26))))
if(! (flag & ((1u << 31) | (1 << 26))))
Xorriso_result(xorriso,0);
missing= 1;
(*result)|= 1;
@ -384,7 +384,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
strcpy(respt, "? ");
Text_shellsafe(iso_adr, respt, 1);
strcat(respt, " (ISO) : cannot find this file in ISO image\n");
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
missing= 1;
(*result)|= 2;
@ -410,7 +410,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
sprintf(respt, "%s st_mode : %7.7o <> %7.7o\n",
a, (unsigned int) (s1.st_mode & ~S_IFMT),
(unsigned int) (s2.st_mode & ~S_IFMT));
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 4;
}
@ -418,7 +418,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
if((s1.st_mode&S_IFMT)!=(s2.st_mode&S_IFMT)) {
sprintf(respt, "%s type : %s <> %s\n",
a, Ftypetxt(s1.st_mode, 0), Ftypetxt(s2.st_mode, 0));
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 8;
if((s1.st_mode&S_IFMT) == S_IFLNK) {
@ -458,7 +458,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
if((*result) & (1 << 19)) {
sprintf(respt, "%s ACL : %d difference%s\n",
a, diff_count, diff_count == 1 ? "" : "s");
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
}
}
@ -479,7 +479,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
(*result)|= (1 << 20);
sprintf(respt, "%s xattr : %d difference%s\n",
a, diff_count, diff_count == 1 ? "" : "s");
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
}
}
@ -487,14 +487,14 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
if(s1.st_uid != s2.st_uid) {
sprintf(respt, "%s st_uid : %lu <> %lu\n", a,
(unsigned long) s1.st_uid, (unsigned long) s2.st_uid);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 16;
}
if(s1.st_gid != s2.st_gid) {
sprintf(respt, "%s st_gid : %lu <> %lu\n", a,
(unsigned long) s1.st_gid, (unsigned long) s2.st_gid);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 32;
}
@ -504,7 +504,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
sprintf(respt, "%s %s st_rdev : %lu <> %lu\n", a,
(S_ISCHR(s1.st_mode) ? "S_IFCHR" : "S_IFBLK"),
(unsigned long) s1.st_rdev, (unsigned long) s1.st_rdev);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 64;
}
@ -514,7 +514,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
sprintf(respt, "%s st_size : %.f <> %.f diff= %.f\n",
a, (double) s1.st_size, (double) s2.st_size,
((double) s1.st_size) - (double) s2.st_size);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 128;
}
@ -523,7 +523,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
a, Ftimetxt(s1.st_mtime, ttx1, 0),
Ftimetxt(s2.st_mtime, ttx2, 0),
((double) s1.st_mtime) - (double) s2.st_mtime);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 256;
}
@ -533,7 +533,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
a, Ftimetxt(s1.st_atime, ttx1, 0),
Ftimetxt(s2.st_atime, ttx2, 0),
((double) s1.st_atime) - (double) s2.st_atime);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 512;
}
@ -544,7 +544,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
a, Ftimetxt(s1.st_ctime, ttx1, 0),
Ftimetxt(s2.st_ctime, ttx2, 0),
((double) s1.st_ctime) - (double) s2.st_ctime);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 1024;
}
@ -573,7 +573,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
!((*result) & (8 | 128 | 256 | 512 | 1024))) {
sprintf(respt,
"%s content : node timestamp younger than image timestamp\n", a);
if((xorriso->do_aaip & 32) && !(flag&(1<<31)))
if((xorriso->do_aaip & 32) && !(flag&(1u<<31)))
Xorriso_result(xorriso,0);
stamp= s2.st_mtime;
if((flag & 1) && s2.st_atime >= stamp)
@ -584,19 +584,19 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
a, Ftimetxt(stamp, ttx1, 3 << 1),
Ftimetxt(xorriso->isofs_st_in, ttx2, 3 << 1),
((double) stamp) - (double) xorriso->isofs_st_in);
if((xorriso->do_aaip & 32) && !(flag&(1<<31)))
if((xorriso->do_aaip & 32) && !(flag&(1u<<31)))
Xorriso_result(xorriso,0);
}
sprintf(respt,
"%s content : assuming inequality due to size or timestamps\n", a);
if((xorriso->do_aaip & 32) && !(flag&(1<<31)))
if((xorriso->do_aaip & 32) && !(flag&(1u<<31)))
Xorriso_result(xorriso,0);
}
}
} else if(ret == 1) { /* mismatch */
(*result)|= (1 << 21);
sprintf(respt, "%s dev_ino : differing\n", a);
if((xorriso->do_aaip & 32) && !(flag&(1<<31)))
if((xorriso->do_aaip & 32) && !(flag&(1u<<31)))
Xorriso_result(xorriso,0);
if((xorriso->do_aaip & 64) && S_ISREG(s1.st_mode) && S_ISREG(s2.st_mode)){
@ -605,12 +605,12 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
(*result)|= (1 << 15); /* content bytes differ */
sprintf(respt,
"%s content : assuming inequality after dev_ino mismatch\n", a);
if((xorriso->do_aaip & 32) && !(flag&(1<<31)))
if((xorriso->do_aaip & 32) && !(flag&(1u<<31)))
Xorriso_result(xorriso,0);
}
} else {
sprintf(respt, "%s dev_ino : no dev_ino stored with image node\n", a);
if((xorriso->do_aaip & 32) && !(flag&(1<<31)))
if((xorriso->do_aaip & 32) && !(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= (1 << 22);
}
@ -634,7 +634,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
ret= Xorriso_compare_2_contents(xorriso, a, disk_adr, s1.st_size,
offset, bytes,
part_path, stbuf.st_size, result,
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1<<31))));
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1u<<31))));
if(ret<0)
was_error= 1;
}
@ -642,7 +642,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
sprintf(xorriso->info_text,
"- %s/* (ISO) : Not all split parts present (%d of %d)\n",
iso_adr, split_count, total_parts);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 1);
(*result)|= 1<<18;
}
@ -650,7 +650,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
ret= Xorriso_compare_2_contents(xorriso, a, disk_adr, s1.st_size,
(off_t) 0, s1.st_size,
iso_adr, s2.st_size, result,
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1<<31))));
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1u<<31))));
if(ret<0)
was_error= 1;
}
@ -746,7 +746,7 @@ int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter, void *node,
(xorriso->do_follow_param && !(flag&2))) <<28;
ret= Xorriso_compare_2_files(xorriso, disk_path, iso_path, "", &result,
2 | follow_links | ((!!(flag & 4)) << 26)
| ((!(flag&2))<<27) | ((flag&1)<<31));
| ((!(flag&2))<<27) | (((unsigned)(flag&1))<<31));
/* was once: | ((!(flag&1))<<29) */
if(ret<xorriso->find_compare_result)
xorriso->find_compare_result= ret;

2
xorriso/disk_ops.c

@ -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) {

8
xorriso/drive_mgt.c

@ -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) {

10
xorriso/emulators.c

@ -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];

8
xorriso/iso_manip.c

@ -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)

2
xorriso/opts_p_z.c

@ -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);

2
xorriso/read_run.c

@ -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);

2
xorriso/xorriso_timestamp.h

@ -1 +1 @@
#define Xorriso_timestamP "2019.08.12.152719"
#define Xorriso_timestamP "2019.08.12.190808"

Loading…
Cancel
Save