Update
Fix warnings on powerpc architecture where it would seem char is unsigned so comparisons with -1 cause a warning that comparison is always true/wrong. (Thanks to Ender for reporting.) (Logical change 1.324)edge.strict_endians
parent
e14c9479ce
commit
9193cb6298
|
@ -120,7 +120,7 @@ int parse_options (int argc, char **argv)
|
|||
opts.inode = -1;
|
||||
opts.attr = -1;
|
||||
|
||||
while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != -1) {
|
||||
while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
||||
switch (c) {
|
||||
case 1: /* A non-option argument */
|
||||
if (!opts.device) {
|
||||
|
|
|
@ -217,7 +217,7 @@ static void parse_options(int argc, char **argv)
|
|||
|
||||
memset(&opt, 0, sizeof(opt));
|
||||
|
||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
||||
switch (c) {
|
||||
case 1: /* A non-option argument */
|
||||
if (opt.volume)
|
||||
|
|
|
@ -126,7 +126,7 @@ int parse_options (int argc, char **argv)
|
|||
opts.range_begin = -1;
|
||||
opts.range_end = -1;
|
||||
|
||||
while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != -1) {
|
||||
while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
||||
switch (c) {
|
||||
case 1: /* A non-option argument */
|
||||
if (!opts.device) {
|
||||
|
|
|
@ -153,7 +153,7 @@ int parse_options (int argc, char *argv[])
|
|||
|
||||
opts.inode = -1;
|
||||
|
||||
while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != -1) {
|
||||
while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
||||
switch (c) {
|
||||
case 'd': /* A non-option argument */
|
||||
if (!opts.device) {
|
||||
|
|
|
@ -144,7 +144,7 @@ int parse_options(int argc, char *argv[])
|
|||
opts.device = NULL;
|
||||
opts.path = "/";
|
||||
|
||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
|
||||
while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
||||
switch (c) {
|
||||
case 'd':
|
||||
opts.device = optarg;
|
||||
|
|
|
@ -389,7 +389,7 @@ static int parse_options(int argc, char **argv)
|
|||
memset(&opt, 0, sizeof(opt));
|
||||
opt.show_progress = 1;
|
||||
|
||||
while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != -1) {
|
||||
while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
||||
switch (c) {
|
||||
case 1: /* A non-option argument */
|
||||
if (!err && !opt.volume)
|
||||
|
|
|
@ -302,7 +302,7 @@ int parse_options (int argc, char *argv[])
|
|||
opts.percent = -1;
|
||||
opts.fillbyte = -1;
|
||||
|
||||
while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != -1) {
|
||||
while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != (char)-1) {
|
||||
switch (c) {
|
||||
case 1: /* A non-option argument */
|
||||
if (!opts.device) {
|
||||
|
@ -313,7 +313,7 @@ int parse_options (int argc, char *argv[])
|
|||
}
|
||||
break;
|
||||
case 'b':
|
||||
if (opts.fillbyte == -1) {
|
||||
if (opts.fillbyte == (char)-1) {
|
||||
end = NULL;
|
||||
opts.fillbyte = strtol (optarg, &end, 0);
|
||||
if (end && *end)
|
||||
|
@ -444,7 +444,8 @@ int parse_options (int argc, char *argv[])
|
|||
|
||||
switch (opts.mode) {
|
||||
case MODE_SCAN:
|
||||
if (opts.output || opts.dest || (opts.fillbyte != -1)) {
|
||||
if (opts.output || opts.dest ||
|
||||
(opts.fillbyte != (char)-1)) {
|
||||
Eprintf ("Scan can only be used with --percent, "
|
||||
"--match, --ignore-case, --size and --time.\n");
|
||||
err++;
|
||||
|
@ -463,9 +464,11 @@ int parse_options (int argc, char *argv[])
|
|||
}
|
||||
break;
|
||||
case MODE_COPY:
|
||||
if ((opts.fillbyte != -1) || (opts.percent != -1) ||
|
||||
opts.match || opts.match_case ||
|
||||
(opts.size_begin > 0) || (opts.size_end > 0)) {
|
||||
if ((opts.fillbyte != (char)-1) ||
|
||||
(opts.percent != -1) ||
|
||||
opts.match || opts.match_case ||
|
||||
(opts.size_begin > 0) ||
|
||||
(opts.size_end > 0)) {
|
||||
Eprintf ("Copy can only be used with --output and --destination.\n");
|
||||
err++;
|
||||
}
|
||||
|
@ -491,7 +494,7 @@ int parse_options (int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
if (opts.fillbyte == -1)
|
||||
if (opts.fillbyte == (char)-1)
|
||||
opts.fillbyte = 0;
|
||||
|
||||
if (ver)
|
||||
|
|
Loading…
Reference in New Issue