mirror of
https://gitee.com/openharmony/ability_idl_tool
synced 2024-11-23 07:20:29 +00:00
!133 idl_tool_2工具联调适配修改
Merge pull request !133 from guofanfeng/idl_tool2_co_work
This commit is contained in:
commit
274b1f7596
@ -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);
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user