Changeset 1055 for trunk/src/core


Ignore:
Timestamp:
Jun 23, 2008, 1:15:25 PM (16 years ago)
Author:
gah
Message:
 
Location:
trunk/src/core
Files:
3 edited

Legend:

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

    r1051 r1055  
    9090                xerror.h
    9191
    92 # Build the scew library directly into Rappture for now. 
     92# Build the scew and b64 libraries directly into Rappture for now. 
    9393# Note: This works because of viewpath-ing. See the VPATH variable.
    9494B64_OBJS        = \
  • trunk/src/core/RpDXWriter.cc

    r1051 r1055  
    3030    _origin(NULL)
    3131{
    32     _delta  = (float*) malloc(_rank*_rank*sizeof(float));
     32    _delta  = (float*) malloc(_rank * _rank* sizeof(float));
    3333    if (_delta == NULL) {
    3434        fprintf(stderr,
    35             "Error allocating %d bytes, for _delta, inside DXWriter Constructor\n",
    36             _rank*_rank*sizeof(float));
     35            "Error allocating %lu bytes, for _delta, inside DXWriter Constructor\n",
     36                (unsigned long)(_rank *_rank * sizeof(float)));
    3737            return;
    3838    }
     
    5252    if (_origin == NULL) {
    5353        fprintf(stderr,
    54             "Error allocating %d bytes, for _origin, inside DXWriter Constructor\n",
    55             _rank*sizeof(float));
     54            "Error allocating %lu bytes, for _origin, inside DXWriter Constructor\n",
     55                (unsigned long)(_rank * sizeof(float)));
    5656            return;
    5757    }
     
    7373    if (_delta == NULL) {
    7474        fprintf(stderr,
    75             "Error allocating %d bytes, for _delta, inside DXWriter Constructor\n",
    76             _rank*_rank*sizeof(float));
     75            "Error allocating %lu bytes, for _delta, inside DXWriter Constructor\n",
     76                (unsigned long)(_rank * _rank * sizeof(float)));
    7777            return;
    7878    }
     
    9292    if (_origin == NULL) {
    9393        fprintf(stderr,
    94             "Error allocating %d bytes, for _origin, inside DXWriter Constructor\n",
    95             _rank*sizeof(float));
     94            "Error allocating %lu bytes, for _origin, inside DXWriter Constructor\n",
     95                (unsigned long)(_rank*sizeof(float)));
    9696            return;
    9797    }
     
    119119DXWriter::origin(float* o)
    120120{
    121     float *tmp = NULL;
    122     size_t nbytes = 0;
    123 
    124121    if (o == NULL) {
    125122        return *this;
    126123    }
    127 
    128     nbytes = _rank*sizeof(float);
    129     tmp = (float*) malloc(nbytes);
     124    size_t nbytes = _rank * sizeof(float);
     125    float *tmp = (float*) malloc(nbytes);
    130126    if (tmp == NULL) {
    131         fprintf(stderr,"Unable to malloc %d bytes inside DXWriter::origin\n",
    132             nbytes);
     127        fprintf(stderr,"Unable to malloc %lu bytes inside DXWriter::origin\n",
     128                (unsigned long)nbytes);
    133129        return *this;
    134130    }
     
    147143DXWriter::delta(float* d)
    148144{
    149     float *tmp = NULL;
    150     size_t nbytes = 0;
    151 
    152145    if (d == NULL) {
    153146        return *this;
    154147    }
    155148
    156     nbytes = pow(_rank,2)*sizeof(float);
    157     tmp = (float*) malloc(nbytes);
     149    size_t nbytes = _rank * _rank * sizeof(float);
     150    float *tmp = (float*)malloc(nbytes);
    158151    if (tmp == NULL) {
    159         fprintf(stderr,"Unable to malloc %d bytes inside DXWriter::delta\n",
    160             nbytes);
     152        fprintf(stderr,"Unable to malloc %lu bytes inside DXWriter::delta\n",
     153                (unsigned long)nbytes);
    161154        return *this;
    162155    }
     
    175168DXWriter::counts(size_t *p)
    176169{
    177     size_t *tmp = NULL;
    178     size_t nbytes = 0;
    179 
    180170    if (p == NULL) {
    181171        return *this;
    182172    }
    183 
    184     nbytes = _rank*sizeof(size_t);
    185     tmp = (size_t*) malloc(nbytes);
     173    size_t nbytes = _rank * sizeof(size_t);
     174    size_t *tmp = (size_t*) malloc(nbytes);
    186175    if (tmp == NULL) {
    187         fprintf(stderr,"Unable to malloc %d bytes inside DXWriter::pos\n",
    188             nbytes);
     176        fprintf(stderr,"Unable to malloc %lu bytes inside DXWriter::pos\n",
     177                (unsigned long)nbytes);
    189178        return *this;
    190179    }
     
    196185
    197186    _positions = tmp;
    198 
    199187    return *this;
    200188}
     
    241229    dxfile.append("object 1 class gridpositions counts",35);
    242230    for (size_t i=0; i < _rank; i++) {
    243         sprintf(b, " %10d",_positions[i]);
     231        sprintf(b, " %10lu", (unsigned long)_positions[i]);
    244232        dxfile.append(b,11);
    245233    }
     
    261249    dxfile.append("\nobject 2 class gridconnections counts", 38);
    262250    for (size_t i=0; i < _rank; i++) {
    263         sprintf(b, " %10d",_positions[i]);
     251        sprintf(b, " %10lu",(unsigned long)_positions[i]);
    264252        dxfile.append(b,11);
    265253    }
  • trunk/src/core/RpSimpleBuffer.h

    r1051 r1055  
    412412
    413413    if (buf == NULL) {
    414         fprintf(stderr,"Can't allocate %i bytes of memory\n",nbytes);
     414        fprintf(stderr,"Can't allocate %lu bytes of memory\n",
     415                (long unsigned int)nbytes);
    415416        _fileState = false;
    416417        return 0;
Note: See TracChangeset for help on using the changeset viewer.