summaryrefslogtreecommitdiff
blob: 6ab98729a83e3cacdee016760a121230eb723d7f (plain)
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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
 include/BALL/COMMON/global.h                       | 26 +++++------
 include/BALL/COMMON/hash.h                         | 36 +++++++--------
 include/BALL/DATATYPE/bitVector.h                  |  2 +-
 include/BALL/DATATYPE/hashMap.h                    |  9 +---
 include/BALL/DATATYPE/string.h                     | 11 +++--
 include/BALL/DATATYPE/string.iC                    |  5 ++
 include/BALL/SYSTEM/binaryFileAdaptor.h            | 53 +++++++++++-----------
 source/COMMON/exception.C                          |  6 +--
 source/COMMON/hash.C                               |  2 +-
 source/COMMON/init.C                               |  4 +-
 source/COMMON/logStream.C                          |  6 +--
 source/COMMON/version.C                            |  2 +-
 source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C | 41 +++++++++--------
 source/STRUCTURE/kekulizer.C                       |  8 ++--
 source/TEST/INIFile_test.C                         |  8 ++--
 source/TEST/ParameterSection_test.C                |  2 +-
 16 files changed, 114 insertions(+), 107 deletions(-)

diff --git a/include/BALL/COMMON/global.h b/include/BALL/COMMON/global.h
index 11d9246..02c81c6 100644
--- a/include/BALL/COMMON/global.h
+++ b/include/BALL/COMMON/global.h
@@ -9,7 +9,7 @@
 #	include <BALL/CONFIG/config.h>
 #endif
 
-#include <limits.h>
+#include <limits>
 #include <time.h>
 
 #ifdef BALL_HAS_BASETSD_H
@@ -223,28 +223,28 @@ namespace BALL
 		ASCII__SEMICOLON        = ';'
 	};
 
-	static const Distance INVALID_DISTANCE = INT_MIN;
-	static const Distance DISTANCE_MIN = (INT_MIN + 1);
-	static const Distance DISTANCE_MAX = INT_MAX;
+	static const Distance INVALID_DISTANCE = std::numeric_limits<Distance>::max();
+	static const Distance DISTANCE_MIN = (std::numeric_limits<Distance>::min() + 1);
+	static const Distance DISTANCE_MAX = std::numeric_limits<Distance>::max();
 
-	static const Handle INVALID_HANDLE = INT_MAX;
+	static const Handle INVALID_HANDLE = std::numeric_limits<Handle>::max();
 	static const Handle HANDLE_MIN = 0 ;
-	static const Handle HANDLE_MAX = INT_MAX - 1;
+	static const Handle HANDLE_MAX = std::numeric_limits<Handle>::max() - 1;
 
 	static const Index INVALID_INDEX = -1;
 	static const Index INDEX_MIN = 0;
-	static const Index INDEX_MAX = INT_MAX;
+	static const Index INDEX_MAX = std::numeric_limits<Index>::max();
 
-	static const Position INVALID_POSITION = INT_MAX;
+	static const Position INVALID_POSITION = std::numeric_limits<Position>::max();
 	static const Position POSITION_MIN = 0;
-	static const Position POSITION_MAX = INT_MAX - 1;
+	static const Position POSITION_MAX = std::numeric_limits<Position>::max() - 1;
 
 #	undef SIZE_MAX
-	static const Size INVALID_SIZE = INT_MAX;
+	static const Size INVALID_SIZE = std::numeric_limits<Size>::max();
 	static const Size SIZE_MIN = 0;
-	static const Size SIZE_MAX = INT_MAX - 1;
-	
-	
+	static const Size SIZE_MAX = std::numeric_limits<Size>::max() - 1;
+
+
 }
 
 #endif // BALL_COMMON_GLOBAL_H
