Changeset 332e93a for src/InitTweak
- Timestamp:
- Feb 4, 2025, 9:18:54 PM (12 months ago)
- Branches:
- master
- Children:
- 090b076
- Parents:
- 985ff5f (diff), 1ee74df (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. - File:
-
- 1 edited
-
src/InitTweak/GenInit.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/GenInit.cpp
r985ff5f r332e93a 164 164 ast::ObjectDecl * arrayDimension = nullptr; 165 165 166 const ast::TypeExpr * ty = dynamic_cast< const ast::TypeExpr * >( arrayType->dimension.get() ); 167 if ( ty ) { 166 if ( auto ty = dynamic_cast< const ast::TypeExpr * >( arrayType->dimension.get() ) ) { 168 167 auto inst = ty->type.as<ast::EnumInstType>(); 169 if ( inst ) { 170 if ( inst->base->isCfa ) { 171 arrayDimension = new ast::ObjectDecl( 168 if ( inst && !inst->base->is_c_enum() ) { 169 arrayDimension = new ast::ObjectDecl( 170 arrayType->dimension->location, 171 dimensionName.newName(), 172 new ast::BasicType( ast::BasicKind::UnsignedChar ), 173 new ast::SingleInit( 172 174 arrayType->dimension->location, 173 dimensionName.newName(), 174 new ast::BasicType( ast::BasicKind::UnsignedChar ), 175 new ast::SingleInit( 176 arrayType->dimension->location, 177 ast::ConstantExpr::from_int( arrayType->dimension->location, inst->base->members.size() ) 178 ) 179 ); 180 // return arrayType; 181 } 175 ast::ConstantExpr::from_int( arrayType->dimension->location, inst->base->members.size() ) 176 ) 177 ); 182 178 } 183 179 }
Note:
See TracChangeset
for help on using the changeset viewer.