Ignore:
Timestamp:
Aug 5, 2024, 9:31:08 AM (20 hours ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
f6d2e9b
Parents:
c588acb (diff), 7db4fcd4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/ImplementEnumFunc.cpp

    rc588acb rcc077f4  
    2525                : decl(decl),
    2626                  functionNesting{functionNesting},
    27                 //   quasi_void_decl(new ast::StructDecl(decl->location,
    28                 //      "quasi_void", ast::AggregateDecl::Struct,
    29                 //      {}, ast::Linkage::AutoGen)),
    3027                  proto_linkage{ast::Linkage::Cforall} {}
    3128
     
    194191        {new ast::ObjectDecl(getLocation(), "_i", new ast::EnumInstType(decl))},
    195192        {new ast::ObjectDecl(getLocation(), "_ret",
    196             new ast::BasicType(ast::BasicKind::UnsignedInt))});
     193            new ast::BasicType(ast::BasicKind::SignedInt))});
    197194}
    198195
     
    229226        return genProto(
    230227                "fromInt_unsafe",
    231                 {new ast::ObjectDecl(getLocation(), "_i", new ast::BasicType(ast::BasicKind::UnsignedInt))},
     228                {new ast::ObjectDecl(getLocation(), "_i", new ast::BasicType(ast::BasicKind::SignedInt))},
    232229                {new ast::ObjectDecl(getLocation(), "_ret", new ast::EnumInstType(decl))}
    233230        );
     
    238235                "fromInstance",
    239236                {new ast::ObjectDecl(getLocation(), "_i", new ast::EnumInstType(decl))},
    240                 {new ast::ObjectDecl(getLocation(), "_ret", new ast::BasicType(ast::BasicKind::UnsignedInt))}
     237                {new ast::ObjectDecl(getLocation(), "_ret", new ast::BasicType(ast::BasicKind::SignedInt))}
    241238        );
    242239}
     
    285282                func->location,
    286283                new ast::VariableExpr(func->location, param),
    287                 new ast::BasicType(ast::BasicKind::UnsignedInt),
     284                new ast::BasicType(ast::BasicKind::SignedInt),
    288285                ast::GeneratedFlag::ExplicitCast
    289286        );
     
    383380                        func->location,
    384381                        new ast::VariableExpr( func->location, func->params.front() ),
    385                         new ast::BasicType( ast::BasicKind::UnsignedInt ),
     382                        new ast::BasicType( ast::BasicKind::SignedInt ),
    386383                        ast::GeneratedFlag::ExplicitCast
    387384                )});
     
    407404                func->location,
    408405                new ast::VariableExpr(func->location, func->params.front()),
    409                 new ast::BasicType( ast::BasicKind::UnsignedInt ),
     406                new ast::BasicType( ast::BasicKind::SignedInt ),
    410407                        ast::GeneratedFlag::ExplicitCast);
    411408        func->stmts = new ast::CompoundStmt(
Note: See TracChangeset for help on using the changeset viewer.