about summary refs log tree commit diff
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-11-17 18:36:19 +0100
committeroy <Tom_Adams@web.de>2010-11-17 18:36:19 +0100
commit3d3572f845c1d61acd960caf0c28562b9c8681e5 (patch)
tree35462aeb48e77f217a79fdaaee36b80777e81d55
parentd32b93d3ec538c89539d39c61cac4b56e00db8be (diff)
downloadzcatch-3d3572f845c1d61acd960caf0c28562b9c8681e5.tar.gz
zcatch-3d3572f845c1d61acd960caf0c28562b9c8681e5.zip
fixed some compiler warnings
-rw-r--r--src/base/system.c10
-rw-r--r--src/engine/client/text.cpp4
-rw-r--r--src/engine/shared/demo.h1
-rw-r--r--src/game/client/lineinput.h2
-rw-r--r--src/game/editor/ed_editor.cpp4
5 files changed, 12 insertions, 9 deletions
diff --git a/src/base/system.c b/src/base/system.c
index 972fbada..b7f76a88 100644
--- a/src/base/system.c
+++ b/src/base/system.c
@@ -987,10 +987,12 @@ int fs_is_dir(const char *path)
 
 int fs_chdir(const char *path)
 {
-	if (fs_is_dir(path))
+	if(fs_is_dir(path))
 	{
-		chdir(path);
-		return 0;
+		if(chdir(path))
+			return 1;
+		else
+			return 0;
 	}
 	else
 		return 1;
@@ -1306,7 +1308,7 @@ void gui_messagebox(const char *title, const char *message)
 		title,
 		message);
 
-	system(cmd);
+	(void)system(cmd);
 #elif defined(CONF_FAMILY_WINDOWS)
 	MessageBox(NULL,
 		message,
diff --git a/src/engine/client/text.cpp b/src/engine/client/text.cpp
index ddc9429f..e4707a69 100644
--- a/src/engine/client/text.cpp
+++ b/src/engine/client/text.cpp
@@ -540,8 +540,8 @@ public:
 		int ActualSize;
 		int i;
 		int GotNewLine = 0;
-		float DrawX, DrawY;
-		int LineCount;
+		float DrawX = 0.0f, DrawY = 0.0f;
+		int LineCount = 0;
 		float CursorX, CursorY;
 		const char *pEnd;
 
diff --git a/src/engine/shared/demo.h b/src/engine/shared/demo.h
index 12b12f05..37e86831 100644
--- a/src/engine/shared/demo.h
+++ b/src/engine/shared/demo.h
@@ -43,6 +43,7 @@ public:
 	class IListner
 	{
 	public:
+		virtual ~IListner() {}
 		virtual void OnDemoPlayerSnapshot(void *pData, int Size) = 0;
 		virtual void OnDemoPlayerMessage(void *pData, int Size) = 0;
 	};
diff --git a/src/game/client/lineinput.h b/src/game/client/lineinput.h
index f5c65282..71612b99 100644
--- a/src/game/client/lineinput.h
+++ b/src/game/client/lineinput.h
@@ -25,7 +25,7 @@ public:
 	void Set(const char *pString);
 	const char *GetString() const { return m_Str; }
 	int GetLength() const { return m_Len; }
-	unsigned GetCursorOffset() const { return m_CursorPos; }
+	int GetCursorOffset() const { return m_CursorPos; }
 };
 
 #endif
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp
index 9fb457aa..867049e1 100644
--- a/src/game/editor/ed_editor.cpp
+++ b/src/game/editor/ed_editor.cpp
@@ -2127,8 +2127,8 @@ static void EditorListdirCallback(const char *pName, int IsDir, int StorageType,
 	int Length = str_length(pName);
 	if((pName[0] == '.' && (pName[1] == 0 ||
 		(pName[1] == '.' && pName[2] == 0 && (!str_comp(pEditor->m_pFileDialogPath, "maps") || !str_comp(pEditor->m_pFileDialogPath, "mapres"))))) ||
-		(!IsDir && (pEditor->m_FileDialogFileType == CEditor::FILETYPE_MAP && (Length < 4 || str_comp(pName+Length-4, ".map"))) ||
-		(pEditor->m_FileDialogFileType == CEditor::FILETYPE_IMG && (Length < 4 || str_comp(pName+Length-4, ".png")))))
+		(!IsDir && ((pEditor->m_FileDialogFileType == CEditor::FILETYPE_MAP && (Length < 4 || str_comp(pName+Length-4, ".map"))) ||
+		(pEditor->m_FileDialogFileType == CEditor::FILETYPE_IMG && (Length < 4 || str_comp(pName+Length-4, ".png"))))))
 		return;
 
 	CEditor::CFilelistItem Item;