Changeset 3893 in MondoRescue


Ignore:
Timestamp:
Mar 13, 2024, 4:49:30 PM (3 months ago)
Author:
Bruno Cornec
Message:

Remove more warnings - switch and size_t/int comparisons

Location:
branches/3.3/mondo/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mondo/src/common/libmondo-archive.c

    r3892 r3893  
    18001800                default:
    18011801                    log_msg(2, "feed_into_ntfsprog() called in background --- pid=%ld", (long int) (pid));
     1802                    break;
    18021803                }
    18031804            }
     
    19801981
    19811982    p_last_set_archived = (int *) inbuf;
    1982     p_archival_threads_running = (int *) (inbuf + 4);
    1983     p_next_set_to_archive = (int *) (inbuf + 8);
    1984     p_list_of_fileset_flags = (char *) (inbuf + 12);
     1983    p_archival_threads_running = (int *) (inbuf) + 4;
     1984    p_next_set_to_archive = (int *) (inbuf) + 8;
     1985    p_list_of_fileset_flags = (char *) (inbuf) + 12;
    19851986
    19861987    mr_asprintf(archiving_filelist_fname, FILELIST_FNAME_RAW_SZ, bkpinfo->tmpdir, 0L);
     
    21402141    memset((void *) transfer_block, 0, sizeof(struct s_bkpinfo) + BKPINFO_LOC_OFFSET + 64);
    21412142    p_last_set_archived = (int *) transfer_block;
    2142     p_archival_threads_running = (int *) (transfer_block + 4);
    2143     p_next_set_to_archive = (int *) (transfer_block + 8);
    2144     p_list_of_fileset_flags = (char *) (transfer_block + 12);
     2143    p_archival_threads_running = (int *) (transfer_block) + 4;
     2144    p_next_set_to_archive = (int *) (transfer_block) + 8;
     2145    p_list_of_fileset_flags = (char *) (transfer_block) + 12;
    21452146    memcpy((void *) (transfer_block + BKPINFO_LOC_OFFSET), (void *) bkpinfo, sizeof(struct s_bkpinfo));
    21462147    pvp = &vp;
     
    27782779        mr_asprintf(value, "usb");
    27792780        break;
     2781    case none:
    27802782    default:
    27812783        fatal_error("Unknown backup_media_type");
     2784        break;
    27822785    }
    27832786
  • branches/3.3/mondo/src/common/libmondo-cli.c

    r3892 r3893  
    969969        mr_asprintf(tmp, "(Unknown)");
    970970        mr_asprintf(tmp2, "(Unknown)");
     971        break;
    971972    }
    972973
  • branches/3.3/mondo/src/common/libmondo-devices.c

    r3892 r3893  
    128128    int i = 0;
    129129    int mount_cnt = 0;
    130     int lastpos = 0;
     130    size_t lastpos = 0;
    131131    char *mounted_file_system = NULL;
    132132    char *command = NULL;
     
    249249    int i = 0;
    250250    int c = 0;
    251     int lastpos = 0;
     251    size_t lastpos = 0;
    252252    char *VG = NULL;
    253253    char *tmp = NULL;
     
    729729    default:
    730730        mr_asprintf(output, "%s", "default");
     731        break;
    731732    }
    732733    return (output);
     
    16601661
    16611662char *token = NULL;
    1662 int lastpos = 0;
     1663size_t lastpos = 0;
    16631664char *mounted_on_dsf = NULL;
    16641665char *not_mounted_on_dsf = NULL;
     
    17461747        mr_free(tmp);
    17471748        mr_free(tmp2);
     1749        break;
     1750    default:
     1751        fatal_error("Error processing -I or -E option");
    17481752        break;
    17491753    }
     
    24132417        break;
    24142418    default:
    2415         fatal_error("I, Mojo Jojo, shall defeat those pesky Powerpuff Girls!");
     2419    case none:
     2420        fatal_error("Unknown backup_media_type");
     2421        break;
    24162422    }
    24172423
  • branches/3.3/mondo/src/common/libmondo-filelist.c

    r3892 r3893  
    13201320    char *find_skeleton_marker = NULL;
    13211321    int i;
    1322     int lastpos = 0;
     1322    size_t lastpos = 0;
    13231323    static int depth = 0;
    13241324    char *p;
  • branches/3.3/mondo/src/common/libmondo-raid.c

    r3892 r3893  
    359359            mr_asprintf(org, "raid5");
    360360            break;
     361        default:
     362            mr_asprintf(org, "Unknown RAID level %d", raidrec->plex[i].raidlevel);
     363            fatal_error(org);
     364            break;
    361365        }
    362366        fprintf(fout, "  plex org %s", org);
     
    939943int res = 0, row, i, index_min;
    940944int v = 0;
    941 int lastpos = 0;
     945size_t lastpos = 0;
    942946size_t len = 0;
    943947char *token = NULL;
  • branches/3.3/mondo/src/common/libmondo-string.c

    r3892 r3893  
    997997        mr_asprintf(type_of_backup, "USB");
    998998        break;
     999    case none:
    9991000    default:
    1000         mr_asprintf(type_of_backup, "ISO");
     1001        fatal_error("Unknown backup_media_type");
     1002        break;
    10011003    }
    10021004    return (type_of_backup);
  • branches/3.3/mondo/src/include/mr_str.h

    r3892 r3893  
    1515/* functions (public methods) */
    1616
    17 extern char *mr_strtok(char *instr, const char *delims, int *lastpos);
     17extern char *mr_strtok(char *instr, const char *delims, size_t *lastpos);
    1818extern char *mr_stresc(char *instr, char *toesc, const char escchr, const char specialchr);
    1919extern char *mr_date(void);
  • branches/3.3/mondo/src/lib/mr_str.c

    r3892 r3893  
    2626 * @note this function allocates memory that needs to be freed by caller
    2727 **/
    28 char *mr_strtok(char *instr, const char *delims, int *lastpos) {
     28char *mr_strtok(char *instr, const char *delims, size_t *lastpos) {
    2929
    3030char *token = NULL;
     
    5757*lastpos = *lastpos + pos1 + pos2 + 1;
    5858
    59 return token;
     59return(token);
    6060}
    6161
     
    205205char *output = NULL;
    206206char *tmp = NULL;
    207 int i = 0;
     207size_t i = 0;
    208208
    209209mr_asprintf(output, "%s", in);
  • branches/3.3/mondo/src/mondorestore/mondo-prep.c

    r3892 r3893  
    604604        break;
    605605     default:
    606         fatal_error("Unknown RAID parity algorithm.");
     606        mr_free(program);
     607        mr_asprintf(program, "Unknown RAID parity algorithm %d", raidlist->el[i].parity);
     608        fatal_error(program);
    607609        break;
    608610    }
  • branches/3.3/mondo/src/mondorestore/mondo-rstr-newt.c

    r3892 r3893  
    824824            break;
    825825        default:
    826             mr_asprintf(tmp, "unknown (%i)", raidrec->raidlevel);
     826            mr_asprintf(tmp, "unknown (%d)", raidrec->raidlevel);
    827827            break;
    828828        }
     
    12271227                                (mountlist, raidlist->disks.el[l].device);
    12281228                        }
     1229                        break;
     1230                    default:
     1231                        log_msg("Unknown raidlevel %d",raidrec->plex[j].raidlevel);
    12291232                        break;
    12301233                    }
  • branches/3.3/mondo/src/mondorestore/mondo-rstr-tools.c

    r3892 r3893  
    14381438            update_evalcall_form(0);
    14391439        }
     1440        break;
    14401441    }
    14411442    close_evalcall_form();
  • branches/3.3/mondo/src/mondorestore/mondorestore.c

    r3892 r3893  
    385385        default:
    386386            log_msg(3, "feed_into_ntfsprog() called in background --- pid=%ld", (long int) (pid));
     387            break;
    387388        }
    388389        mr_free(ntfsprog_fifo);
     
    11481149        default:
    11491150            log_msg(3, "feed_into_ntfsprog() called in background --- pid=%ld", (long int) (pid));
     1151            break;
    11501152        }
    11511153        mr_free(ntfsprog_fifo);
Note: See TracChangeset for help on using the changeset viewer.