Revision 752 branches/threaded2/src/nh99/model7.cpp

model7.cpp (revision 752)
4 4
 * Author: David Fournier
5 5
 * Copyright (c) 2008-2012 Regents of the University of California
6 6
 */
7
#include <sstream>
8
#include <thread>
7 9
#if defined(USE_LAPLACE)
8 10
#  include <df1b2fun.h>
9 11
#else
......
41 43
  signal(SIGILL,exit_handler);
42 44
  signal(SIGINT,exit_handler);
43 45
}
46
ad_comm::ad_comm(void)
47
{
48
  allocate();
49
}
50
ad_comm::ad_comm(const ad_comm& copy): ad_comm(copy.argc, copy.argv) 
51
{
44 52

  
45

  
46

  
47
ad_comm::ad_comm(int _argc,char * _argv[])
53
}
54
ad_comm::ad_comm(int _argc, char* _argv[])
48 55
{
49 56
  if (option_match(_argc,_argv,"-version") > -1
50 57
   || option_match(_argc,_argv,"--version") > -1)
......
56 63
  }
57 64

  
58 65
  ad_comm::argc=_argc;
59
  ad_comm::argv=_argv;
66
  ad_comm::argv =_argv;
60 67
  int pvm_flag=0;
61 68
  if (option_match(_argc,_argv,"-time")>-1)
62 69
  {
......
82 89
  if (option_match(_argc,_argv,"-slave")>-1)  pvm_flag=2;
83 90
  if (option_match(_argc,_argv,"-master")>-1) pvm_flag=1;
84 91

  
92
  pvm_manager = nullptr;
85 93
#if defined(USE_ADPVM)
86 94
  if (pvm_flag)
87 95
    pvm_manager = new adpvm_manager(pvm_flag);
88
  else
89 96
#endif
90
    pvm_manager = NULL;
91 97

  
92 98

  
93 99
#if defined(USE_ADPVM)
......
124 130
    }
125 131
  }
126 132
#endif
127

  
128

  
129
  /*
130
    if (option_match(_argc,_argv,"-gui")>-1)
131
    {
132
      vm_initialize();
133
    }
134
  */
135 133
  set_signal_handlers();
136
  adprogram_name=_argv[0];
134
  adprogram_name = new adstring(_argv[0]);
137 135
  int len=strlen(_argv[0]);
138
  for (int i=1;i<=len;i++) adprogram_name[i]=tolower(adprogram_name[i]);
136
  for (int i = 1; i <= len; i++) 
137
  {
138
    (*adprogram_name)[i] = tolower((*adprogram_name)[i]);
139
  }
139 140
#if !defined(__SPDLL__)
140
  strip_full_path(adprogram_name);
141
  strip_full_path(*adprogram_name);
141 142
#endif
142 143
  adstring workdir;
143 144
  ad_getcd(workdir);
......
151 152
    {
152 153
      // remove path (if user runs -help)
153 154
      unsigned int i;
154
      for (i=adprogram_name.size();i>=1;i--)
155
      for (i = (*adprogram_name).size(); i >= 1; i--)
155 156
      {
156 157
#ifdef _WIN32
157
        if (adprogram_name(i) == '\\')
158
        if ((*adprogram_name)(i) == '\\')
158 159
#else
159
        if (adprogram_name(i) == '/')
160
        if ((*adprogram_name)(i) == '/')
160 161
#endif
161 162
        {
162
          adprogram_name=adprogram_name(i+1,adprogram_name.size());
163
          *adprogram_name = (*adprogram_name)(i + 1, (*adprogram_name).size());
163 164
          break;
164 165
        }
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff