Fixes for misc. compiler warnings.

Originally committed to SVN as r797.
This commit is contained in:
Niels Martin Hansen 2007-01-15 15:27:13 +00:00
parent a8abb99e6b
commit 818b31edc3
8 changed files with 28 additions and 12 deletions

View file

@ -231,7 +231,6 @@ void AudioSpectrum::RenderRange(__int64 range_start, __int64 range_end, bool sel
{ {
unsigned long first_line = (unsigned long)(range_start / line_length / 2); unsigned long first_line = (unsigned long)(range_start / line_length / 2);
unsigned long last_line = (unsigned long)(range_end / line_length / 2); unsigned long last_line = (unsigned long)(range_end / line_length / 2);
unsigned long lines_to_render = last_line - first_line + 1;
float *power = new float[line_length]; float *power = new float[line_length];

View file

@ -75,7 +75,7 @@ namespace Automation4 {
LOGFONTW lf; LOGFONTW lf;
ZeroMemory(&lf, sizeof(lf)); ZeroMemory(&lf, sizeof(lf));
lf.lfHeight = fontsize; lf.lfHeight = (LONG)fontsize;
lf.lfWeight = style->bold ? FW_BOLD : FW_NORMAL; lf.lfWeight = style->bold ? FW_BOLD : FW_NORMAL;
lf.lfItalic = style->italic; lf.lfItalic = style->italic;
lf.lfUnderline = style->underline; lf.lfUnderline = style->underline;
@ -131,7 +131,7 @@ namespace Automation4 {
// USING wxTheFontList SEEMS TO CAUSE BAD LEAKS! // USING wxTheFontList SEEMS TO CAUSE BAD LEAKS!
//wxFont *thefont = wxTheFontList->FindOrCreateFont( //wxFont *thefont = wxTheFontList->FindOrCreateFont(
wxFont thefont( wxFont thefont(
fontsize, (int)fontsize,
wxFONTFAMILY_DEFAULT, wxFONTFAMILY_DEFAULT,
style->italic ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL, style->italic ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL,
style->bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL, style->bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL,
@ -146,7 +146,7 @@ namespace Automation4 {
for (unsigned int i = 0; i < text.length(); i++) { for (unsigned int i = 0; i < text.length(); i++) {
int a, b, c, d; int a, b, c, d;
thedc.GetTextExtent(text[i], &a, &b, &c, &d); thedc.GetTextExtent(text[i], &a, &b, &c, &d);
width += a + style->spacing; width += a + (int)style->spacing;
height = b > height ? b : height; height = b > height ? b : height;
descent = c > descent ? c : descent; descent = c > descent ? c : descent;
extlead= d > extlead ? d : extlead; extlead= d > extlead ? d : extlead;

View file

@ -170,6 +170,7 @@ namespace Automation4 {
public: public:
ScriptConfigDialog() : win(0) { } ScriptConfigDialog() : win(0) { }
virtual ~ScriptConfigDialog() { }
wxWindow* GetWindow(wxWindow *parent); wxWindow* GetWindow(wxWindow *parent);
void DeleteWindow(); void DeleteWindow();
virtual void ReadBack() = 0; virtual void ReadBack() = 0;
@ -245,8 +246,8 @@ namespace Automation4 {
void SetTitle(const wxString &_title); void SetTitle(const wxString &_title);
void AddDebugOutput(const wxString &msg); void AddDebugOutput(const wxString &msg);
volatile bool has_inited;
volatile bool script_finished; volatile bool script_finished;
volatile bool has_inited;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
@ -327,6 +328,7 @@ namespace Automation4 {
static std::vector<ScriptFactory*> *factories; static std::vector<ScriptFactory*> *factories;
protected: protected:
ScriptFactory() { } ScriptFactory() { }
virtual ~ScriptFactory() { }
wxString engine_name; wxString engine_name;
wxString filename_pattern; wxString filename_pattern;
public: public:

View file

@ -517,9 +517,9 @@ namespace Automation4 {
} }
LuaFeatureMacro::LuaFeatureMacro(const wxString &_name, const wxString &_description, lua_State *_L) LuaFeatureMacro::LuaFeatureMacro(const wxString &_name, const wxString &_description, lua_State *_L)
: LuaFeature(_L, SCRIPTFEATURE_MACRO, _name) : Feature(SCRIPTFEATURE_MACRO, _name)
, FeatureMacro(_name, _description) , FeatureMacro(_name, _description)
, Feature(SCRIPTFEATURE_MACRO, _name) , LuaFeature(_L, SCRIPTFEATURE_MACRO, _name)
{ {
// new table for containing the functions for this feature // new table for containing the functions for this feature
lua_newtable(L); lua_newtable(L);
@ -590,9 +590,9 @@ namespace Automation4 {
// LuaFeatureFilter // LuaFeatureFilter
LuaFeatureFilter::LuaFeatureFilter(const wxString &_name, const wxString &_description, int merit, lua_State *_L) LuaFeatureFilter::LuaFeatureFilter(const wxString &_name, const wxString &_description, int merit, lua_State *_L)
: LuaFeature(_L, SCRIPTFEATURE_FILTER, _name) : Feature(SCRIPTFEATURE_FILTER, _name)
, FeatureFilter(_name, _description, merit) , FeatureFilter(_name, _description, merit)
, Feature(SCRIPTFEATURE_FILTER, _name) , LuaFeature(_L, SCRIPTFEATURE_FILTER, _name)
{ {
// Works the same as in LuaFeatureMacro // Works the same as in LuaFeatureMacro
lua_newtable(L); lua_newtable(L);
@ -837,6 +837,8 @@ namespace Automation4 {
Register(this); Register(this);
} }
~LuaScriptFactory() { }
virtual Script* Produce(const wxString &filename) const virtual Script* Produce(const wxString &filename) const
{ {
// Just check if file extension is .lua // Just check if file extension is .lua

View file

@ -122,6 +122,7 @@ namespace Automation4 {
virtual void LuaReadBack(lua_State *L) = 0; virtual void LuaReadBack(lua_State *L) = 0;
LuaConfigDialogControl(lua_State *L); LuaConfigDialogControl(lua_State *L);
virtual ~LuaConfigDialogControl() { }
}; };
class LuaConfigDialog : public ScriptConfigDialog { class LuaConfigDialog : public ScriptConfigDialog {

View file

@ -123,6 +123,8 @@ namespace Automation4 {
lua_pop(L, 1); lua_pop(L, 1);
} }
virtual ~Label() { }
wxControl *Create(wxWindow *parent) wxControl *Create(wxWindow *parent)
{ {
return cw = new wxStaticText(parent, -1, label); return cw = new wxStaticText(parent, -1, label);
@ -155,6 +157,8 @@ namespace Automation4 {
lua_pop(L, 1); lua_pop(L, 1);
} }
virtual ~Edit() { }
wxControl *Create(wxWindow *parent) wxControl *Create(wxWindow *parent)
{ {
return cw = new wxTextCtrl(parent, -1, text, wxDefaultPosition, wxDefaultSize, 0); return cw = new wxTextCtrl(parent, -1, text, wxDefaultPosition, wxDefaultSize, 0);
@ -184,6 +188,8 @@ namespace Automation4 {
// Nothing more // Nothing more
} }
virtual ~Textbox() { }
wxControl *Create(wxWindow *parent) wxControl *Create(wxWindow *parent)
{ {
cw = new wxTextCtrl(parent, -1, text, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); cw = new wxTextCtrl(parent, -1, text, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
@ -230,6 +236,8 @@ nospin:
} }
} }
virtual ~IntEdit() { }
typedef wxValidator IntTextValidator; // TODO typedef wxValidator IntTextValidator; // TODO
wxControl *Create(wxWindow *parent) wxControl *Create(wxWindow *parent)
{ {
@ -278,6 +286,8 @@ nospin:
// TODO: spin button support // TODO: spin button support
} }
virtual ~FloatEdit() { }
typedef wxValidator FloatTextValidator; typedef wxValidator FloatTextValidator;
wxControl *Create(wxWindow *parent) wxControl *Create(wxWindow *parent)
{ {
@ -326,6 +336,8 @@ nospin:
lua_pop(L, 1); lua_pop(L, 1);
} }
virtual ~Dropdown() { }
wxControl *Create(wxWindow *parent) wxControl *Create(wxWindow *parent)
{ {
return cw = new wxComboBox(parent, -1, value, wxDefaultPosition, wxDefaultSize, items, wxCB_READONLY); return cw = new wxComboBox(parent, -1, value, wxDefaultPosition, wxDefaultSize, items, wxCB_READONLY);
@ -363,6 +375,8 @@ nospin:
lua_pop(L, 1); lua_pop(L, 1);
} }
virtual ~Checkbox() { }
wxControl *Create(wxWindow *parent) wxControl *Create(wxWindow *parent)
{ {
return cw = new wxCheckBox(parent, -1, label); return cw = new wxCheckBox(parent, -1, label);

View file

@ -34,9 +34,6 @@
// //
#pragma once
//////////// ////////////
// Includes // Includes
#include "base_grid.h" #include "base_grid.h"

View file

@ -241,6 +241,7 @@ void hsv_to_rgb(int H, int S, int V, unsigned char *R, unsigned char *G, unsigne
b = v; b = v;
break; break;
case 5: case 5:
default:
r = v; r = v;
g = p; g = p;
b = q; b = q;