Commit 66933708 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Avoiding use of long int.

parent 472aefb2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
/usr/share/automake-1.11/COPYING
 No newline at end of file
/usr/share/automake-1.9/COPYING
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
/usr/share/automake-1.11/INSTALL
 No newline at end of file
/usr/share/automake-1.9/INSTALL
 No newline at end of file
+4 −4
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ template< class T > class tnlCurve : public tnlObject, public tnlList< tnlCurveE
template< class T > bool Write( const tnlCurve< T >& curve,
                                ostream& str,
                                const char* format,
                                const long int step = 1 )
                                const int step = 1 )
{
   if( ! format )
   {
@@ -124,8 +124,8 @@ template< class T > bool Write( const tnlCurve< T >& curve,
   }
   if( strcmp( format, "gnuplot" ) == 0 )
   {
      const long int size = curve. Size();
      long int i, j;
      const int size = curve. Size();
      int i, j;
      for( i = 0; i < size; i += step )
      {
         if( curve[ i ]. separator )
@@ -151,7 +151,7 @@ template< class T > bool Write( const tnlCurve< T >& curve,
template< class T > bool Write( const tnlCurve< T >& curve,
                                const char* file_name,
                                const char* format,
                                const long int step = 1 )
                                const int step = 1 )
{
   fstream file;
   if( strncmp( format, "bin",3 ) == 0 )
+9 −9
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ template< class T > class tnlField1D : public tnlLongVector< T >
   : tnlLongVector< T >( 0 )
   { };

   tnlField1D( long int _x_size )
   tnlField1D( int _x_size )
   : tnlLongVector< T >( _x_size ),
     x_size( _x_size )
   { };
@@ -46,12 +46,12 @@ template< class T > class tnlField1D : public tnlLongVector< T >
      return tnlString( "tnlField1D< " ) + tnlString( GetParameterType( t ) ) + tnlString( " >" );
   };

   long int GetXSize() const
   int GetXSize() const
   {
      return x_size;
   };

   bool SetNewDimensions( long int new_x_size )
   bool SetNewDimensions( int new_x_size )
   {
      x_size = new_x_size;
      return tnlLongVector< T > :: SetNewSize( x_size );
@@ -63,19 +63,19 @@ template< class T > class tnlField1D : public tnlLongVector< T >
   };
   

   const T& operator() ( long int i ) const
   const T& operator() ( int i ) const
   {
      assert( i < x_size && i >= 0 );
      return tnlLongVector< T > :: data[ i ];
   };

   T& operator() ( long int i )
   T& operator() ( int i )
   {
      assert( i < x_size && i >= 0 );
      return tnlLongVector< T > :: data[ i ];
   };

   long int GetLongVectorIndex( long int i ) const
   int GetLongVectorIndex( int i ) const
   {
      assert( i >= 0 && i < x_size );
      return i;
@@ -85,7 +85,7 @@ template< class T > class tnlField1D : public tnlLongVector< T >
   bool Save( ostream& file ) const
   {
      if( ! tnlLongVector< T > :: Save( file ) ) return false;
      file. write( ( char* ) &x_size, sizeof( long int ) );
      file. write( ( char* ) &x_size, sizeof( int ) );
      if( file. bad() ) return false;
      return true;
   };
@@ -94,14 +94,14 @@ template< class T > class tnlField1D : public tnlLongVector< T >
   bool Load( istream& file )
   {
      if( ! tnlLongVector< T > :: Load( file ) ) return false;
      file. read( ( char* ) &x_size, sizeof( long int ) );
      file. read( ( char* ) &x_size, sizeof( int ) );
      if( file. bad() ) return false;
      return true;
   };   
   
   protected:

   long int x_size;
   int x_size;
};

// Explicit instatiation
+15 −15
Original line number Diff line number Diff line
@@ -30,8 +30,8 @@ template< class T > class tnlField2D : public tnlLongVector< T >
   : tnlLongVector< T >( 0 )
   { };

   tnlField2D( long int _x_size,
             long int _y_size )
   tnlField2D( int _x_size,
               int _y_size )
   : tnlLongVector< T >( _x_size * _y_size ),
     x_size( _x_size ), y_size( _y_size )
   { };
@@ -47,18 +47,18 @@ template< class T > class tnlField2D : public tnlLongVector< T >
      return tnlString( "tnlField2D< " ) + tnlString( GetParameterType( t ) ) + tnlString( " >" );
   };

   long int GetXSize() const
   int GetXSize() const
   {
      return x_size;
   };

   long int GetYSize() const
   int GetYSize() const
   {
      return y_size;
   };

   bool SetNewDimensions( long int new_x_size,
                          long int new_y_size )
   bool SetNewDimensions( int new_x_size,
                          int new_y_size )
   {
      x_size = new_x_size;
      y_size = new_y_size;
@@ -70,26 +70,26 @@ template< class T > class tnlField2D : public tnlLongVector< T >
      return SetNewDimensions( f. GetXSize(), f. GetYSize() );
   };

   void SetSharedData( T* _data, const long int _x_size, const long int _y_size )
   void SetSharedData( T* _data, const int _x_size, const int _y_size )
   {
      tnlLongVector< T > :: SetSharedData( _data, _x_size * _y_size );
      x_size = _x_size;
      y_size = _y_size;
   };

   const T& operator() ( long int i, long int j ) const
   const T& operator() ( int i, int j ) const
   {
      assert( i < x_size && j < y_size && i >= 0 && j >= 0 );
      return tnlLongVector< T > :: data[ i * y_size + j ];
   };

   T& operator() ( long int i, long int j )
   T& operator() ( int i, int j )
   {
      assert( i < x_size && j < y_size && i >= 0 && j >= 0 );
      return tnlLongVector< T > :: data[ i * y_size + j ];
   };

   long int GetLongVectorIndex( long int i, long int j ) const
   int GetLongVectorIndex( int i, int j ) const
   {
      assert( i >= 0 && j >= 0 );
      assert( i < x_size && j < y_size );
@@ -100,8 +100,8 @@ template< class T > class tnlField2D : public tnlLongVector< T >
   bool Save( ostream& file ) const
   {
      if( ! tnlLongVector< T > :: Save( file ) ) return false;
      file. write( ( char* ) &x_size, sizeof( long int ) );
      file. write( ( char* ) &y_size, sizeof( long int ) );
      file. write( ( char* ) &x_size, sizeof( int ) );
      file. write( ( char* ) &y_size, sizeof( int ) );
      if( file. bad() ) return false;
      return true;
   };
@@ -110,15 +110,15 @@ template< class T > class tnlField2D : public tnlLongVector< T >
   bool Load( istream& file )
   {
      if( ! tnlLongVector< T > :: Load( file ) ) return false;
      file. read( ( char* ) &x_size, sizeof( long int ) );
      file. read( ( char* ) &y_size, sizeof( long int ) );
      file. read( ( char* ) &x_size, sizeof( int ) );
      file. read( ( char* ) &y_size, sizeof( int ) );
      if( file. bad() ) return false;
      return true;
   };   
   
   protected:

   long int x_size, y_size;
   int x_size, y_size;
};

// Explicit instatiation
Loading