summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2009-03-26 22:42:19 +0000
committerleo2009-03-26 22:42:19 +0000
commit18af717c34bf548336d75589ce8a474709823db4 (patch)
tree1785176047dd208d6c3412879361c7b41e188f97
parentd7eeec6efeec6270cb3fb20f4c91ba229c9b285f (diff)
Fixed compiler warnings.
git-svn-id: http://svn.leocad.org/tags/leocad-0.75@759 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rw-r--r--common/pieceinf.cpp3
-rw-r--r--common/project.cpp7
-rw-r--r--common/project.h2
-rw-r--r--common/str.cpp1
-rwxr-xr-xcommon/system.h2
-rw-r--r--iphone/system.cpp2
-rw-r--r--linux/dialogs.cpp14
-rw-r--r--linux/dialogs.h2
-rw-r--r--linux/system.cpp6
-rw-r--r--macosx/system.cpp2
-rw-r--r--win/System.cpp7
11 files changed, 22 insertions, 26 deletions
diff --git a/common/pieceinf.cpp b/common/pieceinf.cpp
index 967a2ab..cab91d4 100644
--- a/common/pieceinf.cpp
+++ b/common/pieceinf.cpp
@@ -1028,10 +1028,11 @@ void PieceInfo::ZoomExtents(float Fov, float Aspect, float* EyePos) const
{ m_fDimensions[3], m_fDimensions[1], m_fDimensions[2] } };
float SmallestU = 10000.0f;
+ float* PlaneArray[4] = { TopPlane, BottomPlane, LeftPlane, RightPlane };
for (int i = 0; i < 4; i++)
{
- float* Plane;
+ float* Plane = PlaneArray[i];
switch (i)
{
diff --git a/common/project.cpp b/common/project.cpp
index 16d2651..5722c79 100644
--- a/common/project.cpp
+++ b/common/project.cpp
@@ -2608,7 +2608,7 @@ void Project::RenderOverlays(int Viewport)
{
Vector3 Tangent, Normal = m_OverlayTrackStart - m_OverlayCenter;
Normal.Normalize();
- float Angle;
+ float Angle = 0;
switch (m_OverlayMode)
{
@@ -3527,7 +3527,7 @@ void Project::CreateImages (Image* images, int width, int height, unsigned short
Sys_FinishMemoryRender (render);
}
-void Project::CreateHTMLPieceList(FILE* f, int nStep, bool bImages, char* ext)
+void Project::CreateHTMLPieceList(FILE* f, int nStep, bool bImages, const char* ext)
{
Piece* pPiece;
int col[LC_MAXCOLORS], ID = 0, c;
@@ -3898,7 +3898,8 @@ void Project::HandleCommand(LC_COMMANDS id, unsigned long nParam)
if (SystemDoDialog(LC_DLG_HTML, &opts))
{
FILE* f;
- char *ext, *htmlext, fn[LC_MAXPATH];
+ const char *ext, *htmlext;
+ char fn[LC_MAXPATH];
int i;
unsigned short last = GetLastStep();
diff --git a/common/project.h b/common/project.h
index 61fd111..0f959a0 100644
--- a/common/project.h
+++ b/common/project.h
@@ -191,7 +191,7 @@ protected:
void RenderBoxes(bool bHilite);
void RenderInitialize();
void DrawGrid();
- void CreateHTMLPieceList(FILE* f, int nStep, bool bImages, char* ext);
+ void CreateHTMLPieceList(FILE* f, int nStep, bool bImages, const char* ext);
inline bool IsDrawing()
{
diff --git a/common/str.cpp b/common/str.cpp
index c176f6e..c28a22c 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -197,7 +197,6 @@ bool String::Match(const String& Expression) const
}
else if (*p == '(')
{
- const char* Start = p;
int c = 0;
// Skip what's inside the parenthesis.
diff --git a/common/system.h b/common/system.h
index 0010bc6..cd79b10 100755
--- a/common/system.h
+++ b/common/system.h
@@ -98,7 +98,7 @@ void SystemUpdateCategories(bool SearchOnly);
void SystemInit();
void SystemFinish();
-int SystemDoMessageBox(char* prompt, int nMode);
+int SystemDoMessageBox(const char* prompt, int nMode);
bool SystemDoDialog(int nMode, void* param);
void SystemDoPopupMenu(int nMenu, int x, int y);
void SystemDoWaitCursor(int nCode);
diff --git a/iphone/system.cpp b/iphone/system.cpp
index 5aaf5c5..b6e41b2 100644
--- a/iphone/system.cpp
+++ b/iphone/system.cpp
@@ -169,7 +169,7 @@ void SystemFinish()
}
// FIXME: remove
-int SystemDoMessageBox(char* prompt, int mode)
+int SystemDoMessageBox(const char* prompt, int mode)
{
return Sys_MessageBox(prompt, "", mode);
}
diff --git a/linux/dialogs.cpp b/linux/dialogs.cpp
index 30ed729..cdbd650 100644
--- a/linux/dialogs.cpp
+++ b/linux/dialogs.cpp
@@ -294,7 +294,7 @@ static void filedlg_callback(GtkWidget *widget, gpointer data)
*cur_ret = LC_CANCEL;
}
-int filedlg_execute(char* caption, char* filename)
+int filedlg_execute(const char* caption, char* filename)
{
GtkWidget* dlg;
dlg = gtk_file_selection_new (caption);
@@ -2540,7 +2540,7 @@ typedef struct
void* data;
} LC_GROUPEDITDLG_STRUCT;
-
+/*
static void groupeditdlg_ok(GtkWidget *widget, gpointer data)
{
// LC_GROUPEDITDLG_STRUCT* s = (LC_GROUPEDITDLG_STRUCT*)data;
@@ -2548,7 +2548,7 @@ static void groupeditdlg_ok(GtkWidget *widget, gpointer data)
*cur_ret = LC_OK;
}
-
+*/
void groupeditdlg_addchildren(GtkWidget *tree, Group *pGroup, LC_GROUPEDITDLG_OPTS *opts)
{
#if 0
@@ -2826,21 +2826,21 @@ static void librarydlg_update_tree (GtkWidget *dlg)
PiecesLibrary *lib = g_App->GetPiecesLibrary();
GtkCTree *ctree = GTK_CTREE (gtk_object_get_data (GTK_OBJECT (dlg), "tree"));
GtkCTreeNode *parent;
- char *text = "Pieces";
+ const char *text = "Pieces";
gtk_clist_freeze (GTK_CLIST (ctree));
gtk_clist_clear (GTK_CLIST (ctree));
- parent = gtk_ctree_insert_node (ctree, NULL, NULL, &text, 0, NULL, NULL, NULL, NULL, FALSE, TRUE);
+ parent = gtk_ctree_insert_node (ctree, NULL, NULL, (gchar**)&text, 0, NULL, NULL, NULL, NULL, FALSE, TRUE);
for (int i = 0; i < lib->GetNumCategories(); i++)
{
text = lib->GetCategoryName(i);
- gtk_ctree_insert_node (ctree, parent, NULL, &text, 0, NULL, NULL, NULL, NULL, TRUE, TRUE);
+ gtk_ctree_insert_node (ctree, parent, NULL, (gchar**)&text, 0, NULL, NULL, NULL, NULL, TRUE, TRUE);
}
text = "Unassigned";
- gtk_ctree_insert_node (ctree, parent, NULL, &text, 0, NULL, NULL, NULL, NULL, TRUE, TRUE);
+ gtk_ctree_insert_node (ctree, parent, NULL, (gchar**)&text, 0, NULL, NULL, NULL, NULL, TRUE, TRUE);
gtk_clist_thaw (GTK_CLIST (ctree));
}
diff --git a/linux/dialogs.h b/linux/dialogs.h
index cf69fc3..1cacd8b 100644
--- a/linux/dialogs.h
+++ b/linux/dialogs.h
@@ -18,7 +18,7 @@ int openprojectdlg_execute (char* filename);
int saveprojectdlg_execute (char* filename);
int savepicturedlg_execute (void* param);
int msgbox_execute (const char* text, const char *caption, int flags);
-int filedlg_execute(char* caption, char* filename);
+int filedlg_execute(const char* caption, char* filename);
int arraydlg_execute(void* param);
int aboutdlg_execute(void* param);
int htmldlg_execute(void* param);
diff --git a/linux/system.cpp b/linux/system.cpp
index 4a613a2..3dae29e 100644
--- a/linux/system.cpp
+++ b/linux/system.cpp
@@ -512,7 +512,7 @@ void SystemUpdateSelected(unsigned long flags, int SelectedCount, Object* Focus)
gtk_widget_set_sensitive (item, (flags & LC_SEL_UNSELECTED) != 0);
item = GTK_WIDGET (gtk_object_get_data (GTK_OBJECT (((GtkWidget*)(*main_window))), "menu_edit_select_none"));
- gtk_widget_set_sensitive (item, flags & (LC_SEL_PIECE|LC_SEL_CAMERA|LC_SEL_LIGHT) != 0);
+ gtk_widget_set_sensitive (item, (flags & (LC_SEL_PIECE|LC_SEL_CAMERA|LC_SEL_LIGHT)) != 0);
item = GTK_WIDGET (gtk_object_get_data (GTK_OBJECT (((GtkWidget*)(*main_window))), "menu_edit_select_invert"));
gtk_widget_set_sensitive (item, (flags & LC_SEL_NO_PIECES) == 0);
item = GTK_WIDGET (gtk_object_get_data (GTK_OBJECT (((GtkWidget*)(*main_window))), "menu_edit_select_byname"));
@@ -610,9 +610,9 @@ void SystemFinish()
}
// FIXME: remove
-int SystemDoMessageBox(char* prompt, int mode)
+int SystemDoMessageBox(const char* prompt, int mode)
{
- return msgbox_execute (prompt, "LeoCAD", mode);
+ return msgbox_execute(prompt, "LeoCAD", mode);
}
bool SystemDoDialog(int mode, void* param)
diff --git a/macosx/system.cpp b/macosx/system.cpp
index afe0516..363734a 100644
--- a/macosx/system.cpp
+++ b/macosx/system.cpp
@@ -168,7 +168,7 @@ void SystemFinish()
}
// FIXME: remove
-int SystemDoMessageBox(char* prompt, int mode)
+int SystemDoMessageBox(const char* prompt, int mode)
{
return 0;
}
diff --git a/win/System.cpp b/win/System.cpp
index 652346a..a60a5ca 100644
--- a/win/System.cpp
+++ b/win/System.cpp
@@ -1128,21 +1128,16 @@ void SystemSetWindowCaption(char* caption)
AfxSetWindowText(AfxGetMainWnd()->m_hWnd, caption);
}
-int SystemDoMessageBox(char* prompt, int nMode)
+int SystemDoMessageBox(const char* prompt, int nMode)
{
return AfxMessageBox(prompt, nMode);
}
int Sys_MessageBox (const char* text, const char* caption, int type)
-
{
-
return AfxMessageBox(text, type);
-
}
-
-
extern BOOL AFXAPI AfxFullPath(LPTSTR lpszPathOut, LPCTSTR lpszFileIn);
bool SystemDoDialog(int nMode, void* param)