Revision 1598

trunk/src/nh99/admodel.h (revision 1598)
730 730
};
731 731
#endif // #if defined(USE_ADPVM)
732 732

  
733

  
734 733
class initial_params;
735

  
736
typedef initial_params * pinitial_params;
737
typedef void * ptovoid;
738

  
734
typedef initial_params* pinitial_params;
735
typedef void* ptovoid;
739 736
/**
740
 * Description not yet available.
741
 * \param
742
 */
737
For storing void pointers in a array.
738
*/
743 739
class adlist_ptr
744 740
{
745 741
  ptovoid * ptr;
746 742
  int current_size;
747 743
  int current;
748 744
  void resize(void);
749
  void add_to_list(void * p);
745
  void add_to_list(void* p);
750 746
public:
747
  adlist_ptr(int init_size);
751 748
  ~adlist_ptr();
752
  pinitial_params  & operator [] (int i);
753
  adlist_ptr(int init_size);
749

  
750
  void initialize();
751

  
752
  pinitial_params& operator[](int i);
753

  
754 754
  friend class initial_params;
755 755
};
756 756

  
trunk/src/nh99/model.cpp (revision 1598)
1234 1234

  
1235 1235

  
1236 1236
#if defined(__SPDLL__)
1237
#  if !defined(linux)
1238
#    include <windows.h>
1239
#  endif
1237
  #if defined(_WIN32)
1238
    #include <windows.h>
1240 1239
void get_sp_printf(void)
1241 1240
{
1242
#if !defined(linux)
1243 1241
  ad_printf=NULL;
1244 1242
  HINSTANCE h=LoadLibrary("sqpe.dll");
1245 1243
  if(h)
1246 1244
    ad_printf= (fptr) GetProcAddress(h,"S_newio_printf");
1247
#endif
1248 1245
}
1246
  #endif
1249 1247
#endif
1250 1248

  
1251
  pinitial_params & adlist_ptr::operator [] (int i)
1249
pinitial_params& adlist_ptr::operator[](int i)
1250
{
1251
  return (pinitial_params&)ptr[i];
1252
}
1253
/**
1254
Construct array with init_size.
1255
*/
1256
adlist_ptr::adlist_ptr(int init_size)
1257
{
1258
  current = 0;
1259
  ptr = new ptovoid[init_size];
1260
  if (ptr == 0)
1252 1261
  {
1253
    return (pinitial_params &) ptr[i];
1262
    cerr << "Error: allocating memory in adlist_ptr" << endl;
1254 1263
  }
1255

  
1256
  adlist_ptr::adlist_ptr(int init_size)
1264
  current_size = init_size;
1265
}
1266
void adlist_ptr::initialize()
1267
{
1268
  for (int i = 0; i < current_size; i++)
1257 1269
  {
1258
    current=0;
1259
    ptr = new ptovoid[init_size];
1260
    if (ptr==0)
1261
    {
1262
      cerr << "Errorl allocating memory in adlist_ptr" << endl;
1263
    }
1264
    current_size=init_size;
1270
    ptr[i] = 0;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff