Revision 1110 trunk/src/df1b2-separable/df1b2f10.cpp

df1b2f10.cpp (revision 1110)
16 16
 */
17 17
void test_smartlist::reset(void)
18 18
{
19
  bptr=buffer; 
19
  bptr=buffer;
20 20
  eof_flag=0;
21 21
  lseek(fp, 0L, SEEK_SET);
22 22
  written_flag=0;
......
29 29
 * Description not yet available.
30 30
 * \param
31 31
 */
32
test_smartlist::test_smartlist(void) 
32
test_smartlist::test_smartlist(void)
33 33
{
34 34
  bufsize=0;
35 35
  buffer=0;
36 36
  true_buffer=0;
37
  buffend=0; 
37
  buffend=0;
38 38
  bptr=0;
39 39
  fp=-1;
40 40
}
......
43 43
 * Description not yet available.
44 44
 * \param
45 45
 */
46
test_smartlist::test_smartlist(unsigned int _bufsize,const adstring& _filename) 
46
test_smartlist::test_smartlist(unsigned int _bufsize,const adstring& _filename)
47 47
{
48 48
  allocate(_bufsize,_filename);
49 49
}
......
52 52
 * Description not yet available.
53 53
 * \param
54 54
 */
55
void test_smartlist::allocate(unsigned int _bufsize,const adstring& _filename) 
55
void test_smartlist::allocate(unsigned int _bufsize,const adstring& _filename)
56 56
{
57 57
  if (sizeof(char)>1)
58 58
  {
......
66 66
  direction=0;
67 67
  bufsize=_bufsize;
68 68
  filename=_filename;
69
  //AD_ALLOCATE(true_buffer,char,bufsize+2*sizeof(double),df1b2_gradlist) 
69
  //AD_ALLOCATE(true_buffer,char,bufsize+2*sizeof(double),df1b2_gradlist)
70 70
  if ((true_buffer=new char[(bufsize+2)*sizeof(double) ])==0)
71 71
  {
72 72
    cerr << "Allocation error in df1b2_gradlist" << endl;
......
84 84
                   O_BINARY, S_IREAD | S_IWRITE);
85 85
  if (fp == -1)
86 86
  {
87
    cerr << "Error trying to open file " << filename 
87
    cerr << "Error trying to open file " << filename
88 88
         << " in class test_smartlist " << endl;
89 89
    exit(1);
90 90
  }
......
122 122
    if (nbytes>bufsize)
123 123
    {
124 124
      cerr << "Error -- record size in file seems to be larger than"
125
       " the buffer it was created from " << endl 
125
       " the buffer it was created from " << endl
126 126
        << " buffer size is " << bufsize << " record size is supposedly "
127 127
        << nbytes << endl;
128 128
    }
......
217 217
    written_flag=1;
218 218
    // get the current file position
219 219
    off_t pos=lseek(fp,0L,SEEK_CUR);
220
  
220

  
221 221
    // write the size of the next record into the file
222 222
    ::write(fp,&nbytes,sizeof(int));
223
  
223

  
224 224
    // write the record into the file
225 225
    int nw=::write(fp,buffer,nbytes);
226 226
    //cout << "Number of bytes written " << nw << endl;
227
    //cout << "buffer value = "; 
227
    //cout << "buffer value = ";
228 228
    //for (int ii=0;ii<=25;ii++)
229 229
    //  cout << int (*(buffer+ii)) << " ";
230 230
    //cout << endl;
......
235 235
    }
236 236
    // reset the pointer to the beginning of the buffer
237 237
    bptr=buffer;
238
  
238

  
239 239
    // now write the previous file position into the file so we can back up
240 240
    // when we want to.
241 241
    ::write(fp,&pos,sizeof(off_t));
242
  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff