Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/ImplementEnumFunc.cpp

    r5f210c0 r0c327ce  
    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)),
    2730                  proto_linkage{ast::Linkage::Cforall} {}
    2831
     
    191194        {new ast::ObjectDecl(getLocation(), "_i", new ast::EnumInstType(decl))},
    192195        {new ast::ObjectDecl(getLocation(), "_ret",
    193             new ast::BasicType(ast::BasicKind::SignedInt))});
     196            new ast::BasicType(ast::BasicKind::UnsignedInt))});
    194197}
    195198
     
    226229        return genProto(
    227230                "fromInt_unsafe",
    228                 {new ast::ObjectDecl(getLocation(), "_i", new ast::BasicType(ast::BasicKind::SignedInt))},
     231                {new ast::ObjectDecl(getLocation(), "_i", new ast::BasicType(ast::BasicKind::UnsignedInt))},
    229232                {new ast::ObjectDecl(getLocation(), "_ret", new ast::EnumInstType(decl))}
    230233        );
     
    235238                "fromInstance",
    236239                {new ast::ObjectDecl(getLocation(), "_i", new ast::EnumInstType(decl))},
    237                 {new ast::ObjectDecl(getLocation(), "_ret", new ast::BasicType(ast::BasicKind::SignedInt))}
     240                {new ast::ObjectDecl(getLocation(), "_ret", new ast::BasicType(ast::BasicKind::UnsignedInt))}
    238241        );
    239242}
     
    282285                func->location,
    283286                new ast::VariableExpr(func->location, param),
    284                 new ast::BasicType(ast::BasicKind::SignedInt),
     287                new ast::BasicType(ast::BasicKind::UnsignedInt),
    285288                ast::GeneratedFlag::ExplicitCast
    286289        );
     
    380383                        func->location,
    381384                        new ast::VariableExpr( func->location, func->params.front() ),
    382                         new ast::BasicType( ast::BasicKind::SignedInt ),
     385                        new ast::BasicType( ast::BasicKind::UnsignedInt ),
    383386                        ast::GeneratedFlag::ExplicitCast
    384387                )});
     
    404407                func->location,
    405408                new ast::VariableExpr(func->location, func->params.front()),
    406                 new ast::BasicType( ast::BasicKind::SignedInt ),
     409                new ast::BasicType( ast::BasicKind::UnsignedInt ),
    407410                        ast::GeneratedFlag::ExplicitCast);
    408411        func->stmts = new ast::CompoundStmt(
Note: See TracChangeset for help on using the changeset viewer.