Fix for a possible compile error under OS X

(cherry picked from commit 621d28adef)
This commit is contained in:
Marcelo Fernandez 2018-02-14 13:10:17 -03:00 committed by Hein-Pieter van Braam
parent 02e910275c
commit c5388fb0cf
3 changed files with 140 additions and 132 deletions

View File

@ -37,7 +37,7 @@
#define kOutputBus 0 #define kOutputBus 0
#ifdef OSX_ENABLED #ifdef OSX_ENABLED
static OSStatus outputDeviceAddressCB(AudioObjectID inObjectID, UInt32 inNumberAddresses, const AudioObjectPropertyAddress *inAddresses, void *__nullable inClientData) { static OSStatus outputDeviceAddressCB(AudioObjectID inObjectID, UInt32 inNumberAddresses, const AudioObjectPropertyAddress *inAddresses, void *inClientData) {
AudioDriverCoreAudio *driver = (AudioDriverCoreAudio *)inClientData; AudioDriverCoreAudio *driver = (AudioDriverCoreAudio *)inClientData;
driver->reopen(); driver->reopen();

View File

@ -81,20 +81,7 @@ void EditorHelpSearch::_sbox_input(const Ref<InputEvent> &p_ie) {
} }
} }
class EditorHelpSearch::IncrementalSearch : public Reference { void EditorHelpSearch::IncrementalSearch::phase1(Map<String, DocData::ClassDoc>::Element *E) {
String term;
TreeItem *root;
EditorHelpSearch *search;
Tree *search_options;
DocData *doc;
Ref<Texture> def_icon;
int phase;
Map<String, DocData::ClassDoc>::Element *iterator;
void phase1(Map<String, DocData::ClassDoc>::Element *E) {
if (E->key().findn(term) != -1) { if (E->key().findn(term) != -1) {
@ -108,7 +95,7 @@ class EditorHelpSearch::IncrementalSearch : public Reference {
} }
} }
void phase2(Map<String, DocData::ClassDoc>::Element *E) { void EditorHelpSearch::IncrementalSearch::phase2(Map<String, DocData::ClassDoc>::Element *E) {
DocData::ClassDoc &c = E->get(); DocData::ClassDoc &c = E->get();
@ -173,7 +160,7 @@ class EditorHelpSearch::IncrementalSearch : public Reference {
} }
} }
bool slice() { bool EditorHelpSearch::IncrementalSearch::slice() {
if (phase > 2) if (phase > 2)
return true; return true;
@ -204,8 +191,7 @@ class EditorHelpSearch::IncrementalSearch : public Reference {
return false; return false;
} }
public: EditorHelpSearch::IncrementalSearch::IncrementalSearch(EditorHelpSearch *p_search, Tree *p_search_options, const String &p_term) :
IncrementalSearch(EditorHelpSearch *p_search, Tree *p_search_options, const String &p_term) :
search(p_search), search(p_search),
search_options(p_search_options) { search_options(p_search_options) {
@ -219,12 +205,12 @@ public:
iterator = 0; iterator = 0;
} }
bool empty() const { bool EditorHelpSearch::IncrementalSearch::empty() const {
return root->get_children() == NULL; return root->get_children() == NULL;
} }
bool work(uint64_t slot = 1000000 / 10) { bool EditorHelpSearch::IncrementalSearch::work(uint64_t slot) {
const uint64_t until = OS::get_singleton()->get_ticks_usec() + slot; const uint64_t until = OS::get_singleton()->get_ticks_usec() + slot;
@ -236,7 +222,6 @@ public:
return true; return true;
} }
};
void EditorHelpSearch::_update_search() { void EditorHelpSearch::_update_search() {
search_options->clear(); search_options->clear();

View File

@ -54,7 +54,30 @@ class EditorHelpSearch : public ConfirmationDialog {
Tree *search_options; Tree *search_options;
String base_type; String base_type;
class IncrementalSearch; class IncrementalSearch : public Reference {
String term;
TreeItem *root;
EditorHelpSearch *search;
Tree *search_options;
DocData *doc;
Ref<Texture> def_icon;
int phase;
Map<String, DocData::ClassDoc>::Element *iterator;
void phase1(Map<String, DocData::ClassDoc>::Element *E);
void phase2(Map<String, DocData::ClassDoc>::Element *E);
bool slice();
public:
IncrementalSearch(EditorHelpSearch *p_search, Tree *p_search_options, const String &p_term);
bool empty() const;
bool work(uint64_t slot = 1000000 / 10);
};
Ref<IncrementalSearch> search; Ref<IncrementalSearch> search;
void _update_search(); void _update_search();