Changeset 657


Ignore:
Timestamp:
Apr 3, 2007 12:23:28 PM (14 years ago)
Author:
dkearney
Message:

cleaned up all the compile time warnings in core rappture2 objects

Location:
trunk/src2/core
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/src2/core/Makefile.in

    r596 r657  
    128128# DO NOT DELETE THIS LINE -- make depend depends on it.
    129129
    130 # should use librappture2.a or $(LDFLAGS)  but this uses RpOutcome.o
    131 viz: viz.o libviz.a
     130viz: viz.o librappture2.a
    132131        $(CXX) $(CFLAGS) -o viz $^
    133132
  • trunk/src2/core/Ptr.h

    r621 r657  
    137137{
    138138    if (_pc) {
    139         return _pc->pointer();
     139        return (Type*)_pc->pointer();
    140140    }
    141141    return NULL;
  • trunk/src2/core/RpBuffer.cc

    r652 r657  
    11/*
    22 * ======================================================================
    3  *  Rappture::RpBuffer
     3 *  Rappture::Buffer
    44 *
    55 *  AUTHOR:  Derrick Kearney, Purdue University
  • trunk/src2/core/RpBuffer.h

    r621 r657  
    11/*
    22 * ======================================================================
    3  *  Rappture::RpBuffer
     3 *  Rappture::Buffer
    44 *
    55 *  AUTHOR:  Derrick Kearney, Purdue University
  • trunk/src2/core/RpField1D.cc

    r454 r657  
    5656    _meshPtr = field._meshPtr;
    5757    _counter = field._counter;
     58    return *this;
    5859}
    5960
     
    133134        define(nodeId, y);
    134135    }
     136    return 0;
    135137}
    136138
     
    146148        if (y > _vmax) { _vmax = y; }
    147149    }
     150    return 0;
    148151}
    149152
  • trunk/src2/core/RpField1D.h

    r372 r657  
    1818#define RAPPTURE_FIELD1D_H
    1919
    20 #include "RpPtr.h"
     20#include "rappture2.h"
    2121#include "RpMesh1D.h"
    2222
  • trunk/src2/core/RpFieldPrism3D.cc

    r454 r657  
    7676FieldPrism3D::define(int nodeId, double f)
    7777{
    78     while (_valuelist.size() <= nodeId) {
     78    while (_valuelist.size() <= (unsigned int)nodeId) {
    7979        _valuelist.push_back(NAN);
    8080    }
     
    9393FieldPrism3D::value(double x, double y, double z, double outside) const
    9494{
    95     double f0, f1, fy0, fy1, fz0, fz1;
    96 
    9795    if (!_meshPtr.isNull()) {
    9896        CellPrism3D cell = _meshPtr->locate(Node3D(x,y,z));
  • trunk/src2/core/RpFieldPrism3D.h

    r372 r657  
    1919#include <math.h>
    2020#include <vector>
    21 #include "RpPtr.h"
     21#include "rappture2.h"
    2222#include "RpMeshPrism3D.h"
    2323
  • trunk/src2/core/RpFieldRect3D.cc

    r470 r657  
    104104FieldRect3D::define(int nodeId, double f)
    105105{
    106     while (_valuelist.size() < nodeId) {
     106    while (_valuelist.size() < (unsigned int)(nodeId)) {
    107107        _valuelist.push_back(NAN);
    108108    }
  • trunk/src2/core/RpFieldRect3D.h

    r372 r657  
    1919#include <math.h>
    2020#include <vector>
    21 #include "RpPtr.h"
     21#include "rappture2.h"
    2222#include "RpMeshRect3D.h"
    2323
  • trunk/src2/core/RpFieldTri2D.h

    r372 r657  
    1919#include <math.h>
    2020#include <vector>
    21 #include "RpPtr.h"
     21#include "rappture2.h"
    2222#include "RpMeshTri2D.h"
    2323
  • trunk/src2/core/RpMesh1D.cc

    r446 r657  
    104104    _id2node = mesh._id2node;
    105105    _id2nodeDirty = mesh._id2nodeDirty;
     106    return *this;
    106107}
    107108
     
    151152{
    152153    if (!_id2nodeDirty) {
    153         if (nodeId < _id2node.size()) {
     154        if ((unsigned int) nodeId < _id2node.size()) {
    154155            int n = _id2node[nodeId];
    155156            _nodelist.erase( _nodelist.begin()+n );
     
    165166    }
    166167    _id2nodeDirty = 1;
     168    return *this;
    167169}
    168170
     
    183185            }
    184186            // 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()) ) {
    186189                _nodelist.erase( _nodelist.begin()+n+1 );
    187190                _id2nodeDirty = 1;
     
    199202    _counter = 0;
    200203    _id2nodeDirty = 0;
     204    return *this;
    201205}
    202206
  • trunk/src2/core/RpMesh1D.h

    r370 r657  
    7575    int _counter;                   // auto counter for node IDs
    7676
     77    std::deque<int> _id2node;       // maps node Id => index in _nodelist
    7778    int _id2nodeDirty;              // non-zero => _id2node needs to be rebuilt
    78     std::deque<int> _id2node;       // maps node Id => index in _nodelist
    7979
    8080    // methods for serializing/deserializing version 'A'
  • trunk/src2/core/RpMeshPrism3D.cc

    r370 r657  
    109109    _xymesh = mesh._xymesh;
    110110    _zmesh  = mesh._zmesh;
     111    return *this;
    111112}
    112113
  • trunk/src2/core/RpMeshRect3D.cc

    r370 r657  
    112112    _axis[1] = mesh._axis[1];
    113113    _axis[2] = mesh._axis[2];
     114    return *this;
    114115}
    115116
  • trunk/src2/core/RpMeshTri2D.cc

    r446 r657  
    169169    _id2node = mesh._id2node;
    170170    _lastLocate.clear();
     171    return *this;
    171172}
    172173
     
    208209    if (!_id2nodeDirty) {
    209210        // 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()) {
    211212            int newsize = 2*_id2node.size();
    212213            for (int i=_id2node.size(); i < newsize; i++) {
     
    277278    _id2node.assign(100, -1);
    278279    _lastLocate.clear();
     280    return *this;
    279281}
    280282
     
    288290MeshTri2D::atNode(int pos)
    289291{
    290     assert(pos >= 0 && pos < _nodelist.size());
     292    assert(pos >= 0 && (unsigned int)(pos) < _nodelist.size());
    291293    return _nodelist.at(pos);
    292294}
     
    301303MeshTri2D::atCell(int pos)
    302304{
    303     assert(pos >= 0 && pos < _celllist.size());
     305    assert(pos >= 0 && (unsigned int)(pos) < _celllist.size());
    304306
    305307    Tri2D& cell = _celllist[pos];
     
    401403    nonconst->_rebuildNodeIdMap();
    402404
    403     if (nodeId < _id2node.size()) {
     405    if ((unsigned int)nodeId < _id2node.size()) {
    404406        int n = _id2node[nodeId];
    405407        if (n >= 0) {
  • trunk/src2/core/RpNode.h

    r370 r657  
    3232    virtual int dimensionality() const = 0;
    3333
     34    virtual ~Node();
     35
    3436private:
    3537    int _id;  // node identifier (used for fields)
     
    4446    virtual double x() const { return _x; }
    4547    virtual double x(double newval) { _x = newval; return _x; }
     48
     49    virtual ~Node1D();
    4650
    4751private:
     
    6064    virtual double x(double newval) { _x = newval; return _x; }
    6165    virtual double y(double newval) { _y = newval; return _y; }
     66
     67    virtual ~Node2D();
    6268
    6369private:
     
    8086    virtual double z(double newval) { _z = newval; return _z; }
    8187
     88    virtual ~Node3D();
     89
    8290private:
    8391    double _x;  // x-coordinate
  • trunk/src2/core/RpSerialBuffer.cc

    r413 r657  
    1616#ifdef BIGENDIAN
    1717#  define ENDIAN_FOR_LOOP(var,size)  \
    18      for (int var=size-1; var >= 0; var--)
     18     for (var=size-1; var >= 0; var--)
    1919#else
    2020#  define ENDIAN_FOR_LOOP(var,size)  \
    21      for (int var=0; var < size; var++)
     21     for (var=0; var < size; var++)
    2222#endif
    2323
     
    6767    _buffer = sb._buffer;
    6868    _pos = 0;  // auto-rewind
     69    return *this;
    6970}
    7071
     
    117118{
    118119    char *ptr = (char*)(&ival);
     120    unsigned int i = 0;
    119121
    120122    ENDIAN_FOR_LOOP(i, sizeof(int)) {
     
    128130{
    129131    char *ptr = (char*)(&dval);
     132    unsigned int i = 0;
    130133
    131134    ENDIAN_FOR_LOOP(i, sizeof(double)) {
     
    164167SerialBuffer::atEnd() const
    165168{
    166     return (_pos >= _buffer.size());
     169    return ((unsigned int)_pos >= _buffer.size());
    167170}
    168171
     
    171174{
    172175    char c = '\0';
    173     if (_pos < _buffer.size()) {
     176    if ((unsigned int)_pos < _buffer.size()) {
    174177        c = _buffer[_pos++];
    175178    }
     
    182185    int ival = 0;
    183186    char *ptr = (char*)(&ival);
     187    unsigned int i = 0;
    184188
    185189    ENDIAN_FOR_LOOP(i, sizeof(int)) {
    186         if (_pos < _buffer.size()) {
     190        if ((unsigned int)_pos < _buffer.size()) {
    187191            ptr[i] = _buffer[_pos++];
    188192        }
     
    196200    double dval = 0;
    197201    char *ptr = (char*)(&dval);
     202    unsigned int i = 0;
    198203
    199204    ENDIAN_FOR_LOOP(i, sizeof(double)) {
    200         if (_pos < _buffer.size()) {
     205        if ((unsigned int)_pos < _buffer.size()) {
    201206            ptr[i] = _buffer[_pos++];
    202207        }
     
    210215    std::string sval;
    211216    char c;
    212     while (_pos < _buffer.size()) {
     217    while ((unsigned int)_pos < _buffer.size()) {
    213218        c = _buffer[_pos++];
    214219        if (c == '\0') {
     
    228233
    229234    nbytes = readInt();
    230     while (_pos < _buffer.size() && nbytes-- > 0) {
     235    while ((unsigned int)_pos < _buffer.size() && nbytes-- > 0) {
    231236        bval.push_back( _buffer[_pos++] );
    232237    }
  • trunk/src2/core/RpSerializable.h

    r413 r657  
    1717#include <string>
    1818#include <map>
    19 #include "RpPtr.h"
    20 #include "RpOutcome.h"
     19#include "rappture2.h"
    2120#include "RpSerialBuffer.h"
    2221
  • trunk/src2/core/RpSerializer.cc

    r370 r657  
    100100
    101101    // 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++) {
    103103        const char* id = _idlist.at(i);
    104104        Ptr<Serializable> objPtr = _id2obj[id];
     
    121121{
    122122    Serializer *nonconst = (Serializer*)this;
    123     assert(pos >= 0 && pos < _idlist.size());
     123    assert(pos >= 0 && (unsigned int)pos < _idlist.size());
    124124
    125125    std::string id(_idlist[pos]);
     
    132132    _id2obj.clear();
    133133    _idlist.clear();
     134    return *this;
    134135}
    135136
  • trunk/src2/core/RpSerializer.h

    r370 r657  
    2020
    2121#include <map>
    22 #include "RpPtr.h"
    23 #include "RpOutcome.h"
     22#include "rappture2.h"
    2423#include "RpSerialBuffer.h"
    2524#include "RpSerializable.h"
Note: See TracChangeset for help on using the changeset viewer.