Ejemplo n.º 1
0
T
baz (T b, T c)
{
  T a;
  b &= 0xffffffffffffffffULL;
  c &= 0xffffffffffffffffULL;
  if (b < 7 || c < 7)
    return 0;
  a = b * c;
  if (a == (((T) 0xfffffffffffffffeULL << 64) | 1))
    required_check ();
  return a;
}
Ejemplo n.º 2
0
T
bar (T b, T c)
{
  T a;
  b &= 0xffffffffffffffffULL;
  c &= 0xffffffffffffffffULL;
  if (b < 7 || c < 7)
    return 0;
  a = b * c;
  if (a == 49)
    required_check ();
  return a;
}
Ejemplo n.º 3
0
  static bool load(XMLAttributesIterator xml_attributes_iterator, Dispatcher & dispatcher)
  {
    typedef typename boost::parameter::value_type<args, tag::xml_attribute_policy, 
      policy::xml::attribute_iterator<XMLAttributesIterator> >::type xml_policy;

    typedef typename boost::parameter::value_type<args, tag::error_policy, 
      policy::error::default_policy<typename Dispatcher::context_type> >::type error_policy;

    detail::required_attributes_check<RequiredAttributes> required_check;
    for(; !xml_policy::is_end(xml_attributes_iterator); 
      xml_policy::advance(xml_attributes_iterator))
    {
      BOOST_SCOPED_ENUM(detail::namespace_id) ns = xml_policy::get_namespace(xml_attributes_iterator);
      if (ns == detail::namespace_id::other)
        continue;
      typename xml_policy::attribute_name_type attribute_name = xml_policy::get_local_name(xml_attributes_iterator);
      detail::attribute_id id = detail::attribute_name_to_id(ns, xml_policy::get_string_range(attribute_name));
      switch (id)
      {
      case detail::unknown_attribute_id:
        if (!error_policy::unknown_attribute(dispatcher.context(), 
          xml_policy::get_attribute(xml_attributes_iterator), 
          xml_policy::get_string_range(attribute_name), ns, tag::source::attribute()))
          return false;
        break;
      case detail::attribute_id_style:
      {
        if (ParseStyleAttribute)
        {
          if (!load_style<xml_policy, error_policy>(xml_attributes_iterator, dispatcher))
            return false;
          break;
        }
      }
      default:
      {
        typename xml_policy::attribute_value_type value = xml_policy::get_value(xml_attributes_iterator);
        if (!dispatcher.load_attribute(id, xml_policy::get_string_range(value), tag::source::attribute()))
          return false;
        required_check(id);
      }
      }
    }

    detail::missing_attribute_visitor<error_policy> visitor(dispatcher.context());
    return required_check.visit_missing(visitor);
  }