12 // Is this still needed? (Lgb)
14 void * my_memcpy(void * ps_in, void const * pt_in, size_t n)
16 char * ps = static_cast<char *>(ps_in);
17 char const * pt = static_cast<char const *>(pt_in);
18 while (n--) *ps++ = *pt++;
23 int MathedArray::empty() const
29 int MathedArray::last() const
35 void MathedArray::last(int l)
41 int MathedArray::maxsize() const
47 void MathedArray::resize(int newsize)
49 if (newsize < ARRAY_MIN_SIZE)
50 newsize = ARRAY_MIN_SIZE;
51 newsize += ARRAY_STEP - (newsize % ARRAY_STEP);
53 if (last_ >= newsize) last_ = newsize - 1;
59 MathedArray::MathedArray(int size)
61 maxsize_ = (size < ARRAY_MIN_SIZE) ? ARRAY_MIN_SIZE : size;
67 void MathedArray::move(int p, int shift)
70 if (last_ + shift >= maxsize_) {
71 resize(last_ + shift);
73 memmove(&bf_[p + shift], &bf_[p], last_ - p);
80 void MathedArray::mergeF(MathedArray * a, int p, int dx)
82 my_memcpy(&bf_[p], &a->bf_[0], dx);
86 void MathedArray::raw_pointer_copy(MathedInset ** p, int pos) const
88 my_memcpy(p, &bf_[pos], sizeof(MathedInset*));
92 void MathedArray::raw_pointer_insert(void * p, int pos, int len)
94 my_memcpy(&bf_[pos], &p, len);
98 void MathedArray::strange_copy(MathedArray * dest, int dpos,
101 my_memcpy(&dest[dpos], &bf_[spos], len);
105 byte MathedArray::operator[](int i) const
111 byte & MathedArray::operator[](int i)
117 void MathedArray::insert(int pos, byte c)
119 if (pos < 0) pos = last_;
121 resize(maxsize_ + ARRAY_STEP);