fixed couple of warnings

This commit is contained in:
oy 2012-12-20 16:30:16 +01:00
parent 4337eb80f3
commit 3329c549e6
6 changed files with 13 additions and 7 deletions

View file

@ -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;

View file

@ -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

View file

@ -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);

View file

@ -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)

View file

@ -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);

View 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;
}