Adding of _t to (u)int types, and WChar to char32_t

See: eaae0bb5e
This commit is contained in:
Jonathan G Rennison
2024-01-07 16:41:53 +00:00
parent 55d78a23be
commit 97e6f3062e
655 changed files with 7555 additions and 7555 deletions

View File

@@ -107,7 +107,7 @@ static DBusHandlerResult FcitxDBusMessageFilter(DBusConnection *connection, DBus
if (dbus_message_is_signal(message, "org.fcitx.Fcitx.InputContext", "UpdatePreedit")) {
const char *text = nullptr;
int32 cursor;
int32_t cursor;
if (!dbus_message_get_args(message, nullptr, DBUS_TYPE_STRING, &text, DBUS_TYPE_INT32, &cursor, DBUS_TYPE_INVALID)) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
if (text != nullptr && EditBoxInGlobalFocus()) {
@@ -136,7 +136,7 @@ static void FcitxInit()
int pid = getpid();
int id = -1;
uint32 enable, hk1sym, hk1state, hk2sym, hk2state;
uint32_t enable, hk1sym, hk1state, hk2sym, hk2state;
DBusMessage *msg = dbus_message_new_method_call(_fcitx_service_name, "/inputmethod", "org.fcitx.Fcitx.InputMethod", "CreateICv3");
if (!msg) return;
auto guard1 = scope_guard([&]() {
@@ -158,7 +158,7 @@ static void FcitxInit()
dbus_connection_add_filter(_fcitx_dbus_session_conn, &FcitxDBusMessageFilter, nullptr, nullptr);
dbus_connection_flush(_fcitx_dbus_session_conn);
uint32 caps = CAPACITY_PREEDIT;
uint32_t caps = CAPACITY_PREEDIT;
DBusMessage *msg2 = dbus_message_new_method_call(_fcitx_service_name, _fcitx_ic_name, "org.fcitx.Fcitx.InputContext", "SetCapacity");
if (!msg2) return;
auto guard3 = scope_guard([&]() {
@@ -174,12 +174,12 @@ static void FcitxInit()
_fcitx_mode = true;
}
static uint32 _fcitx_last_keycode = 0;
static uint32 _fcitx_last_keysym = 0;
static uint16 _last_sdl_key_mod;
static uint32_t _fcitx_last_keycode = 0;
static uint32_t _fcitx_last_keysym = 0;
static uint16_t _last_sdl_key_mod;
static bool FcitxProcessKey()
{
uint32 fcitx_mods = 0;
uint32_t fcitx_mods = 0;
if (_last_sdl_key_mod & KMOD_SHIFT) fcitx_mods |= FcitxKeyState_Shift;
if (_last_sdl_key_mod & KMOD_CAPS) fcitx_mods |= FcitxKeyState_CapsLock;
if (_last_sdl_key_mod & KMOD_CTRL) fcitx_mods |= FcitxKeyState_Ctrl;
@@ -189,7 +189,7 @@ static bool FcitxProcessKey()
if (_last_sdl_key_mod & KMOD_RGUI) fcitx_mods |= FcitxKeyState_Meta;
int type = FCITX_PRESS_KEY;
uint32 event_time = 0;
uint32_t event_time = 0;
DBusMessage *msg = dbus_message_new_method_call(_fcitx_service_name, _fcitx_ic_name, "org.fcitx.Fcitx.InputContext", "ProcessKeyEvent");
if (!msg) return false;
@@ -203,7 +203,7 @@ static bool FcitxProcessKey()
auto guard2 = scope_guard([&]() {
dbus_message_unref(reply);
});
uint32 handled = 0;
uint32_t handled = 0;
if (!dbus_message_get_args(reply, nullptr, DBUS_TYPE_INT32, &handled, DBUS_TYPE_INVALID)) return false;
return handled;
}
@@ -387,7 +387,7 @@ bool VideoDriver_SDL_Base::CreateMainWindow(uint w, uint h, uint flags)
SDL_Surface *icon = SDL_LoadBMP(icon_path.c_str());
if (icon != nullptr) {
/* Get the colourkey, which will be magenta */
uint32 rgbmap = SDL_MapRGB(icon->format, 255, 0, 255);
uint32_t rgbmap = SDL_MapRGB(icon->format, 255, 0, 255);
SDL_SetColorKey(icon, SDL_TRUE, rgbmap);
SDL_SetWindowIcon(this->sdl_window, icon);
@@ -581,7 +581,7 @@ static const SDLVkMapping _vk_mapping[] = {
AS(SDLK_HASH, WKC_HASH),
};
static uint ConvertSdlKeyIntoMy(SDL_Keysym *sym, WChar *character)
static uint ConvertSdlKeyIntoMy(SDL_Keysym *sym, char32_t *character)
{
const SDLVkMapping *map;
uint key = 0;
@@ -736,7 +736,7 @@ bool VideoDriver_SDL_Base::PollEvent()
(ev.key.keysym.sym == SDLK_RETURN || ev.key.keysym.sym == SDLK_f)) {
if (ev.key.repeat == 0) ToggleFullScreen(!_fullscreen);
} else {
WChar character;
char32_t character;
uint keycode = ConvertSdlKeyIntoMy(&ev.key.keysym, &character);
// Only handle non-text keys here. Text is handled in
@@ -768,7 +768,7 @@ bool VideoDriver_SDL_Base::PollEvent()
uint keycode = ConvertSdlKeycodeIntoMy(kc);
if (keycode == WKC_BACKQUOTE && FocusedWindowIsConsole()) {
WChar character;
char32_t character;
Utf8Decode(&character, ev.text.text);
HandleKeypress(keycode, character);
} else {
@@ -913,7 +913,7 @@ void VideoDriver_SDL_Base::Stop()
void VideoDriver_SDL_Base::InputLoop()
{
uint32 mod = SDL_GetModState();
uint32_t mod = SDL_GetModState();
const Uint8 *keys = SDL_GetKeyboardState(nullptr);
bool old_ctrl_pressed = _ctrl_pressed;