Commit e93639f1 authored by Davis King's avatar Davis King

These changes don't actually change what the code does, but they

avoid some silly warnings from gcc 4.4 and 4.5.
parent a8337a66
...@@ -133,20 +133,20 @@ namespace dlib ...@@ -133,20 +133,20 @@ namespace dlib
T& operator() ( T& operator() (
long r, long r,
long c long c
) { return data[r][c]; } ) { return *(data+r*num_cols + c); }
const T& operator() ( const T& operator() (
long r, long r,
long c long c
) const { return data[r][c]; } ) const { return *(data+r*num_cols + c); }
T& operator() ( T& operator() (
long i long i
) { return *(*data + i); } ) { return data[i]; }
const T& operator() ( const T& operator() (
long i long i
) const { return *(*data + i); } ) const { return data[i]; }
void swap( void swap(
layout& item layout& item
...@@ -175,7 +175,7 @@ namespace dlib ...@@ -175,7 +175,7 @@ namespace dlib
} }
private: private:
T data[num_rows][num_cols]; T data[num_rows*num_cols];
}; };
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
...@@ -546,20 +546,20 @@ namespace dlib ...@@ -546,20 +546,20 @@ namespace dlib
T& operator() ( T& operator() (
long r, long r,
long c long c
) { return data[c][r]; } ) { return *(data+c*num_rows + r); }
const T& operator() ( const T& operator() (
long r, long r,
long c long c
) const { return data[c][r]; } ) const { return *(data+c*num_rows + r); }
T& operator() ( T& operator() (
long i long i
) { return *(*data + i); } ) { return data[i]; }
const T& operator() ( const T& operator() (
long i long i
) const { return *(*data + i); } ) const { return data[i]; }
void swap( void swap(
layout& item layout& item
...@@ -588,7 +588,7 @@ namespace dlib ...@@ -588,7 +588,7 @@ namespace dlib
} }
private: private:
T data[num_cols][num_rows]; T data[num_cols*num_rows];
}; };
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
......
This diff is collapsed.
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