This file is indexed.

/usr/include/givaro/givarray0.inl is in libgivaro-dev 4.0.2-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
// ========================================================================== //
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givarray0.inl,v $
// Copyright(c)'1994-2009 by The Givaro group
// This file is part of Givaro.
// Givaro is governed by the CeCILL-B license under French law
// and abiding by the rules of distribution of free software.
// see the COPYRIGHT file for more details.
// Author: T. Gautier
// $Id: givarray0.inl,v 1.7 2011-02-02 16:23:55 briceboyer Exp $
// ======================================================================= //
/** @internal
 * @file bstruct/givarray0.inl
 * implementation of operators of Array0<T>
 */

#ifndef __GIVARO__array0_INL
#define __GIVARO__array0_INL

namespace Givaro {

	// Default cstor : ctsor of s size array
	template<class T>
	inline void Array0<T>::build( size_t s, const T& t)
	{
		// JGD 24.02.2011 : size_t is unsigned
		//  GIVARO_ASSERT( s>=0, "[Array<T>::cstor(size_t)] must takes a >=0 parameter");
		_psz = _size = s;
		if (s !=0) {
			_d = GivaroMM<T>::allocate(s);
			GivaroMM<T>::initialize(_d, s, t);
			_cnt = GivaroMM<int>::allocate(1);
			*_cnt = 1;
		} else { _d =0; _cnt =0; }
	}

	template<class T>
	inline Array0<T>::Array0 ( size_t s )
	{
		build(s, T());
	}

	template<class T>
	inline Array0<T>::Array0 ( size_t s, const T& t)
	{
		build(s, t);
	}


	// Recopy cstor : logical copy
	template<class T>
	inline Array0<T>::Array0 (const Self_t& p, givNoCopy)
	{
		_psz = p._psz; _size = p._size;
		if (_size !=0)
		{ // increment ref. counting
			_d = p._d;
			_cnt = p._cnt; (*_cnt) ++;
		}
		else { _d = 0; _cnt = 0; }
	}


	// Recopy cstor : physical copy
	template<class T>
	inline Array0<T>::Array0 (const Self_t& p, givWithCopy)
	{
		_psz = _size = p._size;
		if (_size !=0) {
			_d = GivaroMM<T>::allocate(_size);
			_cnt = GivaroMM<int>::allocate(1);
			*_cnt = 1;
			for (size_t i=0; i<_size; i++)
				GivaroMM<T>::initone(&_d[i], p._d[i]);
		} else { _d =0; _cnt =0; }
	}

	// Destroy of the array
	template<class T>
	inline void Array0<T>::destroy( )
	{
		if (_psz !=0) {
			if (--(*_cnt) ==0)
			{
				GivaroMM<T>::destroy(_d, _psz);
				GivaroMM<T>::desallocate(_d);
				GivaroMM<int>::desallocate(_cnt);
			}
		}
		_size = _psz = 0; _cnt = 0; _d = 0;
	}

	// Allocation of an array of s Elements
	template<class T>
	inline void Array0<T>::allocate( size_t s )
	{
		// JGD 24.02.2011 : size_t is unsigned
		//  GIVARO_ASSERT( s>=0, "[Array<T>::allocate]: must takes a >=0 parameter");
		if (_cnt !=0) {
			if (((*_cnt) ==1) && (_psz >= s)) { _size = s; return; }
			this->destroy();
		}
		if (s >0) {
			_d = GivaroMM<T>::allocate(s);
			GivaroMM<T>::initialize(_d, s);
			_cnt = GivaroMM<int>::allocate(1);
			*_cnt = 1;
		}
		else _cnt =0;
		_psz = _size = s;
	}

	// Reallocation of an array of s Elements
	// and recopy the min(_size,s) first Elements
	template<class T>
	inline void Array0<T>::reallocate( size_t s )
	{
		// JGD 24.02.2011 : size_t is unsigned
		//  GIVARO_ASSERT( s>=0, "[Array<T>::reallocate]: must takes a >=0 parameter");
		if (_cnt !=0) {
			if (*_cnt ==1) {
				if (_psz >=s) { _size = s; return; }
			}
			else (*_cnt) --;
		}
		if (s >0) {
			T* tmp = GivaroMM<T>::allocate(s);
			GivaroMM<T>::initialize(tmp+_size, s-_size);
			if (_cnt !=0) {
				for (size_t i=0; i<_size; i++)
					GivaroMM<T>::initone(&(tmp[i]), _d[i]);
				this->destroy();
			}
			_cnt = GivaroMM<int>::allocate(1);
			*_cnt = 1;
			_d = tmp;
		} else _cnt =0;
		_psz = _size = s;
	}