diff --git a/include/BALL/COMMON/hash.h b/include/BALL/COMMON/hash.h
index 8d45df3..ebb9a55 100644
--- a/include/BALL/COMMON/hash.h
+++ b/include/BALL/COMMON/hash.h
@@ -15,24 +15,6 @@
 
 namespace BALL 
 {
-	/**	General Hash Function Template.
-			This template function provides a simple wrapper
-			for the specialized hash functions. It facilitates their use 
-			in STL hash associative containers which expect a <b>Hasher</b>
-			class as template parameter.
-	\ingroup Common
-	*/
-  template <typename T>
-  class HashFunction
-  {
-    public:
-		
-		HashIndex operator () (const T& t) const
-    {
-      return Hash(t);
-		}
-	};
-
 	/**	@name Specialized Hash Functions.
 	*/
 	//@{
@@ -105,6 +87,24 @@ namespace BALL
 
 	//@}
 
+	/**	General Hash Function Template.
+			This template function provides a simple wrapper
+			for the specialized hash functions. It facilitates their use 
+			in STL hash associative containers which expect a <b>Hasher</b>
+			class as template parameter.
+	\ingroup Common
+	*/
+  template <typename T>
+  class HashFunction
+  {
+    public:
+		
+		HashIndex operator () (const T& t) const
+    {
+      return Hash(t);
+		}
+	};
+
 } // namespace BALL
 
 #endif // BALL_COMMON_HASH_H
diff --git a/include/BALL/DATATYPE/bitVector.h b/include/BALL/DATATYPE/bitVector.h
index 991f08e..dc7ead6 100644
--- a/include/BALL/DATATYPE/bitVector.h
+++ b/include/BALL/DATATYPE/bitVector.h
@@ -18,7 +18,7 @@
 #endif
 
 
-#include <string.h>
+#include <cstring>
 
 #define BALL_BLOCK_BITS 8
 #define BALL_BLOCK_MASK (BALL_BLOCK_BITS - 1)
diff --git a/include/BALL/DATATYPE/hashMap.h b/include/BALL/DATATYPE/hashMap.h
index 329db2b..f185b8c 100644
--- a/include/BALL/DATATYPE/hashMap.h
+++ b/include/BALL/DATATYPE/hashMap.h
@@ -236,7 +236,7 @@ namespace BALL
 	template <class Key, class T>
 	const T& HashMap<Key, T>::operator [] (const Key& key) const
 	{
-		ConstIterator it = find(key);
+		ConstIterator it = this->find(key);
 		if (it == Base::end())
 		{
 			throw IllegalKey(__FILE__, __LINE__);
@@ -272,12 +272,7 @@ namespace BALL
 	T& HashMap<Key, T>::operator [] (const Key& key)
 		
 	{
-		Iterator it = find(key);
-		if (it == Base::end())
-		{
-			it = insert(ValueType(key, T())).first;
-		}
-		return it->second;
+		return BALL_MAP_NAME::operator[] (key);
 	}
 
 } // namespace BALL
diff --git a/include/BALL/DATATYPE/string.h b/include/BALL/DATATYPE/string.h
index 1172180..aa11c35 100644
--- a/include/BALL/DATATYPE/string.h
+++ b/include/BALL/DATATYPE/string.h
@@ -27,10 +27,10 @@
 #endif
 
 #include <string>
-#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cctype>
+#include <cerrno>
+#include <cstdlib>
+#include <cstring>
 #include <iostream>
 #include <vector>
 
@@ -155,6 +155,9 @@ namespace BALL
 		/// STL string copy constructor
 		String(const string& string);
 
+		/// Copy constructor
+		String(const String& s);
+
 #ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES
 		/// Move constructor
 		String(String&& s);
diff --git a/include/BALL/DATATYPE/string.iC b/include/BALL/DATATYPE/string.iC
index b255849..c347588 100644
--- a/include/BALL/DATATYPE/string.iC
+++ b/include/BALL/DATATYPE/string.iC
@@ -8,6 +8,11 @@ String::String()
 {
 }
 
+BALL_INLINE String::String(const String& s)
+	: string(s)
+{
+}
+
 #ifdef BALL_STD_STRING_HAS_RVALUE_REFERENCES
 BALL_INLINE
 String::String(String&& s)
diff --git a/include/BALL/SYSTEM/binaryFileAdaptor.h b/include/BALL/SYSTEM/binaryFileAdaptor.h
index 64f0f5d..6488e18 100644
--- a/include/BALL/SYSTEM/binaryFileAdaptor.h
+++ b/include/BALL/SYSTEM/binaryFileAdaptor.h
@@ -10,6 +10,33 @@
 
 namespace BALL
 {
+	/** Coping with endianness. This function swaps the bytes of a variable
+			of type T if this type is of size 2n.
+	*/
+	template <typename T>
+	void swapBytes(T& t)
+	{
+		if (sizeof(T) % 2 != 0)
+		{
+			Log.error() << "Cannot swap types of uneven size." << std::endl;
+			return;
+		}
+
+		char* tmp = reinterpret_cast<char*>(&t);
+		std::reverse(tmp, tmp + sizeof(T));
+	}
+
+	//In the following some specialisations of swapBytes are provided for efficiency reasons
+	//These should also cover BALL types like Size, Position and Index
+	template<> BALL_EXPORT void swapBytes(unsigned short&);
+	template<> BALL_EXPORT void swapBytes(short&);
+	template<> BALL_EXPORT void swapBytes(unsigned int&);
+	template<> BALL_EXPORT void swapBytes(int&);
+	template<> BALL_EXPORT void swapBytes(unsigned long&);
+	template<> BALL_EXPORT void swapBytes(long&);
+	template<> BALL_EXPORT void swapBytes(float&);
+	template<> BALL_EXPORT void swapBytes(double&);
+
 	/**
 	 * Helper class for data conversion.
 	 * BinaryFileAdaptors are used to read and write binary data from and to
@@ -152,32 +179,6 @@ namespace BALL
 		return is;
 	}
 
-	/** Coping with endianness. This function swaps the bytes of a variable
-			of type T if this type is of size 2n.
-	*/
-	template <typename T>
-	void swapBytes(T& t)
-	{
-		if (sizeof(T) % 2 != 0)
-		{
-			Log.error() << "Cannot swap types of uneven size." << std::endl;
-			return;
-		}
-
-		char* tmp = reinterpret_cast<char*>(&t);
-		std::reverse(tmp, tmp + sizeof(T));
-	}
-
-	//In the following some specialisations of swapBytes are provided for efficiency reasons
-	//These should also cover BALL types like Size, Position and Index
-	template<> BALL_EXPORT void swapBytes(unsigned short&);
-	template<> BALL_EXPORT void swapBytes(short&);
-	template<> BALL_EXPORT void swapBytes(unsigned int&);
-	template<> BALL_EXPORT void swapBytes(int&);
-	template<> BALL_EXPORT void swapBytes(unsigned long&);
-	template<> BALL_EXPORT void swapBytes(long&);
-	template<> BALL_EXPORT void swapBytes(float&);
-	template<> BALL_EXPORT void swapBytes(double&);
 } //namespace BALL
 
 #ifndef BALL_NO_INLINE_FUNCTIONS
diff --git a/source/COMMON/exception.C b/source/COMMON/exception.C
index e7855ce..464f971 100644
--- a/source/COMMON/exception.C
+++ b/source/COMMON/exception.C
@@ -9,10 +9,10 @@
 #include <iostream>
 #include <typeinfo>
 #include <exception>
-#include <stdio.h>
-#include <stdlib.h>	// for getenv in terminate()
+#include <cstdio>
+#include <cstdlib>	// for getenv in terminate()
 #include <sys/types.h>
-#include <signal.h> // for SIGSEGV and kill
+#include <csignal> // for SIGSEGV and kill
 
 #ifdef BALL_HAS_UNISTD_H
 #	include <unistd.h> // fot getpid
diff --git a/source/COMMON/hash.C b/source/COMMON/hash.C
index 0d81493..ffe75de 100644
--- a/source/COMMON/hash.C
+++ b/source/COMMON/hash.C
@@ -72,7 +72,7 @@ namespace BALL
 		Index index = 0;
 		Index temp_index;
 
-#		define BALL_BITS_IN_HASHVALUE_   (sizeof(Index) * CHAR_BIT)
+#		define BALL_BITS_IN_HASHVALUE_   (sizeof(Index) * std::numeric_limits<unsigned char>::digits)
 #		define BALL_THREE_QUARTERS_      ((Index)((BALL_BITS_IN_HASHVALUE_ * 3) / 4))
 #		define BALL_ONE_EIGHTH_          ((Index)(BALL_BITS_IN_HASHVALUE_ / 8))
 #		define BALL_HIGH_BITS_           (~((Index)(~0) >> BALL_ONE_EIGHTH_))
diff --git a/source/COMMON/init.C b/source/COMMON/init.C
index d426756..856fe68 100644
--- a/source/COMMON/init.C
+++ b/source/COMMON/init.C
@@ -4,8 +4,8 @@
 
 #include <BALL/COMMON/init.h>
 
-#include <locale.h>
-#include <stdlib.h>
+#include <clocale>
+#include <cstdlib>
 
 namespace BALL
 {
diff --git a/source/COMMON/logStream.C b/source/COMMON/logStream.C
index 12b9184..0340e24 100644
--- a/source/COMMON/logStream.C
+++ b/source/COMMON/logStream.C
@@ -26,9 +26,9 @@ namespace BALL
 	// at this point, it is not yet possible to
 	// include BALL/COMMON/limits.h (which were a 
 	// much nicer solution...). Ugly header dependencies...
-	const int LogStreamBuf::MIN_LEVEL = INT_MIN;
-	const int LogStreamBuf::MAX_LEVEL = INT_MAX;
-	const Time LogStreamBuf::MAX_TIME = INT_MAX;
+	const int LogStreamBuf::MIN_LEVEL = std::numeric_limits<int>::min();
+	const int LogStreamBuf::MAX_LEVEL = std::numeric_limits<int>::max();
+	const Time LogStreamBuf::MAX_TIME = std::numeric_limits<Time>::max();
 
 	LogStreamBuf::LogStreamBuf() 
 		: std::streambuf(),
diff --git a/source/COMMON/version.C b/source/COMMON/version.C
index 1a0987b..15c9d87 100644
--- a/source/COMMON/version.C
+++ b/source/COMMON/version.C
@@ -12,7 +12,7 @@ namespace BALL
 {
 	const char* VersionInfo::getVersion() 
 	{
-		return BALL_RELEASE_STRING " ("__DATE__", " __TIME__ ")";
+		return BALL_RELEASE_STRING " (" __DATE__ ", " __TIME__ ")";
 	}
 
 	int VersionInfo::getMinorRevision()
diff --git a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
index 89a1f68..4f872ae 100644
--- a/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
+++ b/source/STRUCTURE/BONDORDERS/FPTBondOrderStrategy.C
@@ -323,7 +323,7 @@ namespace BALL
 			}
 		}
 
-		return *best;
+		return DPConstRow_(boost::reference_wrapper<DPConfig_ const>(best->first), best->second);
 	}
 
 	FPTBondOrderStrategy::Penalty FPTBondOrderStrategy::DPTable_::operator[](FPTBondOrderStrategy::DPConfig_ const& config) const
