Skip to content

Commit

Permalink
fixed errors reported by rgleason with wxDateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
registry committed Aug 15, 2016
1 parent 81f4034 commit 1f685b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions src/ATTPortFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ ATTPortFactory::saveStandardPort(const wxDateTime & date, const ATTStandardPort&
{
if ( port.m_StPName.size() == 0)
return;
long ticks = date.GetTicks();
time_t ticks = date.GetTicks();
StPorts[ port.m_StPName][ ticks ] = port;
}

Expand All @@ -128,7 +128,7 @@ ATTPortFactory::saveSecondaryPort(const wxDateTime & date, const ATTSecondaryPor

if ( port.m_ScPName.size() == 0)
return;
long ticks = y_date.GetTicks();
time_t ticks = y_date.GetTicks();
ScPorts[ port.m_ScPName][ ticks ] = port;

}
Expand Down Expand Up @@ -266,7 +266,7 @@ ATTPortFactory::writeStandardPort( const wxString& path, const wxDateTime & dat
std::cerr << "Cannot seek while writing " << port.m_StPName << std::endl;
return ;
}
char buffer[ port.getSize()];
char * buffer = new char[ port.getSize()];



Expand All @@ -279,6 +279,7 @@ ATTPortFactory::writeStandardPort( const wxString& path, const wxDateTime & dat
}

file.Close();
delete[] buffer;
}

void
Expand Down Expand Up @@ -363,7 +364,7 @@ ATTPortFactory::readStandardPort( const wxString& path, const wxDateTime & date
std::cerr << "Cannot seek while reading " << path << std::endl;
return ;
}
char buffer[ port.getSize()];
char * buffer = new char[ port.getSize()];



Expand All @@ -387,7 +388,8 @@ ATTPortFactory::readStandardPort( const wxString& path, const wxDateTime & date
wxFileName fname ( path );
port.m_StPName = fname.GetFullName();
}
file.Close();
file.Close();
delete[] buffer;
}

void
Expand All @@ -402,7 +404,7 @@ ATTPortFactory::readSecondaryPort( const wxString& path, ATTSecondaryPort& por
std::cerr << "Cannot seek while reading " << path << std::endl;
return ;
}
char buffer[ port.getSize()];
char * buffer = new char[ port.getSize()];

size_t read = 0;
while ( read != port.getSize())
Expand All @@ -414,7 +416,8 @@ ATTPortFactory::readSecondaryPort( const wxString& path, ATTSecondaryPort& por
wxFileName fname ( path );
port.m_ScPName = fname.GetFullName();

file.Close();
file.Close();
delete[] buffer;

}

Expand Down
4 changes: 2 additions & 2 deletions src/ATTPortFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ class ATTPortFactory // provides and stores standart/secondary port to given dat
{


WX_DECLARE_HASH_MAP( long,
WX_DECLARE_HASH_MAP( time_t,
ATTSecondaryPort,
wxIntegerHash,
wxIntegerEqual,
ScPsList );
WX_DECLARE_HASH_MAP( long,
WX_DECLARE_HASH_MAP( time_t,
ATTStandardPort,
wxIntegerHash,
wxIntegerEqual,
Expand Down

0 comments on commit 1f685b4

Please sign in to comment.