~ubuntu-branches/ubuntu/jaunty/aspectc++/jaunty

« back to all changes in this revision

Viewing changes to Puma/src/parser/CConstant.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-07-07 14:41:02 UTC
  • mfrom: (1.1.3 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707144102-lzml7t07f3sl00r5
Tags: 1.0pre4~svn.20080711-1
* new upstream snapshot.
* include all upstream documentation. Clarifying emails regarding
  licensing has been included into debian/copyright.
* reformat description following recomendations of
  http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description
  (Closes: #480316)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
 
25
25
bool CConstant::operator== (const CConstant &other) const {
26
 
  return (value.int_val == other.value.int_val) &&
27
 
         (value.uint_val == other.value.uint_val) &&
28
 
         (value.float_val == other.value.float_val);
 
26
  return value_type == INT_VAL  ? (value.int_val == other.convert_to_int ()) :
 
27
         value_type == UINT_VAL ? (value.uint_val == other.convert_to_uint ()) :
 
28
                                  (value.float_val == other.convert_to_float ());
29
29
}
30
30
 
31
31
 
292
292
}
293
293
 
294
294
void CConstant::print (ostream &out) const {
295
 
 if (isSigned ())
296
 
   out << convert_to_int ();
297
 
 else if (isUnsigned ())
298
 
   out << convert_to_uint ();
299
 
 else if (isFloat ())
300
 
   out << convert_to_float ();
 
295
  if (Type ()->VirtualType ()->is_bool ())
 
296
    out << (convert_to_int () ? "true" : "false");
 
297
  else if (isSigned ())
 
298
    out << convert_to_int ();
 
299
  else if (isUnsigned ())
 
300
    out << convert_to_uint ();
 
301
  else if (isFloat ())
 
302
    out << convert_to_float ();
301
303
}
302
304
 
303
305
} // namespace Puma