@@ -602,6 +602,9 @@ namespace BALL
 
 		return bonds;
 	}
+	
+#define	convertToCRow(tmp)\
+		std::make_pair(boost::reference_wrapper<const DPConfig_>((tmp).first), (tmp).second)
 
 	void FPTBondOrderStrategy::FPTBondOrderAssignment_::computeIntroduceBag(TreeDecompositionBag& bag, DPTable_& child, 
 	                                                                        AdditionalBagProperties_& property)
@@ -622,7 +625,7 @@ namespace BALL
 		// copy with n new bondvalue-columns with different values
 		for (DPTable_::const_iterator iter = child.begin(); iter != child.end(); ++iter)
 		{
-			DPConstRow_ child_entry = *iter;
+			DPConstRow_ child_entry = convertToCRow(*iter);
 			DPConfig_ conf(num_valences, num_bonds);
 
 			Size vindex = 0;
@@ -787,7 +790,7 @@ namespace BALL
 
 		for (DPTable_::const_iterator entry_iterator = child.begin(); entry_iterator != child.end(); ++entry_iterator)
 		{
-			Penalty entry_penalty(forgetInnerVertexIn(bag, *entry_iterator, new_entry, child_property.bonds, forgotten_index));
+			Penalty entry_penalty(forgetInnerVertexIn(bag, convertToCRow(*entry_iterator), new_entry, child_property.bonds, forgotten_index));
 			if (entry_penalty < upper_bound_)
 			{
 				property.table->insert(new_entry, entry_penalty);
@@ -804,7 +807,7 @@ namespace BALL
 		Penalty min_penalty = FPTBondOrderStrategy::infinite_penalty;
 		for (DPTable_::const_iterator iter = child.begin(); iter != child.end(); ++iter)
 		{
-			min_penalty = std::min(min_penalty, forgetInnerVertexIn(bag, *iter, empty, empty_list, 0));
+			min_penalty = std::min(min_penalty, forgetInnerVertexIn(bag, convertToCRow(*iter), empty, empty_list, 0));
 
 			if (Maths::isEqual(0, min_penalty))
 			{
@@ -830,17 +833,17 @@ namespace BALL
 		// insert each entry of the left child into a DPJoinMap
 		for (DPTable_::const_iterator left_iter = left_child.begin(); left_iter != left_child.end(); ++left_iter)
 		{
-			DPConstRow_ left_entry = *left_iter;
-			map.insert(pair<DPConfig_ const*, Penalty> (left_entry.first.get_pointer(), left_entry.second));
+			DPConstRow_ left_entry = convertToCRow(*left_iter);
+			map.insert(std::pair<DPConfig_ const*, Penalty> (left_entry.first.get_pointer(), left_entry.second));
 		}
 
 		// find for each entry of the right child's table appropiate entries in the DPJoinMap (which have the same bondvalues)
 		for (DPTable_::const_iterator r_iter = right_child.begin(); r_iter != right_child.end(); ++r_iter)
 		{
-			DPConstRow_ right_entry = *r_iter;
+			DPConstRow_ right_entry = convertToCRow(*r_iter);
 			DPConfig_ const* right_conf = right_entry.first.get_pointer();
 
-			pair<DPJoinMap_::const_iterator, DPJoinMap_::const_iterator> matching_range(map.equal_range(right_conf));
+			std::pair<DPJoinMap_::const_iterator, DPJoinMap_::const_iterator> matching_range(map.equal_range(right_conf));
 
 			for (DPJoinMap_::const_iterator match  = matching_range.first;
 					                            match != matching_range.second; ++match)
@@ -1441,7 +1444,7 @@ namespace BALL
 			delete current_state_;
 		}
 
-		multiset<BackTrackingState_*, StateComparator_>::iterator first = queue_.begin();
+		std::multiset<BackTrackingState_*, StateComparator_>::iterator first = queue_.begin();
 		current_state_ = *first;
 		queue_.erase(first);
 		--max_heap_size_;
@@ -1598,7 +1601,7 @@ namespace BALL
 		// insert possible antecessors in vectors
 		for (DPTable_::const_iterator iter = left_table.begin(); iter != left_table.end(); ++iter)
 		{
-			DPConstRow_ antecessor = *iter;
+			DPConstRow_ antecessor = convertToCRow(*iter);
 			if (comp.compare(&successor, antecessor.first.get_pointer()) == 0)
 			{
 				left_entries.push_back(iter);
@@ -1607,7 +1610,7 @@ namespace BALL
 
 		for (DPTable_::const_iterator iter = right_table.begin(); iter != right_table.end(); ++iter)
 		{
-			DPConstRow_ antecessor = *iter;
+			DPConstRow_ antecessor = convertToCRow(*iter);
 			if (comp.compare(&successor, antecessor.first.get_pointer()) == 0)
 			{
 				right_entries.push_back(iter);
@@ -1619,10 +1622,10 @@ namespace BALL
 
 		for (std::vector<DPTable_::const_iterator>::const_iterator left = left_entries.begin(); left != left_entries.end(); ++left)
 		{
-			DPConstRow_ left_entry = **left;
+			DPConstRow_ left_entry = convertToCRow(**left);
 			for (std::vector<DPTable_::const_iterator>::const_iterator right = right_entries.begin(); right != right_entries.end(); ++right)
 			{
-				DPConstRow_ right_entry = **right;
+				DPConstRow_ right_entry = convertToCRow(**right);
 
 				// check sum of valences
 				bool correct_valences = true;
@@ -1653,8 +1656,8 @@ namespace BALL
 
 		Penalty best_penalty = best.first->second + best.second->second;
 
-		DPConstRow_ left  = *best.first;
-		DPConstRow_ right = *best.second;
+		DPConstRow_ left  = convertToCRow(*best.first);
+		DPConstRow_ right = convertToCRow(*best.second);
 
 		extendState(state, left.first, 0);
 		++state.index;
@@ -1664,8 +1667,8 @@ namespace BALL
 		{
 			DPPairIt_ entry = *iter;
 
-			DPConstRow_ left  = *entry.first;
-			DPConstRow_ right = *entry.second;
+			DPConstRow_ left  = convertToCRow(*entry.first);
+			DPConstRow_ right = convertToCRow(*entry.second);
 
 			Penalty add_penalty = (left.second + right.second) - best_penalty;
 			if (isSolutionNeeded(state.assignment.penalty + add_penalty))
@@ -1716,7 +1719,7 @@ namespace BALL
 		// check for each row entry: is it a possible anteccessor?
 		for (DPTable_::iterator iter = table.begin(); iter != table.end(); ++iter)
 		{
-			Penalty pen  = bond_assignment_->forgetInnerVertexIn(bag, *iter, test_entry, child_bonds, forgotten_index);
+			Penalty pen  = bond_assignment_->forgetInnerVertexIn(bag, convertToCRow(*iter), test_entry, child_bonds, forgotten_index);
 
 			if (pen < FPTBondOrderStrategy::infinite_penalty && test_entry == successor)
 			{
@@ -1783,7 +1786,7 @@ namespace BALL
 		{
 			while (queue_.size() > max_heap_size_)
 			{
-				multiset<BackTrackingState_*, StateComparator_>::iterator pos = queue_.end();
+				std::multiset<BackTrackingState_*, StateComparator_>::iterator pos = queue_.end();
 				--pos;
 				delete *pos;
 				queue_.erase(pos);
diff --git a/source/STRUCTURE/kekulizer.C b/source/STRUCTURE/kekulizer.C
index d1f4e78..c277091 100644
--- a/source/STRUCTURE/kekulizer.C
+++ b/source/STRUCTURE/kekulizer.C
@@ -266,7 +266,7 @@ void Kekuliser::dump()
 			Log.error() << partner->getName() << " ";
 		}
 		Log.error() << "  " << current_penalty_;
-		if (lowest_penalty_ != INT_MAX) Log.error() << " + " << lowest_penalty_;
+		if (lowest_penalty_ != std::numeric_limits<int>::max()) Log.error() << " + " << lowest_penalty_;
 		Log.error() << std::endl;
 	}
 }
@@ -415,11 +415,11 @@ bool Kekuliser::fixAromaticRings_()
 #endif
 
 		solutions_.clear();
-		lowest_penalty_ = INT_MAX;
+		lowest_penalty_ = std::numeric_limits<int>::max();
 		current_penalty_ = 0;
 		fixAromaticSystem_(0);
 		// test could be changed to achieve at most a given max value:
-		if (lowest_penalty_ < INT_MAX) 
+		if (lowest_penalty_ < std::numeric_limits<int>::max())
 		{
 			if (lowest_penalty_ == 0)
 			{
@@ -765,7 +765,7 @@ void Kekuliser::applySolution_(Position pos)
 // return the best solution
 Position Kekuliser::calculateDistanceScores_()
 {
-	float best_score = INT_MAX;
+	float best_score = std::numeric_limits<int>::max();
 	Size best_solution = 0;
 
 	for (Position solp = 0; solp < solutions_.size(); solp++)
diff --git a/source/TEST/INIFile_test.C b/source/TEST/INIFile_test.C
index 1f59d2c..cf37841 100644
--- a/source/TEST/INIFile_test.C
+++ b/source/TEST/INIFile_test.C
@@ -198,10 +198,10 @@ CHECK(bool appendLine(const String& section_name, const String& line))
 	
 	CAPTURE_OUTPUT_LEVEL(2000)
 		TEST_EQUAL(ini.appendLine("Section9", "GAU"), false)
-	COMPARE_OUTPUT("In INIFile "BALL_TEST_DATA_PATH(INIFile_test.ini)" , error while appending line: GAU . Illegal section-name: Section9\n")
+	COMPARE_OUTPUT("In INIFile " BALL_TEST_DATA_PATH(INIFile_test.ini)" , error while appending line: GAU . Illegal section-name: Section9\n")
 	CAPTURE_OUTPUT_LEVEL(2000)
 		TEST_EQUAL(ini.appendLine("Section2", "[AU"), false)	
-	COMPARE_OUTPUT("In INIFile "BALL_TEST_DATA_PATH(INIFile_test.ini)" , error while appending line: [AU . Illegal section-name: Section2\n")
+	COMPARE_OUTPUT("In INIFile " BALL_TEST_DATA_PATH(INIFile_test.ini)" , error while appending line: [AU . Illegal section-name: Section2\n")
 	TEST_EQUAL(ini.appendLine("Section3", "test1 = 123"), true)	
 	TEST_EQUAL(*ini.getLine(9), "test1 = 123")
 	TEST_EQUAL(ini.getNumberOfLines(), 11)
@@ -403,13 +403,13 @@ CHECK(bool appendSection(const String& section))
 	TEST_EQUAL(ini.hasSection(ini.HEADER), true)
 	CAPTURE_OUTPUT_LEVEL(2000)
 		TEST_EQUAL(ini.appendSection(ini.HEADER), false)
-		const char* output = "INIFile::appendSection: "BALL_TEST_DATA_PATH(INIFile_test.ini)" , while adding section: '#HEADER!' already exists.\n";
+		const char* output = "INIFile::appendSection: " BALL_TEST_DATA_PATH(INIFile_test.ini)" , while adding section: '#HEADER!' already exists.\n";
 	COMPARE_OUTPUT(output)
   TEST_EQUAL(ini.getNumberOfLines(), 10)
 
   CAPTURE_OUTPUT_LEVEL(2000)
 		TEST_EQUAL(ini.appendSection("Section1"), false)
-	COMPARE_OUTPUT("INIFile::appendSection: "BALL_TEST_DATA_PATH(INIFile_test.ini)" , while adding section: 'Section1' already exists.\n")
+	COMPARE_OUTPUT("INIFile::appendSection: " BALL_TEST_DATA_PATH(INIFile_test.ini)" , while adding section: 'Section1' already exists.\n")
   TEST_EQUAL(ini.getNumberOfLines(), 10)
 	TEST_EQUAL(ini.hasSection("Section1"), true)
 
diff --git a/source/TEST/ParameterSection_test.C b/source/TEST/ParameterSection_test.C
index 16424cd..b934b4a 100644
--- a/source/TEST/ParameterSection_test.C
+++ b/source/TEST/ParameterSection_test.C
@@ -55,7 +55,7 @@ CHECK(ParameterSection::extractSection(Parameters& parameters, const String& sec
   bool result;
 	CAPTURE_OUTPUT_LEVEL(2000)
 		result = ps.extractSection(param, "Section1");
-	COMPARE_OUTPUT("ParameterSection::extractSection: error reading section Section1 of file "BALL_TEST_DATA_PATH(ParameterSection_test.ini)":\nWrong number of fields in the format line: 0. FORMAT:\n")
+	COMPARE_OUTPUT("ParameterSection::extractSection: error reading section Section1 of file " BALL_TEST_DATA_PATH(ParameterSection_test.ini)":\nWrong number of fields in the format line: 0. FORMAT:\n")
 	TEST_EQUAL(result, false)
 	TEST_EQUAL(ps.getSectionName(), "Section1")