Revision 1583

trunk/tests/gtests/test_dlist.cpp (revision 1583)
9 9
{
10 10
  dlist lst;
11 11
  EXPECT_STRNE(0, ddlist_space);
12
  EXPECT_EQ(0, lst.total_addresses());
12 13
}
13 14
TEST_F(test_dlist, destructor)
14 15
{
trunk/src/linad99/fvar.hpp (revision 1583)
1274 1274

  
1275 1275
 public:
1276 1276
   dlist();			// constructor
1277
   void check_list(void);	// check list integrity
1278 1277
   ~dlist();			// destructor
1279 1278
   dlink *create();		//create a new link
1280 1279
   void free_remove(dlink * rem);
1281 1280
   dlink *append(dlink *);	// add a link
1282 1281
   dlink *last_remove();
1282

  
1283
   void check_list(void);	// check list integrity
1284
   size_t total_addresses() const;
1285

  
1283 1286
   friend void funnel_gradcalc(void);
1284 1287
   friend void slave_gradcalc(void);
1285 1288
   friend void gradcalc(int nvar, const dvector & g);
trunk/src/linad99/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
*/
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff