User forums > Nightly builds

The 19 september 2010 build (6608) CODECOMPLETION BRANCH version is out.

<< < (14/19) > >>

Loaden:

--- Quote from: oBFusCATed on September 24, 2010, 09:03:29 am ---Also why do you create the locker on the heap, probably some commenting will be good, this is way to non trivial code you've written.

--- End quote ---
Because we need to give the main thread of a chance to enter the critical.
You can check this code:

--- Code: ---// Do the code completion when we enter:
// #include "| or #include <|
void CodeCompletion::CodeCompleteIncludes()
{
...
    // #include <|
    if (m_CCSystemHeaderFiles)
    {
        wxCriticalSectionLocker locker(s_HeadersCriticalSection);
        wxArrayString& incDirs = GetSystemIncludeDirs(&m_NativeParser.GetParser(),
                                                      project ? project->GetModified() : true);
        for (size_t i = 0; i < incDirs.GetCount(); ++i)
        {
            SystemHeadersMap::iterator it = m_SystemHeadersMap.find(incDirs[i]);
            if (it != m_SystemHeadersMap.end())
            {
                const std::list<wxString>& headers = it->second;
                for (std::list<wxString>::const_iterator it = headers.begin(); it != headers.end(); ++it)
                    files.insert(*it);
            }
        }
    }

--- End code ---
This will make the UI more responsive.

Loaden:

--- Quote from: oBFusCATed on September 24, 2010, 09:03:29 am ---In this case != NULL is best (in fact you could use != nullptr in C::B), because you're documenting that this is a check for NULL.
"!!" is very confusing for people not seen this before...

--- End quote ---
Got it! Thanks!!

--- Quote ---Index: src/plugins/codecompletion/codecompletion.cpp
===================================================================
--- src/plugins/codecompletion/codecompletion.cpp    (revision 6632)
+++ src/plugins/codecompletion/codecompletion.cpp    (working copy)
@@ -339,7 +339,7 @@
                 m_Locker = new(std::nothrow) wxCriticalSectionLocker(s_HeadersCriticalSection);
             }
 
-            return !!m_Locker;
+            return m_Locker != NULL;
         }
 
     private:

--- End quote ---

Loaden:

--- Quote from: Borr on September 24, 2010, 09:00:21 am ---ibpp(http://www.ibpp.org/)  and CC problem still not solved
http://forums.codeblocks.org/index.php/topic,11844.msg80492.html#msg80492

--- End quote ---
Template inheritance is not yet supported.

oBFusCATed:
Loaden:
Why don't you use message passing for this?
What you've done is just a hack...
Also, It seems that the list of files won't be correct if the main thread enters the critical section before the worker have finished.
Probably it will be better to add an item in the list -> "Processing 10%"

killerbot:
well :


--- Code: ---return m_Locker != 0;

--- End code ---

NULL :  :-(    , please C++0X come fast (or at least gcc implement it fast) nullptr.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version