]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Remove most of the compiler warning in radiant
authorMattia Basaglia <mattia.basaglia@gmail.com>
Mon, 20 Jul 2015 17:07:28 +0000 (19:07 +0200)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Mon, 20 Jul 2015 17:07:28 +0000 (19:07 +0200)
62 files changed:
contrib/bobtoolz/DMap.cpp
contrib/bobtoolz/DMap.h
contrib/bobtoolz/DPatch.cpp
contrib/bobtoolz/bobToolz-GTK.cpp
contrib/bobtoolz/dialogs/dialogs-gtk.cpp
contrib/bobtoolz/misc.cpp
contrib/prtview/portals.cpp
contrib/prtview/prtview.cpp
contrib/prtview/prtview.h
contrib/shaderplug/shaderplug.cpp
contrib/ufoaiplug/ufoai_gtk.cpp
include/iarchive.h
include/ientity.h
include/iimage.h
include/imap.h
include/irender.h
include/iscenegraph.h
include/iscriplib.h
include/iselection.h
include/itextstream.h
include/itextures.h
include/modelskin.h
include/renderable.h
include/windowobserver.h
libs/profile/file.cpp
libs/profile/profile.cpp
libs/render.h
libs/str.h
libs/stringio.h
libs/xml/ixml.h
libs/xml/xmlparser.h
libs/xml/xmltextags.cpp
libs/xml/xmltextags.h
plugins/entity/light.cpp
plugins/image/jpeg.cpp
plugins/image/ktx.cpp
plugins/imagehl/hlw.cpp
plugins/imagehl/mip.cpp
plugins/imagehl/sprite.cpp
plugins/mapq3/plugin.cpp
plugins/md3model/md5.cpp
plugins/shaders/shaders.cpp
plugins/vfspk3/vfs.cpp
radiant/brush_primit.cpp
radiant/build.cpp
radiant/camwindow.cpp
radiant/dialog.h
radiant/eclass.cpp
radiant/eclass_doom3.cpp
radiant/entityinspector.cpp
radiant/environment.cpp
radiant/environment.h
radiant/filetypes.cpp
radiant/findtexturedialog.cpp
radiant/gtkdlgs.cpp
radiant/gtkdlgs.h
radiant/mainframe.cpp
radiant/patch.cpp
radiant/texwindow.cpp
radiant/undo.cpp
radiant/xmlstuff.h
radiant/xywindow.cpp

index 72356946ca81b68e425171883dce4cad0da7ec58..18edc3b1fee51870082c1336f6a43ab908b23d08 100644 (file)
@@ -58,7 +58,7 @@ DMap::~DMap(){
        ClearEntities();
 }
 
