Revision 1590 trunk/src/linad99/gradstak.cpp

gradstak.cpp (revision 1590)
16 16
  #include <io.h>
17 17
#endif
18 18

  
19
  #ifdef __MSVC32__
20
    #define lseek _lseek
21
    #define  read _read
22
    #define write _write
23
    #define open _open
24
    #define close _close
25
    #include <sys\stat.h>
26
    #include <fcntl.h>
27
  #endif
19
#ifdef _MSC_VER
20
  #define lseek _lseek
21
  #define  read _read
22
  #define write _write
23
  #define open _open
24
  #define close _close
25
  #include <sys\stat.h>
26
  #include <fcntl.h>
27
#endif
28 28

  
29

  
30 29
#if defined(__TURBOC__) && !defined(__linux__)
31 30
  #pragma hdrstop
32 31
  #include <iostream.h>
......
91 90
#include <string.h>
92 91
#include <time.h>
93 92

  
94
  char lastchar(char *);
93
char lastchar(char *);
94
char ad_random_part[6]="tmp";
95 95

  
96
  char ad_random_part[6]="tmp";
97

  
98
/**
99
 * Description not yet available.
100
 * \param
101
 */
102
  void fill_ad_random_part(void)
96
void fill_ad_random_part(void)
97
{
98
/*
99
  time_t t,tt;
100
  time(&t);
101
  tt=t;
102
  int div=1;
103
  for (int i=0;i<6;i++)
103 104
  {
104
   /*
105
    time_t t,tt;
106
    time(&t);
107
    tt=t;
108
    int div=1;
109
    for (int i=0;i<6;i++)
110
    {
111
      ad_random_part[i]=(tt/div)%10+48;
112
      div*=10;
113
    }
114
   */
105
    ad_random_part[i]=(tt/div)%10+48;
106
    div*=10;
115 107
  }
116

  
108
*/
109
}
117 110
/**
118
 * Description not yet available.
119
 * \param
120
 */
121
  grad_stack::grad_stack()
111
Default constructor
112
*/
113
grad_stack::grad_stack()
114
{
115
  gradient_structure::TOTAL_BYTES = 0;
116
  gradient_structure::PREVIOUS_TOTAL_BYTES=0;
117
  true_length = gradient_structure::GRADSTACK_BUFFER_SIZE;
118
  length = true_length;
119
  if ((true_ptr_first = new grad_stack_entry[(size_t)length]) == 0)
122 120
  {
123
    gradient_structure::TOTAL_BYTES = 0;
124
    gradient_structure::PREVIOUS_TOTAL_BYTES=0;
125
    true_length = gradient_structure::GRADSTACK_BUFFER_SIZE;
126
    length = true_length;
127
    if ( (true_ptr_first = new  grad_stack_entry [(size_t)length]) == 0)
128
    {
129
      cerr << "Memory allocation error in grad_stack constructor\n"
130
        << " trying to allocate "
131
                   << length * sizeof(grad_stack_entry)<<" bytes\n";
132
      ad_exit(1);
133
    }
121
    cerr << "Memory allocation error in grad_stack constructor\n"
122
         << " trying to allocate "
123
         << length * sizeof(grad_stack_entry)<<" bytes\n";
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff