fix:warning

Signed-off-by: wuchengwen <wuchengwen4@huawei.com>
This commit is contained in:
wuchengwen 2024-10-16 16:45:05 +08:00
parent ca1575096d
commit 261deee0d8
4 changed files with 8 additions and 6 deletions

View File

@ -21,7 +21,7 @@ InputMethod_ErrorCode ErrorCodeConvert(int32_t code);
#ifdef __cplusplus
extern "C"{
#endif /* __cplusplus */
InputMethod_ErrorCode IsValidInputMethodProxy(InputMethod_InputMethodProxy *inputMethodProxy);
InputMethod_ErrorCode IsValidInputMethodProxy(const InputMethod_InputMethodProxy *inputMethodProxy);
void ClearInputMethodProxy(void);
#ifdef __cplusplus
}

View File

@ -36,7 +36,7 @@ struct InputMethod_InputMethodProxy {
InputMethod_InputMethodProxy *g_inputMethodProxy = nullptr;
std::mutex g_textEditorProxyMapMutex;
InputMethod_ErrorCode IsValidInputMethodProxy(InputMethod_InputMethodProxy *inputMethodProxy)
InputMethod_ErrorCode IsValidInputMethodProxy(const InputMethod_InputMethodProxy *inputMethodProxy)
{
if (inputMethodProxy == nullptr) {
IMSA_HILOGE("inputMethodProxy is nullptr");
@ -118,7 +118,7 @@ static int32_t IsValidTextEditorProxy(InputMethod_TextEditorProxy *textEditor)
return IME_ERR_OK;
}
static TextConfig ConstructTextConfig(const InputMethod_TextConfig& config)
static TextConfig ConstructTextConfig(const InputMethod_TextConfig &config)
{
TextConfig textConfig = {
.inputAttribute = {
@ -160,7 +160,7 @@ InputMethod_ErrorCode OH_InputMethodController_Attach(InputMethod_TextEditorProx
InputMethod_TextConfig config;
textEditor->getTextConfigFunc(textEditor, &config);
auto textConfig = ConstructTextConfig(config);
auto textConfig = ConstructTextConfig(config);
auto controller = InputMethodController::GetInstance();
OHOS::sptr<NativeTextChangedListener> listener = nullptr;

View File

@ -236,7 +236,7 @@ int32_t NativeTextChangedListener::ReceivePrivateCommand(
}
size_t index = 0;
for (auto &item : privateCommand) {
for (const auto &item : privateCommand) {
command[index] = new InputMethod_PrivateCommand();
command[index]->key = item.first;
command[index]->value = item.second;

View File

@ -17,7 +17,7 @@
using namespace testing::ext;
class InputMethodControllerCapiTest : public testing::Test { };
namespace {
/**
* @tc.name: TestCursorInfo_001
* @tc.desc: create and destroy TestCursorInfo success
@ -557,6 +557,7 @@ HWTEST_F(InputMethodControllerCapiTest, OH_TextConfig_GetSelection_001, TestSize
InputMethod_TextConfig *config = OH_TextConfig_Create();
ASSERT_NE(config, nullptr);
ret = OH_TextConfig_GetSelection(config, nullptr, nullptr);
EXPECT_EQ(IME_ERR_NULL_POINTER, ret);
int32_t start = 0;
ret = OH_TextConfig_GetSelection(config, &start, nullptr);
EXPECT_EQ(ret, IME_ERR_NULL_POINTER);
@ -1512,3 +1513,4 @@ HWTEST_F(InputMethodControllerCapiTest, TestAttachWithNorrmalParam_001, TestSize
OH_AttachOptions_Destroy(options);
OH_TextEditorProxy_Destroy(textEditorProxy);
}
}