|
a/src/utils/smallut.h |
|
b/src/utils/smallut.h |
|
... |
|
... |
197 |
{
|
197 |
{
|
198 |
if (s.length() && s.length() < len)
|
198 |
if (s.length() && s.length() < len)
|
199 |
s = s.insert(0, len - s.length(), '0');
|
199 |
s = s.insert(0, len - s.length(), '0');
|
200 |
}
|
200 |
}
|
201 |
|
201 |
|
202 |
#ifndef deleteZ
|
|
|
203 |
#define deleteZ(X) {delete X;X = 0;}
|
|
|
204 |
#endif
|
|
|
205 |
|
|
|
206 |
// Code for static initialization of an stl map. Somewhat like Boost.assign.
|
202 |
// Code for static initialization of an stl map. Somewhat like Boost.assign.
|
207 |
// Ref: http://stackoverflow.com/questions/138600/initializing-a-static-stdmapint-int-in-c
|
203 |
// Ref: http://stackoverflow.com/questions/138600/initializing-a-static-stdmapint-int-in-c
|
208 |
// Example use: map<int, int> m = map_list_of (1,2) (3,4) (5,6) (7,8);
|
204 |
// Example use: map<int, int> m = create_map (1,2) (3,4) (5,6) (7,8);
|
209 |
|
205 |
|
210 |
template <typename T, typename U>
|
206 |
template <typename T, typename U>
|
211 |
class create_map
|
207 |
class create_map
|
212 |
{
|
208 |
{
|
213 |
private:
|
209 |
private:
|
|
... |
|
... |
234 |
#define MIN(A,B) (((A)<(B)) ? (A) : (B))
|
230 |
#define MIN(A,B) (((A)<(B)) ? (A) : (B))
|
235 |
#endif
|
231 |
#endif
|
236 |
#ifndef MAX
|
232 |
#ifndef MAX
|
237 |
#define MAX(A,B) (((A)>(B)) ? (A) : (B))
|
233 |
#define MAX(A,B) (((A)>(B)) ? (A) : (B))
|
238 |
#endif
|
234 |
#endif
|
|
|
235 |
#ifndef deleteZ
|
|
|
236 |
#define deleteZ(X) {delete X;X = 0;}
|
|
|
237 |
#endif
|
239 |
|
238 |
|
240 |
void smallut_init_mt();
|
239 |
void smallut_init_mt();
|
241 |
|
240 |
|
242 |
#endif /* _SMALLUT_H_INCLUDED_ */
|
241 |
#endif /* _SMALLUT_H_INCLUDED_ */
|