1/* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16// Autogenerated file -- DO NOT EDIT! 17// Enums with more than 32 bits are not alowded in C and it's trouble 18// NOLINTBEGIN(hicpp-signed-bitwise) 19 20% Enums::enums&.each do |name, enum| 21% if enum.flags.length > 0 22% if enum.flags.length <= 32 || enum.type == "int" 23enum Es2panda<%= name %> { 24% enum.flags&.each_with_index do |flag, index| 25% if enum.type == 'unsigned' 26% if index == 0 27 <%= enum.name_to_upper_snake %>_<%= flag %> = 0U, 28% else 29 <%= enum.name_to_upper_snake %>_<%= flag %> = 1U << <%= index - 1%>U, 30% end 31% else 32 <%= enum.name_to_upper_snake %>_<%= flag %>, 33% end 34% end 35% enum.flag_unions&.each do |union_name, flags| 36 <%= enum.name_to_upper_snake %>_<%= union_name %> = <%= flags.map { |flag| "#{enum.name_to_upper_snake}_#{flag}"}.join(' | ') %>, 37% end 38}; 39// NOLINTNEXTLINE(modernize-use-using) 40typedef enum Es2panda<%= name %> Es2panda<%= name %>; 41 42% else 43// NOLINTNEXTLINE(modernize-use-using) 44typedef uint64_t Es2panda<%= name %>; 45 46% end 47% end 48% end 49 50// NOLINTEND(hicpp-signed-bitwise) 51