summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-03-18 21:03:18 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2013-03-18 21:03:18 +0100
commit7c0d78d164cbce489cea672f110a4f3f96515ea1 (patch)
tree2894c58b8e2ca925f0014b1a3c7e04468f683ac7
parent35aabe3781239c22f65a87541bde03497abf2743 (diff)
Fix compiler warnings.
-rw-r--r--plugingui/eventhandler.cc6
-rw-r--r--plugingui/filebrowser.h2
-rw-r--r--plugingui/listbox.cc53
-rw-r--r--plugingui/nativewindow_win32.cc2
-rw-r--r--src/audioinputengine.h2
-rw-r--r--src/audiooutputengine.h2
-rw-r--r--src/events.h2
-rw-r--r--vst/drumgizmo_vst.cc9
-rw-r--r--vst/input_vst.h2
9 files changed, 42 insertions, 38 deletions
diff --git a/plugingui/eventhandler.cc b/plugingui/eventhandler.cc
index 017434e..1953da2 100644
--- a/plugingui/eventhandler.cc
+++ b/plugingui/eventhandler.cc
@@ -64,9 +64,6 @@ extern GUI::Window *gwindow;
#include "window.h"
LRESULT CALLBACK dialogProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
{
- static int last_x = 0;
- static int last_y = 0;
-
GUI::EventHandler *handler =
(GUI::EventHandler *) GetWindowLong(hwnd, GWL_USERDATA);
@@ -119,9 +116,6 @@ LRESULT CALLBACK dialogProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
e->x = (int)(short) LOWORD(lp);
e->y = (int)(short) HIWORD(lp);
handler->event = e;
-
- last_x = e->x;
- last_y = e->y;
}
break;
diff --git a/plugingui/filebrowser.h b/plugingui/filebrowser.h
index 2402c23..4cd5799 100644
--- a/plugingui/filebrowser.h
+++ b/plugingui/filebrowser.h
@@ -68,8 +68,8 @@ private:
#ifdef WIN32
// Only used on win32
- GUI::Label lbl_drive;
GUI::ComboBox drv;
+ GUI::Label lbl_drive;
#endif
};
diff --git a/plugingui/listbox.cc b/plugingui/listbox.cc
index 40f8a2a..45ea5f5 100644
--- a/plugingui/listbox.cc
+++ b/plugingui/listbox.cc
@@ -84,7 +84,7 @@ void GUI::ListBox::addItem(std::string name, std::string value)
}
}
- if(selected == -1) setSelection(items.size() - 1);
+ if(selected == -1) setSelection((int)items.size() - 1);
}
void GUI::ListBox::clear()
@@ -180,8 +180,8 @@ void GUI::ListBox::scrollEvent(ScrollEvent *e)
{
scroll_offset += e->delta;
if(scroll_offset < 0) scroll_offset = 0;
- if(scroll_offset > (items.size() - 1))
- scroll_offset = (items.size() - 1);
+ if(scroll_offset > ((int)items.size() - 1))
+ scroll_offset = ((int)items.size() - 1);
repaintEvent(NULL);
}
@@ -207,12 +207,12 @@ void GUI::ListBox::keyEvent(GUI::KeyEvent *e)
int numitems = height() / (font.textHeight() + padding);
marked++;
- if(marked > (items.size() - 1)) marked = items.size() - 1;
+ if(marked > ((int)items.size() - 1)) marked = (int)items.size() - 1;
if(marked > (scroll_offset + numitems - 1)) {
scroll_offset = marked - numitems + 1;
- if(scroll_offset > (items.size() - 1))
- scroll_offset = (items.size() - 1);
+ if(scroll_offset > ((int)items.size() - 1))
+ scroll_offset = ((int)items.size() - 1);
}
}
break;
@@ -228,11 +228,11 @@ void GUI::ListBox::keyEvent(GUI::KeyEvent *e)
// Number of items that can be displayed at a time.
int numitems = height() / (font.textHeight() + padding);
- marked = items.size() - 1;
+ marked = (int)items.size() - 1;
if(marked > (scroll_offset + numitems - 1)) {
scroll_offset = marked - numitems + 1;
- if(scroll_offset > (items.size() - 1))
- scroll_offset = (items.size() - 1);
+ if(scroll_offset > ((int)items.size() - 1))
+ scroll_offset = ((int)items.size() - 1);
}
}
break;
@@ -255,25 +255,24 @@ void GUI::ListBox::keyEvent(GUI::KeyEvent *e)
void GUI::ListBox::buttonEvent(ButtonEvent *e)
{
- if(e->x > (width() - btn_size) && e->y < (width() - 1)) {
- if(e->y > 0 && e->y < btn_size) {
- if(e->direction == -1) return;
- scroll_offset--;
- if(scroll_offset < 0) scroll_offset = 0;
- repaintEvent(NULL);
- return;
- }
-
- if(e->y > (height() - btn_size) && e->y < (height() - 1)) {
- if(e->direction == -1) return;
- scroll_offset++;
- if(scroll_offset > (items.size() - 1))
- scroll_offset = (items.size() - 1);
- repaintEvent(NULL);
- return;
- }
+ if(e->x > ((int)width() - btn_size) && e->y < ((int)width() - 1)) {
+ if(e->y > 0 && e->y < btn_size) {
+ if(e->direction == -1) return;
+ scroll_offset--;
+ if(scroll_offset < 0) scroll_offset = 0;
+ repaintEvent(NULL);
+ return;
}
-
+
+ if(e->y > ((int)height() - btn_size) && e->y < ((int)height() - 1)) {
+ if(e->direction == -1) return;
+ scroll_offset++;
+ if(scroll_offset > ((int)items.size() - 1))
+ scroll_offset = ((int)items.size() - 1);
+ repaintEvent(NULL);
+ return;
+ }
+ }
if(e->direction == -1) {
int skip = scroll_offset;
diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc
index 8a0b912..34e18fa 100644
--- a/plugingui/nativewindow_win32.cc
+++ b/plugingui/nativewindow_win32.cc
@@ -79,7 +79,7 @@ GUI::NativeWindowWin32::NativeWindowWin32(GlobalContext *gctx,
wndId = 0;
// }
- gctx->m_hwnd = CreateWindowEx(NULL/*ex_style*/, gctx->m_className,
+ gctx->m_hwnd = CreateWindowEx(0/*ex_style*/, gctx->m_className,
"DGBasisWidget",
(WS_OVERLAPPEDWINDOW | WS_VISIBLE),
window->x(), window->y(),
diff --git a/src/audioinputengine.h b/src/audioinputengine.h
index c17b964..c2d2e24 100644
--- a/src/audioinputengine.h
+++ b/src/audioinputengine.h
@@ -35,6 +35,8 @@
class AudioInputEngine {
public:
+ virtual ~AudioInputEngine() {}
+
virtual bool init(Instruments &instruments) = 0;
virtual void setParm(std::string parm, std::string value) = 0;
diff --git a/src/audiooutputengine.h b/src/audiooutputengine.h
index d2d2310..8b2b768 100644
--- a/src/audiooutputengine.h
+++ b/src/audiooutputengine.h
@@ -35,6 +35,8 @@
class AudioOutputEngine {
public:
+ virtual ~AudioOutputEngine() {}
+
virtual bool init(Channels channels) = 0;
virtual void setParm(std::string parm, std::string value) = 0;
diff --git a/src/events.h b/src/events.h
index 29cad22..a4adcee 100644
--- a/src/events.h
+++ b/src/events.h
@@ -40,6 +40,8 @@ typedef unsigned int timepos_t;
class Event {
public:
+ virtual ~Event() {}
+
typedef enum {
sample
} type_t;
diff --git a/vst/drumgizmo_vst.cc b/vst/drumgizmo_vst.cc
index 4d3ce9f..8a24a0f 100644
--- a/vst/drumgizmo_vst.cc
+++ b/vst/drumgizmo_vst.cc
@@ -132,8 +132,13 @@ DrumGizmoVst::DrumGizmoVst(audioMasterCallback audioMaster)
canProcessReplacing();
isSynth();
- char id[] = "DGV5"; // Four bytes typecasted into an unsigned integer
- setUniqueID(*(unsigned int*)id);
+ union {
+ char cid[4];
+ unsigned int iid;
+ } id;
+
+ memcpy(id.cid, "DGV5", 4); // Four bytes typecasted into an unsigned integer
+ setUniqueID(id.iid);
// setUniqueID((unsigned int)time(NULL));
diff --git a/vst/input_vst.h b/vst/input_vst.h
index e8378c8..668f39c 100644
--- a/vst/input_vst.h
+++ b/vst/input_vst.h
@@ -35,7 +35,7 @@
class InputVST : public AudioInputEngine {
public:
InputVST();
- ~InputVST();
+ virtual ~InputVST();
bool init(Instruments &instruments);