Use safer rstime_t instead of time_t

Avoid problems to serialization on different platforms, without breaking
nested STL containers serialization.

The conversion have been made with sed, and checked with grep, plus
kdiff3 visual ispection, plus rutime tests, so it should be fine.
This commit is contained in:
Gioacchino Mazzurco 2018-10-07 01:34:05 +02:00
parent 41aa675a9b
commit 329050a9c2
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
223 changed files with 930 additions and 911 deletions

View file

@ -46,7 +46,7 @@ void RsBanListConfigItem::serial_process(RsGenericSerializer::SerializeJob j,RsG
{
RsTypeSerializer::serial_process<uint32_t>(j,ctx,banListType,"type") ;
RsTypeSerializer::serial_process (j,ctx,banListPeerId,"peerId") ;
RsTypeSerializer::serial_process<time_t> (j,ctx,update_time,"update_time") ;
RsTypeSerializer::serial_process<rstime_t> (j,ctx,update_time,"update_time") ;
RsTypeSerializer::serial_process (j,ctx,banned_peers,"banned_peers") ;
}
RsItem *RsBanListSerialiser::create_item(uint16_t service_id,uint8_t item_sub_id) const

View file

@ -68,7 +68,7 @@ public:
uint32_t banListType ;
RsPeerId banListPeerId ;
time_t update_time ;
rstime_t update_time ;
RsTlvBanList banned_peers;
};

View file

@ -79,7 +79,7 @@ public:
virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
std::map<RsGxsId,time_t> mTimeStamps ;
std::map<RsGxsId,rstime_t> mTimeStamps ;
std::set<RsGxsId> mContacts ;
};

View file

@ -25,7 +25,7 @@
#include "rsitems/rsitem.h"
#include "rsitems/rsserviceids.h"
#include "util/rstime.h"
#include "retroshare/rsgxsifacetypes.h"
std::ostream &operator<<(std::ostream &out, const RsGroupMetaData &meta);
@ -99,7 +99,7 @@ struct TurtleGxsInfo
RsGxsId author;
std::string name ;
std::string description ;
time_t last_post ;
rstime_t last_post ;
uint32_t number_of_posts ;
};

View file

@ -20,7 +20,7 @@
* *
*******************************************************************************/
#include <stdio.h>
#include <time.h>
#include "util/rstime.h"
#include "serialiser/rsbaseserial.h"
#include "rsitems/rsgxsreputationitems.h"

View file

@ -67,8 +67,8 @@ public:
RsTlvPeerIdSet suppliers; // list of friends who feed this group
uint32_t max_visible_count ; // max visible count reported by contributing friends
time_t statistics_update_TS ; // last time the max visible count was updated.
time_t last_group_modification_TS ; // last time the group was modified, either in meta data or in the list of messages posted in it.
rstime_t statistics_update_TS ; // last time the max visible count was updated.
rstime_t last_group_modification_TS ; // last time the group was modified, either in meta data or in the list of messages posted in it.
};
class RsGxsGrpConfigItem : public RsGxsNetServiceItem, public RsGxsGrpConfig

View file

@ -20,7 +20,7 @@
* *
*******************************************************************************/
#include <stdexcept>
#include <time.h>
#include "util/rstime.h"
#include "serialiser/rsbaseserial.h"
#include "serialiser/rstlvbase.h"