Changeset 1055 for trunk/src/core
- Timestamp:
- Jun 23, 2008, 1:15:25 PM (16 years ago)
- Location:
- trunk/src/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/Makefile.in
r1051 r1055 90 90 xerror.h 91 91 92 # Build the scew librarydirectly into Rappture for now.92 # Build the scew and b64 libraries directly into Rappture for now. 93 93 # Note: This works because of viewpath-ing. See the VPATH variable. 94 94 B64_OBJS = \ -
trunk/src/core/RpDXWriter.cc
r1051 r1055 30 30 _origin(NULL) 31 31 { 32 _delta = (float*) malloc(_rank *_rank*sizeof(float));32 _delta = (float*) malloc(_rank * _rank* sizeof(float)); 33 33 if (_delta == NULL) { 34 34 fprintf(stderr, 35 "Error allocating % dbytes, 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))); 37 37 return; 38 38 } … … 52 52 if (_origin == NULL) { 53 53 fprintf(stderr, 54 "Error allocating % dbytes, 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))); 56 56 return; 57 57 } … … 73 73 if (_delta == NULL) { 74 74 fprintf(stderr, 75 "Error allocating % dbytes, 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))); 77 77 return; 78 78 } … … 92 92 if (_origin == NULL) { 93 93 fprintf(stderr, 94 "Error allocating % dbytes, 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))); 96 96 return; 97 97 } … … 119 119 DXWriter::origin(float* o) 120 120 { 121 float *tmp = NULL;122 size_t nbytes = 0;123 124 121 if (o == NULL) { 125 122 return *this; 126 123 } 127 128 nbytes = _rank*sizeof(float); 129 tmp = (float*) malloc(nbytes); 124 size_t nbytes = _rank * sizeof(float); 125 float *tmp = (float*) malloc(nbytes); 130 126 if (tmp == NULL) { 131 fprintf(stderr,"Unable to malloc % dbytes inside DXWriter::origin\n",132 127 fprintf(stderr,"Unable to malloc %lu bytes inside DXWriter::origin\n", 128 (unsigned long)nbytes); 133 129 return *this; 134 130 } … … 147 143 DXWriter::delta(float* d) 148 144 { 149 float *tmp = NULL;150 size_t nbytes = 0;151 152 145 if (d == NULL) { 153 146 return *this; 154 147 } 155 148 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); 158 151 if (tmp == NULL) { 159 fprintf(stderr,"Unable to malloc % dbytes inside DXWriter::delta\n",160 152 fprintf(stderr,"Unable to malloc %lu bytes inside DXWriter::delta\n", 153 (unsigned long)nbytes); 161 154 return *this; 162 155 } … … 175 168 DXWriter::counts(size_t *p) 176 169 { 177 size_t *tmp = NULL;178 size_t nbytes = 0;179 180 170 if (p == NULL) { 181 171 return *this; 182 172 } 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); 186 175 if (tmp == NULL) { 187 fprintf(stderr,"Unable to malloc % dbytes inside DXWriter::pos\n",188 176 fprintf(stderr,"Unable to malloc %lu bytes inside DXWriter::pos\n", 177 (unsigned long)nbytes); 189 178 return *this; 190 179 } … … 196 185 197 186 _positions = tmp; 198 199 187 return *this; 200 188 } … … 241 229 dxfile.append("object 1 class gridpositions counts",35); 242 230 for (size_t i=0; i < _rank; i++) { 243 sprintf(b, " %10 d",_positions[i]);231 sprintf(b, " %10lu", (unsigned long)_positions[i]); 244 232 dxfile.append(b,11); 245 233 } … … 261 249 dxfile.append("\nobject 2 class gridconnections counts", 38); 262 250 for (size_t i=0; i < _rank; i++) { 263 sprintf(b, " %10 d",_positions[i]);251 sprintf(b, " %10lu",(unsigned long)_positions[i]); 264 252 dxfile.append(b,11); 265 253 } -
trunk/src/core/RpSimpleBuffer.h
r1051 r1055 412 412 413 413 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); 415 416 _fileState = false; 416 417 return 0;
Note: See TracChangeset
for help on using the changeset viewer.