diff --git a/src/c_bind.h b/src/c_bind.h index 394d313c9..07e657b46 100644 --- a/src/c_bind.h +++ b/src/c_bind.h @@ -69,7 +69,7 @@ public: const char *GetBind(unsigned int index) const { - if (index < NUM_KEYS) return Binds[index]; + if (index < NUM_KEYS) return Binds[index].GetChars(); else return NULL; } diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index 8ddd022e9..bbce1ee77 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -1203,11 +1203,11 @@ static int DumpHash (FConsoleCommand **table, bool aliases, const char *pattern= void FConsoleAlias::PrintAlias () { - if (m_Command[0]) + if (m_Command[0].IsNotEmpty()) { Printf (TEXTCOLOR_YELLOW "%s : %s\n", m_Name, m_Command[0].GetChars()); } - if (m_Command[1]) + if (m_Command[1].IsNotEmpty()) { Printf (TEXTCOLOR_ORANGE "%s : %s\n", m_Name, m_Command[1].GetChars()); } diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 8b4b06209..68dafa5ea 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -925,7 +925,7 @@ void WriteUserInfo(FArchive &arc, userinfo_t &info) case NAME_PlayerClass: i = info.GetPlayerClassNum(); - arc.WriteString(i == -1 ? "Random" : PlayerClasses[i].Type->DisplayName); + arc.WriteString(i == -1 ? "Random" : PlayerClasses[i].Type->DisplayName.GetChars()); break; default: diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index ebe4879ac..4d557f62b 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -1411,7 +1411,7 @@ void DBaseStatusBar::DrawLog () { int hudwidth, hudheight; - if (CPlayer->LogText && *CPlayer->LogText) + if (CPlayer->LogText.IsNotEmpty()) { // This uses the same scaling as regular HUD messages switch (con_scaletext) diff --git a/src/menu/optionmenuitems.h b/src/menu/optionmenuitems.h index 29b860af2..796e88c17 100644 --- a/src/menu/optionmenuitems.h +++ b/src/menu/optionmenuitems.h @@ -504,7 +504,7 @@ public: int Draw(FOptionMenuDescriptor *desc, int y, int indent, bool selected) { - const char *txt = mCurrent? (const char*)mAltText : mLabel; + const char *txt = mCurrent? mAltText.GetChars() : mLabel; if (*txt == '$') txt = GStrings(txt + 1); int w = SmallFont->StringWidth(txt) * CleanXfac_1; int x = (screen->GetWidth() - w) / 2; diff --git a/src/p_user.cpp b/src/p_user.cpp index a680e5615..9f5a37293 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -1189,7 +1189,7 @@ const char *APlayerPawn::GetSoundClass() const // [GRB] PClassPlayerPawn *pclass = GetClass(); - return pclass->SoundClass.IsNotEmpty() ? pclass->SoundClass : "player"; + return pclass->SoundClass.IsNotEmpty() ? pclass->SoundClass.GetChars() : "player"; } //=========================================================================== diff --git a/src/r_defs.h b/src/r_defs.h index 4f0b5ed01..c5d759351 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -151,8 +151,8 @@ struct FUDMFKey FUDMFKey& operator =(const FString &val) { Type = UDMF_String; - IntVal = strtol(val, NULL, 0); - FloatVal = strtod(val, NULL); + IntVal = strtol(val.GetChars(), NULL, 0); + FloatVal = strtod(val.GetChars(), NULL); StringVal = val; return *this; } diff --git a/src/s_sound.cpp b/src/s_sound.cpp index a2d69fbd5..4c60f62a3 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -415,7 +415,7 @@ void S_Start () // Parse the global SNDINFO S_ParseSndInfo(true); - if (*LocalSndInfo) + if (LocalSndInfo.IsNotEmpty()) { // Now parse the local SNDINFO int j = Wads.CheckNumForFullName(LocalSndInfo, true); @@ -432,7 +432,7 @@ void S_Start () if (parse_ss) { - S_ParseSndSeq(*LocalSndSeq? Wads.CheckNumForFullName(LocalSndSeq, true) : -1); + S_ParseSndSeq(LocalSndSeq.IsNotEmpty()? Wads.CheckNumForFullName(LocalSndSeq, true) : -1); } LastLocalSndInfo = LocalSndInfo; @@ -2553,7 +2553,7 @@ int S_GetMusic (char **name) { int order; - if (mus_playing.name) + if (mus_playing.name.IsNotEmpty()) { *name = copystring (mus_playing.name); order = mus_playing.baseorder; diff --git a/src/s_sound.h b/src/s_sound.h index a72f3be0c..edaabb60d 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -102,7 +102,7 @@ public: } FSoundID(const FString &name) { - ID = S_FindSound(name); + ID = S_FindSound(name.GetChars()); } FSoundID(const FSoundID &other) { @@ -120,7 +120,7 @@ public: } FSoundID &operator=(const FString &name) { - ID = S_FindSound(name); + ID = S_FindSound(name.GetChars()); return *this; } operator int() const diff --git a/src/zstring.h b/src/zstring.h index 90c80e752..5b0c375e3 100644 --- a/src/zstring.h +++ b/src/zstring.h @@ -343,16 +343,16 @@ namespace StringFormat // FName inline implementations that take FString parameters -inline FName::FName(const FString &text) { Index = NameData.FindName (text, text.Len(), false); } -inline FName::FName(const FString &text, bool noCreate) { Index = NameData.FindName (text, text.Len(), noCreate); } -inline FName &FName::operator = (const FString &text) { Index = NameData.FindName (text, text.Len(), false); return *this; } -inline FName &FNameNoInit::operator = (const FString &text) { Index = NameData.FindName (text, text.Len(), false); return *this; } +inline FName::FName(const FString &text) { Index = NameData.FindName (text.GetChars(), text.Len(), false); } +inline FName::FName(const FString &text, bool noCreate) { Index = NameData.FindName (text.GetChars(), text.Len(), noCreate); } +inline FName &FName::operator = (const FString &text) { Index = NameData.FindName (text.GetChars(), text.Len(), false); return *this; } +inline FName &FNameNoInit::operator = (const FString &text) { Index = NameData.FindName (text.GetChars(), text.Len(), false); return *this; } // Hash FStrings on their contents. (used by TMap) extern unsigned int SuperFastHash (const char *data, size_t len); template<> struct THashTraits { - hash_t Hash(const FString &key) { return (hash_t)SuperFastHash(key, key.Len()); } + hash_t Hash(const FString &key) { return (hash_t)SuperFastHash(key.GetChars(), key.Len()); } // Compares two keys, returning zero if they are the same. int Compare(const FString &left, const FString &right) { return left.Compare(right); } };