-DEntity* DMap::AddEntity( char *classname, int ID ){
+DEntity* DMap::AddEntity( const char *classname, int ID ){
        DEntity* newEntity;
        if ( ID == -1 ) {
                newEntity = new DEntity( classname, m_nNextEntity++ );
index b4a3f79bff33e6a716f4d4ec75f9f6b3f0c9e13f..f527d04d85411299d50564f3de5ac9309c15369c 100644 (file)
@@ -45,7 +45,7 @@ DEntity* GetWorldSpawn();
 void ClearEntities();
 
 DEntity* GetEntityForID( int ID );
-DEntity* AddEntity( char* classname = "worldspawn", int ID = -1 );
+DEntity* AddEntity( const char* classname = "worldspawn", int ID = -1 );
 
 std::list<DEntity*> entityList;
 
index 2228b23bc54f36c478d08ddefbf199be8ead2ca2..2d023967aaeeefa72475c47d47f7f411ba1ddd07 100644 (file)
@@ -302,7 +302,7 @@ DPatch* DPatch::MergePatches( patch_merge_t merge_info, DPatch *p1, DPatch *p2 )
 
        int newHeight = p1->height + p2->height - 1;
        if ( newHeight > MAX_PATCH_HEIGHT ) {
-               return false;
+               return NULL;
        }
 
        DPatch* newPatch = new DPatch();
@@ -483,8 +483,6 @@ std::list<DPatch> DPatch::SplitRows(){
 
 std::list<DPatch> DPatch::Split(){
        std::list<DPatch> patchList;
-       int i;
-       int x, y;
 
        if ( width >= 5 ) {
                std::list<DPatch> patchColList = SplitCols();
index d7893955406236a4c0ece233280a04b81ac89641..c4a057bd6a365bb155f214a258ee4608d46b33ce 100644 (file)
@@ -57,10 +57,10 @@ void BobToolz_destroy(){
 }
 
 // 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,Split patches cols,Split patches rows,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,Split patches cols,Split patches rows,Turn edge";
 
 // globals
 GtkWidget *g_pRadiantWnd = NULL;
@@ -284,11 +284,11 @@ class BobToolzPluginDependencies :
 public:
 BobToolzPluginDependencies() :
        GlobalEntityModuleRef( GlobalRadiant().getRequiredGameDescriptionKeyValue( "entities" ) ),
+       GlobalEntityClassManagerModuleRef( GlobalRadiant().getRequiredGameDescriptionKeyValue( "entityclass" ) ),
        GlobalShadersModuleRef( GlobalRadiant().getRequiredGameDescriptionKeyValue( "shaders" ) ),
        GlobalBrushModuleRef( GlobalRadiant().getRequiredGameDescriptionKeyValue( "brushtypes" ) ),
-       GlobalPatchModuleRef( GlobalRadiant().getRequiredGameDescriptionKeyValue( "patchtypes" ) ),
-       GlobalEntityClassManagerModuleRef( GlobalRadiant().getRequiredGameDescriptionKeyValue( "entityclass" ) ){
-}
+       GlobalPatchModuleRef( GlobalRadiant().getRequiredGameDescriptionKeyValue( "patchtypes" ) )
+       {}
 };
 
 class BobToolzPluginModule : public TypeSystemRef
index b596f0591a846ec8c50575818221155fcbdb6fbf..4f84838d9a9db592016d82894aebfae9f9c31b87 100644 (file)
@@ -115,7 +115,7 @@ static void dialog_button_callback_settex( GtkWidget *widget, gpointer data ){
     Data validation Routines
    ---------------------------------*/
 
-bool ValidateTextFloat( const char* pData, char* error_title, float* value ){
+bool ValidateTextFloat( const char* pData, const char* error_title, float* value ){
        if ( pData ) {
                float testNum = (float)atof( pData );
 
@@ -134,7 +134,7 @@ bool ValidateTextFloat( const char* pData, char* error_title, float* value ){
        return FALSE;
 }
 
-bool ValidateTextFloatRange( const char* pData, float min, float max, char* error_title, float* value ){
+bool ValidateTextFloatRange( const char* pData, float min, float max, const char* error_title, float* value ){
        char error_buffer[256];
        sprintf( error_buffer, "Please Enter A Floating Point Number Between %.3f and %.3f", min, max );
 
@@ -156,7 +156,7 @@ bool ValidateTextFloatRange( const char* pData, float min, float max, char* erro
        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 );
 
@@ -178,7 +178,7 @@ bool ValidateTextIntRange( const char* pData, int min, int max, char* error_titl
        return FALSE;
 }
 
-bool ValidateTextInt( const char* pData, char* error_title, int* value ){
+bool ValidateTextInt( const char* pData, const char* error_title, int* value ){
        if ( pData ) {
                int testNum = atoi( pData );
 
@@ -597,7 +597,7 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
        EMessageBoxReturn ret;
        int loop = 1;
 
-       char    *text = "Please set a value in the boxes below and press 'OK' to build the stairs";
+       const gchar    *text = "Please set a value in the boxes below and press 'OK' to build the stairs";
 
        window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
 
@@ -1909,7 +1909,7 @@ EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){
        EMessageBoxReturn ret;
        int loop = 1;
 
-       char    *text = "Please set a value in the boxes below and press 'OK' to make a chain";
+       const gchar    *text = "Please set a value in the boxes below and press 'OK' to make a chain";
 
        window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
 
@@ -2012,4 +2012,4 @@ EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){
        gtk_widget_destroy( window );
 
        return ret;
-}
\ No newline at end of file
+}
index 977879f59e4b0fe4f239356eddef76aa623e87f3..202065fc0a70cd9b3068d8bc435a8df8f70f890d 100644 (file)
@@ -129,7 +129,7 @@ char* TranslateString( char *buf ){
 
        std::size_t l = strlen( buf );
        char* out = buf2;
-       for ( int i = 0 ; i < l ; i++ )
+       for ( std::size_t i = 0 ; i < l ; i++ )
        {
                if ( buf[i] == '\n' ) {
                        *out++ = '\r';
index a896fcd4276e48ae18eee8d08ea66acea1655109..b85945bc34892ea47915eb21508272f7076f3974 100644 (file)
@@ -37,10 +37,10 @@ CPortalsRender render;
 
 int compare( const void *arg1, const void *arg2 ){
 
-       if ( portals.portal[*( (int *)arg1 )].dist > portals.portal[*( (int *)arg2 )].dist ) {
+       if ( portals.portal[*( (const int *)arg1 )].dist > portals.portal[*( (const int *)arg2 )].dist ) {
                return -1;
        }
-       else if ( portals.portal[*( (int *)arg1 )].dist < portals.portal[*( (int *)arg2 )].dist ) {
+       else if ( portals.portal[*( (const int *)arg1 )].dist < portals.portal[*( (const int *)arg2 )].dist ) {
                return 1;
        }
 
@@ -61,7 +61,7 @@ bool CBspPortal::Build( char *def ){
        char *c = def;
        unsigned int n;
        int dummy1, dummy2;
-       int res_cnt, i;
+       int res_cnt = 0, i;
 
        if ( portals.hint_flags ) {
                res_cnt = sscanf( def, "%u %d %d %d", &point_count, &dummy1, &dummy2, (int *)&hint );
@@ -603,7 +603,7 @@ void CPortalsDrawSolid::render( RenderStateFlags state ) const {
 }
 
 void CPortalsDrawSolidOutline::render( RenderStateFlags state ) const {
-       for ( int n = 0; n < portals.portal_count; n++ )
+       for ( unsigned int n = 0; n < portals.portal_count; n++ )
        {
                if ( portals.lines == 2 && !portals.portal[n].hint ) {
                        continue;
@@ -632,7 +632,7 @@ void CPortalsDrawSolidOutline::render( RenderStateFlags state ) const {
 
                glBegin( GL_LINE_LOOP );
 
-               for ( int p = 0; p < portals.portal[n].point_count; p++ )
+               for ( unsigned int p = 0; p < portals.portal[n].point_count; p++ )
                        glVertex3fv( portals.portal[n].inner_point[p].p );
 
                glEnd();
index 301ac9ea154a8835682c9b22a6a89d3a285ea359..36702213c2018bdc46abee5fa56061e667a40391 100644 (file)
@@ -162,7 +162,7 @@ void SaveConfig(){
 
 #define CONFIG_SECTION "Configuration"
 
-int INIGetInt( char *key, int def ){
+int INIGetInt( const char *key, int def ){
        char value[1024];
 
        if ( read_var( INIfn.c_str(), CONFIG_SECTION, key, value ) ) {
@@ -173,7 +173,7 @@ int INIGetInt( char *key, int def ){
        }
 }
 
-void INISetInt( char *key, int val, char *comment /* = NULL */ ){
+void INISetInt( const char* key, int val, const char* comment /* = NULL */ ){
        char s[1000];
 
        if ( comment ) {
index e149ae80c99f9460a30bd5e46eec3398051f6945..df84d6a24cf6eaf242bd62e00eee958b1a486fca 100644 (file)
@@ -25,8 +25,8 @@
 void InitInstance();
 void SaveConfig();
 
-int INIGetInt( char *key, int def );
-void INISetInt( char *key, int val, char *comment = 0 );
+int INIGetInt( const char *key, int def );
+void INISetInt( const char *key, int val, const char *comment = 0 );
 
 #define IDOK                1
 #define IDCANCEL            2
index 62e9abe6aa1df261f9bc64515f7783d31690bb05..0cf2cbd04b4be0aded5148712ec37781dc6ad80f 100644 (file)
@@ -118,7 +118,7 @@ void LoadTextureFile( const char* filename ){
 
 typedef FreeCaller1<const char*, LoadTextureFile> LoadTextureFileCaller;
 
-void GetTextures( char* extension ){
+void GetTextures( const char* extension ){
        GlobalFileSystem().forEachFile( "textures/", extension, LoadTextureFileCaller(), 0 );
 }
 
index c01a31fe721158748cda9cd267571fb59640f956..afbb47b21235da7d9990a805d80008ce6ad94b57 100644 (file)
@@ -43,23 +43,23 @@ UFOAIGtk( void* gtk_window ) : m_gtk_window( ( GtkWindow* )gtk_window ){
  * This is useful for popping up 'are you sure you want to quit?'
  * type dialogs.
  */
-static gboolean delete_event( GtkWidget *widget, GdkEvent *event, gpointer data ){
+/*static gboolean delete_event( GtkWidget *widget, GdkEvent *event, gpointer data ){
        return FALSE;
-}
+}*/
 
 /**
  * @brief destroy widget if destroy signal is passed to widget
  */
-static void destroy( GtkWidget *widget, gpointer data ){
+/*static void destroy( GtkWidget *widget, gpointer data ){
        gtk_widget_destroy( widget );
-}
+}*/
 
 /**
  * @brief function for close button to destroy the toplevel widget
  */
-static void close_window( GtkWidget *widget, gpointer data ){
+/*static void close_window( GtkWidget *widget, gpointer data ){
        gtk_widget_destroy( gtk_widget_get_toplevel( widget ) );
-}
+}*/
 
 /* =============================== */
 
index dddf5579853e5dac3ec916e15638efa7276b6710..197945c04169205d1799e34a30b5afe73133c8ba 100644 (file)
@@ -31,6 +31,7 @@ class InputStream;
 class ArchiveFile
 {
 public:
+virtual ~ArchiveFile(){}
 /// \brief Destroys the file object.
 virtual void release() = 0;
 /// \brief Returns the size of the file data in bytes.
@@ -50,6 +51,7 @@ class TextInputStream;
 class ArchiveTextFile
 {
 public:
+virtual ~ArchiveTextFile(){}
 /// \brief Destroys the file object.
 virtual void release() = 0;
 /// \brief Returns the stream associated with this file.
@@ -79,6 +81,7 @@ public:
 class Visitor
 {
 public:
+virtual ~Visitor(){}
 virtual void visit( const char* name ) = 0;
 };
 
@@ -91,6 +94,7 @@ enum EMode
        eFilesAndDirectories = 0x03,
 };
 
+virtual ~Archive(){}
 /// \brief Destroys the archive object.
 /// Any unreleased file object associated with the archive remains valid. */
 virtual void release() = 0;
index c315b3abb2708a527c355ee7759efe44ef5d5363..e38ce596161febe5809c34d445ff3cf4348c6565 100644 (file)
@@ -34,6 +34,7 @@ typedef Callback1<const char*> KeyObserver;
 class EntityKeyValue
 {
 public:
+virtual ~EntityKeyValue(){}
 virtual const char* c_str() const = 0;
 virtual void assign( const char* other ) = 0;
 virtual void attach( const KeyObserver& observer ) = 0;
@@ -48,6 +49,7 @@ STRING_CONSTANT( Name, "Entity" );
 class Observer
 {
 public:
+virtual ~Observer(){}
 virtual void insert( const char* key, EntityKeyValue& value ) = 0;
 virtual void erase( const char* key, EntityKeyValue& value ) = 0;
 virtual void clear() { };
@@ -56,9 +58,11 @@ virtual void clear() { };
 class Visitor
 {
 public:
+virtual ~Visitor(){}
 virtual void visit( const char* key, const char* value ) = 0;
 };
 
+virtual ~Entity(){}
 virtual const EntityClass& getEntityClass() const = 0;
 virtual void forEachKeyValue( Visitor& visitor ) const = 0;
 virtual void setKeyValue( const char* key, const char* value ) = 0;
index c159e657152af1ba8ede594a4c3d53ffb99e234e..4539825ce459a05f02340dcaf5ac5529eeb2abdc 100644 (file)
@@ -29,6 +29,7 @@ typedef unsigned char byte;
 class Image
 {
 public:
+virtual ~Image(){}
 virtual void release() = 0;
 virtual byte* getRGBAPixels() const = 0;
 virtual unsigned int getWidth() const = 0;
index 7af4c4721335f9bb016b1f2ba2b8b58c9e7ab037..05347e6eb6b73ca19771d9be9d1a9ac4c5734c8d 100644 (file)
@@ -32,7 +32,7 @@ class MapImporter
 {
 public:
 STRING_CONSTANT( Name, "MapImporter" );
-
+virtual ~MapImporter() {}
 virtual bool importTokens( Tokeniser& tokeniser ) = 0;
 };
 
@@ -42,6 +42,7 @@ class MapExporter
 public:
 STRING_CONSTANT( Name, "MapExporter" );
 
+virtual ~MapExporter() {}
 virtual void exportTokens( TokenWriter& writer ) const = 0;
 };
 
@@ -63,6 +64,7 @@ INTEGER_CONSTANT( Version, 2 );
 STRING_CONSTANT( Name, "map" );
 mutable bool wrongFormat;
 
+virtual ~MapFormat(){}
 /// \brief Read a map graph into \p root from \p outputStream, using \p entityTable to create entities.
 virtual void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const = 0;
 /// \brief Write the map graph obtained by applying \p traverse to \p root into \p outputStream.
index 5199454287cb9081797c61cfddc7a96461df0baf..282fb031f9c083b10709a0060a45013159b314cd 100644 (file)
@@ -67,6 +67,7 @@ class Shader;
 class RendererLight
 {
 public:
+virtual ~RendererLight(){}
 virtual Shader* getShader() const = 0;
 virtual const AABB& aabb() const = 0;
 virtual bool testAABB( const AABB& other ) const = 0;
@@ -80,6 +81,7 @@ virtual const Matrix4& projection() const = 0;
 class LightCullable
 {
 public:
+virtual ~LightCullable(){}
 virtual bool testLight( const RendererLight& light ) const = 0;
 virtual void insertLight( const RendererLight& light ){
 }
@@ -95,6 +97,7 @@ typedef Callback1<const RendererLight&> RendererLightCallback;
 class LightList
 {
 public:
+virtual ~LightList(){}
 virtual void evaluateLights() const = 0;
 virtual void lightsChanged() const = 0;
 virtual void forEachLight( const RendererLightCallback& callback ) const = 0;
@@ -107,6 +110,7 @@ const int c_attr_Binormal = 4;
 class OpenGLRenderable
 {
 public:
+virtual ~OpenGLRenderable(){}
 virtual void render( RenderStateFlags state ) const = 0;
 };
 
@@ -119,6 +123,7 @@ class ModuleObserver;
 class Shader
 {
 public:
+virtual ~Shader(){}
 virtual void addRenderable( const OpenGLRenderable& renderable, const Matrix4& modelview, const LightList* lights = 0 ) = 0;
 virtual void incrementUsed() = 0;
 virtual void decrementUsed() = 0;
@@ -134,6 +139,7 @@ public:
 INTEGER_CONSTANT( Version, 1 );
 STRING_CONSTANT( Name, "renderstate" );
 
+virtual ~ShaderCache(){}
 virtual Shader* capture( const char* name ) = 0;
 virtual void release( const char* name ) = 0;
 /*! Render all Shader objects. */
index 6b28b0fc9a7122c3f5cf6184ebbd3263f120e987..e22a4b765d3b876cfd98650140e4130a1db0db40 100644 (file)
@@ -76,6 +76,7 @@ STRING_CONSTANT( Name, "scenegraph" );
 class Walker
 {
 public:
+virtual ~Walker(){}
 /// \brief Called before traversing the first child-instance of 'instance'. If the return value is false, the children of the current instance are not traversed.
 virtual bool pre( const Path& path, Instance& instance ) const = 0;
 /// \brief Called after traversing the last child-instance of 'instance'.
@@ -83,6 +84,7 @@ virtual void post( const Path& path, Instance& instance ) const {
 }
 };
 
+virtual ~Graph(){}
 /// \brief Returns the root-node of the graph.
 virtual Node& root() = 0;
 /// \brief Sets the root-node of the graph to be 'node'.
index 8f64503355b4ded1267a926dfd20a2dc4f3f42ab..113f140947950a05f9f8489efb9d5479a3d75e64 100644 (file)
@@ -33,6 +33,7 @@
 class Tokeniser
 {
 public:
+virtual ~Tokeniser(){}
 virtual void release() = 0;
 virtual void nextLine() = 0;
 virtual const char* getToken() = 0;
@@ -46,6 +47,7 @@ class TextInputStream;
 class TokenWriter
 {
 public:
+virtual ~TokenWriter(){}
 virtual void release() = 0;
 virtual void nextLine() = 0;
 virtual void writeToken( const char* token ) = 0;
index f5c76310b1cc4e17196ebebb33157c1779f839e0..48f49f8a328e7e67a793ba8056cbdd148dca1540 100644 (file)
@@ -35,6 +35,7 @@ class Selectable
 public:
 STRING_CONSTANT( Name, "Selectable" );
 
+virtual ~Selectable(){}
 virtual void setSelected( bool select ) = 0;
 virtual bool isSelected() const = 0;
 };
@@ -47,6 +48,7 @@ class Instance;
 class InstanceSelectionObserver
 {
 public:
+virtual ~InstanceSelectionObserver(){}
 virtual void onSelectedChanged( scene::Instance& instance ) = 0;
 };
 
@@ -90,6 +92,7 @@ enum EManipulatorMode
        eClip,
 };
 
+virtual ~SelectionSystem(){}
 virtual void SetMode( EMode mode ) = 0;
 virtual EMode Mode() const = 0;
 virtual void SetComponentMode( EComponentMode mode ) = 0;
@@ -110,6 +113,7 @@ virtual void setSelectedAllComponents( bool selected ) = 0;
 class Visitor
 {
 public:
+virtual ~Visitor(){}
 virtual void visit( scene::Instance& instance ) const = 0;
 };
 virtual void foreachSelected( const Visitor& visitor ) const = 0;
index 7d69c7b5ae3372986031249b296f9ab2cbcde38d..3bc7b2a56c8c245e6f7869738575af7f0a1c8591 100644 (file)
@@ -32,6 +32,7 @@
 class TextInputStream
 {
 public:
+virtual ~TextInputStream(){}
 /// \brief Attempts to read the next \p length characters from the stream to \p buffer.
 /// Returns the number of characters actually stored in \p buffer.
 virtual std::size_t read( char* buffer, std::size_t length ) = 0;
@@ -41,6 +42,7 @@ virtual std::size_t read( char* buffer, std::size_t length ) = 0;
 class TextOutputStream
 {
 public:
+virtual ~TextOutputStream(){}
 /// \brief Attempts to write \p length characters to the stream from \p buffer.
 /// Returns the number of characters actually read from \p buffer.
 virtual std::size_t write( const char* buffer, std::size_t length ) = 0;
index cc91399d2c452115b233e660ad5ab9d5fe139e43..ee3d49eb23b60df23b22d51ff6843258f08811a1 100644 (file)
@@ -52,6 +52,7 @@ inline bool operator<( const LoadImageCallback& self, const LoadImageCallback& o
 class TexturesCacheObserver
 {
 public:
+virtual ~TexturesCacheObserver(){}
 virtual void unrealise() = 0;
 virtual void realise() = 0;
 };
@@ -61,6 +62,7 @@ class TexturesCache
 public:
 INTEGER_CONSTANT( Version, 1 );
 STRING_CONSTANT( Name, "textures" );
+virtual ~TexturesCache(){}
 virtual LoadImageCallback defaultLoader() const = 0;
 virtual Image* loadImage( const char* name ) = 0;
 virtual qtexture_t* capture( const char* name ) = 0;
index bb5922ee7704b89c48ee666a8c5d353dd9e1b1b2..6e818b1174e65325ed697e51a3663a6fee5fea2d 100644 (file)
@@ -41,6 +41,7 @@ class ModelSkin
 {
 public:
 STRING_CONSTANT( Name, "ModelSkin" );
+virtual ~ModelSkin(){}
 /// \brief Attach an \p observer whose realise() and unrealise() methods will be called when the skin is loaded or unloaded.
 virtual void attach( ModuleObserver& observer ) = 0;
 /// \brief Detach an \p observer previously-attached by calling \c attach.
@@ -57,6 +58,7 @@ class SkinnedModel
 {
 public:
 STRING_CONSTANT( Name, "SkinnedModel" );
+virtual ~SkinnedModel(){}
 /// \brief Instructs the skinned model to update its skin.
 virtual void skinChanged() = 0;
 };
@@ -66,6 +68,7 @@ class ModelSkinCache
 public:
 INTEGER_CONSTANT( Version, 1 );
 STRING_CONSTANT( Name, "modelskin" );
+virtual ~ModelSkinCache(){}
 /// \brief Increments the reference count of and returns a reference to the skin uniquely identified by 'name'.
 virtual ModelSkin& capture( const char* name ) = 0;
 /// \brief Decrements the reference-count of the skin uniquely identified by 'name'.
index 8b972170ed7c723c786956a966e6f72cc21dffea..0c0e770bd35347719aac73338019edbbb1e88ca2 100644 (file)
@@ -48,7 +48,7 @@ enum EStyle
 virtual void PushState() = 0;
 virtual void PopState() = 0;
 virtual void SetState( Shader* state, EStyle mode ) = 0;
-virtual const EStyle getStyle() const = 0;
+virtual EStyle getStyle() const = 0;
 virtual void Highlight( EHighlightMode mode, bool bEnable = true ) = 0;
 virtual void setLights( const LightList& lights ){
 }
index b72d0820682b4d458e1290e20f985b1e4914632d..8f7594831dede33f5457cb39193654ef27dca92e 100644 (file)
@@ -79,6 +79,7 @@ typedef Vector2 WindowVector;
 class WindowObserver
 {
 public:
+virtual ~WindowObserver(){}
 virtual void release() = 0;
 virtual void onSizeChanged( int width, int height ) = 0;
 virtual void onMouseDown( const WindowVector& position, ButtonIdentifier button, ModifierFlags modifiers ) = 0;
index ec230964e3b8e31177186c21fb627cabc2d92549..4ad46ea241e58a5ab4fff1c10ec0ce47e2400de5 100644 (file)
@@ -175,7 +175,7 @@ MemStream::size_type MemStream::write( const byte_type* buffer, size_type length
                GrowFile( m_nPosition + length );
        }
 
-       memcpy( (unsigned char*)m_pBuffer + m_nPosition, (unsigned char*)buffer, length );
+       memcpy( (unsigned char*)m_pBuffer + m_nPosition, (const unsigned char*)buffer, length );
 
        m_nPosition += size_type( length );
 
@@ -271,7 +271,7 @@ int MemStream::Seek( offset_type lOff, int nFrom ){
                lNewPos = m_nFileSize + lOff;
        }
        else{
-               return ( position_type ) - 1;
+               return - 1;
        }
 
        m_nPosition = lNewPos;
index 71d2ae1b9c18b250cae0e987d042764a7c1f8d11..c1505e073b15ac1c2b68fbf58a5fd92568dbe11e 100644 (file)
@@ -252,7 +252,7 @@ bool profile_load_buffer( const char * rc_path, const char *name, void *buffer,
                fclose( f );
        }
 
-       return true;
+       return ret;
 }
 
 int profile_load_int( const char *filename, const char *section, const char *key, int default_value ){
index b53612bf11621d78f6fe28f8d14c1eba244ccdf9..d568edb386216a826a823d6d6799cf24ce45ec83 100644 (file)
@@ -171,7 +171,7 @@ RenderIndex m_prev0;
 RenderIndex m_prev1;
 RenderIndex m_prev2;
 
-const RenderIndex find_or_insert( const Vertex& vertex ){
+RenderIndex find_or_insert( const Vertex& vertex ){
        RenderIndex index = 0;
 
        while ( 1 )
index 9090bf2d6e4587b797c1fbfa7a87d8a0fc63e1b3..47be309dd2318e6e75f150e1d81ee369a5dcb573 100644 (file)
@@ -254,7 +254,6 @@ const char* Left( std::size_t n ){
        }
        else
        {
-               g_pStrWork = "";
                g_pStrWork = new char[1];
                g_pStrWork[0] = '\0';
        }
@@ -290,7 +289,6 @@ const char* Mid( std::size_t first, std::size_t n ) const {
        }
        else
        {
-               g_pStrWork = "";
                g_pStrWork = new char[1];
                g_pStrWork[0] = '\0';
        }
@@ -429,7 +427,7 @@ bool operator >( char* pStr ) const { return ( m_bIgnoreCase ) ? stricmp( m_pStr
 bool operator >( const char* pStr ) const { return ( m_bIgnoreCase ) ? stricmp( m_pStr, pStr ) > 0 : strcmp( m_pStr, pStr ) > 0; }
 char& operator []( std::size_t nIndex ) { return m_pStr[nIndex]; }
 const char& operator []( std::size_t nIndex ) const { return m_pStr[nIndex]; }
-const char GetAt( std::size_t nIndex ) { return m_pStr[nIndex]; }
+char GetAt( std::size_t nIndex ) { return m_pStr[nIndex]; }
 };
 
 
index ff1a3a67a1300f58ff4b7cefdd7dc01c26b069e2..8af056e6fc514726a818d77c8065cf5f7d227890 100644 (file)
@@ -219,7 +219,7 @@ inline bool string_parse_size( const char* string, std::size_t& i ){
 }
 
 
-#define RETURN_FALSE_IF_FAIL( expression ) if ( !expression ) {return false; }else
+#define RETURN_FALSE_IF_FAIL( expression ) if ( !expression ) {return false; }
 
 inline void Tokeniser_unexpectedError( Tokeniser& tokeniser, const char* token, const char* expected ){
        globalErrorStream() << Unsigned( tokeniser.getLine() ) << ":" << Unsigned( tokeniser.getColumn() ) << ": parse error at '" << ( token != 0 ? token : "#EOF" ) << "': expected '" << expected << "'\n";
index 7b86020ff28430e7e81447aec174d6332e82327a..7740c832126256472bce9fe4a086cebaaef675d4 100644 (file)
 class XMLAttrVisitor
 {
 public:
+virtual ~XMLAttrVisitor(){}
 virtual void visit( const char* name, const char* value ) = 0;
 };
 
 class XMLElement
 {
 public:
+virtual ~XMLElement(){}
 virtual const char* name() const = 0;
 virtual const char* attribute( const char* name ) const = 0;
 virtual void forEachAttribute( XMLAttrVisitor& visitor ) const = 0;
@@ -43,7 +45,7 @@ class XMLImporter : public TextOutputStream
 {
 public:
 STRING_CONSTANT( Name, "XMLImporter" );
-
+virtual ~XMLImporter(){}
 virtual void pushElement( const XMLElement& element ) = 0;
 virtual void popElement( const char* name ) = 0;
 };
@@ -52,7 +54,7 @@ class XMLExporter
 {
 public:
 STRING_CONSTANT( Name, "XMLExporter" );
-
+virtual ~XMLExporter(){}
 virtual void exportXML( XMLImporter& importer ) = 0;
 };
 
index b11d355bce45c1a42df4f4df3644b1071747c13a..1c1bdb01fca448eb08077deb1965444a9675c382 100644 (file)
@@ -187,7 +187,7 @@ XMLStreamParser( TextInputStream& istream )
        : m_istream( istream ){
 }
 virtual void exportXML( XMLImporter& importer ){
-       bool wellFormed = false;
+       //bool wellFormed = false;
 
        char chars[BUFSIZE];
        std::size_t res = m_istream.read( chars, 4 );
@@ -203,7 +203,7 @@ virtual void exportXML( XMLImporter& importer ){
                }
                xmlParseChunk( ctxt, chars, 0, 1 );
 
-               wellFormed = ( ctxt->wellFormed == 1 );
+               //wellFormed = ( ctxt->wellFormed == 1 );
 
                xmlFreeParserCtxt( ctxt );
        }
index c9d2b06b6087c455c88426c8ab089baf67b971f1..7baf0e5e084e4e709f2ea47bb0cf46e97da57c7c 100644 (file)
@@ -49,16 +49,16 @@ bool XmlTagBuilder::CreateXmlDocument(){
        xmlTextWriterStartDocument( writer, NULL, "UTF-8", NULL );
 
        // create the root node with stock and custom elements
-       xmlTextWriterStartElement( writer, (xmlChar*)"root" );
-       xmlTextWriterWriteString( writer, (xmlChar*)"\n  " );
-       xmlTextWriterStartElement( writer, (xmlChar*)"stock" );
-       xmlTextWriterWriteString( writer, (xmlChar*)"\n  " );
+       xmlTextWriterStartElement( writer, (const xmlChar*)"root" );
+       xmlTextWriterWriteString( writer, (const xmlChar*)"\n  " );
+       xmlTextWriterStartElement( writer, (const xmlChar*)"stock" );
+       xmlTextWriterWriteString( writer, (const xmlChar*)"\n  " );
        xmlTextWriterEndElement( writer );
-       xmlTextWriterWriteString( writer, (xmlChar*)"\n  " );
-       xmlTextWriterStartElement( writer, (xmlChar*)"custom" );
-       xmlTextWriterWriteString( writer, (xmlChar*)"\n  " );
+       xmlTextWriterWriteString( writer, (const xmlChar*)"\n  " );
+       xmlTextWriterStartElement( writer, (const xmlChar*)"custom" );
+       xmlTextWriterWriteString( writer, (const xmlChar*)"\n  " );
        xmlTextWriterEndElement( writer );
-       xmlTextWriterWriteString( writer, (xmlChar*)"\n" );
+       xmlTextWriterWriteString( writer, (const xmlChar*)"\n" );
        xmlTextWriterEndElement( writer );
 
        // end of the xml document
@@ -151,26 +151,28 @@ bool XmlTagBuilder::AddShaderNode( const char* shader, TextureType textureType,
                switch ( nodeShaderType )
                {
                case SHADER:
-                       newnode = xmlNewNode( NULL, (xmlChar*)"shader" );
+                       newnode = xmlNewNode( NULL, (const xmlChar*)"shader" );
                        break;
                case TEXTURE:
-                       newnode = xmlNewNode( NULL, (xmlChar*)"texture" );
+                       newnode = xmlNewNode( NULL, (const xmlChar*)"texture" );
+               default:
+                       return false;
                };
 
                newnode = xmlDocCopyNode( newnode, doc, 1 );
-               xmlSetProp( newnode, (xmlChar*)"path", (xmlChar*)shader );
-               xmlNodeSetContent( newnode, (xmlChar*)"\n    " );
+               xmlSetProp( newnode, (const xmlChar*)"path", (const xmlChar*)shader );
+               xmlNodeSetContent( newnode, (const xmlChar*)"\n    " );
 
                if ( nodePtr->nodeTab[0]->children->next == NULL ) { // there are no shaders yet
                        // add spaces
-                       newtext = xmlNewText( (xmlChar*)"  " );
+                       newtext = xmlNewText( (const xmlChar*)"  " );
                        xmlAddChild( nodeParent->children, newtext );
 
                        // add the new node
                        xmlAddNextSibling( nodeParent->children, newnode );
 
                        // append a new line
-                       newtext = xmlNewText( (xmlChar*)"\n  " );
+                       newtext = xmlNewText( (const xmlChar*)"\n  " );
                        xmlAddNextSibling( nodeParent->children->next, newtext );
                }
                else {
@@ -178,7 +180,7 @@ bool XmlTagBuilder::AddShaderNode( const char* shader, TextureType textureType,
                        xmlAddNextSibling( nodeParent->children, newnode );
 
                        // append a new line and spaces
-                       newtext = xmlNewText( (xmlChar*)"\n    " );
+                       newtext = xmlNewText( (const xmlChar*)"\n    " );
                        xmlAddNextSibling( nodeParent->children->next, newtext );
                }
 
@@ -327,26 +329,26 @@ bool XmlTagBuilder::AddShaderTag( const char* shader, const char* content, NodeT
        }
 
        if ( !xmlXPathNodeSetIsEmpty( nodePtr ) ) { // node was found
-               xmlNodePtr newnode = xmlNewNode( NULL, (xmlChar*)"tag" );
+               xmlNodePtr newnode = xmlNewNode( NULL, (const xmlChar*)"tag" );
                xmlNodePtr nodeParent = nodePtr->nodeTab[0];
                newnode = xmlDocCopyNode( newnode, doc, 1 );
-               xmlNodeSetContent( newnode, (xmlChar*)content );
+               xmlNodeSetContent( newnode, (const xmlChar*)content );
 
                if ( nodePtr->nodeTab[0]->children->next == NULL ) { // shader node has NO children
                        // add spaces
-                       xmlNodePtr newtext = xmlNewText( (xmlChar*)"  " );
+                       xmlNodePtr newtext = xmlNewText( (const xmlChar*)"  " );
                        xmlAddChild( nodeParent->children, newtext );
 
                        // add new node
                        xmlAddNextSibling( nodeParent->children, newnode );
 
                        // append a new line + spaces
-                       newtext = xmlNewText( (xmlChar*)"\n    " );
+                       newtext = xmlNewText( (const xmlChar*)"\n    " );
                        xmlAddNextSibling( nodeParent->children->next, newtext );
                }
                else { // shader node has children already - the new node will be the first sibling
                        xmlAddNextSibling( nodeParent->children, newnode );
-                       xmlNodePtr newtext = xmlNewText( (xmlChar*)"\n      " );
+                       xmlNodePtr newtext = xmlNewText( (const xmlChar*)"\n      " );
                        xmlAddNextSibling( nodeParent->children->next, newtext );
                }
                xmlXPathFreeObject( xpathPtr );
@@ -376,7 +378,7 @@ int XmlTagBuilder::RenameShaderTag( const char* oldtag, CopiedString newtag ){
        strcat( expression, oldtag );
        strcat( expression, "']/*" );
 
-       xmlXPathObjectPtr result = xmlXPathEvalExpression( (xmlChar*)expression, context );
+       xmlXPathObjectPtr result = xmlXPathEvalExpression( (const xmlChar*)expression, context );
        if ( !result ) {
                return 0;
        }
@@ -388,7 +390,7 @@ int XmlTagBuilder::RenameShaderTag( const char* oldtag, CopiedString newtag ){
                char* content = (char*)xmlNodeGetContent( ptrContent );
 
                if ( strcmp( content, oldtag ) == 0 ) { // found a node with old content?
-                       xmlNodeSetContent( ptrContent, (xmlChar*)newtag.c_str() );
+                       xmlNodeSetContent( ptrContent, (const xmlChar*)newtag.c_str() );
                        num++;
                }
        }
@@ -422,7 +424,7 @@ bool XmlTagBuilder::DeleteShaderTag( const char* shader, const char* tag ){
                for ( int i = 0; i < nodePtr->nodeNr; i++ )
                {
                        xmlNodePtr ptrContent = nodePtr->nodeTab[i];
-                       char* content = (char*)(xmlChar*)xmlNodeGetContent( ptrContent );
+                       const char* content = (const char*)xmlNodeGetContent( ptrContent );
 
                        if ( strcmp( content, tag ) == 0 ) { // find the node
                                xmlNodePtr ptrWhitespace = nodePtr->nodeTab[i]->prev;
@@ -476,7 +478,7 @@ void XmlTagBuilder::GetShaderTags( const char* shader, std::vector<CopiedString>
           returns a vector containing the tags
         */
 
-       char* expression;
+       const char* expression;
 
        if ( shader == NULL ) { // get all tags from all shaders
                expression = "/root/*/*/tag";
@@ -510,7 +512,7 @@ void XmlTagBuilder::GetUntagged( std::set<CopiedString>& shaders ){
           returns a set containing the shaders (with path)
         */
 
-       char* expression = "/root/*/*[not(child::tag)]";
+       const char* expression = "/root/*/*[not(child::tag)]";
 
        xmlXPathObjectPtr xpathPtr = XpathEval( expression );
        xmlNodeSetPtr nodePtr;
@@ -527,7 +529,7 @@ void XmlTagBuilder::GetUntagged( std::set<CopiedString>& shaders ){
                for ( int i = 0; i < nodePtr->nodeNr; i++ )
                {
                        ptr = nodePtr->nodeTab[i];
-                       shaders.insert( (char*)xmlGetProp( ptr, (xmlChar*)"path" ) );
+                       shaders.insert( (char*)xmlGetProp( ptr, (const xmlChar*)"path" ) );
                }
        }
 
@@ -540,7 +542,7 @@ void XmlTagBuilder::GetAllTags( std::set<CopiedString>& tags ){
           returns a set containing all used tags
         */
 
-       char* expression = "/root/*/*/tag";
+       const char* expression = "/root/*/*/tag";
 
        xmlXPathObjectPtr xpathPtr = XpathEval( expression );
        xmlNodeSetPtr nodePtr;
@@ -584,7 +586,7 @@ void XmlTagBuilder::TagSearch( const char* expression, std::set<CopiedString>& p
                for ( int i = 0; i < nodePtr->nodeNr; i++ )
                {
                        ptr = nodePtr->nodeTab[i];
-                       xmlattrib = xmlGetProp( ptr, (xmlChar*)"path" );
+                       xmlattrib = xmlGetProp( ptr, (const xmlChar*)"path" );
                        paths.insert( (CopiedString)(char*)xmlattrib );
                }
        }
index 7a1bae6db1ff3236ee964f8b3c947ba3cf80f20b..dbad5f5629199ad8a98916718338e05585670498 100644 (file)
@@ -58,7 +58,7 @@ xmlXPathContextPtr context;
 xmlNodeSetPtr nodePtr;
 
 xmlXPathObjectPtr XpathEval( const char* queryString ){
-       xmlChar* expression = (xmlChar*)queryString;
+       const xmlChar* expression = (const xmlChar*)queryString;
        xmlXPathObjectPtr result = xmlXPathEvalExpression( expression, context );
        return result;
 };
index dbde66c14193bd5d5933885922ff0125ff8323dc..0b559893384db1d10d47d219ebd1763008a9cf9d 100644 (file)
@@ -649,7 +649,7 @@ void render( RenderStateFlags state ) const {
        points[6] = vector4_projected( matrix4_transformed_vector4( unproject, Vector4( points[6], 1 ) ) );
        points[7] = vector4_projected( matrix4_transformed_vector4( unproject, Vector4( points[7], 1 ) ) );
        Vector4 test1 = matrix4_transformed_vector4( unproject, Vector4( 0.5f, 0.5f, 0.5f, 1 ) );
-       Vector3 test2 = vector4_projected( test1 );
+       /*Vector3 test2 =*/ vector4_projected( test1 );
        aabb_draw_wire( points );
 }
 };
index 138151a2f62c81de5270f9188ff211d53c59a745..31685fd86fda5feb8f0f3dc10291c25e4ed33ede 100644 (file)
@@ -297,13 +297,12 @@ static void j_putRGBAScanline( unsigned char* jpegline, int widthPix, unsigned c
 
        for ( count = 0; count < widthPix; count++ )
        {
-               unsigned char iRed, iBlu, iGrn, iAlp;
+               unsigned char iRed, iBlu, iGrn;
                unsigned char *oRed, *oBlu, *oGrn, *oAlp;
 
                iRed = *( jpegline + count * 4 + 0 );
                iGrn = *( jpegline + count * 4 + 1 );
                iBlu = *( jpegline + count * 4 + 2 );
-               iAlp = *( jpegline + count * 4 + 3 );
 
                oRed = outBuf + offset + count * 4 + 0;
                oGrn = outBuf + offset + count * 4 + 1;
@@ -318,7 +317,7 @@ static void j_putRGBAScanline( unsigned char* jpegline, int widthPix, unsigned c
 #if 1
                *oAlp = 255;
 #else
-               *oAlp = iAlp;
+               *oAlp = *( jpegline + count * 4 + 3 );
 #endif
        }
 }
index 582d0b8b3652eeee74b321c3522e5bd983e09126..6837a2d8207e5dc9d360c4441b8a68350b8f7c97 100644 (file)
@@ -47,6 +47,7 @@
 class KTX_Decoder
 {
 public:
+       virtual ~KTX_Decoder(){}
        virtual void Decode( PointerInputStream& istream, byte* out ) = 0;
        virtual unsigned int GetPixelSize() = 0;
 };
index 2731e15ad2003a4462331e2b5488ca55c5d0a8b0..e82b833bfa2480c5b3bacd27bfd885f42b2dee14 100644 (file)
@@ -91,7 +91,7 @@ typedef struct
 Image* LoadHLWBuff( byte* buffer ){
        byte *buf_p;
        unsigned long mipdatasize;
-       int columns, rows, numPixels;
+       int columns, rows;
        byte *pixbuf;
        int row, column;
        byte *palette;
@@ -108,7 +108,7 @@ Image* LoadHLWBuff( byte* buffer ){
 
        columns = lpMip->width;
        rows = lpMip->height;
-       numPixels = columns * rows;
+       //int numPixels = columns * rows;
 
        RGBAImage* image = new RGBAImage( columns, rows );
 
index 51dbfd7e916409764e448fc21e1f169bd2873534..2e4f979b40fa51268dc5b33f17a16be49ae1dfa8 100644 (file)
@@ -138,7 +138,6 @@ static const byte quakepalette[768] =
 Image* LoadMIPBuff( byte* buffer ){
        byte *buf_p;
        int palettelength;
-       unsigned long mipdatasize;
        int columns, rows, numPixels;
        byte *pixbuf;
        int i;
@@ -158,7 +157,7 @@ Image* LoadMIPBuff( byte* buffer ){
                return 0;
        }
 
-       mipdatasize = GET_MIP_DATA_SIZE( columns, rows );
+       // unsigned long mipdatasize = GET_MIP_DATA_SIZE( columns, rows );
 
        palettelength = vfsLoadFile( "gfx/palette.lmp", (void **) &loadedpalette );
        if ( palettelength == 768 ) {
index b6347ec480f9444f95f84977d56e3aad372c552c..0fdec869d34767e81182ceb66edd5f288574d234 100644 (file)
@@ -102,7 +102,7 @@ typedef struct {
 
 Image* LoadIDSPBuff( byte *buffer ){
        byte *buf_p;
-       int columns, rows, numPixels;
+       int columns, rows;
        byte *pixbuf;
 
        int row, column;
@@ -159,7 +159,7 @@ Image* LoadIDSPBuff( byte *buffer ){
        // palette = buffer+mipdatasize+2;
        // buf_p = buffer+lpMip->offsets[0];
 
-       numPixels = columns * rows;
+       //int numPixels = columns * rows;
 
        RGBAImage* image = new RGBAImage( columns, rows );
 
index 2c3d99c519b550838dbd503a563a9fde75aa3c9e..e21cf22d94b32562d1ad83179313c7b637451686 100644 (file)
@@ -110,7 +110,7 @@ void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator&
        if ( !Tokeniser_getSize( tokeniser, version ) ) {
                return;
        }
-       if ( version != MapVersion() ) {
+       if ( version != std::size_t(MapVersion()) ) {
                globalErrorStream() << "Doom 3 map version " << MapVersion() << " supported, version is " << Unsigned( version ) << "\n";
                return;
        }
@@ -181,7 +181,7 @@ void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator&
        if ( !Tokeniser_getSize( tokeniser, version ) ) {
                return;
        }
-       if ( version != MapVersion() ) {
+       if ( version != std::size_t(MapVersion()) ) {
                globalErrorStream() << "Quake 4 map version " << MapVersion() << " supported, version is " << Unsigned( version ) << "\n";
                return;
        }
index 69719051c588e568cbafad6b86edebc8dc41eed1..8516b9d5cbb87bbfdf189ca3c4456f44087d310b 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "model.h"
 
-#define MD5_RETURN_FALSE_IF_FAIL( expression ) if ( !( expression ) ) { globalErrorStream() << "md5 parse failed: " # expression "\n"; return false; } else
+#define MD5_RETURN_FALSE_IF_FAIL( expression ) if ( !( expression ) ) { globalErrorStream() << "md5 parse failed: " # expression "\n"; return false; }
 
 bool MD5_parseToken( Tokeniser& tokeniser, const char* string ){
        const char* token = tokeniser.getToken();
index 54df7abc499c4658c464d4f068bf9e2d4a49051a..a431ef4fbd109c0664f2d189d12353fc28045b9d 100644 (file)
@@ -782,7 +782,7 @@ qtexture_t* evaluateTexture( const TextureExpression& texture, const ShaderParam
 
 float evaluateFloat( const ShaderValue& value, const ShaderParameters& params, const ShaderArguments& args ){
        const char* result = evaluateShaderValue( value.c_str(), params, args );
-       float f;
+       float f = 0;
        if ( !string_parse_float( result, f ) ) {
                globalErrorStream() << "parsing float value failed: " << makeQuoted( result ) << "\n";
        }
index 893f002bdf66f46351df1b5d3325347aecac9550..4ccc8b59d4e7f30b280a08ac978641fa48ff184f 100644 (file)
@@ -473,8 +473,8 @@ int GetFileCount( const char *filename, int flag ){
 
        for ( archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i )
        {
-               if ( ( *i ).is_pakfile && ( flag & VFS_SEARCH_PAK ) != 0
-                        || !( *i ).is_pakfile && ( flag & VFS_SEARCH_DIR ) != 0 ) {
+               if ( (( *i ).is_pakfile && ( flag & VFS_SEARCH_PAK ) != 0)
+                        || (!( *i ).is_pakfile && ( flag & VFS_SEARCH_DIR ) != 0) ) {
                        if ( ( *i ).archive->containsFile( fixed ) ) {
                                ++count;
                        }
index 4ea73c0356a7572e168bc12dec3381d1044f4fbe..6aae7bb2282e84409eef3453171df5c17bee8048 100644 (file)
@@ -1235,7 +1235,7 @@ inline Matrix4 matrix4_reflection_for_plane45( const Plane3& plane, const Vector
        Vector3 first = from;
        Vector3 second = to;
 
-       if ( vector3_dot( from, plane.normal() ) > 0 == vector3_dot( to, plane.normal() ) > 0 ) {
+       if ( (vector3_dot( from, plane.normal() ) > 0) == (vector3_dot( to, plane.normal() ) > 0) ) {
                first = vector3_negated( first );
                second = vector3_negated( second );
        }
@@ -1253,7 +1253,7 @@ inline Matrix4 matrix4_reflection_for_plane45( const Plane3& plane, const Vector
 
        Matrix4 swap = matrix4_swap_axes( first, second );
 
-       Matrix4 tmp = matrix4_reflection_for_plane( plane );
+       /*Matrix4 tmp =*/ matrix4_reflection_for_plane( plane );
 
        swap.tx() = -static_cast<float>( -2 * plane.a * plane.d );
        swap.ty() = -static_cast<float>( -2 * plane.b * plane.d );
index 073e0ddf12049b467afdb4b7b32a0cbec375e8b5..3ea279dacd7e06a06e7f38f0e84cdee04335df1e 100644 (file)
@@ -55,6 +55,7 @@ const char* build_get_variable( const char* name ){
 class Evaluatable
 {
 public:
+virtual ~Evaluatable(){}
 virtual void evaluate( StringBuffer& output ) = 0;
 virtual void exportXML( XMLImporter& importer ) = 0;
 };
index de2e03e0e1b438b6a514d9754e0aa05ae8ed17c7..fdd5cc587a34c7897f18fb3b309497b29f211a42 100644 (file)
@@ -319,17 +319,15 @@ void Camera_FreeMove( camera_t& camera, int dx, int dy ){
 }
 
 void Cam_MouseControl( camera_t& camera, int x, int y ){
-       int xl, xh;
-       int yl, yh;
        float xf, yf;
 
        xf = (float)( x - camera.width / 2 ) / ( camera.width / 2 );
        yf = (float)( y - camera.height / 2 ) / ( camera.height / 2 );
 
-       xl = camera.width / 3;
-       xh = xl * 2;
-       yl = camera.height / 3;
-       yh = yl * 2;
+       //int xl = camera.width / 3;
+       //int xh = xl * 2;
+       //int yl = camera.height / 3;
+       //int yh = yl * 2;
 
        xf *= 1.0f - fabsf( yf );
        if ( xf < 0 ) {
@@ -1353,7 +1351,7 @@ void SetState( Shader* state, EStyle style ){
                m_state_stack.back().m_state = state;
        }
 }
-const EStyle getStyle() const {
+EStyle getStyle() const {
        return eFullMaterials;
 }
 void PushState(){
index 2a0454ebad33afe1d3208a7edeff3d5411383d39..61e1580d90ad68a753f32ac80e6e64bff80e4516 100644 (file)
@@ -85,8 +85,10 @@ inline void StringExport( CopiedString& self, const StringImportCallback& import
 typedef ReferenceCaller1<CopiedString, const StringImportCallback&, StringExport> StringExportCaller;
 
 
-struct DLG_DATA
+class DLG_DATA
 {
+public:
+       virtual ~DLG_DATA(){}
        virtual void release() = 0;
        virtual void importData() const = 0;
        virtual void exportData() const = 0;
index db65063a50ea28fefc99aaee562c74e43511a59c..c74c7b72ee257013d59908b30a4ee4e81cf539d9 100644 (file)
@@ -45,7 +45,7 @@ namespace
 typedef std::map<const char*, EntityClass*, RawStringLessNoCase> EntityClasses;
 EntityClasses g_entityClasses;
 EntityClass   *eclass_bad = 0;
-char eclass_directory[1024];
+//char eclass_directory[1024];
 typedef std::map<CopiedString, ListAttributeType> ListAttributeTypes;
 ListAttributeTypes g_listTypes;
 }
index 620cc276808309c33c868327dfb7e8e78aa30c62..6c4bb022bc42da24c8ef09dd2beb5bb51b8f3acd 100644 (file)
@@ -84,7 +84,7 @@ inline void printParseError( const char* message ){
        globalErrorStream() << message;
 }
 
-#define PARSE_RETURN_FALSE_IF_FAIL( expression ) if ( !( expression ) ) { printParseError( FILE_LINE "\nparse failed: " # expression "\n" ); return false; } else
+#define PARSE_RETURN_FALSE_IF_FAIL( expression ) if ( !( expression ) ) { printParseError( FILE_LINE "\nparse failed: " # expression "\n" ); return false; }
 
 bool EntityClassDoom3_parseToken( Tokeniser& tokeniser ){
        const char* token = tokeniser.getToken();
index 5c1c330b913f7d6966550eb10dc7ff2db07741c3..859050ec1027cccbd25f7915bcd724f710bb6f0d 100644 (file)
@@ -118,6 +118,7 @@ void Scene_EntitySetKeyValue_Selected_Undoable( const char* key, const char* val
 class EntityAttribute
 {
 public:
+virtual ~EntityAttribute(){}
 virtual GtkWidget* getWidget() const = 0;
 virtual void update() = 0;
 virtual void release() = 0;
index 9583b90fbc3761fff1e41f25be173f376aec0401..232b3582cae011860a142835bee8f7d8fb7c7f45 100644 (file)
@@ -30,7 +30,7 @@
 #include "cmdlib.h"
 
 int g_argc;
-char** g_argv;
+const char ** g_argv;
 
 void args_init( int argc, char* argv[] ){
        int i, j, k;
@@ -51,11 +51,11 @@ void args_init( int argc, char* argv[] ){
        }
 
        g_argc = argc;
-       g_argv = argv;
+       g_argv = (const char **)argv;
 }
 
-char *gamedetect_argv_buffer[1024];
-void gamedetect_found_game( char *game, char *path ){
+const char *gamedetect_argv_buffer[1024];
+void gamedetect_found_game( const char *game, char *path ){
        int argc;
        static char buf[128];
 
@@ -79,7 +79,7 @@ void gamedetect_found_game( char *game, char *path ){
        g_argv = gamedetect_argv_buffer;
 }
 
-bool gamedetect_check_game( char *gamefile, const char *checkfile1, const char *checkfile2, char *buf /* must have 64 bytes free after bufpos */, int bufpos ){
+bool gamedetect_check_game( const char *gamefile, const char *checkfile1, const char *checkfile2, char *buf /* must have 64 bytes free after bufpos */, int bufpos ){
        buf[bufpos] = '/';
 
        strcpy( buf + bufpos + 1, checkfile1 );
@@ -196,7 +196,7 @@ const char* LINK_NAME =
 ;
 
 /// brief Returns the filename of the executable belonging to the current process, or 0 if not found.
-char* getexename( char *buf ){
+const char* getexename( char *buf ){
        /* Now read the symbolic link */
        int ret = readlink( LINK_NAME, buf, PATH_MAX );
 
index 7ee16c6f56b32bedb71361bba9ad626c1fcc1843..e04565dff8117af9714691b423d67890deb294a9 100644 (file)
@@ -27,6 +27,6 @@ const char* environment_get_home_path();
 const char* environment_get_app_path();
 
 extern int g_argc;
-extern char** g_argv;
+extern const char** g_argv;
 
 #endif
index 87cb205c15b4afd6fc7519b3458b08d380f717d7..cfb3cc6f76623af76492bc4bcb115c66fba90e23 100644 (file)
@@ -35,7 +35,8 @@ class RadiantFileTypeRegistry : public IFileTypeRegistry
 struct filetype_copy_t
 {
        filetype_copy_t( const char* moduleName, const filetype_t other )
-               : m_moduleName( moduleName ), m_name( other.name ), m_pattern( other.pattern ), m_can_load( other.can_load ), m_can_import( other.can_import ), m_can_save( other.can_save ){
+               : m_can_load( other.can_load ), m_can_import( other.can_import ), m_can_save( other.can_save ),
+               m_moduleName( moduleName ), m_name( other.name ), m_pattern( other.pattern ) {
        }
        const char* getModuleName() const {
                return m_moduleName.c_str();
index 5fd58f7c426a7a1f0a001e3fdee569497918f3e6..83ac42f054d8481a664bf43d9f0c43831891f2c6 100644 (file)
@@ -100,7 +100,7 @@ static void OnApply( GtkWidget* widget, gpointer data ){
        FindTextureDialog_apply();
 }
 
-static void OnFind( GtkWidget* widget, gpointer data ){
+/*static void OnFind( GtkWidget* widget, gpointer data ){
        g_FindTextureDialog.exportData();
        FindTextureDialog_apply();
 }
@@ -109,7 +109,7 @@ static void OnOK( GtkWidget* widget, gpointer data ){
        g_FindTextureDialog.exportData();
        FindTextureDialog_apply();
        g_FindTextureDialog.HideDlg();
-}
+}*/
 
 static void OnClose( GtkWidget* widget, gpointer data ){
        g_FindTextureDialog.HideDlg();
index 34fc54c7a80e1a4ecd9884a4d699a22986a32f3c..e35b467e70cd16cd5052ea6bb3b1ce1a1624b58e 100644 (file)
@@ -923,7 +923,7 @@ EMessageBoxReturn DoLightIntensityDlg( int *intensity ){
 // =============================================================================
 // Add new shader tag dialog
 
-EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, char* title ){
+EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, const char* title ){
        ModalDialog dialog;
        GtkEntry* textentry;
        ModalDialogButton ok_button( dialog, eIDOK );
@@ -984,7 +984,7 @@ EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, char* title ){
        return ret;
 }
 
-EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, char* title ){
+EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, const char* title ){
        ModalDialog dialog;
        ModalDialogButton ok_button( dialog, eIDOK );
 
index 0ff194e606dd1ae80f42cac5a878d2229680ccb3..05f8b8b9ea38c31b9d42cac79d0f4664b8610e56 100644 (file)
@@ -35,8 +35,8 @@
 #include "string/string.h"
 
 EMessageBoxReturn DoLightIntensityDlg( int *intensity );
-EMessageBoxReturn DoShaderTagDlg( CopiedString *tag, char* title );
-EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, char* title );
+EMessageBoxReturn DoShaderTagDlg( CopiedString *tag, const char* title );
+EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, const char* title );
 EMessageBoxReturn DoTextureLayout( float *fx, float *fy );
 void DoTextEditor( const char* filename, int cursorpos );
 
index 95dba53b4d35cb4b44aed6ce5f6ff9e61c2a21c1..7e04d46a71486ea41f12ee63282d2ba38b416c25 100644 (file)
@@ -2379,14 +2379,14 @@ GtkToolbar* create_main_toolbar( MainFrame::EViewStyle style ){
 
        gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
 
-       GtkButton* g_view_entities_button = toolbar_append_button( toolbar, "Entities (N)", "entities.bmp", "ToggleEntityInspector" );
+       /*GtkButton* g_view_entities_button =*/ toolbar_append_button( toolbar, "Entities (N)", "entities.bmp", "ToggleEntityInspector" );
        GtkButton* g_view_console_button = toolbar_append_button( toolbar, "Console (O)", "console.bmp", "ToggleConsole" );
        GtkButton* g_view_textures_button = toolbar_append_button( toolbar, "Texture Browser (T)", "texture_browser.bmp", "ToggleTextures" );
        // TODO: call light inspector
        //GtkButton* g_view_lightinspector_button = toolbar_append_button(toolbar, "Light Inspector", "lightinspector.bmp", "ToggleLightInspector");
 
        gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) );
-       GtkButton* g_refresh_models_button = toolbar_append_button( toolbar, "Refresh Models", "refresh_models.bmp", "RefreshReferences" );
+       /*GtkButton* g_refresh_models_button =*/ toolbar_append_button( toolbar, "Refresh Models", "refresh_models.bmp", "RefreshReferences" );
 
 
        // disable the console and texture button in the regular layouts
index b31def460421835a87b98173fc706e21e7e24991..dca55b79b2176b13bf33f80df1151fda5e82dad3 100644 (file)
@@ -1357,14 +1357,13 @@ void Patch::ConstructPrefab( const AABB& aabb, EPatchPrefab eType, int axis, std
                // vPos[1] = aabb.origin;
                // vPos[2] = vector3_added(aabb.origin, aabb.extents);
 
-               int i, j;
                float f = 1 / cos( M_PI / n );
-               for ( i = 0; i < width; ++i )
+               for ( std::size_t i = 0; i < width; ++i )
                {
                        float angle = ( M_PI * i ) / n; // 0 to 2pi
                        float x = vPos[1][0] + ( vPos[2][0] - vPos[1][0] ) * cos( angle ) * ( ( i & 1 ) ? f : 1.0f );
                        float y = vPos[1][1] + ( vPos[2][1] - vPos[1][1] ) * sin( angle ) * ( ( i & 1 ) ? f : 1.0f );
-                       for ( j = 0; j < height; ++j )
+                       for ( std::size_t j = 0; j < height; ++j )
                        {
                                float z = vPos[0][2] + ( vPos[2][2] - vPos[0][2] ) * ( j / (float)( height - 1 ) );
                                PatchControl *v;
@@ -1383,12 +1382,11 @@ void Patch::ConstructPrefab( const AABB& aabb, EPatchPrefab eType, int axis, std
                // vPos[1] = aabb.origin;
                // vPos[2] = vector3_added(aabb.origin, aabb.extents);
 
-               int i, j;
                float f = 1 / cos( M_PI / n );
-               for ( i = 0; i < width; ++i )
+               for ( std::size_t i = 0; i < width; ++i )
                {
                        float angle = ( M_PI * i ) / n;
-                       for ( j = 0; j < height; ++j )
+                       for ( std::size_t j = 0; j < height; ++j )
                        {
                                float x = vPos[1][0] + ( 1.0f - ( j / (float)( height - 1 ) ) ) * ( vPos[2][0] - vPos[1][0] ) * cos( angle ) * ( ( i & 1 ) ? f : 1.0f );
                                float y = vPos[1][1] + ( 1.0f - ( j / (float)( height - 1 ) ) ) * ( vPos[2][1] - vPos[1][1] ) * sin( angle ) * ( ( i & 1 ) ? f : 1.0f );
@@ -1410,13 +1408,12 @@ void Patch::ConstructPrefab( const AABB& aabb, EPatchPrefab eType, int axis, std
                // vPos[1] = aabb.origin;
                // vPos[2] = vector3_added(aabb.origin, aabb.extents);
 
-               int i, j;
                float f = 1 / cos( M_PI / n );
                float g = 1 / cos( M_PI / ( 2 * m ) );
-               for ( i = 0; i < width; ++i )
+               for ( std::size_t i = 0; i < width; ++i )
                {
                        float angle = ( M_PI * i ) / n;
-                       for ( j = 0; j < height; ++j )
+                       for ( std::size_t j = 0; j < height; ++j )
                        {
                                float angle2 = ( M_PI * j ) / ( 2 * m );
                                float x = vPos[1][0] + ( vPos[2][0] - vPos[1][0] ) *  sin( angle2 ) * ( ( j & 1 ) ? g : 1.0f ) * cos( angle ) * ( ( i & 1 ) ? f : 1.0f );
index e306015f77f2580aafeea27501902011092306d9..963f694d496082a068a163f39195e42ce5d6f4ef 100644 (file)
@@ -1930,7 +1930,7 @@ void TextureBrowser_SetNotex(){
        name << GlobalRadiant().getAppPath() << "bitmaps/notex.bmp";
        g_notex = name.c_str();
 
-       name = NULL;
+       name = StringOutputStream();
        name << GlobalRadiant().getAppPath() << "bitmaps/shadernotex.bmp";
        g_shadernotex = name.c_str();
 }
index 9910fb98a1b68ac2bc7495b8af64eb0a492058a8..c12811b9b74426119b4bdaaaa8116d0adacdecd5 100644 (file)
@@ -254,7 +254,7 @@ void release( Undoable* undoable ){
        m_undoables.erase( undoable );
 }
 void setLevels( std::size_t levels ){
-       if ( levels > MAX_UNDO_LEVELS() ) {
+       if ( levels > std::size_t(MAX_UNDO_LEVELS()) ) {
                levels = MAX_UNDO_LEVELS();
        }
 
index a30303f4c8273bee5cbb4c57fc33f6719a19b4cb..b6f6a4e47bc972c74d0ea8ef1e41cd04d19f5e2b 100644 (file)
@@ -68,8 +68,8 @@ class IGL2DWindow;
 class ISAXHandler
 {
 public:
-virtual void Release(){
-}
+virtual ~ISAXHandler(){}
+virtual void Release(){}
 virtual void saxStartElement( message_info_t* ctx, const xmlChar* name, const xmlChar** attrs ) = 0;
 virtual void saxEndElement( message_info_t* ctx, const xmlChar* name ) = 0;
 virtual void saxCharacters( message_info_t* ctx, const xmlChar* ch, int len ) = 0;
index b094b7744d5f034f57216469357dc65d59068734..61f3c4783aa2277729abba2857167df5b90f4c3e 100644 (file)
@@ -413,6 +413,7 @@ inline unsigned int buttons_for_button_and_modifiers( ButtonIdentifier button, M
        case ButtonEnumeration::LEFT: buttons |= RAD_LBUTTON; break;
        case ButtonEnumeration::MIDDLE: buttons |= RAD_MBUTTON; break;
        case ButtonEnumeration::RIGHT: buttons |= RAD_RBUTTON; break;
+       default: break;
        }
 
        if ( bitfield_enabled( flags, c_modifierControl ) ) {
@@ -1449,7 +1450,7 @@ void XYWnd::XY_LoadBackgroundImage( const char *name ){
        globalOutputStream() << "Loaded background texture " << relative << "\n";
        g_pParentWnd->ActiveXY()->m_backgroundActivated = true;
 
-       int m_ix, m_iy;
+       int m_ix = 0, m_iy = 0;
        switch ( g_pParentWnd->ActiveXY()->m_viewType )
        {
        case XY:
@@ -2064,7 +2065,7 @@ void SetState( Shader* state, EStyle style ){
                m_state_stack.back().m_state = state;
        }
 }
-const EStyle getStyle() const {
+EStyle getStyle() const {
        return eWireframeOnly;
 }
 void PushState(){