mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
fixed couple of warnings
This commit is contained in:
parent
4337eb80f3
commit
3329c549e6
3
src/engine/external/json-parser/json.c
vendored
3
src/engine/external/json-parser/json.c
vendored
|
@ -201,6 +201,7 @@ json_value * json_parse_ex (json_settings * settings, const json_char * json, ch
|
|||
long num_digits, num_fraction, num_e;
|
||||
|
||||
error[0] = '\0';
|
||||
num_digits = num_fraction = num_e = 0;
|
||||
|
||||
memset (&state, 0, sizeof (json_state));
|
||||
memcpy (&state.settings, settings, sizeof (json_settings));
|
||||
|
@ -220,6 +221,8 @@ json_value * json_parse_ex (json_settings * settings, const json_char * json, ch
|
|||
|
||||
top = root = 0;
|
||||
flags = flag_seek_value;
|
||||
string_length = 0;
|
||||
string = 0;
|
||||
|
||||
cur_line = 1;
|
||||
cur_line_begin = json;
|
||||
|
|
|
@ -47,13 +47,13 @@ void CCountryFlags::LoadCountryflagsIndexfile()
|
|||
{
|
||||
NUM_INDICES = 2,
|
||||
};
|
||||
char *paIndices[NUM_INDICES] = {"custom", "ISO 3166-1"};
|
||||
const char *paIndices[NUM_INDICES] = {"custom", "ISO 3166-1"};
|
||||
for(int Index = 0; Index < NUM_INDICES; ++Index)
|
||||
{
|
||||
const json_value &rStart = rInit[paIndices[Index]];
|
||||
const json_value &rStart = rInit[(const char *)paIndices[Index]];
|
||||
if(rStart.type == json_array)
|
||||
{
|
||||
for(int i = 0; i < rStart.u.array.length; ++i)
|
||||
for(unsigned i = 0; i < rStart.u.array.length; ++i)
|
||||
{
|
||||
char aBuf[64];
|
||||
|
||||
|
@ -101,6 +101,7 @@ void CCountryFlags::LoadCountryflagsIndexfile()
|
|||
|
||||
// clean up
|
||||
json_value_free(pJsonData);
|
||||
mem_free(pFileData);
|
||||
m_aCountryFlags.sort_range();
|
||||
|
||||
// find index of default item
|
||||
|
|
|
@ -1615,7 +1615,7 @@ void CMenus::RenderServerbrowser(CUIRect MainView)
|
|||
+------+ +------------+
|
||||
*/
|
||||
|
||||
CUIRect ServerList, ToolBox, BottomBox;
|
||||
CUIRect ServerList, BottomBox;
|
||||
|
||||
MainView.HSplitTop(20.0f, 0, &MainView);
|
||||
MainView.HSplitBottom(80.0f, &ServerList, &MainView);
|
||||
|
|
|
@ -505,7 +505,7 @@ void LoadLanguageIndexfile(IStorage *pStorage, IConsole *pConsole, sorted_array<
|
|||
const json_value &rStart = (*pJsonData)["language indices"];
|
||||
if(rStart.type == json_array)
|
||||
{
|
||||
for(int i = 0; i < rStart.u.array.length; ++i)
|
||||
for(unsigned i = 0; i < rStart.u.array.length; ++i)
|
||||
{
|
||||
char aFileName[128];
|
||||
str_format(aFileName, sizeof(aFileName), "languages/%s.json", (const char *)rStart[i]["file"]);
|
||||
|
@ -515,6 +515,7 @@ void LoadLanguageIndexfile(IStorage *pStorage, IConsole *pConsole, sorted_array<
|
|||
|
||||
// clean up
|
||||
json_value_free(pJsonData);
|
||||
mem_free(pFileData);
|
||||
}
|
||||
|
||||
void CMenus::RenderLanguageSelection(CUIRect MainView, bool Header)
|
||||
|
|
|
@ -114,7 +114,7 @@ int CSkins::SkinScan(const char *pName, int IsDir, int DirType, void *pUser)
|
|||
return 0;
|
||||
|
||||
CSkin Skin = pSelf->m_DummySkin;
|
||||
bool SpecialSkin = pName[0] == 'x' & pName[1] == '_';
|
||||
bool SpecialSkin = pName[0] == 'x' && pName[1] == '_';
|
||||
CLineReader LineReader;
|
||||
LineReader.Init(File);
|
||||
|
||||
|
|
|
@ -85,12 +85,13 @@ bool CLocalizationDatabase::Load(const char *pFilename, IStorage *pStorage, ICon
|
|||
const json_value &rStart = (*pJsonData)["translated strings"];
|
||||
if(rStart.type == json_array)
|
||||
{
|
||||
for(int i = 0; i < rStart.u.array.length; ++i)
|
||||
for(unsigned i = 0; i < rStart.u.array.length; ++i)
|
||||
AddString((const char *)rStart[i]["or"], (const char *)rStart[i]["tr"]);
|
||||
}
|
||||
|
||||
// clean up
|
||||
json_value_free(pJsonData);
|
||||
mem_free(pFileData);
|
||||
m_CurrentVersion = ++m_VersionCounter;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue