!133 idl_tool_2工具联调适配修改

Merge pull request !133 from guofanfeng/idl_tool2_co_work
This commit is contained in:
openharmony_ci 2024-06-26 02:10:56 +00:00 committed by Gitee
commit 274b1f7596
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 7 additions and 13 deletions

View File

@ -24,8 +24,6 @@ class HDICppCodeEmitter : public HDICodeEmitter {
public:
~HDICppCodeEmitter() override = default;
bool OutPut(const AutoPtr<AST> &ast, const std::string &targetDirectory);
protected:
void GetImportInclusions(HeaderFile::HeaderFileSet &headerFiles);

View File

@ -27,17 +27,13 @@ namespace Idl {
void SACppCodeEmitter::GetStdlibInclusions(HeaderFile::HeaderFileSet &headerFiles)
{
const AST::TypeStringMap &types = ast_->GetTypes();
// Add header files dependency by default to avoid compatibility problems
headerFiles.emplace(HeaderFileType::OTHER_MODULES_HEADER_FILE, "string_ex");
headerFiles.emplace(HeaderFileType::CPP_STD_HEADER_FILE, "cstdint");
for (const auto &pair : types) {
AutoPtr<ASTType> type = pair.second;
switch (type->GetTypeKind()) {
case TypeKind::TYPE_STRING: {
headerFiles.emplace(HeaderFileType::OTHER_MODULES_HEADER_FILE, "string_ex");
break;
}
case TypeKind::TYPE_BYTE: {
headerFiles.emplace(HeaderFileType::CPP_STD_HEADER_FILE, "cstdint");
break;
}
case TypeKind::TYPE_ARRAY:
case TypeKind::TYPE_LIST: {
headerFiles.emplace(HeaderFileType::CPP_STD_HEADER_FILE, "vector");

View File

@ -348,8 +348,8 @@ bool IntfTypeChecker::CheckIntfSmAstTypes()
bool IntfTypeChecker::CheckSmInterfaceAst()
{
int index;
for (int i = 0; i < ast_->GetInterfaceDefNumber(); i++) {
size_t index = 0;
for (size_t i = 0; i < ast_->GetInterfaceDefNumber(); i++) {
if (!ast_->GetInterfaceDef(i)->IsExternal()) {
index = i;
break;

View File

@ -118,7 +118,7 @@ char File::PeekChar()
bool File::IsEof() const
{
return isEof_ || buffer_[position_] == -1;
return isEof_ || buffer_[position_] == static_cast<char>(-1);
}
size_t File::Read()