- Timestamp:
- Apr 3, 2007, 12:23:28 PM (17 years ago)
- Location:
- trunk/src2/core
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src2/core/Makefile.in
r596 r657 128 128 # DO NOT DELETE THIS LINE -- make depend depends on it. 129 129 130 # should use librappture2.a or $(LDFLAGS) but this uses RpOutcome.o 131 viz: viz.o libviz.a 130 viz: viz.o librappture2.a 132 131 $(CXX) $(CFLAGS) -o viz $^ 133 132 -
trunk/src2/core/Ptr.h
r621 r657 137 137 { 138 138 if (_pc) { 139 return _pc->pointer();139 return (Type*)_pc->pointer(); 140 140 } 141 141 return NULL; -
trunk/src2/core/RpBuffer.cc
r652 r657 1 1 /* 2 2 * ====================================================================== 3 * Rappture:: RpBuffer3 * Rappture::Buffer 4 4 * 5 5 * AUTHOR: Derrick Kearney, Purdue University -
trunk/src2/core/RpBuffer.h
r621 r657 1 1 /* 2 2 * ====================================================================== 3 * Rappture:: RpBuffer3 * Rappture::Buffer 4 4 * 5 5 * AUTHOR: Derrick Kearney, Purdue University -
trunk/src2/core/RpField1D.cc
r454 r657 56 56 _meshPtr = field._meshPtr; 57 57 _counter = field._counter; 58 return *this; 58 59 } 59 60 … … 133 134 define(nodeId, y); 134 135 } 136 return 0; 135 137 } 136 138 … … 146 148 if (y > _vmax) { _vmax = y; } 147 149 } 150 return 0; 148 151 } 149 152 -
trunk/src2/core/RpField1D.h
r372 r657 18 18 #define RAPPTURE_FIELD1D_H 19 19 20 #include " RpPtr.h"20 #include "rappture2.h" 21 21 #include "RpMesh1D.h" 22 22 -
trunk/src2/core/RpFieldPrism3D.cc
r454 r657 76 76 FieldPrism3D::define(int nodeId, double f) 77 77 { 78 while (_valuelist.size() <= nodeId) {78 while (_valuelist.size() <= (unsigned int)nodeId) { 79 79 _valuelist.push_back(NAN); 80 80 } … … 93 93 FieldPrism3D::value(double x, double y, double z, double outside) const 94 94 { 95 double f0, f1, fy0, fy1, fz0, fz1;96 97 95 if (!_meshPtr.isNull()) { 98 96 CellPrism3D cell = _meshPtr->locate(Node3D(x,y,z)); -
trunk/src2/core/RpFieldPrism3D.h
r372 r657 19 19 #include <math.h> 20 20 #include <vector> 21 #include " RpPtr.h"21 #include "rappture2.h" 22 22 #include "RpMeshPrism3D.h" 23 23 -
trunk/src2/core/RpFieldRect3D.cc
r470 r657 104 104 FieldRect3D::define(int nodeId, double f) 105 105 { 106 while (_valuelist.size() < nodeId) {106 while (_valuelist.size() < (unsigned int)(nodeId)) { 107 107 _valuelist.push_back(NAN); 108 108 } -
trunk/src2/core/RpFieldRect3D.h
r372 r657 19 19 #include <math.h> 20 20 #include <vector> 21 #include " RpPtr.h"21 #include "rappture2.h" 22 22 #include "RpMeshRect3D.h" 23 23 -
trunk/src2/core/RpFieldTri2D.h
r372 r657 19 19 #include <math.h> 20 20 #include <vector> 21 #include " RpPtr.h"21 #include "rappture2.h" 22 22 #include "RpMeshTri2D.h" 23 23 -
trunk/src2/core/RpMesh1D.cc
r446 r657 104 104 _id2node = mesh._id2node; 105 105 _id2nodeDirty = mesh._id2nodeDirty; 106 return *this; 106 107 } 107 108 … … 151 152 { 152 153 if (!_id2nodeDirty) { 153 if ( nodeId < _id2node.size()) {154 if ((unsigned int) nodeId < _id2node.size()) { 154 155 int n = _id2node[nodeId]; 155 156 _nodelist.erase( _nodelist.begin()+n ); … … 165 166 } 166 167 _id2nodeDirty = 1; 168 return *this; 167 169 } 168 170 … … 183 185 } 184 186 // last node in interval? 185 else if (n+1 < _nodelist.size() && node.x() == _nodelist[n+1].x()) { 187 else if ( ( (unsigned int)(n+1) < _nodelist.size()) 188 && ( node.x() == _nodelist[n+1].x()) ) { 186 189 _nodelist.erase( _nodelist.begin()+n+1 ); 187 190 _id2nodeDirty = 1; … … 199 202 _counter = 0; 200 203 _id2nodeDirty = 0; 204 return *this; 201 205 } 202 206 -
trunk/src2/core/RpMesh1D.h
r370 r657 75 75 int _counter; // auto counter for node IDs 76 76 77 std::deque<int> _id2node; // maps node Id => index in _nodelist 77 78 int _id2nodeDirty; // non-zero => _id2node needs to be rebuilt 78 std::deque<int> _id2node; // maps node Id => index in _nodelist79 79 80 80 // methods for serializing/deserializing version 'A' -
trunk/src2/core/RpMeshPrism3D.cc
r370 r657 109 109 _xymesh = mesh._xymesh; 110 110 _zmesh = mesh._zmesh; 111 return *this; 111 112 } 112 113 -
trunk/src2/core/RpMeshRect3D.cc
r370 r657 112 112 _axis[1] = mesh._axis[1]; 113 113 _axis[2] = mesh._axis[2]; 114 return *this; 114 115 } 115 116 -
trunk/src2/core/RpMeshTri2D.cc
r446 r657 169 169 _id2node = mesh._id2node; 170 170 _lastLocate.clear(); 171 return *this; 171 172 } 172 173 … … 208 209 if (!_id2nodeDirty) { 209 210 // id2node map up to date? then keep it up to date 210 if ( node.id() >= _id2node.size()) {211 if ((unsigned int)node.id() >= _id2node.size()) { 211 212 int newsize = 2*_id2node.size(); 212 213 for (int i=_id2node.size(); i < newsize; i++) { … … 277 278 _id2node.assign(100, -1); 278 279 _lastLocate.clear(); 280 return *this; 279 281 } 280 282 … … 288 290 MeshTri2D::atNode(int pos) 289 291 { 290 assert(pos >= 0 && pos< _nodelist.size());292 assert(pos >= 0 && (unsigned int)(pos) < _nodelist.size()); 291 293 return _nodelist.at(pos); 292 294 } … … 301 303 MeshTri2D::atCell(int pos) 302 304 { 303 assert(pos >= 0 && pos< _celllist.size());305 assert(pos >= 0 && (unsigned int)(pos) < _celllist.size()); 304 306 305 307 Tri2D& cell = _celllist[pos]; … … 401 403 nonconst->_rebuildNodeIdMap(); 402 404 403 if ( nodeId < _id2node.size()) {405 if ((unsigned int)nodeId < _id2node.size()) { 404 406 int n = _id2node[nodeId]; 405 407 if (n >= 0) { -
trunk/src2/core/RpNode.h
r370 r657 32 32 virtual int dimensionality() const = 0; 33 33 34 virtual ~Node(); 35 34 36 private: 35 37 int _id; // node identifier (used for fields) … … 44 46 virtual double x() const { return _x; } 45 47 virtual double x(double newval) { _x = newval; return _x; } 48 49 virtual ~Node1D(); 46 50 47 51 private: … … 60 64 virtual double x(double newval) { _x = newval; return _x; } 61 65 virtual double y(double newval) { _y = newval; return _y; } 66 67 virtual ~Node2D(); 62 68 63 69 private: … … 80 86 virtual double z(double newval) { _z = newval; return _z; } 81 87 88 virtual ~Node3D(); 89 82 90 private: 83 91 double _x; // x-coordinate -
trunk/src2/core/RpSerialBuffer.cc
r413 r657 16 16 #ifdef BIGENDIAN 17 17 # define ENDIAN_FOR_LOOP(var,size) \ 18 for ( intvar=size-1; var >= 0; var--)18 for (var=size-1; var >= 0; var--) 19 19 #else 20 20 # define ENDIAN_FOR_LOOP(var,size) \ 21 for ( intvar=0; var < size; var++)21 for (var=0; var < size; var++) 22 22 #endif 23 23 … … 67 67 _buffer = sb._buffer; 68 68 _pos = 0; // auto-rewind 69 return *this; 69 70 } 70 71 … … 117 118 { 118 119 char *ptr = (char*)(&ival); 120 unsigned int i = 0; 119 121 120 122 ENDIAN_FOR_LOOP(i, sizeof(int)) { … … 128 130 { 129 131 char *ptr = (char*)(&dval); 132 unsigned int i = 0; 130 133 131 134 ENDIAN_FOR_LOOP(i, sizeof(double)) { … … 164 167 SerialBuffer::atEnd() const 165 168 { 166 return ( _pos >= _buffer.size());169 return ((unsigned int)_pos >= _buffer.size()); 167 170 } 168 171 … … 171 174 { 172 175 char c = '\0'; 173 if ( _pos < _buffer.size()) {176 if ((unsigned int)_pos < _buffer.size()) { 174 177 c = _buffer[_pos++]; 175 178 } … … 182 185 int ival = 0; 183 186 char *ptr = (char*)(&ival); 187 unsigned int i = 0; 184 188 185 189 ENDIAN_FOR_LOOP(i, sizeof(int)) { 186 if ( _pos < _buffer.size()) {190 if ((unsigned int)_pos < _buffer.size()) { 187 191 ptr[i] = _buffer[_pos++]; 188 192 } … … 196 200 double dval = 0; 197 201 char *ptr = (char*)(&dval); 202 unsigned int i = 0; 198 203 199 204 ENDIAN_FOR_LOOP(i, sizeof(double)) { 200 if ( _pos < _buffer.size()) {205 if ((unsigned int)_pos < _buffer.size()) { 201 206 ptr[i] = _buffer[_pos++]; 202 207 } … … 210 215 std::string sval; 211 216 char c; 212 while ( _pos < _buffer.size()) {217 while ((unsigned int)_pos < _buffer.size()) { 213 218 c = _buffer[_pos++]; 214 219 if (c == '\0') { … … 228 233 229 234 nbytes = readInt(); 230 while ( _pos < _buffer.size() && nbytes-- > 0) {235 while ((unsigned int)_pos < _buffer.size() && nbytes-- > 0) { 231 236 bval.push_back( _buffer[_pos++] ); 232 237 } -
trunk/src2/core/RpSerializable.h
r413 r657 17 17 #include <string> 18 18 #include <map> 19 #include "RpPtr.h" 20 #include "RpOutcome.h" 19 #include "rappture2.h" 21 20 #include "RpSerialBuffer.h" 22 21 -
trunk/src2/core/RpSerializer.cc
r370 r657 100 100 101 101 // write out each object in the list, in order 102 for ( int i=0; i < _idlist.size(); i++) {102 for (unsigned int i=0; i < _idlist.size(); i++) { 103 103 const char* id = _idlist.at(i); 104 104 Ptr<Serializable> objPtr = _id2obj[id]; … … 121 121 { 122 122 Serializer *nonconst = (Serializer*)this; 123 assert(pos >= 0 && pos < _idlist.size());123 assert(pos >= 0 && (unsigned int)pos < _idlist.size()); 124 124 125 125 std::string id(_idlist[pos]); … … 132 132 _id2obj.clear(); 133 133 _idlist.clear(); 134 return *this; 134 135 } 135 136 -
trunk/src2/core/RpSerializer.h
r370 r657 20 20 21 21 #include <map> 22 #include "RpPtr.h" 23 #include "RpOutcome.h" 22 #include "rappture2.h" 24 23 #include "RpSerialBuffer.h" 25 24 #include "RpSerializable.h"
Note: See TracChangeset
for help on using the changeset viewer.