diff --git a/src/common/platform/posix/sdl/i_system.cpp b/src/common/platform/posix/sdl/i_system.cpp index ab0c6bd7df8..183d11fc38b 100644 --- a/src/common/platform/posix/sdl/i_system.cpp +++ b/src/common/platform/posix/sdl/i_system.cpp @@ -118,7 +118,7 @@ void Unix_I_FatalError(const char* errortext) FString cmd; cmd << "kdialog --title \"" GAMENAME " " << GetVersionString() << "\" --msgbox \"" << errortext << "\""; - popen(cmd, "r"); + popen(cmd.GetChars(), "r"); } #ifndef NO_GTK else if (I_GtkAvailable()) @@ -131,7 +131,7 @@ void Unix_I_FatalError(const char* errortext) FString title; title << GAMENAME " " << GetVersionString(); - if (SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title, errortext, NULL) < 0) + if (SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, title.GetChars(), errortext, NULL) < 0) { printf("\n%s\n", errortext); } @@ -316,9 +316,9 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad, int& for(i = 0; i < numwads; ++i) { - const char *filepart = strrchr(wads[i].Path, '/'); + const char *filepart = strrchr(wads[i].Path.GetChars(), '/'); if(filepart == NULL) - filepart = wads[i].Path; + filepart = wads[i].Path.GetChars(); else filepart++; // Menu entries are specified in "tag" "item" pairs, where when a @@ -329,9 +329,9 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad, int& if(defaultiwad >= 0 && defaultiwad < numwads) { - const char *filepart = strrchr(wads[defaultiwad].Path, '/'); + const char *filepart = strrchr(wads[defaultiwad].Path.GetChars(), '/'); if(filepart == NULL) - filepart = wads[defaultiwad].Path; + filepart = wads[defaultiwad].Path.GetChars(); else filepart++; cmd.AppendFormat(" --default \"%s (%s)\"", wads[defaultiwad].Name.GetChars(), filepart); @@ -377,9 +377,9 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad, int& printf ("Please select a game wad (or 0 to exit):\n"); for (i = 0; i < numwads; ++i) { - const char *filepart = strrchr (wads[i].Path, '/'); + const char *filepart = strrchr (wads[i].Path.GetChars(), '/'); if (filepart == NULL) - filepart = wads[i].Path; + filepart = wads[i].Path.GetChars(); else filepart++; printf ("%d. %s (%s)\n", i+1, wads[i].Name.GetChars(), filepart); diff --git a/src/common/platform/posix/sdl/sdlglvideo.cpp b/src/common/platform/posix/sdl/sdlglvideo.cpp index 86a31c0c37d..edea37aa31d 100644 --- a/src/common/platform/posix/sdl/sdlglvideo.cpp +++ b/src/common/platform/posix/sdl/sdlglvideo.cpp @@ -139,7 +139,7 @@ namespace Priv caption.Format(GAMENAME " %s (%s)", GetVersionString(), GetGitTime()); const uint32_t windowFlags = (win_maximized ? SDL_WINDOW_MAXIMIZED : 0) | SDL_WINDOW_RESIZABLE | extraFlags; - Priv::window = SDL_CreateWindow(caption, + Priv::window = SDL_CreateWindow(caption.GetChars(), (win_x <= 0) ? SDL_WINDOWPOS_CENTERED_DISPLAY(vid_adapter) : win_x, (win_y <= 0) ? SDL_WINDOWPOS_CENTERED_DISPLAY(vid_adapter) : win_y, win_w, win_h, windowFlags); @@ -585,7 +585,7 @@ void I_SetWindowTitle(const char* caption) { FString default_caption; default_caption.Format(GAMENAME " %s (%s)", GetVersionString(), GetGitTime()); - SDL_SetWindowTitle(Priv::window, default_caption); + SDL_SetWindowTitle(Priv::window, default_caption.GetChars()); } } diff --git a/src/common/platform/posix/unix/i_specialpaths.cpp b/src/common/platform/posix/unix/i_specialpaths.cpp index f844f0dd044..81cf2ae6693 100644 --- a/src/common/platform/posix/unix/i_specialpaths.cpp +++ b/src/common/platform/posix/unix/i_specialpaths.cpp @@ -50,15 +50,15 @@ FString GetUserFile (const char *file) path = NicePath("$HOME/" GAME_DIR "/"); - if (stat (path, &info) == -1) + if (stat (path.GetChars(), &info) == -1) { struct stat extrainfo; // Sanity check for $HOME/.config FString configPath = NicePath("$HOME/.config/"); - if (stat (configPath, &extrainfo) == -1) + if (stat (configPath.GetChars(), &extrainfo) == -1) { - if (mkdir (configPath, S_IRUSR | S_IWUSR | S_IXUSR) == -1) + if (mkdir (configPath.GetChars(), S_IRUSR | S_IWUSR | S_IXUSR) == -1) { I_FatalError ("Failed to create $HOME/.config directory:\n%s", strerror(errno)); } @@ -72,9 +72,9 @@ FString GetUserFile (const char *file) // Transfer the old zdoom directory to the new location bool moved = false; FString oldpath = NicePath("$HOME/." GAMENAMELOWERCASE "/"); - if (stat (oldpath, &extrainfo) != -1) + if (stat (oldpath.GetChars(), &extrainfo) != -1) { - if (rename(oldpath, path) == -1) + if (rename(oldpath.GetChars(), path) == -1) { I_Error ("Failed to move old " GAMENAMELOWERCASE " directory (%s) to new location (%s).", oldpath.GetChars(), path.GetChars()); @@ -115,7 +115,7 @@ FString M_GetAppDataPath(bool create) FString path = NicePath("$HOME/.config/" GAMENAMELOWERCASE); if (create) { - CreatePath(path); + CreatePath(path.GetChars()); } return path; } @@ -135,7 +135,7 @@ FString M_GetCachePath(bool create) FString path = NicePath("$HOME/.config/zdoom/cache"); if (create) { - CreatePath(path); + CreatePath(path.GetChars()); } return path; } @@ -231,7 +231,7 @@ FString M_GetDemoPath() FString M_GetNormalizedPath(const char* path) { char *actualpath; - actualpath = realpath(path, NULL); + actualpath = realpath(path.GetChars(), NULL); if (!actualpath) // error ? return nullptr; FString fullpath = actualpath; diff --git a/src/ct_chat.cpp b/src/ct_chat.cpp index acad5b35afc..ad4c99484ca 100644 --- a/src/ct_chat.cpp +++ b/src/ct_chat.cpp @@ -193,7 +193,7 @@ bool CT_Responder (event_t *ev) #ifdef __unix__ else if (ev->subtype == EV_GUI_MButtonDown) { - CT_PasteChat(I_GetFromClipboard(true)); + CT_PasteChat(I_GetFromClipboard(true).GetChars()); } #endif } diff --git a/src/d_main.cpp b/src/d_main.cpp index 70c938ebf77..78421e707f6 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2041,7 +2041,7 @@ static void AddAutoloadFiles(const char *autoname, std::vector& all #ifdef __unix__ file = NicePath("$HOME/" GAME_DIR "/skins"); - D_AddDirectory (allwads, file, "*.wad", GameConfig); + D_AddDirectory (allwads, file.GetChars(), "*.wad", GameConfig); #endif // Add common (global) wads diff --git a/src/posix/i_steam.cpp b/src/posix/i_steam.cpp index 913ae398912..046adca49ab 100644 --- a/src/posix/i_steam.cpp +++ b/src/posix/i_steam.cpp @@ -179,7 +179,7 @@ TArray I_GetSteamPath() FString regPath = appSupportPath + "/Steam/config/config.vdf"; try { - SteamInstallFolders = ParseSteamRegistry(regPath); + SteamInstallFolders = ParseSteamRegistry(regPath.GetChars()); } catch(class CRecoverableError &error) {