Commit 256b431c2e841b9a7aae08adbb08d4e95e4027c7

Authored by david
1 parent 26da82c8

fixed Linux compiler errors

stim/gl/gl_texture.h
... ... @@ -47,8 +47,8 @@ class gl_texture : public virtual image_stack<T, F>
47 47 //initializes important variables
48 48 void init() {
49 49 texID = 0; //initialize texture ID to zero, default if OpenGL returns an error
50   - memset(R, 0, sizeof(size_t));
51   - memset(S, 0, sizeof(F));
  50 + //memset(R, 0, sizeof(size_t));
  51 + //memset(grid<T, 4, F>::S, 0, sizeof(F));
52 52 }
53 53  
54 54 //guesses the color format of the texture
... ... @@ -244,14 +244,14 @@ class gl_texture : public virtual image_stack&lt;T, F&gt;
244 244 ///@param z size of the voxel in z direction
245 245 /// Sets the dimenstions of the voxels.
246 246 void setSpacing(float sx, float sy, float sz){
247   - S[1] = sx;
248   - S[2] = sy;
249   - S[3] = sz;
  247 + grid<T, 4, F>::S[1] = sx;
  248 + grid<T, 4, F>::S[2] = sy;
  249 + grid<T, 4, F>::S[3] = sz;
250 250 }
251 251  
252 252 ///Returns a stim::vec that contains the x, y, z sizes of the voxel.
253 253 vec<float> getDims(){
254   - vec<float> dims(S[1], S[2], S[3]);
  254 + vec<float> dims(grid<T, 4, F>::S[1], grid<T, 4, F>::S[2], grid<T, 4, F>::S[3]);
255 255 return dims;
256 256 }
257 257  
... ...
stim/grids/grid.h
... ... @@ -206,7 +206,7 @@ public:
206 206 result<<"]"<<std::endl;
207 207  
208 208 //calculate the number of values to output
209   - unsigned long nV = min((unsigned long long)R[0], (unsigned long long)10);
  209 + unsigned long nV = std::min((unsigned long long)R[0], (unsigned long long)10);
210 210  
211 211 for(unsigned long v = 0; v<nV; v++){
212 212 result<<ptr[v];
... ...
stim/grids/image_stack.h
... ... @@ -121,10 +121,10 @@ public:
121 121 void
122 122 set_dim(float x, float y, float z)
123 123 {
124   - S[0] = 1;
125   - S[1] = x;
126   - S[2] = y;
127   - S[3] = z;
  124 + grid<T, 4, F>::S[0] = 1;
  125 + grid<T, 4, F>::S[1] = x;
  126 + grid<T, 4, F>::S[2] = y;
  127 + grid<T, 4, F>::S[3] = z;
128 128 }
129 129  
130 130 ///set dimensions of the grid.
... ...
stim/parser/filename.h
... ... @@ -110,11 +110,11 @@ protected:
110 110 unix_dir = unix_dir.substr(2, unix_dir.length()-2); //extract the directory structure
111 111 }
112 112  
113   - if(unix_dir.front() == '/'){ //if there is a leading slash
  113 + if(unix_dir[0] == '/'){ //if there is a leading slash
114 114 relative = false; //the path is not relative
115 115 unix_dir = unix_dir.substr(1, unix_dir.length() - 1); //remove the slash
116 116 }
117   - if(unix_dir.back() == '/')
  117 + if(unix_dir[unix_dir.size()-1] == '/')
118 118 unix_dir = unix_dir.substr(0, unix_dir.length() - 1);
119 119  
120 120 path = stim::parser::split(unix_dir, '/'); //split up the directory structure
... ...