Revision 1583 trunk/src/linad99/ddlist.cpp

ddlist.cpp (revision 1583)
34 34
char* ddlist_spacea;
35 35

  
36 36
/**
37
 * Description not yet available.
38
 * \param
39
 */
37
Default constructor
38
*/
40 39
dlist::dlist(void)
41 40
{
42 41
  int on,nopt = 0;
......
53 52
      ad_exit(1);
54 53
    }	
55 54
  }
56
  // cout << sizeof(double_and_int) << endl;
57
  // cerr << "dlist::dlist(void)\n";
58 55
  last = 0;
59 56
  last_offset = 0;
60 57
  nlinks = 0;
......
70 67

  
71 68
  ddlist_spacea=ddlist_space+adjust;
72 69

  
73
  for (int i = 0; i < gradient_structure::MAX_DLINKS; ++i)
74
  {
75
    dlink_addresses[i] = 0;
76
  }
70
  memset(dlink_addresses, 0, sizeof(dlink*) * gradient_structure::MAX_DLINKS);
77 71
}
78 72

  
79 73
/**
......
108 102
}
109 103

  
110 104
/**
111
 * Description not yet available.
112
 * \param
113
 */
105
If last node in list exist, remove it and return it.
106
*/
114 107
dlink* dlist::last_remove()
115 108
{
116
  dlink * tmp;
117 109
  if (last)
118 110
  {
119
    tmp=last;
120
    last=last->prev;
121
    return(tmp);
111
    dlink* tmp = last;
112
    last = last->prev;
113
    return tmp;
122 114
  }
123
  else
124
  {
125
    return 0;
126
  }
115
  return 0;
127 116
}
128

  
129 117
/**
130 118
Destructor
131 119
*/
......
164 152
  delete [] dlink_addresses;
165 153
  dlink_addresses = 0;
166 154
}
167

  
168 155
/**
156
Get total addresses stored.
157
*/
158
size_t dlist::total_addresses() const
159
{
160
  size_t total = 0;
161
  for (int i = 0; i < gradient_structure::MAX_DLINKS; ++i)
162
  {
163
    if (dlink_addresses[i] != 0)
164
    {
165
      total++;
166
    }
167
  }
168
  return total;
169
}
170
/**
169 171
 * Description not yet available.
170 172
 * \param
171 173
 */
172 174
void dlist::check_list(void)
173 175
{
174
  dlink * tmp;
175
  dlink * tmp_last=last;
176
  dlink* tmp_last=last;
176 177

  
177 178
  unsigned int count=0;
178 179
  while(tmp_last && count <=nlinks)
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff