Skip to content

Commit

Permalink
fix(rime_levers_api.h): customize_bool() misused bool type
Browse files Browse the repository at this point in the history
BREAKING CHANGE: in signature of C API function `customize_bool()`,
change type `bool` to `Bool` (alias of `int`).

Impact: the changed function is not in use by any first party code,
known to be in use by osfans/trime.
  • Loading branch information
lotem committed Jan 29, 2019
1 parent 2a15ef4 commit 42bacc5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/rime/lever/levers_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ static Bool rime_levers_save_settings(RimeCustomSettings* settings) {
}

static Bool rime_levers_customize_bool(RimeCustomSettings* settings,
const char* key, bool value) {
an<ConfigItem> item = New<ConfigValue>(value);
const char* key, Bool value) {
an<ConfigItem> item = New<ConfigValue>(bool(value));
auto custom_settings = reinterpret_cast<CustomSettings*>(settings);
return custom_settings->Customize(key, item);
}
Expand Down
2 changes: 1 addition & 1 deletion src/rime_levers_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef struct rime_levers_api_t {
void (*custom_settings_destroy)(RimeCustomSettings* settings);
Bool (*load_settings)(RimeCustomSettings* settings);
Bool (*save_settings)(RimeCustomSettings* settings);
Bool (*customize_bool)(RimeCustomSettings* settings, const char* key, bool value);
Bool (*customize_bool)(RimeCustomSettings* settings, const char* key, Bool value);
Bool (*customize_int)(RimeCustomSettings* settings, const char* key, int value);
Bool (*customize_double)(RimeCustomSettings* settings, const char* key, double value);
Bool (*customize_string)(RimeCustomSettings* settings, const char* key, const char* value);
Expand Down

3 comments on commit 42bacc5

@lotem
Copy link
Member Author

@lotem lotem commented on 42bacc5 Jan 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@osfans trime 需要改一下對應的JNI綁定。

@osfans
Copy link
Contributor

@osfans osfans commented on 42bacc5 Mar 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

收到,感謝!
怎麼查看commit中的comment?我偶然在郵箱中查到的。

@lotem
Copy link
Member Author

@lotem lotem commented on 42bacc5 Mar 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有郵件通知,其他的辦法就不知道了。

Please sign in to comment.