/* * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Autogenerated file -- DO NOT EDIT! // Enums with more than 32 bits are not alowded in C and it's trouble // NOLINTBEGIN(hicpp-signed-bitwise) % Enums::enums&.each do |name, enum| % if enum.flags.length > 0 % if enum.flags.length <= 32 || enum.type == "int" enum Es2panda<%= name %> { % enum.flags&.each_with_index do |flag, index| % if enum.type == 'unsigned' % if index == 0 <%= enum.name_to_upper_snake %>_<%= flag %> = 0U, % else <%= enum.name_to_upper_snake %>_<%= flag %> = 1U << <%= index - 1%>U, % end % else <%= enum.name_to_upper_snake %>_<%= flag %>, % end % end % enum.flag_unions&.each do |union_name, flags| <%= enum.name_to_upper_snake %>_<%= union_name %> = <%= flags.each_with_index { |flag, index| flags[index] = "#{enum.name_to_upper_snake}_#{flag}"}.join(' | ') %>, % end }; // NOLINTNEXTLINE(modernize-use-using) typedef enum Es2panda<%= name %> Es2panda<%= name %>; % else // NOLINTNEXTLINE(modernize-use-using) typedef uint64_t Es2panda<%= name %>; % end % end % end // NOLINTEND(hicpp-signed-bitwise)