- Timestamp:
- Feb 25, 2007, 8:53:05 PM (18 years ago)
- Location:
- trunk/src2/core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src2/core/Outcome.cpp
r441 r592 4 4 * 5 5 * AUTHOR: Michael McLennan, Purdue University 6 * Copyright (c) 2004-200 6Purdue Research Foundation6 * Copyright (c) 2004-2007 Purdue Research Foundation 7 7 * ---------------------------------------------------------------------- 8 8 * See the file "license.terms" for information on usage and … … 10 10 * ====================================================================== 11 11 */ 12 #include " RpOutcome.h"12 #include "Outcome.h" 13 13 14 14 using namespace Rappture; … … 45 45 } 46 46 47 /// Destructor 48 Outcome::~Outcome() 49 {} 50 47 51 /** 48 52 * Assign an error condition to the outcome. … … 54 58 _remarkPtr = Ptr<std::string>(new std::string(errmsg)); 55 59 _contextPtr.clear(); 60 return *this; 56 61 } 57 62 … … 65 70 _remarkPtr.clear(); 66 71 _contextPtr.clear(); 72 return *this; 67 73 } 68 74 … … 96 102 _contextPtr = oc._contextPtr; 97 103 } 104 return *this; 98 105 } 99 106 -
trunk/src2/core/Outcome.h
r576 r592 4 4 * 5 5 * AUTHOR: Michael McLennan, Purdue University 6 * Copyright (c) 2004-200 6Purdue Research Foundation6 * Copyright (c) 2004-2007 Purdue Research Foundation 7 7 * ---------------------------------------------------------------------- 8 8 * See the file "license.terms" for information on usage and … … 28 28 Outcome(const Outcome& status); 29 29 Outcome& operator=(const Outcome& status); 30 virtual ~Outcome(); 30 31 31 32 virtual Outcome& error(const char* errmsg, int status=1); -
trunk/src2/core/Ptr.h
r576 r592 97 97 clear(); 98 98 _pc = new PtrCore(ptr); 99 return *this; 99 100 } 100 101 … … 108 109 clear(); 109 110 _pc = ptr._pc; 111 return *this; 110 112 } 111 113 -
trunk/src2/core/RpBuffer.cc
r583 r592 165 165 * @return Number of the bytes used in the buffer. 166 166 */ 167 int167 unsigned int 168 168 SimpleBuffer::size() const 169 169 { … … 194 194 SimpleBuffer::append(const char* bytes, int nbytes) 195 195 { 196 int newSize = 0;196 unsigned int newSize = 0; 197 197 char *newBuffer = NULL; 198 198 … … 217 217 } 218 218 219 newSize = _size + nbytes;219 newSize = (unsigned int)(_size + nbytes); 220 220 221 221 // ensure that our smallest buffer is 200 bytes … … 247 247 memcpy((void*) (_buf + _size), (void*) bytes, (size_t) nbytes); 248 248 249 _size = _size + nbytes;249 _size = _size + (unsigned int) nbytes; 250 250 251 251 return nbytes; … … 262 262 SimpleBuffer::read(const char* bytes, int nbytes) 263 263 { 264 int bytesRead = 0;264 unsigned int bytesRead = 0; 265 265 266 266 // SimpleBuffer is empty. … … 274 274 } 275 275 276 // User specified negative buffer size 277 if (nbytes <= 0) { 278 return 0; 279 } 280 276 281 // make sure we don't read off the end of our buffer 277 if ( (_pos + nbytes) >= _size ) {282 if ( (_pos + nbytes) >= _size ) { 278 283 bytesRead = (_size - _pos); 279 284 } 280 285 else { 281 bytesRead = nbytes;282 } 283 284 if (bytesRead < 0) {286 bytesRead = (unsigned int) nbytes; 287 } 288 289 if (bytesRead <= 0) { 285 290 return 0; 286 291 } … … 290 295 } 291 296 292 _pos = _pos + bytesRead;293 294 return bytesRead;297 _pos = (_pos + bytesRead); 298 299 return (int)bytesRead; 295 300 } 296 301 … … 316 321 _pos = 0; 317 322 } 318 else if (offset >= _size) {323 else if (offset >= (int)_size) { 319 324 /* dont go off the end of data */ 320 325 _pos = _size - 1; 321 326 } 322 327 else { 323 _pos = _pos + offset;328 _pos = (unsigned int)(_pos + offset); 324 329 } 325 330 } … … 334 339 } 335 340 else { 336 _pos = _pos + offset;341 _pos = (unsigned int)(_pos + offset); 337 342 } 338 343 } 339 344 else if (whence == SEEK_END) { 340 if (offset <= (-1* _size)) {345 if (offset <= (-1*((int)_size))) { 341 346 /* dont go off the beginning of data */ 342 347 _pos = 0; … … 347 352 } 348 353 else { 349 _pos = ( _size - 1) + offset;354 _pos = (unsigned int)((_size - 1) + offset); 350 355 } 351 356 } … … 365 370 SimpleBuffer::tell() 366 371 { 367 return _pos;372 return (int)_pos; 368 373 } 369 374 … … 832 837 { 833 838 int tBufSize = 0; 834 int tBufAvl = 2*bin.size();839 unsigned int tBufAvl = 2*bin.size(); 835 840 char* tBuf = new char[tBufAvl]; 836 841 … … 853 858 { 854 859 int tBufSize = 0; 855 int tBufAvl = bin.size();860 unsigned int tBufAvl = bin.size(); 856 861 char* tBuf = new char[tBufAvl]; 857 862 -
trunk/src2/core/RpBuffer.h
r583 r592 91 91 92 92 const char* bytes() const; 93 int size() const;93 unsigned int size() const; 94 94 95 95 SimpleBuffer& clear(); … … 117 117 118 118 /// Position offset within the buffer's memory 119 int _pos;119 unsigned int _pos; 120 120 121 121 /// Size of the used memory in the buffer 122 int _size;122 unsigned int _size; 123 123 124 124 /// Total space available in the buffer 125 int _spaceAvl;125 unsigned int _spaceAvl; 126 126 127 127 /// State of the last file like operation.
Note: See TracChangeset
for help on using the changeset viewer.