Commit ae46c17d authored by Alexab's avatar Alexab
Browse files

Some warnings removed.

--HG--
branch : MockCompsTest
parent 40d161abaf7c
......@@ -116,7 +116,6 @@ void UServerTransportTcpQt::SetServerBinding(std::string &interface_address, int
server->listen(ha, port);
server->close();
QString s = server->serverAddress().toString();
int i=0;
}
//
......@@ -413,7 +412,7 @@ void UServerTransportTcpQt::SendResponseBuffer(std::vector<unsigned char> buffer
buf = new char[buffer.size()];
memcpy(buf,&buffer[0],buffer.size());
out.writeBytes(buf, buffer.size());
out.writeBytes(buf, uint(buffer.size()));
return;
}
}
......
......@@ -297,7 +297,7 @@ void UEngineControlThread::Calculate(void)
RDK::UIControllerStorage::AfterCalculate(EngineIndex);
CalculationNotInProgress->set();
Profiler->CalculateCore();
LastFullStepDuration=MModel_GetFullStepDuration(EngineIndex,0);
LastFullStepDuration=int(MModel_GetFullStepDuration(EngineIndex,0));
}
void UEngineControlThread::Execute(void)
......
......@@ -494,12 +494,12 @@ void UServerControl::ConvertVectorToString(const UParamT &source, std::string &d
void UServerControl::SendCommandResponse(UServerTransport *transport, std::string &client_address, RDK::UParamT &dest, std::vector<RDK::UParamT> &binary_data)
{
UTransferPacket packet;
packet.SetNumParams(1+binary_data.size());
packet.SetParamSize(0,dest.size());
packet.SetNumParams(1+int(binary_data.size()));
packet.SetParamSize(0,int(dest.size()));
packet.SetParam(0,dest);
for(size_t i=0;i<binary_data.size();i++)
{
packet.SetParamSize(i+1,binary_data[i].size());
packet.SetParamSize(i+1,int(binary_data[i].size()));
packet.SetParam(i+1,binary_data[i]);
}
RDK::UParamT buffer;
......
......@@ -101,7 +101,7 @@ bool BaseCrPropMockTempl(RDK::USerStorageXML* serstorage, RDK::UMockUNet* mock_u
CreatorT::template CreateProperty<UPropertyOutputData,ptPubOutput>(serstorage,mock_unet,p_type);
}
}
catch(UComponent::EPropertyNameAlreadyExist& e)
catch(UComponent::EPropertyNameAlreadyExist& )
{
}
......
......@@ -1271,7 +1271,7 @@ UId UContainer::AddComponent(UEPtr<UContainer> comp, UEPtr<UIPointer> pointer)
const UEPtr<UIProperty> prop_ts=FindProperty("TimeStep");
unsigned int time_step_prop_type=prop_ts->GetType();
if(time_step_prop_type & ptPubParameter == ptPubParameter)
if((time_step_prop_type & ptPubParameter) == ptPubParameter)
comp->ChangeUseIndTimeStepMode(true);
else
comp->ChangeUseIndTimeStepMode(false);
......@@ -1348,7 +1348,7 @@ void UContainer::AddStaticComponent(const NameT &classname, const NameT &name, U
const UEPtr<UIProperty> prop_ts=FindProperty("TimeStep");
unsigned int time_step_prop_type=prop_ts->GetType();
if(time_step_prop_type & ptPubParameter == ptPubParameter)
if((time_step_prop_type & ptPubParameter) == ptPubParameter)
comp->ChangeUseIndTimeStepMode(true);
else
comp->ChangeUseIndTimeStepMode(false);
......
......@@ -1099,7 +1099,7 @@ bool PreparePropertyLogString(const UVariable& variable, unsigned int expected_t
template<class T>
const vector<NameT>& UContainer::GetComponentsNameByClassType(vector<NameT> &buffer, UEPtr<UContainer> net, bool find_all)
{
size_t numComp=GetNumComponents();
int numComp=int(GetNumComponents());
UEPtr<UContainer> comp;
UEPtr<UContainer> root(net);
string compName;
......@@ -1110,7 +1110,7 @@ const vector<NameT>& UContainer::GetComponentsNameByClassType(vector<NameT> &buf
switch(find_all)
{
case false:
for(size_t i=0; i<numComp; i++)
for(int i=0; i<numComp; i++)
{
comp=GetComponentByIndex(i);
if(dynamic_pointer_cast<T>(comp))
......@@ -1122,7 +1122,7 @@ const vector<NameT>& UContainer::GetComponentsNameByClassType(vector<NameT> &buf
break;
case true:
for(size_t i=0; i<numComp; i++)
for(int i=0; i<numComp; i++)
{
comp=GetComponentByIndex(i);
comp->GetComponentsNameByClassType<T>(buffer, root, true);
......
......@@ -177,7 +177,7 @@ void UControllerDataReader::SetTimeInterval(double value)
{
TimeInterval=value;
if(value>0)
SetNumPoints(value*Component->GetTimeStep());
SetNumPoints(int(value*Component->GetTimeStep()));
else
SetNumPoints(100000);
}
......@@ -339,7 +339,7 @@ bool UControllerDataReaderTimeEvents::AUpdate(void)
if(PropertyType != 3)
return false;
double x(0.0), y(0.0);
double x(0.0);
const MDMatrix<double> *data=reinterpret_cast<const MDMatrix<double>*>(Property->GetMemoryArea());
if(!data)
......
......@@ -773,8 +773,8 @@ void UEnvironment::RTCalculate(void)
int i=0;
if(LastDuration < timer_interval)
LastDuration=timer_interval;
double realtime=Time.GetSourceCurrentLocalTime();
double doubletime=Time.GetDoubleTime();
//double realtime=Time.GetSourceCurrentLocalTime();
//double doubletime=Time.GetDoubleTime();
double model_duration=Time.GetSourceCurrentLocalTime()-Time.GetDoubleTime();
double model_start_calc_time=Time.GetDoubleTime();
......
......@@ -604,9 +604,9 @@ UEPtr<UContainer> URuntimeLibrary::CreateClassSample(UStorage *storage, USerStor
// .
void URuntimeLibrary::CreateClassSamples(UStorage *storage)
{
int num_classes = ClassesStructures.size();
size_t num_classes = ClassesStructures.size();
for(int i=0;i<num_classes;i++)
for(size_t i=0;i<num_classes;i++)
{
try
{
......@@ -735,7 +735,7 @@ UEPtr<UContainer> UMockLibrary::CreateClassSample(USerStorageXML &xml, UStorage
// .
void UMockLibrary::CreateClassSamples(UStorage *storage)
{
int num_classes = ClassesStructures.size();
int num_classes = int(ClassesStructures.size());
for(int i=0;i<num_classes;i++)
{
......
......@@ -1161,7 +1161,7 @@ bool UStorage::DeleteRuntimeCollection(const std::string &lib_name)
UEPtr<ULibrary> lib=CollectionList[i];
if(lib && lib->GetName() == lib_name)
{
index = i;
index = int(i);
break;
}
}
......
......@@ -207,6 +207,10 @@ USerStorageXML& operator >> (USerStorageXML& storage, std::pair<T1,T2> &data)
}
// Map-
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning (disable: 4700)
#endif
template<typename T1, typename T2>
USerStorageXML& operator << (USerStorageXML& storage, const std::map<T1,T2> &data)
{
......@@ -246,6 +250,9 @@ USerStorageXML& operator << (USerStorageXML& storage, const std::map<T1,T2> &dat
return storage;
}
#ifdef _MSC_VER
#pragma warning ( pop )
#endif
template<typename T1, typename T2>
USerStorageXML& operator >> (USerStorageXML& storage, std::map<T1,T2> &data)
......@@ -280,6 +287,10 @@ USerStorageXML& operator >> (USerStorageXML& storage, std::map<T1,T2> &data)
return storage;
}
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning (disable: 4700)
#endif
//
template<typename T>
USerStorageXML& operator << (USerStorageXML& storage, const std::list<T> &data)
......@@ -313,6 +324,9 @@ USerStorageXML& operator << (USerStorageXML& storage, const std::list<T> &data)
return storage;
}
#ifdef _MSC_VER
#pragma warning ( pop )
#endif
template<typename T>
USerStorageXML& operator >> (USerStorageXML& storage, std::list<T> &data)
......@@ -357,10 +371,13 @@ RDK_LIB_TYPE USerStorageXML& operator >> (USerStorageXML& storage, std::vector<d
RDK_LIB_TYPE USerStorageXML& operator << (USerStorageXML& storage, const std::vector<int> &data);
RDK_LIB_TYPE USerStorageXML& operator >> (USerStorageXML& storage, std::vector<int> &data);
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning (disable: 4700)
#endif
template<typename T>
USerStorageXML& operator << (USerStorageXML& storage, const std::vector<T> &data)
{
storage.SetNodeAttribute("Type","std::vector");
//
......@@ -443,6 +460,9 @@ USerStorageXML& operator << (USerStorageXML& storage, const std::vector<T> &data
return storage;
}
#ifdef _MSC_VER
#pragma warning ( pop )
#endif
template<typename T>
USerStorageXML& operator >> (USerStorageXML& storage, std::vector<T> &data)
......
......@@ -411,7 +411,7 @@ void UCreateConfigurationWizardWidget::onMSLoadModelFromModelsCollection(bool ch
{
QString tmp=QString::fromStdString(n.XMLName);
QTextCodec *codec = QTextCodec::codecForName("Windows-1251");
QByteArray byteArray(n.XMLDescription.c_str(), n.XMLDescription.length());
QByteArray byteArray(n.XMLDescription.c_str(), int(n.XMLDescription.length()));
QString utf8Str = codec->toUnicode(byteArray);
tmp = tmp + " " + utf8Str;
ModelsFromFileData.push_back(tmp);
......
......@@ -144,8 +144,8 @@ void UGraphWidget::setCurrentItem(int myCurrentItem)
void UGraphWidget::AUpdateInterface()
{
size_t n=graphPainter->getSize();
for(size_t i=0; i<n; i++)
int n=graphPainter->getSize();
for(int i=0; i<n; i++)
{
const TSingleGraph& current_graph=graphPainter->getGraph(i);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment