From: mattn <mattn@8a3a26a2-13c4-0310-b231-cf6edde360e5>
Date: Sat, 6 Sep 2008 08:35:17 +0000 (+0000)
Subject: * applied patch by StefanV (from mailinglist) that fixes an error in config.py (broke... 
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7d61328f5fbc9d236c26d4f1c421fe1fadeb22f1;p=xonotic%2Fnetradiant.git

* applied patch by StefanV (from mailinglist) that fixes an error in config.py (broke compilation) and some string conversion warnings
* fixes some more string conversions warnings in bobtoolz
* fixed unresolved symbols in bobtoolz and gtkgensurf (due to the above mentioned patch where the prototypes were not updated)


git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/trunk@320 8a3a26a2-13c4-0310-b231-cf6edde360e5
---

diff --git a/config.py b/config.py
index d3ff368f..b8c4856b 100644
--- a/config.py
+++ b/config.py
@@ -267,9 +267,9 @@ class Config:
 				self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) )
 
 	def Setup( self ):
-			if ( platform == 'local' ):
-				# special case, fetch external paks under the local install directory
-				self.FetchGamePaks( self.install_directory )
+		if ( platform == 'local' ):
+			# special case, fetch external paks under the local install directory
+			self.FetchGamePaks( self.install_directory )
 		# NOTE: unrelated to self.setup_platforms - grab support files and binaries and install them
 		if ( self.platform == 'Windows' ):
 			depsfile = 'GtkR-deps-1.6-3.zip'
@@ -292,7 +292,7 @@ class Config:
 				if ( ret != 0 ):
 					raise Exception( 'unzip dependencies file failed' )
 				os.chdir( backup_cwd )
-				
+
 				# copy all the dependent runtime data to the install directory
 				srcdir = os.path.dirname( backup_cwd )
 				for f in [
diff --git a/contrib/bkgrnd2d/plugin.cpp b/contrib/bkgrnd2d/plugin.cpp
index 3e43a745..3b5cc975 100644
--- a/contrib/bkgrnd2d/plugin.cpp
+++ b/contrib/bkgrnd2d/plugin.cpp
@@ -93,9 +93,9 @@ void DoBkgrndToggleYZ();
 #define NUM_TOOLBAR_BUTTONS 4
 struct toolbar_button_info_s
 {
-	char *image;
-	char *text;
-	char *tip;
+	const char *image;
+	const char *text;
+	const char *tip;
 	void (*func)();
 	IToolbarButton::EType type;
 };
diff --git a/contrib/bobtoolz/DEPair.cpp b/contrib/bobtoolz/DEPair.cpp
index 9d5da9d1..9ef8dc3d 100644
--- a/contrib/bobtoolz/DEPair.cpp
+++ b/contrib/bobtoolz/DEPair.cpp
@@ -42,7 +42,7 @@ DEPair::~DEPair()
 // Implementation
 //////////////////////////////////////////////////////////////////////
 
-void DEPair::Build(char *pKey, char *pValue)
+void DEPair::Build(const char *pKey, const char *pValue)
 {
   key = pKey;
   value = pValue;
diff --git a/contrib/bobtoolz/DEPair.h b/contrib/bobtoolz/DEPair.h
index 11f79045..41f86e48 100644
--- a/contrib/bobtoolz/DEPair.h
+++ b/contrib/bobtoolz/DEPair.h
@@ -28,13 +28,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #pragma once
 #endif // _MSC_VER > 1000
 
-class DEPair  
+class DEPair
 {
 public:
 	DEPair();
 	virtual ~DEPair();
 
-	void Build(char* pKey, char* pValue);
+	void Build(const char* pKey, const char* pValue);
 
 	Str	key;
 	Str	value;
diff --git a/contrib/bobtoolz/DEntity.cpp b/contrib/bobtoolz/DEntity.cpp
index 3719d20e..a0c44a89 100644
--- a/contrib/bobtoolz/DEntity.cpp
+++ b/contrib/bobtoolz/DEntity.cpp
@@ -135,7 +135,7 @@ bool DEntity::LoadFromPrt(char *filename)
 
 	ClearBrushes();
 	ClearEPairs();
-	
+
   bool build = false;
 	for(unsigned int i = 0; i < portals.node_count; i++)
 	{
@@ -144,7 +144,7 @@ bool DEntity::LoadFromPrt(char *filename)
 
 		for(unsigned int j = 0; j < portals.node[i].portal_count; j++)
 		{
-      for(unsigned int k = 0; k < portals.node[i].portal[j].point_count-2; k++) 
+      for(unsigned int k = 0; k < portals.node[i].portal[j].point_count-2; k++)
       {
 	      vec3_t v1, v2, normal, n;
 	      VectorSubtract(portals.node[i].portal[j].point[k+2].p, portals.node[i].portal[j].point[k+1].p, v1);
@@ -152,7 +152,7 @@ bool DEntity::LoadFromPrt(char *filename)
 	      CrossProduct(v1, v2, n);
         VectorNormalize(n, v2);
 
-        if(k == 0) 
+        if(k == 0)
         {
           VectorCopy(v2, normal);
         }
@@ -520,8 +520,8 @@ void DEntity::ClearEPairs()
 	epairList.clear();
 }
 
-void DEntity::AddEPair(char *key, char *value) {	
-	DEPair* newEPair; 
+void DEntity::AddEPair(const char *key, const char *value) {
+	DEPair* newEPair;
 	newEPair = FindEPairByKey( key );
 	if(!newEPair) {
 		newEPair = new DEPair;
@@ -539,14 +539,14 @@ void DEntity::LoadEPairList(epair_t *epl)
 	{
 		if(!strcmp(ep->key, "classname"))
 			SetClassname(ep->value);
-		else	
+		else
 			AddEPair(ep->key, ep->value);
 
 		ep = ep->next;
 	}
 }
 
-bool DEntity::ResetTextures(const char* textureName, float fScale[2],     float fShift[2],    int rotation, const char* newTextureName, 
+bool DEntity::ResetTextures(const char* textureName, float fScale[2],     float fShift[2],    int rotation, const char* newTextureName,
                             int bResetTextureName,    int bResetScale[2], int bResetShift[2], int bResetRotation, bool rebuild)
 {
 	g_FuncTable.m_pfnDeselectAllBrushes();
@@ -557,7 +557,7 @@ bool DEntity::ResetTextures(const char* textureName, float fScale[2],     float
 
 	for(list<DBrush *>::const_iterator resetBrush=brushList.begin(); resetBrush!=brushList.end(); resetBrush++)
 	{
-		bool tmp = (*resetBrush)->ResetTextures(textureName,        fScale,       fShift,       rotation, newTextureName, 
+		bool tmp = (*resetBrush)->ResetTextures(textureName,        fScale,       fShift,       rotation, newTextureName,
                                             bResetTextureName,  bResetScale,  bResetShift,  bResetRotation);
 
 		if(tmp)
@@ -566,7 +566,7 @@ bool DEntity::ResetTextures(const char* textureName, float fScale[2],     float
 
 			if(rebuild)
 			{
-        entity_t *pE = (*resetBrush)->QER_brush->owner;       
+        entity_t *pE = (*resetBrush)->QER_brush->owner;
 				g_FuncTable.m_pfnDeleteBrushHandle((*resetBrush)->QER_brush);
         (*resetBrush)->BuildInRadiant(FALSE, NULL, pE->entityId == 0 ? NULL : pE);
 
@@ -589,7 +589,7 @@ bool DEntity::ResetTextures(const char* textureName, float fScale[2],     float
 
 			  if(rebuild)
 			  {
-          entity_t *pE = (*resetPatch)->QER_brush->owner;       
+          entity_t *pE = (*resetPatch)->QER_brush->owner;
 				  g_FuncTable.m_pfnDeleteBrushHandle((*resetPatch)->QER_brush);
           (*resetPatch)->BuildInRadiant(pE->entityId == 0 ? NULL : pE);
 			  }
diff --git a/contrib/bobtoolz/DEntity.h b/contrib/bobtoolz/DEntity.h
index 63837c84..732703f0 100644
--- a/contrib/bobtoolz/DEntity.h
+++ b/contrib/bobtoolz/DEntity.h
@@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #pragma once
 #endif // _MSC_VER > 1000
 
-class DEntity  
+class DEntity
 {
 public:
 	void RemoveFromRadiant();
@@ -47,7 +47,7 @@ public:
 
 //	epair functions........
 	void LoadEPairList(epair_t* epl);
-	void AddEPair(char* key, char* value);
+	void AddEPair(const char* key, const char* value);
 	void ClearEPairs();
 	DEPair* FindEPairByKey(const char* keyname);
 //	---------------------------------------------
@@ -73,7 +73,7 @@ public:
 	bool* BuildDuplicateList();
 	bool* BuildIntersectList();
 //	---------------------------------------------
-	
+
 
 //	brush operations
 	void ClearBrushes();	// clears brush list and frees memory for brushes
diff --git a/contrib/bobtoolz/DMap.cpp b/contrib/bobtoolz/DMap.cpp
index bc0b0661..0bbaafb8 100644
--- a/contrib/bobtoolz/DMap.cpp
+++ b/contrib/bobtoolz/DMap.cpp
@@ -40,7 +40,7 @@ DMap::~DMap()
 	ClearEntities();
 }
 
-DEntity* DMap::AddEntity(char *classname, int ID)
+DEntity* DMap::AddEntity(const char *classname, int ID)
 {
 	DEntity* newEntity;
 	if(ID == -1)
@@ -49,7 +49,7 @@ DEntity* DMap::AddEntity(char *classname, int ID)
 		newEntity = new DEntity(classname, ID);
 
 	entityList.push_back(newEntity);
-	
+
 	return newEntity;
 }
 
@@ -131,7 +131,7 @@ int DMap::FixBrushes(bool rebuild)
 		else
 		{
 			cnt = (*fixEntity)->FixBrushes(FALSE);
-			
+
 			if(cnt && rebuild)
 				RebuildEntity(*fixEntity);
 		}
@@ -142,21 +142,21 @@ int DMap::FixBrushes(bool rebuild)
 	return count;
 }
 
-void DMap::ResetTextures( const char* textureName, float fScale[2],      float fShift[2],      int rotation, const char* newTextureName, 
+void DMap::ResetTextures( const char* textureName, float fScale[2],      float fShift[2],      int rotation, const char* newTextureName,
                           int bResetTextureName,  int bResetScale[2],  int bResetShift[2],  int bResetRotation)
 {
 	for(list<DEntity *>::const_iterator texEntity=entityList.begin(); texEntity!=entityList.end(); texEntity++)
 	{
 		if(!stricmp("worldspawn", (*texEntity)->m_Classname))
-			(*texEntity)->ResetTextures(textureName,        fScale,       fShift,       rotation, newTextureName, 
+			(*texEntity)->ResetTextures(textureName,        fScale,       fShift,       rotation, newTextureName,
                                   bResetTextureName,  bResetScale,  bResetShift,  bResetRotation, TRUE);
 		else
 		{
-			if((*texEntity)->ResetTextures( textureName,        fScale,       fShift,       rotation, newTextureName, 
+			if((*texEntity)->ResetTextures( textureName,        fScale,       fShift,       rotation, newTextureName,
                                       bResetTextureName,  bResetScale,  bResetShift,  bResetRotation, FALSE))
 				RebuildEntity(*texEntity);
 		}
-	}	
+	}
 }
 
 void DMap::RebuildEntity(DEntity *ent)
diff --git a/contrib/bobtoolz/DMap.h b/contrib/bobtoolz/DMap.h
index 2d572114..b63cafd6 100644
--- a/contrib/bobtoolz/DMap.h
+++ b/contrib/bobtoolz/DMap.h
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #pragma once
 #endif // _MSC_VER > 1000
 
-class DMap  
+class DMap
 {
 public:
 	static void RebuildEntity(DEntity* ent);
@@ -43,7 +43,7 @@ public:
 	void ClearEntities();
 
 	DEntity* DMap::GetEntityForID(int ID);
-	DEntity* AddEntity(char* classname = "worldspawn", int ID = -1);
+	DEntity* AddEntity(const char* classname = "worldspawn", int ID = -1);
 
 	list<DEntity*> entityList;
 
diff --git a/contrib/bobtoolz/bobToolz-GTK.cpp b/contrib/bobtoolz/bobToolz-GTK.cpp
index e0db8f36..d824df54 100644
--- a/contrib/bobtoolz/bobToolz-GTK.cpp
+++ b/contrib/bobtoolz/bobToolz-GTK.cpp
@@ -36,10 +36,10 @@ _QERUITable					  g_MessageTable;			// for path plotting (listening for update)
 _QEREntityTable			  g_EntityTable;
 
 // plugin name
-char* PLUGIN_NAME = "bobToolz";
+const char* PLUGIN_NAME = "bobToolz";
 
 // commands in the menu
-static char* PLUGIN_COMMANDS = "About...,-,Reset Textures...,PitOMatic,-,Vis Viewer,Brush Cleanup,Polygon Builder,Caulk Selection,-,Tree Planter,Drop Entity,Plot Splines,-,Merge Patches,Split patches,Turn edge";
+static const char* PLUGIN_COMMANDS = "About...,-,Reset Textures...,PitOMatic,-,Vis Viewer,Brush Cleanup,Polygon Builder,Caulk Selection,-,Tree Planter,Drop Entity,Plot Splines,-,Merge Patches,Split patches,Turn edge";
 
 // globals
 GtkWidget *g_pRadiantWnd = NULL;
@@ -108,14 +108,14 @@ GtkWidget* new_pixmap (char* filename) {
 	GdkBitmap *mask;
 	GtkWidget *pixmap;
 
-	g_FuncTable.m_pfnLoadBitmap(filename, (void **)&gdkpixmap, (void **)&mask);	
+	g_FuncTable.m_pfnLoadBitmap(filename, (void **)&gdkpixmap, (void **)&mask);
 	pixmap = gtk_pixmap_new (gdkpixmap, mask);
 
 	gdk_pixmap_unref (gdkpixmap);
 	gdk_pixmap_unref (mask);
 
 	return pixmap;
-} 
+}
 
 class CBobtoolzToolbarButton : public IToolbarButton
 {
@@ -140,7 +140,7 @@ public:
     switch( mIndex ) {
       case 3: return eToggleButton;
       default: return eButton;
-    }    
+    }
   }
   virtual const char* getText() const
   {
@@ -210,7 +210,7 @@ public:
   // CSynapseClient API
   bool RequestAPI(APIDescriptor_t *pAPI);
   const char* GetInfo();
-  
+
   CSynapseClientBobtoolz() { }
   virtual ~CSynapseClientBobtoolz() { }
 };
@@ -234,7 +234,7 @@ extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const
   g_pSynapseServer = pServer;
   g_pSynapseServer->IncRef();
   Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf());
-    
+
   g_SynapseClient.AddAPI(TOOLBAR_MAJOR, BOBTOOLZ_MINOR, sizeof(_QERPlugToolbarTable));
   g_SynapseClient.AddAPI(PLUGIN_MAJOR, BOBTOOLZ_MINOR, sizeof(_QERPluginTable));
 
diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp
index 38520003..83b656f2 100644
--- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp
+++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp
@@ -161,7 +161,7 @@ bool ValidateTextFloatRange(const char* pData, float min, float max, char* error
 	return FALSE;
 }
 
-bool ValidateTextIntRange(const char* pData, int min, int max, char* error_title, int* value)
+bool ValidateTextIntRange(const char* pData, int min, int max, const char* error_title, int* value)
 {
 	char error_buffer[256];
 	sprintf(error_buffer, "Please Enter An Integer Between %i and %i", min, max);
diff --git a/contrib/bobtoolz/misc.cpp b/contrib/bobtoolz/misc.cpp
index 9786661a..a0490b46 100644
--- a/contrib/bobtoolz/misc.cpp
+++ b/contrib/bobtoolz/misc.cpp
@@ -117,7 +117,7 @@ void SetInitialStairPos(int dir, vec3_t min, vec3_t max, float width)
 	}
 }
 
-char* TranslateString (char *buf)
+char* TranslateString (const char *buf)
 {
 	static	char	buf2[32768];
 	int		i, l;
@@ -140,7 +140,7 @@ char* TranslateString (char *buf)
 	return buf2;
 }
 
-void Sys_ERROR (char* text, ...)
+void Sys_ERROR (const char* text, ...)
 {
 	va_list argptr;
 	char	buf[32768];
@@ -191,7 +191,7 @@ const char* ExtractFilename(const char* path)
 	return ++p;
 }
 
-extern char* PLUGIN_NAME;
+extern const char* PLUGIN_NAME;
 /*char* GetGameFilename(char* buffer, const char* filename)
 {
 	strcpy(buffer, g_FuncTable.m_pfnGetGamePath());
diff --git a/contrib/bobtoolz/misc.h b/contrib/bobtoolz/misc.h
index 7ccb4599..fb1fe8b9 100644
--- a/contrib/bobtoolz/misc.h
+++ b/contrib/bobtoolz/misc.h
@@ -26,7 +26,7 @@ const char* GetCurrentTexture();
 
 void FillDefaultTexture(_QERFaceData* faceData, vec3_t va, vec3_t vb, vec3_t vc, const char* texture);
 
-void Sys_ERROR (char* text, ...);
+void Sys_ERROR (const char* text, ...);
 
 void BuildMiniPrt(list<Str>* exclusionList);
 
diff --git a/contrib/gtkgensurf/dec.cpp b/contrib/gtkgensurf/dec.cpp
index f2daa816..e651d741 100644
--- a/contrib/gtkgensurf/dec.cpp
+++ b/contrib/gtkgensurf/dec.cpp
@@ -47,7 +47,7 @@ void MakeDecimatedMap(int *NumNodes, int *NumTris, NODE **pNode, TRI **pTri)
 	int Bisect(NODE *, int, int, int);
 	void CalcAngles(NODE *, int *, float *);
 	void EdgeOnSide(int *, int *, int *);
-	int tricall(int, NODE *, int *, TRI **, TRI **, char *);
+	int tricall(int, NODE *, int *, TRI **, TRI **, const char *);
 	int CheckBorders(int *,int,NODE *,int *,TRI **);
 
 	float       biggesterror;
@@ -195,7 +195,7 @@ void MakeDecimatedMap(int *NumNodes, int *NumTris, NODE **pNode, TRI **pTri)
 			Tri = *pTri;
 			// Sliver-check along borders. Since borders are often linear, the errors
 			// along borders will often be zero, so no new points will be added. This
-			// tends to produce long, thin brushes. For all border triangles, check 
+			// tends to produce long, thin brushes. For all border triangles, check
 			// that minimum angle isn't less than SLIVER_ANGLE. If it is, add another
 			// vertex.
 			while(CheckBorders(&NumNodesUsed,NumNodes[0],Node,NumTris,pTri) > 0)
@@ -323,9 +323,8 @@ void MakeDecimatedMap(int *NumNodes, int *NumTris, NODE **pNode, TRI **pTri)
 /*  tricall Takes an array of nodes, spits out an array of triangles         */
 /*                                                                           */
 /*****************************************************************************/
-int tricall(int NumNodes, NODE *Node, int *NumTris, TRI **inTri, TRI **Tri, LPSTR Options)
+int tricall(int NumNodes, NODE *Node, int *NumTris, TRI **inTri, TRI **Tri, const char *Options)
 {
-
 	struct triangulateio in, out;
 	int    i, N;
 	int    NumUsedNodes;
@@ -426,18 +425,18 @@ int tricall(int NumNodes, NODE *Node, int *NumTris, TRI **inTri, TRI **Tri, LPST
 
 	/* Make necessary initializations */
 	out.pointlist          = (REAL *) NULL;  /* Not needed if -N switch used. */
-	out.pointattributelist = (REAL *) NULL;  /* Not needed if -N switch used or 
+	out.pointattributelist = (REAL *) NULL;  /* Not needed if -N switch used or
 	                                            number of point attributes is zero: */
 	out.pointmarkerlist    = (int *) NULL;   /* Not needed if -N or -B switch used. */
 	out.trianglelist       = (int *) NULL;   /* Not needed if -E switch used. */
-	out.triangleattributelist = (REAL *) NULL;   /* Not needed if -E switch used or 
-	                                                number of triangle attributes is 
+	out.triangleattributelist = (REAL *) NULL;   /* Not needed if -E switch used or
+	                                                number of triangle attributes is
                                                     zero: */
 	out.trianglearealist   = (REAL *) NULL;
 	out.neighborlist       = (int *) NULL;   /* Needed only if -n switch used. */
-	out.segmentlist        = (int *) NULL;   /* Needed only if segments are output 
+	out.segmentlist        = (int *) NULL;   /* Needed only if segments are output
 	                                            (-p or -c) and -P not used: */
-	out.segmentmarkerlist  = (int *) NULL;   /* Needed only if segments are output 
+	out.segmentmarkerlist  = (int *) NULL;   /* Needed only if segments are output
 	                                            (-p or -c) and -P and -B not used: */
 	out.edgelist           = (int *) NULL;   /* Needed only if -e switch used. */
 	out.edgemarkerlist     = (int *) NULL;   /* Needed if -e used and -B not used. */
@@ -715,7 +714,7 @@ void MakeBrushes(int NumTris, NODE *Node, TRI *Tri,bool surf,
 		if(UseDetail) contents += CONTENTS_DETAIL;
 		if(UseLadder) contents += CONTENTS_LADDER;
 	}
-	
+
 	OpenFuncGroup();
 	for(i=0; i<NumTris; i++)
 	{
@@ -725,11 +724,11 @@ void MakeBrushes(int NumTris, NODE *Node, TRI *Tri,bool surf,
 		brush.face[0].v[0][0] = Node[Tri[i].v[0]].p[0];
 		brush.face[0].v[0][1] = Node[Tri[i].v[0]].p[1];
 		brush.face[0].v[0][2] = Node[Tri[i].v[0]].p[2];
-		
+
 		brush.face[0].v[1][0] = Node[Tri[i].v[2]].p[0];
 		brush.face[0].v[1][1] = Node[Tri[i].v[2]].p[1];
 		brush.face[0].v[1][2] = Node[Tri[i].v[2]].p[2];
-		
+
 		brush.face[0].v[2][0] = Node[Tri[i].v[1]].p[0];
 		brush.face[0].v[2][1] = Node[Tri[i].v[1]].p[1];
 		brush.face[0].v[2][2] = Node[Tri[i].v[1]].p[2];
@@ -778,50 +777,50 @@ void MakeBrushes(int NumTris, NODE *Node, TRI *Tri,bool surf,
 			brush.face[1].v[0][0] = Node[Tri[i].v[0]].p[0];
 			brush.face[1].v[0][1] = (float)backface;
 			brush.face[1].v[0][2] = Node[Tri[i].v[0]].p[2];
-			
+
 			brush.face[1].v[1][0] = Node[Tri[i].v[1]].p[0];
 			brush.face[1].v[1][1] = (float)backface;
 			brush.face[1].v[1][2] = Node[Tri[i].v[1]].p[2];
-			
+
 			brush.face[1].v[2][0] = Node[Tri[i].v[2]].p[0];
 			brush.face[1].v[2][1] = (float)backface;
 			brush.face[1].v[2][2] = Node[Tri[i].v[2]].p[2];
-			
+
 			// 0-1 side
 			brush.face[2].v[0][0] = Node[Tri[i].v[0]].p[0];
 			brush.face[2].v[0][1] = Node[Tri[i].v[0]].p[1];
 			brush.face[2].v[0][2] = Node[Tri[i].v[0]].p[2];
-			
+
 			brush.face[2].v[1][0] = Node[Tri[i].v[1]].p[0];
 			brush.face[2].v[1][1] = Node[Tri[i].v[1]].p[1];
 			brush.face[2].v[1][2] = Node[Tri[i].v[1]].p[2];
-			
+
 			brush.face[2].v[2][0] = Node[Tri[i].v[1]].p[0];
 			brush.face[2].v[2][1] = (float)backface;
 			brush.face[2].v[2][2] = Node[Tri[i].v[1]].p[2];
-			
+
 			// 1-2 side
 			brush.face[3].v[0][0] = Node[Tri[i].v[1]].p[0];
 			brush.face[3].v[0][1] = Node[Tri[i].v[1]].p[1];
 			brush.face[3].v[0][2] = Node[Tri[i].v[1]].p[2];
-			
+
 			brush.face[3].v[1][0] = Node[Tri[i].v[2]].p[0];
 			brush.face[3].v[1][1] = Node[Tri[i].v[2]].p[1];
 			brush.face[3].v[1][2] = Node[Tri[i].v[2]].p[2];
-			
+
 			brush.face[3].v[2][0] = Node[Tri[i].v[2]].p[0];
 			brush.face[3].v[2][1] = (float)backface;
 			brush.face[3].v[2][2] = Node[Tri[i].v[2]].p[2];
-			
+
 			// 2-0 side
 			brush.face[4].v[0][0] = Node[Tri[i].v[2]].p[0];
 			brush.face[4].v[0][1] = Node[Tri[i].v[2]].p[1];
 			brush.face[4].v[0][2] = Node[Tri[i].v[2]].p[2];
-			
+
 			brush.face[4].v[1][0] = Node[Tri[i].v[0]].p[0];
 			brush.face[4].v[1][1] = Node[Tri[i].v[0]].p[1];
 			brush.face[4].v[1][2] = Node[Tri[i].v[0]].p[2];
-			
+
 			brush.face[4].v[2][0] = Node[Tri[i].v[0]].p[0];
 			brush.face[4].v[2][1] = (float)backface;
 			brush.face[4].v[2][2] = Node[Tri[i].v[0]].p[2];
@@ -832,50 +831,50 @@ void MakeBrushes(int NumTris, NODE *Node, TRI *Tri,bool surf,
 			brush.face[1].v[0][0] = (float)backface;
 			brush.face[1].v[0][1] = Node[Tri[i].v[0]].p[1];
 			brush.face[1].v[0][2] = Node[Tri[i].v[0]].p[2];
-			
+
 			brush.face[1].v[1][0] = (float)backface;
 			brush.face[1].v[1][1] = Node[Tri[i].v[1]].p[1];
 			brush.face[1].v[1][2] = Node[Tri[i].v[1]].p[2];
-			
+
 			brush.face[1].v[2][0] = (float)backface;
 			brush.face[1].v[2][1] = Node[Tri[i].v[2]].p[1];
 			brush.face[1].v[2][2] = Node[Tri[i].v[2]].p[2];
-			
+
 			// 0-1 side
 			brush.face[2].v[0][0] = Node[Tri[i].v[0]].p[0];
 			brush.face[2].v[0][1] = Node[Tri[i].v[0]].p[1];
 			brush.face[2].v[0][2] = Node[Tri[i].v[0]].p[2];
-			
+
 			brush.face[2].v[1][0] = Node[Tri[i].v[1]].p[0];
 			brush.face[2].v[1][1] = Node[Tri[i].v[1]].p[1];
 			brush.face[2].v[1][2] = Node[Tri[i].v[1]].p[2];
-			
+
 			brush.face[2].v[2][0] = (float)backface;
 			brush.face[2].v[2][1] = Node[Tri[i].v[1]].p[1];
 			brush.face[2].v[2][2] = Node[Tri[i].v[1]].p[2];
-			
+
 			// 1-2 side
 			brush.face[3].v[0][0] = Node[Tri[i].v[1]].p[0];
 			brush.face[3].v[0][1] = Node[Tri[i].v[1]].p[1];
 			brush.face[3].v[0][2] = Node[Tri[i].v[1]].p[2];
-			
+
 			brush.face[3].v[1][0] = Node[Tri[i].v[2]].p[0];
 			brush.face[3].v[1][1] = Node[Tri[i].v[2]].p[1];
 			brush.face[3].v[1][2] = Node[Tri[i].v[2]].p[2];
-			
+
 			brush.face[3].v[2][0] = (float)backface;
 			brush.face[3].v[2][1] = Node[Tri[i].v[2]].p[1];
 			brush.face[3].v[2][2] = Node[Tri[i].v[2]].p[2];
-			
+
 			// 2-0 side
 			brush.face[4].v[0][0] = Node[Tri[i].v[2]].p[0];
 			brush.face[4].v[0][1] = Node[Tri[i].v[2]].p[1];
 			brush.face[4].v[0][2] = Node[Tri[i].v[2]].p[2];
-			
+
 			brush.face[4].v[1][0] = Node[Tri[i].v[0]].p[0];
 			brush.face[4].v[1][1] = Node[Tri[i].v[0]].p[1];
 			brush.face[4].v[1][2] = Node[Tri[i].v[0]].p[2];
-			
+
 			brush.face[4].v[2][0] = (float)backface;
 			brush.face[4].v[2][1] = Node[Tri[i].v[0]].p[1];
 			brush.face[4].v[2][2] = Node[Tri[i].v[0]].p[2];
@@ -885,55 +884,55 @@ void MakeBrushes(int NumTris, NODE *Node, TRI *Tri,bool surf,
 			brush.face[1].v[0][0] = Node[Tri[i].v[0]].p[0];
 			brush.face[1].v[0][1] = Node[Tri[i].v[0]].p[1];
 			brush.face[1].v[0][2] = (float)backface;
-			
+
 			brush.face[1].v[1][0] = Node[Tri[i].v[1]].p[0];
 			brush.face[1].v[1][1] = Node[Tri[i].v[1]].p[1];
 			brush.face[1].v[1][2] = (float)backface;
-			
+
 			brush.face[1].v[2][0] = Node[Tri[i].v[2]].p[0];
 			brush.face[1].v[2][1] = Node[Tri[i].v[2]].p[1];
 			brush.face[1].v[2][2] = (float)backface;
-			
+
 			// 0-1 side
 			brush.face[2].v[0][0] = Node[Tri[i].v[0]].p[0];
 			brush.face[2].v[0][1] = Node[Tri[i].v[0]].p[1];
 			brush.face[2].v[0][2] = Node[Tri[i].v[0]].p[2];
-			
+
 			brush.face[2].v[1][0] = Node[Tri[i].v[1]].p[0];
 			brush.face[2].v[1][1] = Node[Tri[i].v[1]].p[1];
 			brush.face[2].v[1][2] = Node[Tri[i].v[1]].p[2];
-			
+
 			brush.face[2].v[2][0] = Node[Tri[i].v[1]].p[0];
 			brush.face[2].v[2][1] = Node[Tri[i].v[1]].p[1];
 			brush.face[2].v[2][2] = (float)backface;
-			
+
 			// 1-2 side
 			brush.face[3].v[0][0] = Node[Tri[i].v[1]].p[0];
 			brush.face[3].v[0][1] = Node[Tri[i].v[1]].p[1];
 			brush.face[3].v[0][2] = Node[Tri[i].v[1]].p[2];
-			
+
 			brush.face[3].v[1][0] = Node[Tri[i].v[2]].p[0];
 			brush.face[3].v[1][1] = Node[Tri[i].v[2]].p[1];
 			brush.face[3].v[1][2] = Node[Tri[i].v[2]].p[2];
-			
+
 			brush.face[3].v[2][0] = Node[Tri[i].v[2]].p[0];
 			brush.face[3].v[2][1] = Node[Tri[i].v[2]].p[1];
 			brush.face[3].v[2][2] = (float)backface;
-			
+
 			// 2-0 side
 			brush.face[4].v[0][0] = Node[Tri[i].v[2]].p[0];
 			brush.face[4].v[0][1] = Node[Tri[i].v[2]].p[1];
 			brush.face[4].v[0][2] = Node[Tri[i].v[2]].p[2];
-			
+
 			brush.face[4].v[1][0] = Node[Tri[i].v[0]].p[0];
 			brush.face[4].v[1][1] = Node[Tri[i].v[0]].p[1];
 			brush.face[4].v[1][2] = Node[Tri[i].v[0]].p[2];
-			
+
 			brush.face[4].v[2][0] = Node[Tri[i].v[0]].p[0];
 			brush.face[4].v[2][1] = Node[Tri[i].v[0]].p[1];
 			brush.face[4].v[2][2] = (float)backface;
 		}
-		
+
 		for(j=0; j<5; j++)
 		{
 			strcpy(brush.face[j].texture,
@@ -1052,10 +1051,10 @@ void MapOut(int NumNodes,int NumTris, NODE *Node, TRI *Tri)
 		default:
 			front  = MoreThan(zmax,32.);
 		}
-		
+
 		for(i=0; i<NumTris; i++)
 			Tri[i].flag = 0;
-		
+
 		switch(Plane)
 		{
 		case PLANE_XZ0:
@@ -1075,7 +1074,7 @@ void MapOut(int NumNodes,int NumTris, NODE *Node, TRI *Tri)
 			j1 = 0;
 			j2 = 1;
 		}
-		
+
 		brush.Number = 0;
 		brush.NumFaces = 6;
 		MaxHints = NH*NV-1;
@@ -1131,41 +1130,41 @@ void MapOut(int NumNodes,int NumTris, NODE *Node, TRI *Tri)
 							brush.face[0].v[0][0] = Node[q[2]].p[0];
 							brush.face[0].v[0][1] = (float)front;
 							brush.face[0].v[0][2] = Node[q[2]].p[2];
-							
+
 							brush.face[0].v[1][0] = Node[q[1]].p[0];
 							brush.face[0].v[1][1] = (float)front;
 							brush.face[0].v[1][2] = Node[q[1]].p[2];
-							
+
 							brush.face[0].v[2][0] = Node[q[0]].p[0];
 							brush.face[0].v[2][1] = (float)front;
 							brush.face[0].v[2][2] = Node[q[0]].p[2];
-							
+
 							// back
 							brush.face[1].v[0][0] = Node[q[0]].p[0];
 							brush.face[1].v[0][1] = (float)backface;
 							brush.face[1].v[0][2] = Node[q[0]].p[2];
-							
+
 							brush.face[1].v[1][0] = Node[q[1]].p[0];
 							brush.face[1].v[1][1] = (float)backface;
 							brush.face[1].v[1][2] = Node[q[1]].p[2];
-							
+
 							brush.face[1].v[2][0] = Node[q[2]].p[0];
 							brush.face[1].v[2][1] = (float)backface;
 							brush.face[1].v[2][2] = Node[q[2]].p[2];
-							
+
 							for(k0=0; k0<brush.NumFaces-2; k0++)
 							{
 								k =k0+2;
 								k1=(k0+1) % (brush.NumFaces-2);
-								
+
 								brush.face[k].v[0][0] = Node[q[k0]].p[0];
 								brush.face[k].v[0][1] = (float)front;
 								brush.face[k].v[0][2] = Node[q[k0]].p[2];
-								
+
 								brush.face[k].v[1][0] = Node[q[k1]].p[0];
 								brush.face[k].v[1][1] = (float)front;
 								brush.face[k].v[1][2] = Node[q[k1]].p[2];
-								
+
 								brush.face[k].v[2][0] = Node[q[k1]].p[0];
 								brush.face[k].v[2][1] = (float)backface;
 								brush.face[k].v[2][2] = Node[q[k1]].p[2];
@@ -1177,41 +1176,41 @@ void MapOut(int NumNodes,int NumTris, NODE *Node, TRI *Tri)
 							brush.face[0].v[0][0] = (float)front;
 							brush.face[0].v[0][1] = Node[q[2]].p[1];
 							brush.face[0].v[0][2] = Node[q[2]].p[2];
-							
+
 							brush.face[0].v[1][0] = (float)front;
 							brush.face[0].v[1][1] = Node[q[1]].p[1];
 							brush.face[0].v[1][2] = Node[q[1]].p[2];
-							
+
 							brush.face[0].v[2][0] = (float)front;
 							brush.face[0].v[2][1] = Node[q[0]].p[1];
 							brush.face[0].v[2][2] = Node[q[0]].p[2];
-							
+
 							// back
 							brush.face[1].v[0][0] = (float)backface;
 							brush.face[1].v[0][1] = Node[q[0]].p[1];
 							brush.face[1].v[0][2] = Node[q[0]].p[2];
-							
+
 							brush.face[1].v[1][0] = (float)backface;
 							brush.face[1].v[1][1] = Node[q[1]].p[1];
 							brush.face[1].v[1][2] = Node[q[1]].p[2];
-							
+
 							brush.face[1].v[2][0] = (float)backface;
 							brush.face[1].v[2][1] = Node[q[2]].p[1];
 							brush.face[1].v[2][2] = Node[q[2]].p[2];
-							
+
 							for(k0=0; k0<brush.NumFaces-2; k0++)
 							{
 								k =k0+2;
 								k1=(k0+1) % (brush.NumFaces-2);
-								
+
 								brush.face[k].v[0][0] = (float)front;
 								brush.face[k].v[0][1] = Node[q[k0]].p[1];
 								brush.face[k].v[0][2] = Node[q[k0]].p[2];
-								
+
 								brush.face[k].v[1][0] = (float)front;
 								brush.face[k].v[1][1] = Node[q[k1]].p[1];
 								brush.face[k].v[1][2] = Node[q[k1]].p[2];
-								
+
 								brush.face[k].v[2][0] = (float)backface;
 								brush.face[k].v[2][1] = Node[q[k1]].p[1];
 								brush.face[k].v[2][2] = Node[q[k1]].p[2];
@@ -1222,41 +1221,41 @@ void MapOut(int NumNodes,int NumTris, NODE *Node, TRI *Tri)
 							brush.face[0].v[0][0] = Node[q[2]].p[0];
 							brush.face[0].v[0][1] = Node[q[2]].p[1];
 							brush.face[0].v[0][2] = (float)front;
-							
+
 							brush.face[0].v[1][0] = Node[q[1]].p[0];
 							brush.face[0].v[1][1] = Node[q[1]].p[1];
 							brush.face[0].v[1][2] = (float)front;
-							
+
 							brush.face[0].v[2][0] = Node[q[0]].p[0];
 							brush.face[0].v[2][1] = Node[q[0]].p[1];
 							brush.face[0].v[2][2] = (float)front;
-							
+
 							// back
 							brush.face[1].v[0][0] = Node[q[0]].p[0];
 							brush.face[1].v[0][1] = Node[q[0]].p[1];
 							brush.face[1].v[0][2] = (float)backface;
-							
+
 							brush.face[1].v[1][0] = Node[q[1]].p[0];
 							brush.face[1].v[1][1] = Node[q[1]].p[1];
 							brush.face[1].v[1][2] = (float)backface;
-							
+
 							brush.face[1].v[2][0] = Node[q[2]].p[0];
 							brush.face[1].v[2][1] = Node[q[2]].p[1];
 							brush.face[1].v[2][2] = (float)backface;
-							
+
 							for(k0=0; k0<brush.NumFaces-2; k0++)
 							{
 								k =k0+2;
 								k1=(k0+1) % (brush.NumFaces-2);
-								
+
 								brush.face[k].v[0][0] = Node[q[k0]].p[0];
 								brush.face[k].v[0][1] = Node[q[k0]].p[1];
 								brush.face[k].v[0][2] = (float)front;
-								
+
 								brush.face[k].v[1][0] = Node[q[k1]].p[0];
 								brush.face[k].v[1][1] = Node[q[k1]].p[1];
 								brush.face[k].v[1][2] = (float)front;
-								
+
 								brush.face[k].v[2][0] = Node[q[k1]].p[0];
 								brush.face[k].v[2][1] = Node[q[k1]].p[1];
 								brush.face[k].v[2][2] = (float)backface;
diff --git a/contrib/gtkgensurf/font.cpp b/contrib/gtkgensurf/font.cpp
index 081a83d4..17a557ec 100644
--- a/contrib/gtkgensurf/font.cpp
+++ b/contrib/gtkgensurf/font.cpp
@@ -176,7 +176,7 @@ void texfont_init ()
 
   int i, j, x, y;
   float inv = 1.0f/128;
-  char *charlines[16] = { 
+  const char *charlines[16] = {
     "abcdefghijklmn", "opqrstuvwxyz0", "123456789ABC", "DEFGHIJKLMN", 
     "OPQRSTUVWX", "YZ,.!;:<>/?{}@$%", "&*()-+=_[] #" };
   unsigned char lefts[7][17] = { 
diff --git a/contrib/gtkgensurf/gendlgs.cpp b/contrib/gtkgensurf/gendlgs.cpp
index 207f6b07..8756f037 100644
--- a/contrib/gtkgensurf/gendlgs.cpp
+++ b/contrib/gtkgensurf/gendlgs.cpp
@@ -1393,10 +1393,10 @@ GtkWidget* create_main_dialog ()
   GtkObject *adj;
   GSList *group;
   int i;
-  char *games[] = { "Quake 2", "Half-Life", "SiN", "Heretic 2", "Kingpin", "Genesis3D", "Quake 3 Arena" };
-  char *waveforms[] = { "Alternating hill/valley", "Cylindrical left-to-right", "Cylindrical top-to-bottom",
+  const char *games[] = { "Quake 2", "Half-Life", "SiN", "Heretic 2", "Kingpin", "Genesis3D", "Quake 3 Arena" };
+  const char *waveforms[] = { "Alternating hill/valley", "Cylindrical left-to-right", "Cylindrical top-to-bottom",
                         "From bitmap", "Fractal" };
-  char *orientations[] = { "Ground surface", "Ceiling", "Wall facing 0", "Wall facing 90",
+  const char *orientations[] = { "Ground surface", "Ceiling", "Wall facing 0", "Wall facing 90",
                            "Wall facing 180","Wall facing 270" };
 
   g_pWnd = dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL);
diff --git a/contrib/gtkgensurf/gensurf.cpp b/contrib/gtkgensurf/gensurf.cpp
index 65f90088..5803b33f 100644
--- a/contrib/gtkgensurf/gensurf.cpp
+++ b/contrib/gtkgensurf/gensurf.cpp
@@ -321,7 +321,7 @@ varargs versions of all text functions.
 FIXME: make this buffer size safe someday
 ============
 */
-char *va (char *format, ...)
+char *va (const char *format, ...)
 {
   va_list argptr;
   static char string[1024];
diff --git a/radiant/pluginmanager.cpp b/radiant/pluginmanager.cpp
index 021531ac..01ef70fa 100644
--- a/radiant/pluginmanager.cpp
+++ b/radiant/pluginmanager.cpp
@@ -48,7 +48,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "version.h"
 
 CRadiantImageManager g_ImageManager;
-CRadiantPluginManager g_PluginsManager;    
+CRadiantPluginManager g_PluginsManager;
 
 _QERPlugSurfaceTable g_SurfaceTable;
 _QERFileSystemTable g_FileSystemTable;
@@ -127,7 +127,7 @@ void InitFileTypes()
 
   GetFileTypeRegistry()->addType(MAP_MAJOR, g_pattern_mapq3);
   GetFileTypeRegistry()->addType(MAP_MAJOR, g_pattern_mapxml);
-  
+
   GetFileTypeRegistry()->addType("region", g_pattern_regq3);
 /*
   GetFileTypeRegistry()->addType(MODEL_MAJOR, g_pattern_modelmd3);
@@ -282,7 +282,7 @@ public:
         return &elem->m_model;
       }
     }
-    
+
     elem = new CModelWrapper(id, version);
     g_ptr_array_add(m_ptrs, elem);
 
@@ -327,7 +327,7 @@ public:
     }
     mAPIs.clear();
   }
-  
+
   // CSynapseAPIManager interface -------------------
   APIDescriptor_t* BuildRequireAPI(APIDescriptor_t* pAPI)
   {
@@ -346,7 +346,7 @@ public:
     for(i=mAPIs.begin(); i!=mAPIs.end(); i++)
       AddItem((_QERPlugToolbarTable*)(*i)->mpTable);
   }
-  
+
 private:
 
   void AddItem(_QERPlugToolbarTable* pTable)
@@ -423,7 +423,7 @@ void CRadiantImageManager::LoadImage(const char *name, byte **pic, int *width, i
     }
     return;
   }
-  
+
   // start walking the interfaces
   list<CImageTableSlot *>::iterator iSlot;
   for(iSlot = mSlots.begin(); iSlot != mSlots.end(); iSlot++)
@@ -456,7 +456,7 @@ const char* CRadiantImageManager::GetNextExtension()
 
 /* plugin manager --------------------------------------- */
 APIDescriptor_t* CRadiantPluginManager::BuildRequireAPI(APIDescriptor_t *pAPI)
-{  
+{
   CPluginSlot *pSlot = new CPluginSlot(pAPI);
   mSlots.push_front(pSlot);
   return pSlot->GetDescriptor();
@@ -479,7 +479,7 @@ void CSynapseClientRadiant::ImportMap(IDataStream *in, CPtrArray *ents, const ch
   }
   else if (strcmp(type,"xmap")==0)
   {
-    g_MapTable2.m_pfnMap_Read(in, ents);    
+    g_MapTable2.m_pfnMap_Read(in, ents);
   }
   else
     Sys_FPrintf(SYS_WRN, "WARNING: no module found for map interface type '%s'\n", type);
@@ -512,7 +512,7 @@ CPluginSlot::CPluginSlot(APIDescriptor_t *pAPI)
 }
 
 CPluginSlot::~CPluginSlot()
-{  
+{
   delete mpAPI;
   delete mpTable;
   while (m_CommandStrings)
@@ -551,14 +551,14 @@ int CPluginSlot::getCommandCount()
 {
   if (!m_bReady)
     Init();
-  return g_slist_length (m_CommandStrings);  
+  return g_slist_length (m_CommandStrings);
 }
-  
+
 const char* CPluginSlot::getCommand(int n)
 {
   if (!m_bReady)
     Init();
-  return (char*)g_slist_nth_data (m_CommandStrings, n);  
+  return (char*)g_slist_nth_data (m_CommandStrings, n);
 }
 
 void CPluginSlot::addMenuID(int n)
@@ -647,11 +647,11 @@ void CPlugInManager::InitForDir(const Str &dir)
     path += g_strModulesDir;
     // SYNAPSE
     g_pParentWnd->GetSynapseServer().AddSearchPath(path);
-  } 
+  }
 }
 
-static const XMLConfigEntry_t manager_entries[] = 
-  { 
+static const XMLConfigEntry_t manager_entries[] =
+  {
     { VFS_MAJOR,            SYN_REQUIRE, sizeof(g_FileSystemTable), &g_FileSystemTable },
     { SHADERS_MAJOR,        SYN_REQUIRE, sizeof(g_ShadersTable),    &g_ShadersTable },
     { MAP_MAJOR,            SYN_REQUIRE, sizeof(g_MapTable),        &g_MapTable },
@@ -662,9 +662,9 @@ static const XMLConfigEntry_t manager_entries[] =
 void CPlugInManager::Init()
 {
   Str synapse_config;
-  
+
   Cleanup();
-  
+
   // set some globals
   g_qeglobals.bBSPFrontendPlugin = false;
 
@@ -675,10 +675,10 @@ void CPlugInManager::Init()
   synapse_config += "synapse.config";
   if (!g_pParentWnd->GetSynapseServer().Initialize(synapse_config.GetBuffer(), &Sys_Printf_VA))
     Error("Synpase server initialization failed (see console)\n");
-  
+
   // builtin modules
   g_pParentWnd->GetSynapseServer().EnumerateBuiltinModule(&eclass_def);
-  
+
   // APIs we provide
   g_pParentWnd->GetSynapseClient().AddAPI(RADIANT_MAJOR, NULL, sizeof(_QERFuncTable_1));
   g_pParentWnd->GetSynapseClient().AddAPI(SCRIPLIB_MAJOR, NULL, sizeof(_QERScripLibTable));
@@ -691,15 +691,15 @@ void CPlugInManager::Init()
   g_pParentWnd->GetSynapseClient().AddAPI(SELECTEDFACE_MAJOR, NULL, sizeof(_QERSelectedFaceTable));
   g_pParentWnd->GetSynapseClient().AddAPI(APPSURFACEDIALOG_MAJOR, NULL, sizeof(_QERAppSurfaceTable));
   g_pParentWnd->GetSynapseClient().AddAPI(UNDO_MAJOR, NULL, sizeof(_QERUndoTable));
-  g_pParentWnd->GetSynapseClient().AddAPI(UI_MAJOR, NULL, sizeof(_QERUITable));  
-  g_pParentWnd->GetSynapseClient().AddAPI(UIGTK_MAJOR, NULL, sizeof(_QERUIGtkTable));  
-  g_pParentWnd->GetSynapseClient().AddAPI(CAMERA_MAJOR, NULL, sizeof(_QERCameraTable));  
-  
+  g_pParentWnd->GetSynapseClient().AddAPI(UI_MAJOR, NULL, sizeof(_QERUITable));
+  g_pParentWnd->GetSynapseClient().AddAPI(UIGTK_MAJOR, NULL, sizeof(_QERUIGtkTable));
+  g_pParentWnd->GetSynapseClient().AddAPI(CAMERA_MAJOR, NULL, sizeof(_QERCameraTable));
+
   // modules configured by XML
   if ( !g_pParentWnd->GetSynapseClient().ConfigXML( &g_pParentWnd->GetSynapseServer(), "core", manager_entries ) ) {
     Error("Synapse server initialization failed (see console)\n");
   }
-  
+
   // adding a manager is a special case that ConfigXML doesn't take care of
   g_pParentWnd->GetSynapseServer().SelectClientConfig( "core" );
   char *minor;
@@ -709,11 +709,11 @@ void CPlugInManager::Init()
   }
   g_ImageManager.SetMatchAPI( IMAGE_MAJOR, minor );
   g_pParentWnd->GetSynapseClient().AddManager( &g_ImageManager );
-  
+
   // SYN_REQUIRE entries which are still hardcoded
   g_pParentWnd->GetSynapseClient().AddAPI(MAP_MAJOR, "mapxml", sizeof(g_MapTable2), SYN_REQUIRE, &g_MapTable2);
   g_pParentWnd->GetSynapseClient().AddAPI(ENTITY_MAJOR, NULL, sizeof(g_EntityTable), SYN_REQUIRE, &g_EntityTable);
-  
+
   // plugins: load anything that claims to be a plugin
   // minor becomes some kind of matching pattern
   // g_PluginsManager is an API any class, it receives several function tables as needed
@@ -850,7 +850,7 @@ void CPlugInManager::DeleteBrushHandle(void * vp)
 
 void CPlugInManager::CommitBrushHandleToMap(void * vp)
 {
-  g_bScreenUpdates = false; 
+  g_bScreenUpdates = false;
   for (int i = 0; i < m_BrushHandles.GetSize(); i++)
   {
     brush_t *pb = reinterpret_cast<brush_t*>(m_BrushHandles.GetAt(i));
@@ -863,7 +863,7 @@ void CPlugInManager::CommitBrushHandleToMap(void * vp)
       Select_Brush(pb);
     }
   }
-  g_bScreenUpdates = true; 
+  g_bScreenUpdates = true;
   Sys_UpdateWindows(W_ALL);
 }
 
@@ -971,7 +971,7 @@ void QERApp_SetCamera( vec3_t origin, vec3_t angles )
   VectorCopy( origin, g_pParentWnd->GetCamWnd()->Camera()->origin );
   VectorCopy( angles, g_pParentWnd->GetCamWnd()->Camera()->angles );
 
-  Sys_UpdateWindows( W_ALL ); // specify 
+  Sys_UpdateWindows( W_ALL ); // specify
   g_pParentWnd->OnTimer();
 }
 
@@ -1484,7 +1484,7 @@ void* WINAPI QERApp_GetEntityHandle(int nIndex)
   return static_cast<void*>(pe);
 }
 
-epair_t* WINAPI QERApp_AllocateEpair( char *key, char *val )
+epair_t* WINAPI QERApp_AllocateEpair( const char *key, const char *val )
 {
   epair_t *e = (epair_t*)qmalloc (sizeof(*e));
   e->key = (char*)qmalloc(strlen(key)+1);
@@ -1503,7 +1503,7 @@ IEpair* WINAPI QERApp_IEpairForEntityHandle(void *vp)
   return pEp;
 }
 
-IEpair* WINAPI QERApp_IEpairForProjectKeys()	
+IEpair* WINAPI QERApp_IEpairForProjectKeys()
 {
   CEpairsWrapper *pEp = new CEpairsWrapper(g_qeglobals.d_project_entity);
   pEp->IncRef();
@@ -1784,7 +1784,7 @@ void CPlugInManager::CommitEntityHandleToMap(void* vpEntity)
 
 void WINAPI QERApp_SetScreenUpdate(int bScreenUpdates)
 {
-  g_bScreenUpdates = bScreenUpdates; 
+  g_bScreenUpdates = bScreenUpdates;
 }
 
 texturewin_t* QERApp_QeglobalsTexturewin()
@@ -2123,7 +2123,7 @@ unsigned long QERApp_GetTickCount()
   gettimeofday(&tp, &tzp);
   if (!basetime)
     basetime = tp.tv_sec;
-  return (tp.tv_sec-basetime) + tp.tv_usec/1000;	
+  return (tp.tv_sec-basetime) + tp.tv_usec/1000;
 #endif
 }
 
@@ -2274,7 +2274,7 @@ bool CSynapseClientRadiant::RequestAPI(APIDescriptor_t *pAPI)
     pShadersTable->m_pfnTexture_ShowInuse = Texture_ShowInuse;
     pShadersTable->m_pfnBuildShaderList = &BuildShaderList;
     pShadersTable->m_pfnPreloadShaders = &PreloadShaders;
-    
+
     return true;
   }
   if (!strcmp(pAPI->major_name, QGL_MAJOR))
@@ -2304,7 +2304,7 @@ bool CSynapseClientRadiant::RequestAPI(APIDescriptor_t *pAPI)
     pQglTable->m_pfn_qglDeleteTextures = qglDeleteTextures;
     pQglTable->m_pfn_qglDrawElements = qglDrawElements;
     pQglTable->m_pfn_qglEnable = qglEnable;
-    pQglTable->m_pfn_qglEnableClientState = qglEnableClientState;	
+    pQglTable->m_pfn_qglEnableClientState = qglEnableClientState;
     pQglTable->m_pfn_qglEnd = qglEnd;
     pQglTable->m_pfn_qglEndList = qglEndList;
     pQglTable->m_pfn_qglFogf = qglFogf;
@@ -2380,7 +2380,7 @@ bool CSynapseClientRadiant::RequestAPI(APIDescriptor_t *pAPI)
     pDataTable->m_pfnSelectedBrushes = QERApp_SelectedBrushes;
     pDataTable->m_pfnFilteredBrushes = QERApp_FilteredBrushes;
     pDataTable->m_pfnLstSkinCache = QERApp_LstSkinCache;
-    
+
     return true;
   }
   if (!strcmp(pAPI->major_name, PATCH_MAJOR))
@@ -2389,24 +2389,24 @@ bool CSynapseClientRadiant::RequestAPI(APIDescriptor_t *pAPI)
     pPatchTable->m_pfnPatch_Alloc = &Patch_Alloc;
     pPatchTable->m_pfnAddBrushForPatch = &AddBrushForPatch;
     pPatchTable->m_pfnMakeNewPatch = &MakeNewPatch;
-  
+
     return true;
   }
   if (!strcmp(pAPI->major_name, ECLASSMANAGER_MAJOR))
   {
     _EClassManagerTable *pEClassManTable = static_cast<_EClassManagerTable *>(pAPI->mpTable);
-    
+
     pEClassManTable->m_pfnEclass_InsertAlphabetized = &Eclass_InsertAlphabetized;
     pEClassManTable->m_pfnGet_Eclass_E = &Get_EClass_E;
     pEClassManTable->m_pfnSet_Eclass_Found = &Set_Eclass_Found;
     pEClassManTable->m_pfnGet_Parsing_Single = &Get_Parsing_Single;
     pEClassManTable->m_pfnEClass_Create = &EClass_Create;
     pEClassManTable->m_pfnEclass_ForName = &Eclass_ForName;
-  
+
     return true;
   }
   if (!strcmp(pAPI->major_name, SELECTEDFACE_MAJOR))
-  { 
+  {
     _QERSelectedFaceTable *pSelectedFaceTable = static_cast<_QERSelectedFaceTable *>(pAPI->mpTable);
 
     pSelectedFaceTable->m_pfnGetSelectedFaceCount = &QERApp_GetSelectedFaceCount;
@@ -2452,7 +2452,7 @@ bool CSynapseClientRadiant::RequestAPI(APIDescriptor_t *pAPI)
     return true;
   }
   if (!strcmp(pAPI->major_name, UNDO_MAJOR))
-  { 
+  {
     _QERUndoTable *pUndoTable = static_cast<_QERUndoTable *>(pAPI->mpTable);
 
     pUndoTable->m_pfnUndo_Start = &Undo_Start;
@@ -2482,7 +2482,7 @@ bool CSynapseClientRadiant::RequestAPI(APIDescriptor_t *pAPI)
     return true;
   }
   if (!strcmp(pAPI->major_name, UI_MAJOR))
-  { 
+  {
     _QERUITable *pUITable = static_cast<_QERUITable *>(pAPI->mpTable);
 
     pUITable->m_pfnCreateGLWindow = QERApp_CreateGLWindow;
@@ -2495,7 +2495,7 @@ bool CSynapseClientRadiant::RequestAPI(APIDescriptor_t *pAPI)
     return true;
   }
   if (!strcmp(pAPI->major_name, UIGTK_MAJOR))
-  { 
+  {
     _QERUIGtkTable *pUIGtkTable = static_cast<_QERUIGtkTable *>(pAPI->mpTable);
 
     pUIGtkTable->m_pfn_GetQeglobalsGLWidget = &QERApp_GetQeGlobalsGLWidget;