[haiku-commits] BRANCH midar-github.master - in src/apps: webpositive/support soundrecorder

  • From: midar-github.master <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 18 Nov 2012 23:48:48 +0100 (CET)

added 2 changesets to branch 'refs/remotes/midar-github/master'
old head: 2a420f60ad34676d5b9b7752ed0e8d6dd496f3ef
new head: 6090683e5e798b2ebbbcf42699b577003202e232
overview: https://github.com/Midar/haiku/compare/2a420f6...6090683

----------------------------------------------------------------------------

d210330: Make SoundRecorder compile with Clang.

6090683: Make WebPositive compile with Clang.
  
  I don't really know why the change in HashMap.h was needed, but without
  it, Clang gave the following error:
  
  src/apps/webpositive/support/HashMap.h:461:29: error: elaborated type refers 
to
        a typedef
  struct HashMap<Key, Value>::Element *
                              ^
  src/apps/webpositive/support/HashMap.h:194:37: note: declared here
          typedef HashMapElement<Key, Value>      Element;

                                     [ Jonathan Schleifer <js@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

4 files changed, 9 insertions(+), 5 deletions(-)
src/apps/soundrecorder/VUView.cpp            | 6 +++++-
src/apps/terminal/BasicTerminalBuffer.cpp    | 2 +-
src/apps/webpositive/support/HashMap.h       | 4 ++--
src/apps/webpositive/support/OpenHashTable.h | 2 +-

############################################################################

Commit:      d210330c04cf73ef9b29e149e0e61547f56cd480
Author:      Jonathan Schleifer <js@xxxxxxxxxxx>
Date:        Sun Nov 18 22:16:39 2012 UTC

Make SoundRecorder compile with Clang.

----------------------------------------------------------------------------

diff --git a/src/apps/soundrecorder/VUView.cpp 
b/src/apps/soundrecorder/VUView.cpp
index c90afc5..b4f7b35 100644
--- a/src/apps/soundrecorder/VUView.cpp
+++ b/src/apps/soundrecorder/VUView.cpp
@@ -9,6 +9,8 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <vector>
+
 #include <MediaDefs.h>
 #include <Screen.h>
 #include <Window.h>
@@ -20,6 +22,8 @@ const rgb_color back_color = {12, 36, 12};
 const rgb_color low_color = {40, 120, 40};
 const rgb_color high_color = {240, 255, 240};
 
+typedef std::vector<rgb_color> rgb_color_vec;
+
 VUView::VUView(BRect rect, uint32 resizeFlags)
        : BView(rect, "vumeter", resizeFlags, B_WILL_DRAW),
        fThreadId(-1),
@@ -108,7 +112,7 @@ VUView::_RenderLaunch(void *data)
 void
 VUView::_RenderLoop()
 {
-       rgb_color levels[fLevelCount][2];
+       std::vector<rgb_color_vec> levels(fLevelCount, rgb_color_vec(2));
        
        for (int32 i = 0; i < fLevelCount; i++) {
                levels[i][0] = levels[i][1] = back_color;       
diff --git a/src/apps/terminal/BasicTerminalBuffer.cpp 
b/src/apps/terminal/BasicTerminalBuffer.cpp
index 76792b4..6c90b52 100644
--- a/src/apps/terminal/BasicTerminalBuffer.cpp
+++ b/src/apps/terminal/BasicTerminalBuffer.cpp
@@ -9,8 +9,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <vector>
 #include <algorithm>
+#include <vector>
 
 #include <String.h>
 

############################################################################

Commit:      6090683e5e798b2ebbbcf42699b577003202e232
Author:      Jonathan Schleifer <js@xxxxxxxxxxx>
Date:        Sun Nov 18 22:27:44 2012 UTC

Make WebPositive compile with Clang.

I don't really know why the change in HashMap.h was needed, but without
it, Clang gave the following error:

src/apps/webpositive/support/HashMap.h:461:29: error: elaborated type refers to
      a typedef
struct HashMap<Key, Value>::Element *
                            ^
src/apps/webpositive/support/HashMap.h:194:37: note: declared here
        typedef HashMapElement<Key, Value>      Element;

----------------------------------------------------------------------------

diff --git a/src/apps/webpositive/support/HashMap.h 
b/src/apps/webpositive/support/HashMap.h
index 36b321f..05a0096 100644
--- a/src/apps/webpositive/support/HashMap.h
+++ b/src/apps/webpositive/support/HashMap.h
@@ -458,10 +458,10 @@ HashMap<Key, Value>::GetIterator() const
 
 // _FindElement
 template<typename Key, typename Value>
-struct HashMap<Key, Value>::Element *
+HashMapElement<Key, Value> *
 HashMap<Key, Value>::_FindElement(const Key& key) const
 {
-       Element* element = fTable.FindFirst(key.GetHashCode());
+       HashMapElement<Key, Value>* element = 
fTable.FindFirst(key.GetHashCode());
        while (element && element->fKey != key) {
                if (element->fNext >= 0)
                        element = fTable.ElementAt(element->fNext);
diff --git a/src/apps/webpositive/support/OpenHashTable.h 
b/src/apps/webpositive/support/OpenHashTable.h
index 437fbed..d66ad66 100644
--- a/src/apps/webpositive/support/OpenHashTable.h
+++ b/src/apps/webpositive/support/OpenHashTable.h
@@ -447,7 +447,7 @@ OpenHashElementArray<Element>::Add(const Element 
&newElement)
 {
        Element *element = Add();
        if (element)
-               element.Adopt(newElement);
+               element->Adopt(newElement);
        return element;
 }
 


Other related posts: