Ticket #7010: ser.patch

File ser.patch, 3.5 KB (added by Luke Elliott <lukester_null@…>, 10 years ago)
  • libs\serialization\src\basic_iarchive.cpp

     
    339339    void * & t
    340340){
    341341    object_id_type oid;
    342342    load(ar, oid);
    343343
    344344    // if its a reference to a old object
    345     if(object_id_type(object_id_vector.size()) > oid){
     345    if(object_id_type(static_cast<unsigned int>(object_id_vector.size())) > oid){
    346346        // we're done
    347347        t = object_id_vector[oid].address;
    348348        return false;
    349349    }
    350350    return true;
    351351}
     
    374374
    375375    // note: extra line used to evade borland issue
    376376    const bool tracking = co.tracking_level;
    377377
    378378    object_id_type this_id;
    379379    moveable_objects_start =
    380     this_id = object_id_type(object_id_vector.size());
     380    this_id = object_id_type(static_cast<unsigned int>(object_id_vector.size()));
    381381
    382382    // if we tracked this object when the archive was saved
    383383    if(tracking){
    384384        // if it was already read
    385385        if(!track(ar, t))
    386386            // we're done
    387387            return;
    388388        // add a new enty into the tracking list
    389389        object_id_vector.push_back(aobject(t, cid));
    390390        // and add an entry for this object
    391         moveable_objects_end = object_id_type(object_id_vector.size());
     391        moveable_objects_end = object_id_type(static_cast<unsigned int>(object_id_vector.size()));
    392392    }
    393393    // read data
    394394    (bis.load_object_data)(ar, t, co.file_version);
    395395    moveable_objects_recent = this_id;
    396396}
    397397
     
    464464        serialization::state_saver<version_type> z(pending_version);
    465465
    466466        pending_bis = & bpis_ptr->get_basic_serializer();
    467467        pending_version = co.file_version;
    468468
    469469        // predict next object id to be created
    470         const unsigned int ui = object_id_vector.size();
     470        const unsigned int ui = static_cast<unsigned int>(object_id_vector.size());
    471471
    472472        serialization::state_saver<object_id_type> w_end(moveable_objects_end);
    473473
    474474        // because the following operation could move the items
    475475        // don't use co after this
    476476        // add to list of serialized objects so that we can properly handle
  • libs\serialization\src\basic_oarchive.cpp

     
    273273        // and save the data
    274274        (bos.save_object_data)(ar, t);
    275275        return;
    276276    }
    277277
    278278    // look for an existing object id
    279     object_id_type oid(object_set.size());
     279    object_id_type oid(static_cast<unsigned int>(object_set.size()));
    280280    // lookup to see if this object has already been written to the archive
    281281    basic_oarchive_impl::aobject ao(t, co.m_class_id, oid);
    282282    std::pair<basic_oarchive_impl::object_set_type::const_iterator, bool>
    283283        aresult = object_set.insert(ao);
    284284    oid = aresult.first->object_id;
    285285
     
    361361        pending_object = t;
    362362        pending_bos = & bpos_ptr->get_basic_serializer();
    363363        bpos_ptr->save_object_ptr(ar, t);
    364364        return;
    365365    }
    366366
    367     object_id_type oid(object_set.size());
     367    object_id_type oid(static_cast<unsigned int>(object_set.size()));
    368368    // lookup to see if this object has already been written to the archive
    369369    basic_oarchive_impl::aobject ao(t, co.m_class_id, oid);
    370370    std::pair<basic_oarchive_impl::object_set_type::const_iterator, bool>
    371371        aresult = object_set.insert(ao);
    372372    oid = aresult.first->object_id;
    373373    // if the saved object already exists