Commit 482527bb authored by Edwin Carlinet's avatar Edwin Carlinet Committed by Guillaume Lazzara
Browse files

Add MLN_WO_GLOBAL_VARS directive that prevents globals vars to be included.

	* mln/border/thickness.hh,
	* mln/core/alias/dpoint1d.hh,
	* mln/core/alias/dpoint2d.hh,
	* mln/core/alias/dpoint3d.hh,
	* mln/fun/v2v/hsl_to_rgb.hh,
	* mln/literal/black.hh,
	* mln/literal/colors.hh,
	* mln/literal/identity.hh,
	* mln/literal/one.hh,
	* mln/literal/origin.hh,
	* mln/literal/white.hh,
	* mln/literal/zero.hh,
	* mln/tag/init.hh,
	* mln/trace/entering.hh,
	* mln/trace/quiet.hh,
	* mln/value/sign.hh : Add MLN_WO_GLOBAL_VARS define.
parent 902b12ce
2010-05-21 edwin carlinet <carlinet@lrde.epita.fr>
Add MLN_WO_GLOBAL_VARS directive that prevents globals vars to be
included.
* mln/border/thickness.hh,
* mln/core/alias/dpoint1d.hh,
* mln/core/alias/dpoint2d.hh,
* mln/core/alias/dpoint3d.hh,
* mln/fun/v2v/hsl_to_rgb.hh,
* mln/literal/black.hh,
* mln/literal/colors.hh,
* mln/literal/identity.hh,
* mln/literal/one.hh,
* mln/literal/origin.hh,
* mln/literal/white.hh,
* mln/literal/zero.hh,
* mln/tag/init.hh,
* mln/trace/entering.hh,
* mln/trace/quiet.hh,
* mln/value/sign.hh: Add MLN_WO_GLOBAL_VARS define.
2010-04-30 Guillaume Lazzara <z@lrde.epita.fr>
 
Add some code in my sandbox.
......@@ -43,8 +43,12 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
unsigned thickness = 3;
# endif // !MLN_WO_GLOBAL_VARS
# endif // !MLN_INCLUDE_ONLY
} // end of namespace mln::border
......
......@@ -68,12 +68,16 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
const dpoint1d before = dpoint1d( -1 );
const dpoint1d after = dpoint1d( +1 );
const dpoint1d ind_dec = before;
const dpoint1d ind_inc = after;
# endif // !MLN_WO_GLOBAL_VARS
# endif // ! MLN_INCLUDE_ONLY
......
......@@ -71,6 +71,8 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
const dpoint2d up = dpoint2d( -1, 0 );
const dpoint2d down = dpoint2d( +1, 0 );
const dpoint2d left = dpoint2d( 0, -1 );
......@@ -81,6 +83,8 @@ namespace mln
const dpoint2d down_left = dpoint2d( +1, -1 );
const dpoint2d down_right = dpoint2d( +1, +1 );
# endif // !MLN_WO_GLOBAL_VARS
# endif // ! MLN_INCLUDE_ONLY
......
......@@ -67,6 +67,8 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
const dpoint3d sagittal_dec = dpoint3d( 0, 0, -1);
const dpoint3d sagittal_inc = dpoint3d( 0, 0, +1);
const dpoint3d axial_dec = dpoint3d( 0, -1, 0);
......@@ -74,6 +76,8 @@ namespace mln
const dpoint3d coronal_dec = dpoint3d(-1, 0, 0);
const dpoint3d coronal_inc = dpoint3d(+1, 0, 0);
# endif // !MLN_WO_GLOBAL_VARS
# endif // ! MLN_INCLUDE_ONLY
......
......@@ -85,11 +85,14 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
/// Global variables.
/// \{
f_hsl_to_rgb_3x8_t f_hsl_to_rgb_3x8;
f_hsl_to_rgb_3x16_t f_hsl_to_rgb_3x16;
/// \}
# endif // !MLN_WO_GLOBAL_VARS
/// This method implements the conversion from HSL to RGB as described by
......
......@@ -55,8 +55,12 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
const black_t& black = black_t();
# endif
# ifdef MLN_NEW_VALUE_TYPES
inline
black_t::operator float() const
......
......@@ -152,6 +152,8 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
const red_t& red = red_t();
const green_t& green = green_t();
......@@ -180,6 +182,8 @@ namespace mln
const olive_t& olive = olive_t();
# endif
# endif
} // end of namespace mln::literal
......
......@@ -49,8 +49,12 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
const identity_t& identity = identity_t();
# endif // !MLN_WO_GLOBAL_VARS
# endif
} // end of namespace mln::literal
......
......@@ -64,9 +64,12 @@ namespace mln
return 1;
}
# ifndef MLN_WO_GLOBAL_VARS
const one_t& one = one_t();
# endif // !MLN_WO_GLOBAL_VARS
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::literal
......
......@@ -50,9 +50,13 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
const origin_t& origin = origin_t();
# endif
# endif // !MLN_WO_GLOBAL_VARS
# endif // !MLN_INCLUDE_ONLY
} // end of namespace mln::literal
......
......@@ -55,8 +55,12 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
const white_t& white = white_t();
# endif
# ifdef MLN_NEW_VALUE_TYPES
inline
white_t::operator float() const
......
......@@ -64,8 +64,12 @@ namespace mln
return 0;
}
# ifndef MLN_WO_GLOBAL_VARS
const zero_t& zero = zero_t();
# endif // !MLN_GLOBAL_VARS
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::literal
......
......@@ -54,6 +54,8 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
bbox_t bbox;
border_t border;
domain_t domain;
......@@ -61,6 +63,8 @@ namespace mln
function_t function;
image_t image;
# endif // !MLN_WO_GLOBAL_VARS
# endif // !MLN_INCLUDE_ONLY
} // end of namespace mln::tag
......
......@@ -53,9 +53,12 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
std::stack<std::clock_t> start_times;
std::stack<std::string> scopes;
# endif // !MLN_WO_GLOBAL_VARS
inline
void entering(const std::string& scope)
......
......@@ -57,6 +57,8 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
bool quiet = true;
unsigned tab = 0;
bool full_trace = false;
......@@ -68,9 +70,10 @@ namespace mln
unsigned max_tab = 0;
timeval start_time;
bool is_quiet = quiet;
} // end of namespace mln::trace::internal
# endif // !MLN_WO_GLOBAL_VARS
# endif // !MLN_INCLUDE_ONLY
} // end of namespace mln::trace
......
......@@ -108,6 +108,13 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
# ifndef MLN_WO_GLOBAL_VARS
const sign sign::zero = 0;
const sign sign::one = 1;
# endif // !MLN_WO_GLOBAL_VARS
inline
sign::sign()
{
......@@ -172,9 +179,6 @@ namespace mln
return *this;
}
const sign sign::zero = 0;
const sign sign::one = 1;
inline
std::ostream& operator<<(std::ostream& ostr, const sign& i)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment