Changeset 19140 for trunk/FACT++


Ignore:
Timestamp:
08/05/18 12:43:21 (6 years ago)
Author:
tbretz
Message:
Fixed some compiler wanring with gcc.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/fits2sql.cc

    r19139 r19140  
    6060        ("unsigned",       vars<string>(),            "In fits files per default columns are signed. This interpretss the column as unsigned value. Use the FITS column name.")
    6161        ("primary",        vars<string>(),            "List of columns to be used as primary keys during table creation (in connection with --create)")
    62         ("first",          var<int64_t>(int64_t(0)),  "First event to start with (default: 0), mainly for test purpose")
    63         ("max",            var<int64_t>(int64_t(0)),  "Maximum number of events to process (0: all), mainly for test purpose")
     62        ("first",          var<size_t>(size_t(0)),    "First event to start with (default: 0), mainly for test purpose")
     63        ("max",            var<size_t>(size_t(0)),    "Maximum number of events to process (0: all), mainly for test purpose")
    6464        ("engine",         var<string>(""),           "Database engine to be used when a new table is created")
    6565        ("row-format",     var<string>(""),           "Defines the ROW_FORMAT keyword for table creation")
     
    288288
    289289    const uint16_t verbose       = conf.Get<uint16_t>("verbose");
    290     const int64_t  first         = conf.Get<int64_t>("first");
    291     const int64_t  max           = conf.Get<int64_t>("max");
     290    const size_t  first          = conf.Get<size_t>("first");
     291    const size_t  max            = conf.Get<size_t>("max");
    292292
    293293    const bool force             = conf.Get<bool>("force");
     
    315315    const vector<string> duplicate = conf.Vec<string>("duplicate");
    316316    const vector<string> notsigned = conf.Vec<string>("unsigned");
     317
     318    if (first>=max)
     319        cerr << "WARNING: Resource `first` (" << first << ") exceeds `max` (" << max << ")" << endl;
     320
    317321
    318322    // -------------------------------------------------------------------------
     
    428432
    429433        const size_t N = col.type=='A' ? 1 : col.num;
    430         for (int i=0; i<N; i++)
     434        for (size_t i=0; i<N; i++)
    431435        {
    432436            query += "   `"+name;
     
    570574    {
    571575        const size_t N = c->type==kVarchar ? 1 : c->num;
    572         for (int i=0; i<N; i++)
     576        for (size_t i=0; i<N; i++)
    573577        {
    574578            if (c!=vec.cbegin())
     
    591595    size_t count = 0;
    592596
    593     const size_t num = max>0 && (max-first)<f.GetNumRows() ? (max-first) : f.GetNumRows();
     597    const size_t num = max>first && (max-first)<f.GetNumRows() ? (max-first) : f.GetNumRows();
    594598    for (size_t j=first; j<num; j++)
    595599    {
     
    604608        {
    605609            const size_t N = c->type==kVarchar ? 1 : c->num;
    606             for (int i=0; i<N; i++)
     610            for (size_t i=0; i<N; i++)
    607611            {
    608612                if (c!=vec.cbegin())
Note: See TracChangeset for help on using the changeset viewer.