Skip to content
Snippets Groups Projects
Commit e40b35f3 authored by Nick Draper's avatar Nick Draper
Browse files

re #64

Clear final warnings on windows build, mainly in iterator
parent 8073cf66
No related branches found
No related tags found
No related merge requests found
......@@ -941,8 +941,16 @@ int ISISRAW::vmstime(char* timbuf, int len, time_t time_value)
* get time in VMS format 01-JAN-1970 00:00:00
*/
int i, n;
struct tm *tmstruct;
struct tm *tmstruct = NULL;
#ifdef _WIN32
errno_t err = localtime_s( tmstruct, &time_value );
if (err)
{
return FAILURE;
}
#else //_WIN32
tmstruct = localtime((time_t*)&time_value);
#endif //_WIN32
n = strftime(timbuf, len, "%d-%b-%Y %H:%M:%S", tmstruct);
for(i=0; i<n; i++)
{
......@@ -954,7 +962,15 @@ int ISISRAW::vmstime(char* timbuf, int len, time_t time_value)
int ISISRAW::readFromFile(const char* filename)
{
#ifdef _WIN32
FILE* input_file=NULL;
if(fopen_s( &input_file, filename, "rb" ) !=0 )
{
return -1;
}
#else //_WIN32
FILE* input_file = fopen(filename,"rb");
#endif //_WIN32
if (input_file != NULL)
{
ioRAW(input_file, true);
......@@ -975,7 +991,15 @@ int ISISRAW::writeToFile(const char* filename)
long pos;
memset(zero_pad, 0, sizeof(zero_pad));
remove(filename);
#ifdef _WIN32
FILE* output_file=NULL;
if(fopen_s( &output_file, filename, "w+bc" ) !=0 )
{
return -1;
}
#else //_WIN32
FILE* output_file = fopen(filename,"w+bc");
#endif //_WIN32
if (output_file != NULL)
{
ioRAW(output_file, false);
......
......@@ -157,6 +157,14 @@
RelativePath=".\src\Histogram1D.cpp"
>
</File>
<File
RelativePath=".\src\tripleIterator.cpp"
>
</File>
<File
RelativePath=".\src\TripleRef.cpp"
>
</File>
<File
RelativePath=".\src\Workspace1D.cpp"
>
......@@ -175,6 +183,14 @@
RelativePath=".\inc\MantidDataObjects\Histogram1D.h"
>
</File>
<File
RelativePath=".\inc\MantidDataObjects\tripleIterator.h"
>
</File>
<File
RelativePath=".\inc\MantidDataObjects\TripleRef.h"
>
</File>
<File
RelativePath=".\inc\MantidDataObjects\Workspace1D.h"
>
......
......@@ -35,12 +35,12 @@ class TripleRef
T second; ///< Second item
T third; ///< Third item
TripleRef(const T A,const T B,const T C);
TripleRef(T A,T B,T C);
TripleRef(const TripleRef<T>&);
TripleRef<T>& operator=(const TripleRef<T>&);
~TripleRef();
const T operator[](int const) const;
T operator[](int const) const;
T operator[](int const);
int operator<(const TripleRef<T>&) const;
int operator>(const TripleRef<T>&) const;
......
......@@ -35,7 +35,7 @@ class triple_iterator : public std::iterator<std::random_access_iterator_tag,Tri
const TripleRef<double&>& operator*() const { return *CPoint; } ///< Base Accessor
const TripleRef<double&>* operator->() const { return CPoint; } ///< Base Pointer accessor
const TripleRef<double&>& operator[](int) const;
//const TripleRef<double&>& operator[](int) const;
triple_iterator<WorkSpace>& operator++();
triple_iterator<WorkSpace> operator++(int);
......
......@@ -18,7 +18,7 @@ TripleRef<T>::TripleRef(const TripleRef<T>& A) :
{}
template<typename T>
TripleRef<T>::TripleRef(const T A,const T B,const T C) :
TripleRef<T>::TripleRef(T A,T B,T C) :
first(A),second(B),third(C)
/*!
Constructor from a 3 value input
......@@ -140,7 +140,7 @@ TripleRef<T>::operator[](const int A)
template<typename T>
const T
T
TripleRef<T>::operator[](const int A) const
/*!
Accessor Value Function
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment