Ticket #7010: ser.patch
File ser.patch, 3.5 KB (added by , 10 years ago) |
---|
-
libs\serialization\src\basic_iarchive.cpp
339 339 void * & t 340 340 ){ 341 341 object_id_type oid; 342 342 load(ar, oid); 343 343 344 344 // 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){ 346 346 // we're done 347 347 t = object_id_vector[oid].address; 348 348 return false; 349 349 } 350 350 return true; 351 351 } … … 374 374 375 375 // note: extra line used to evade borland issue 376 376 const bool tracking = co.tracking_level; 377 377 378 378 object_id_type this_id; 379 379 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())); 381 381 382 382 // if we tracked this object when the archive was saved 383 383 if(tracking){ 384 384 // if it was already read 385 385 if(!track(ar, t)) 386 386 // we're done 387 387 return; 388 388 // add a new enty into the tracking list 389 389 object_id_vector.push_back(aobject(t, cid)); 390 390 // 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())); 392 392 } 393 393 // read data 394 394 (bis.load_object_data)(ar, t, co.file_version); 395 395 moveable_objects_recent = this_id; 396 396 } 397 397 … … 464 464 serialization::state_saver<version_type> z(pending_version); 465 465 466 466 pending_bis = & bpis_ptr->get_basic_serializer(); 467 467 pending_version = co.file_version; 468 468 469 469 // 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()); 471 471 472 472 serialization::state_saver<object_id_type> w_end(moveable_objects_end); 473 473 474 474 // because the following operation could move the items 475 475 // don't use co after this 476 476 // add to list of serialized objects so that we can properly handle -
libs\serialization\src\basic_oarchive.cpp
273 273 // and save the data 274 274 (bos.save_object_data)(ar, t); 275 275 return; 276 276 } 277 277 278 278 // 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())); 280 280 // lookup to see if this object has already been written to the archive 281 281 basic_oarchive_impl::aobject ao(t, co.m_class_id, oid); 282 282 std::pair<basic_oarchive_impl::object_set_type::const_iterator, bool> 283 283 aresult = object_set.insert(ao); 284 284 oid = aresult.first->object_id; 285 285 … … 361 361 pending_object = t; 362 362 pending_bos = & bpos_ptr->get_basic_serializer(); 363 363 bpos_ptr->save_object_ptr(ar, t); 364 364 return; 365 365 } 366 366 367 object_id_type oid( object_set.size());367 object_id_type oid(static_cast<unsigned int>(object_set.size())); 368 368 // lookup to see if this object has already been written to the archive 369 369 basic_oarchive_impl::aobject ao(t, co.m_class_id, oid); 370 370 std::pair<basic_oarchive_impl::object_set_type::const_iterator, bool> 371 371 aresult = object_set.insert(ao); 372 372 oid = aresult.first->object_id; 373 373 // if the saved object already exists