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

df1b2f13.cpp (revision 1110)
17 17
void fixed_smartlist::reset(void)
18 18
{
19 19
  end_saved=0;
20
  bptr=buffer; 
20
  bptr=buffer;
21 21
  eof_flag=0;
22 22
  /*off_t pos=*/lseek(fp,0L,SEEK_CUR);
23 23
  endof_file_ptr=lseek(fp,0L,SEEK_SET);
......
28 28
 * Description not yet available.
29 29
 * \param
30 30
 */
31
fixed_smartlist::fixed_smartlist(void) 
31
fixed_smartlist::fixed_smartlist(void)
32 32
{
33 33
  nentries=0;
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
fixed_smartlist::fixed_smartlist(unsigned int _bufsize,const adstring& _filename) 
46
fixed_smartlist::fixed_smartlist(unsigned int _bufsize,const adstring& _filename)
47 47
{
48 48
  allocate(_bufsize,_filename);
49 49
}
50
void fixed_smartlist::allocate(unsigned int _bufsize,const adstring& _filename) 
50
void fixed_smartlist::allocate(unsigned int _bufsize,const adstring& _filename)
51 51
{
52 52
  nentries=_bufsize/sizeof(fixed_list_entry);
53 53
  end_saved=0;
......
57 57
  direction=0;
58 58
  bufsize=_bufsize;
59 59
  filename=_filename;
60
  AD_ALLOCATE(true_buffer,fixed_list_entry,nentries+2,df1b2_gradlist) 
60
  AD_ALLOCATE(true_buffer,fixed_list_entry,nentries+2,df1b2_gradlist)
61 61
  doubleptr=(double*)true_buffer;
62 62
  true_buffend=true_buffer+nentries+1;
63 63
  buffer=true_buffer+1;
......
71 71
                   O_BINARY, S_IREAD | S_IWRITE);
72 72
  if (fp == -1)
73 73
  {
74
    cerr << "Error trying to open file " << filename 
74
    cerr << "Error trying to open file " << filename
75 75
         << " in class fixed_smartlist " << endl;
76 76
    ad_exit(1);
77 77
  }
......
111 111
    if (nbytes>bufsize)
112 112
    {
113 113
      cerr << "Error -- record size in file seems to be larger than"
114
       " the buffer it was created from " << endl 
114
       " the buffer it was created from " << endl
115 115
        << " buffer size is " << bufsize << " record size is supposedly "
116 116
        << nbytes << endl;
117 117
      ad_exit(1);
......
128 128
/**
129 129
 * Description not yet available.
130 130
 * \param
131
 */   
131
 */
132 132
void fixed_smartlist::initialize(void)
133 133
{
134 134
  end_saved=0;
......
167 167
/**
168 168
 * Description not yet available.
169 169
 * \param
170
 */   
170
 */
171 171
void fixed_smartlist::restore_end(void)
172 172
{
173 173
  if (written_flag)
......
210 210
    written_flag=1;
211 211
    // get the current file position
212 212
    off_t pos=lseek(fp,0L,SEEK_CUR);
213
  
213

  
214 214
    // write the size of the next record into the file
215 215
    //cout << nbytes << endl;
216 216
    ::write(fp,&nbytes,sizeof(int));
217
  
217

  
218 218
    // write the record into the file
219 219
    int nw=::write(fp,buffer,nbytes);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff