From a8eda0db12b4ff2c77b3e2cc826f5093ab433d3e Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 6 May 2012 12:45:59 +0200 Subject: [PATCH] Minor stuff --- audio/mixer.cpp | 2 +- audio/mixer.h | 2 +- ext/vjson/json.cpp | 7 ++++++- ext/vjson/json.h | 7 +++++++ midi/midi_input.h | 1 + 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/audio/mixer.cpp b/audio/mixer.cpp index 8b06d34416..483221bffe 100644 --- a/audio/mixer.cpp +++ b/audio/mixer.cpp @@ -135,7 +135,7 @@ const short *clip_data(const Clip *clip) return clip->data; } -int clip_length(const Clip *clip) { +size_t clip_length(const Clip *clip) { return clip->length; } diff --git a/audio/mixer.h b/audio/mixer.h index 68f4833b3e..99b140aad4 100644 --- a/audio/mixer.h +++ b/audio/mixer.h @@ -33,7 +33,7 @@ Clip *clip_load(const char *filename); void clip_destroy(Clip *clip); const short *clip_data(const Clip *clip); -int clip_length(const Clip *clip); +size_t clip_length(const Clip *clip); void clip_set_loop(int start, int end); diff --git a/ext/vjson/json.cpp b/ext/vjson/json.cpp index a08d2ba60f..8e375af951 100644 --- a/ext/vjson/json.cpp +++ b/ext/vjson/json.cpp @@ -50,7 +50,12 @@ const json_value *json_value::get(const char *child_name, json_type type) const } const char *json_value::getString(const char *child_name) const { - return get(child_name, JSON_STRING)->string_value; + const json_value *val = get(child_name, JSON_STRING); + if (val) + return val->string_value; + else + FLOG("String %s missing from node %s", child_name, this->name); + return 0; } const char *json_value::getString(const char *child_name, const char *default_value) const { diff --git a/ext/vjson/json.h b/ext/vjson/json.h index 5c56ee10cf..a6b9bed80e 100644 --- a/ext/vjson/json.h +++ b/ext/vjson/json.h @@ -107,3 +107,10 @@ private: DISALLOW_COPY_AND_ASSIGN(JsonReader); }; + +// TODO: Make this a push/pop interface similar to JsonWriter. Maybe +// we can get to the point where reading and writing is near identical or the same code. +class JsonCursor { +public: + +}; \ No newline at end of file diff --git a/midi/midi_input.h b/midi/midi_input.h index 125e22f7cd..371a749799 100644 --- a/midi/midi_input.h +++ b/midi/midi_input.h @@ -16,6 +16,7 @@ typedef void *MidiDevice; class MidiListener { public: + virtual ~MidiListener() {} virtual void midiEvent(const uint8_t *cmd) = 0; };