	template<class T>
	inline void Array0<T>::push_back( const T& a )
	{
		this->reallocate(_size+1);
		this->back() = a;
	}

	// Logical destructor: identical to free
	template<class T>
	inline Array0<T>::~Array0 ()
	{
		this->destroy();
	}


	// Physical copy : recopy and assignement on each Element
	template <class T>
	inline Array0<T>& Array0<T>::copy (const Array0<T>& src)
	{
		if (src._d == _d) return *this;
		reallocate(src._size); // - try...
		// -- here we have a large enough array with refcount==1
		const T* baseP = src._d;
		T* baseThis = _d;
		for (size_t i=0; i<_size; i++)
			baseThis[i] = baseP[i];
		return *this;
	}

	// Logical copy
	template <class T>
	inline Array0<T>& Array0<T>::logcopy (const Array0<T>& src)
	{
		destroy();
		_psz = src._psz; _size = src._size;
		if (_psz !=0)
		{
			_d = src._d;
			_cnt = src._cnt; (*_cnt) ++;
		}
		else { _d = 0; _cnt = 0; }
		return *this;
	}


	// Physical copy
	template<class T>
	Array0<T>& Array0<T>::operator= (const Array0<T>& p)
	{
		//throw GivError("[Array0<T>::operator=] cannot be used" " File:" ##__FILE__ ", line:" ##__LINE__ );
		//   throw GivError("[Array0<T>::operator=] cannot be used");
		return this->copy(p);
	}

	template<class T>
	inline size_t Array0<T>::phsize() const { return _psz; }

	template<class T>
	inline T* Array0<T>::baseptr() { return _d; }

	template<class T>
	inline const T* Array0<T>::baseptr() const { return _d; }


	// This following functions directly access to protected
	template <class T>
	inline const T& Array0<T>::front () const
	{
		GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
		return _d[0];
	}

	// Access operator : Write access
	template <class T>
	inline T& Array0<T>::front ()
	{
		GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
		return _d[0];
	}


	// This following functions directly access to protected
	template <class T>
	inline const T& Array0<T>::back () const
	{
		GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
		return _d[_size-1];
	}

	// Access operator : Write access
	template <class T>
	inline T& Array0<T>::back ()
	{
		GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
		return _d[_size-1];
	}



	template <class T>
	inline const T& Array0<T>::operator[] (Indice_t i) const
	{
		GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
		GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>::[]]: index out of bounds.");
		return _d[i];
	}

	// Access operator : Write access
	template <class T>
	inline T& Array0<T>::operator[] (Indice_t i)
	{
		GIVARO_ASSERT(_size >0, "[Array<T>::[]]: try to access to an Element of null size Array0.");
		GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>]: index out of bounds.");
		return _d[i];
	}


	template <class T>
	inline void Array0<T>::write( Indice_t i, const T& val)
	{
		GIVARO_ASSERT(_size >0, "[Array<T>::write]: try to access to an Element of null size Array0.");
		GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>::write]: index out of bounds.");
		_d[i] = val;
	}

	template <class T>
	inline void Array0<T>::read ( Indice_t i, T& val ) const
	{
		GIVARO_ASSERT(_size >0, "[Array<T>::read]: try to access to an Element of null size Array0");
		GIVARO_ASSERT((i >=0)&&(i<(Indice_t)_size), "[Array<T>::read]: index out of bounds.");
		val = _d[i];
	}

	template <class T>
	inline typename Array0<T>::Iterator_t
	Array0<T>::begin()
	{
		return _d;
	}

	template <class T>
	inline typename Array0<T>::Iterator_t
	Array0<T>::end()
	{
		return _d + _size;
	}

	template <class T>
	inline typename Array0<T>::constIterator_t
	Array0<T>::begin() const
	{
		return _d;
	}

	template <class T>
	inline typename Array0<T>::constIterator_t
	Array0<T>::end() const
	{
		return _d + _size;
	}

} // namespace Givaro

#endif // __GIVARO__array0_INL

/* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s:syntax=cpp.doxygen