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

« back to all changes in this revision

Viewing changes to Puma/gen-release/step2/src/DeducedArgument.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:
17
17
// MA  02111-1307  USA                                            
18
18
 
19
19
#include "Puma/DeducedArgument.h"
 
20
#include "Puma/CTemplateParamInfo.h"
20
21
 
21
22
namespace Puma {
22
23
 
23
24
 
 
25
DeducedArgument::DeducedArgument (CTemplateParamInfo *p, CTypeInfo *t, CTree *a, bool da) { 
 
26
  del = false; 
 
27
  type = t->Duplicate (); 
 
28
  value = 0; 
 
29
  param = p; 
 
30
  arg = a; 
 
31
  default_arg = da; 
 
32
}
 
33
 
 
34
DeducedArgument::DeducedArgument (CTemplateParamInfo *p, CConstant *v, CTree *a, bool da) { 
 
35
  del = false; 
 
36
  type = 0; 
 
37
  value = p->ValueType () ? v->cast_to (p->ValueType ()) : v->duplicate (); 
 
38
  param = p; 
 
39
  arg = a; 
 
40
  default_arg = da; 
 
41
}
 
42
 
24
43
DeducedArgument::DeducedArgument (CTemplateParamInfo *p, long val) {
25
44
  type = 0;
26
45
  param = p;
43
62
    return false;
44
63
  if (Type () && *Type () != *a.Type ())
45
64
    return false;
46
 
  if (Value () && 
47
 
      ((Value ()->isSigned () && (! a.Value ()->isSigned () || 
48
 
         Value ()->convert_to_int () != a.Value ()->convert_to_int ())) ||
49
 
       (Value ()->isUnsigned () && (! a.Value ()->isUnsigned () || 
50
 
         Value ()->convert_to_uint () != a.Value ()->convert_to_uint ())) ||
51
 
       (Value ()->isFloat () && (! a.Value ()->isFloat () || 
52
 
         Value ()->convert_to_float () != a.Value ()->convert_to_float ()))))
 
65
  if (Value () && *Value () != *a.Value ())
53
66
    return false;
54
67
  return true;
55
68
}