[haiku-commits] BRANCH midar-github.master - headers/libs/agg src/system/libroot/posix/glibc/stdio-common src/system/libroot/posix/glibc src/apps/icon-o-matic/shape src/system/libroot/posix/arch/x86

  • From: midar-github.master <community@xxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 19 Nov 2012 17:48:55 +0100 (CET)

added 4 changesets to branch 'refs/remotes/midar-github/master'
old head: 6090683e5e798b2ebbbcf42699b577003202e232
new head: 01307acc28b2ea16d263176e5d20580313965563
overview: https://github.com/Midar/haiku/compare/6090683...01307ac

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

3085ec9: Make libagg compile with Clang.

dd9e3c9: Make app_server compile with Clang.

4add70e: Make Icon-O-Matic compile with Clang.
  
  Everything in src/apps compiles with Clang now! :)

01307ac: Make libroot compile with Clang.

                                     [ Jonathan Schleifer <js@xxxxxxxxxxx> ]

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

17 files changed, 76 insertions(+), 25 deletions(-)
headers/libs/agg/agg_renderer_outline_aa.h       |  2 +-
headers/libs/agg/agg_scanline_u.h                | 19 +++++++++----
src/apps/icon-o-matic/shape/PathManipulator.cpp  |  7 +++--
src/servers/app/drawing/DrawingEngine.cpp        |  4 ++-
src/system/libroot/posix/arch/x86/fenv.c         |  7 ++---
.../libroot/posix/glibc/arch/generic/w_dremf.c   |  3 +-
src/system/libroot/posix/glibc/arch/x86/Jamfile  |  3 ++
src/system/libroot/posix/glibc/ctype/Jamfile     |  4 +++
.../libroot/posix/glibc/extensions/Jamfile       |  4 +++
src/system/libroot/posix/glibc/iconv/Jamfile     |  3 ++
src/system/libroot/posix/glibc/libio/Jamfile     |  3 ++
src/system/libroot/posix/glibc/libio/getc_u.c    |  1 -
src/system/libroot/posix/glibc/misc/Jamfile      |  3 ++
.../libroot/posix/glibc/stdio-common/Jamfile     |  3 ++
.../libroot/posix/glibc/stdio-common/printf_fp.c | 29 +++++++++++++++-----
src/system/libroot/posix/glibc/stdlib/Jamfile    |  3 ++
src/system/libroot/posix/glibc/wcsmbs/Jamfile    |  3 ++

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

Commit:      3085ec9b65ac126b0a9653c493ed6b1d21d987f8
Author:      Jonathan Schleifer <js@xxxxxxxxxxx>
Date:        Mon Nov 19 15:45:09 2012 UTC

Make libagg compile with Clang.

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

diff --git a/headers/libs/agg/agg_renderer_outline_aa.h 
b/headers/libs/agg/agg_renderer_outline_aa.h
index e3629db..f9c7674 100644
--- a/headers/libs/agg/agg_renderer_outline_aa.h
+++ b/headers/libs/agg/agg_renderer_outline_aa.h
@@ -1365,7 +1365,7 @@ namespace agg
         //---------------------------------------------------------------------
         void profile(const line_profile_aa& prof) { m_profile = &prof; }
         const line_profile_aa& profile() const { return *m_profile; }
-        line_profile_aa& profile() { return *m_profile; }
+        line_profile_aa& profile() { return *(line_profile_aa*)m_profile; }
 
         //---------------------------------------------------------------------
         int subpixel_width() const { return m_profile->subpixel_width(); }
diff --git a/headers/libs/agg/agg_scanline_u.h 
b/headers/libs/agg/agg_scanline_u.h
index 5a28ed1..b87e81c 100755
--- a/headers/libs/agg/agg_scanline_u.h
+++ b/headers/libs/agg/agg_scanline_u.h
@@ -464,21 +464,28 @@ namespace agg
         typedef base_type::coord_type coord_type;
 
 
-        scanline32_u8_am() : base_type(), m_alpha_mask(0) {}
-        scanline32_u8_am(const AlphaMask& am) : base_type(), m_alpha_mask(&am) 
{}
+        scanline32_u8_am() : m_alpha_mask(0)
+               {
+                       this->base_type();
+               }
+
+        scanline32_u8_am(const AlphaMask& am) : m_alpha_mask(&am)
+               {
+                       this->base_type();
+               }
 
         //--------------------------------------------------------------------
         void finalize(int span_y)
         {
-            base_type::finalize(span_y);
+            this->base_type::finalize(span_y);
             if(m_alpha_mask)
             {
-                typename base_type::iterator span = base_type::begin();
-                unsigned count = base_type::num_spans();
+                typename base_type::iterator span = this->base_type::begin();
+                unsigned count = this->base_type::num_spans();
                 do
                 {
                     m_alpha_mask->combine_hspan(span->x, 
-                                                base_type::y(), 
+                                                this->base_type::y(),
                                                 span->covers, 
                                                 span->len);
                     ++span;

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

Commit:      dd9e3c93ceeec74c35de358744536eda817bdb9c
Author:      Jonathan Schleifer <js@xxxxxxxxxxx>
Date:        Mon Nov 19 15:47:01 2012 UTC

Make app_server compile with Clang.

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

diff --git a/src/servers/app/drawing/DrawingEngine.cpp 
b/src/servers/app/drawing/DrawingEngine.cpp
index 4e3a836..a912406 100644
--- a/src/servers/app/drawing/DrawingEngine.cpp
+++ b/src/servers/app/drawing/DrawingEngine.cpp
@@ -11,8 +11,10 @@
 
 #include <Bitmap.h>
 #include <stdio.h>
+
 #include <algorithm>
 #include <stack>
+#include <vector>
 
 #include "DrawState.h"
 #include "GlyphLayoutEngine.h"
@@ -469,7 +471,7 @@ DrawingEngine::CopyRegion(/*const*/ BRegion* region, int32 
xOffset,
 
        // TODO: make this step unnecessary
        // (by using different stack impl inside node)
-       node nodes[count];
+       std::vector<node> nodes(count);
        for (int32 i= 0; i < count; i++) {
                nodes[i].init(region->RectAt(i), count);
        }

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

Commit:      4add70e0c4b78f1442c30f35fb39cbe7e9582f4d
Author:      Jonathan Schleifer <js@xxxxxxxxxxx>
Date:        Mon Nov 19 15:49:45 2012 UTC

Make Icon-O-Matic compile with Clang.

Everything in src/apps compiles with Clang now! :)

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

diff --git a/src/apps/icon-o-matic/shape/PathManipulator.cpp 
b/src/apps/icon-o-matic/shape/PathManipulator.cpp
index 4a06a51..ad0e7df 100644
--- a/src/apps/icon-o-matic/shape/PathManipulator.cpp
+++ b/src/apps/icon-o-matic/shape/PathManipulator.cpp
@@ -8,6 +8,8 @@
 #include <float.h>
 #include <stdio.h>
 
+#include <vector>
+
 #include <Catalog.h>
 #include <Cursor.h>
 #include <Locale.h>
@@ -1703,7 +1705,7 @@ PathManipulator::_Nudge(BPoint direction)
                int32 count = fromSelection ? fSelection->CountItems()
                                                                        : 
fPath->CountPoints();
                int32 indices[count];
-               control_point points[count];
+               std::vector<control_point> points(count);
 
                // init indices and points
                for (int32 i = 0; i < count; i++) {
@@ -1715,7 +1717,8 @@ PathManipulator::_Nudge(BPoint direction)
                                                           
&points[i].connected);
                }
 
-               fNudgeCommand = new NudgePointsCommand(fPath, indices, points, 
count);
+               fNudgeCommand = new NudgePointsCommand(fPath, indices, 
&points[0],
+                       count);
 
                fNudgeCommand->SetNewTranslation(fNudgeOffset);
                fNudgeCommand->Redo();

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

Commit:      01307acc28b2ea16d263176e5d20580313965563
Author:      Jonathan Schleifer <js@xxxxxxxxxxx>
Date:        Mon Nov 19 16:14:02 2012 UTC

Make libroot compile with Clang.

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

diff --git a/src/system/libroot/posix/arch/x86/fenv.c 
b/src/system/libroot/posix/arch/x86/fenv.c
index b0c657b..78b9db0 100644
--- a/src/system/libroot/posix/arch/x86/fenv.c
+++ b/src/system/libroot/posix/arch/x86/fenv.c
@@ -165,7 +165,7 @@ feupdateenv(const fenv_t *envp)
        return (0);
 }
 
-int
+int __attribute__((weak, alias("feenableexcept")))
 __feenableexcept(int mask)
 {
        int mxcsr, control, omask;
@@ -186,7 +186,7 @@ __feenableexcept(int mask)
        return (~omask);
 }
 
-int
+int __attribute__((weak, alias("fedisableexcept")))
 __fedisableexcept(int mask)
 {
        int mxcsr, control, omask;
@@ -206,6 +206,3 @@ __fedisableexcept(int mask)
        }
        return (~omask);
 }
-
-__weak_reference(__feenableexcept, feenableexcept);
-__weak_reference(__fedisableexcept, fedisableexcept);
diff --git a/src/system/libroot/posix/glibc/arch/generic/w_dremf.c 
b/src/system/libroot/posix/glibc/arch/generic/w_dremf.c
index b740ea3..34a4c4a 100644
--- a/src/system/libroot/posix/glibc/arch/generic/w_dremf.c
+++ b/src/system/libroot/posix/glibc/arch/generic/w_dremf.c
@@ -9,8 +9,7 @@
 #include "math_private.h"
 
 float
-__dremf(x, y)
-       float x, y;
+__dremf(float x, float y)
 {
        return __remainderf(x, y);
 }
diff --git a/src/system/libroot/posix/glibc/arch/x86/Jamfile 
b/src/system/libroot/posix/glibc/arch/x86/Jamfile
index 4035668..34b7834 100644
--- a/src/system/libroot/posix/glibc/arch/x86/Jamfile
+++ b/src/system/libroot/posix/glibc/arch/x86/Jamfile
@@ -20,6 +20,9 @@ if $(OPTIM) = -O0 {
 DEBUG = 0 ;
 
 SubDirCcFlags -D_GNU_SOURCE -D_IEEE_LIBM ;
+if $(HAIKU_GCC_VERSION[1]) >= 4 {
+       SubDirCcFlags -fgnu89-inline ;
+}
 
 local genericSources =
        cmp.c dbl2mpn.c divrem.c 
diff --git a/src/system/libroot/posix/glibc/ctype/Jamfile 
b/src/system/libroot/posix/glibc/ctype/Jamfile
index ff8c702..7b05f43 100644
--- a/src/system/libroot/posix/glibc/ctype/Jamfile
+++ b/src/system/libroot/posix/glibc/ctype/Jamfile
@@ -1,5 +1,9 @@
 SubDir HAIKU_TOP src system libroot posix glibc ctype ;
 
+if $(HAIKU_GCC_VERSION[1]) >= 4 {
+       SubDirCcFlags -fgnu89-inline ;
+}
+
 SubDirSysHdrs $(SUBDIR) ;
 SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch
        $(TARGET_ARCH) ;
diff --git a/src/system/libroot/posix/glibc/extensions/Jamfile 
b/src/system/libroot/posix/glibc/extensions/Jamfile
index 25fdbd5..ab54678 100644
--- a/src/system/libroot/posix/glibc/extensions/Jamfile
+++ b/src/system/libroot/posix/glibc/extensions/Jamfile
@@ -1,5 +1,9 @@
 SubDir HAIKU_TOP src system libroot posix glibc extensions ;
 
+if $(HAIKU_GCC_VERSION[1]) >= 4 {
+       SubDirCcFlags -fgnu89-inline ;
+}
+
 SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch
        $(TARGET_ARCH) ;
 SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch generic 
;
diff --git a/src/system/libroot/posix/glibc/iconv/Jamfile 
b/src/system/libroot/posix/glibc/iconv/Jamfile
index 94cd974..974283b 100644
--- a/src/system/libroot/posix/glibc/iconv/Jamfile
+++ b/src/system/libroot/posix/glibc/iconv/Jamfile
@@ -14,6 +14,9 @@ UsePrivateHeaders libroot ;
 
 
 SubDirCcFlags -D_GNU_SOURCE -DUSE_IN_LIBIO ;
+if $(HAIKU_GCC_VERSION[1]) >= 4 {
+       SubDirCcFlags -fgnu89-inline ;
+}
 
 MergeObject posix_gnu_iconv.o :
        gconv_builtin.c
diff --git a/src/system/libroot/posix/glibc/libio/Jamfile 
b/src/system/libroot/posix/glibc/libio/Jamfile
index 4e6f0dc..bc3c71a 100644
--- a/src/system/libroot/posix/glibc/libio/Jamfile
+++ b/src/system/libroot/posix/glibc/libio/Jamfile
@@ -18,6 +18,9 @@ UsePrivateHeaders libroot ;
 # obstack functionality
 
 SubDirCcFlags -D_GNU_SOURCE -DUSE_IN_LIBIO ;
+if $(HAIKU_GCC_VERSION[1]) >= 4 {
+       SubDirCcFlags -fgnu89-inline ;
+}
 
 MergeObject posix_gnu_libio.o :
        __fsetlocking.c
diff --git a/src/system/libroot/posix/glibc/libio/getc_u.c 
b/src/system/libroot/posix/glibc/libio/getc_u.c
index f0c19b4..2f0c6a2 100644
--- a/src/system/libroot/posix/glibc/libio/getc_u.c
+++ b/src/system/libroot/posix/glibc/libio/getc_u.c
@@ -26,7 +26,6 @@
    in files containing the exception.  */
 
 #include "libioP.h"
-#include <stdio.h>
 
 #undef getc_unlocked
 
diff --git a/src/system/libroot/posix/glibc/misc/Jamfile 
b/src/system/libroot/posix/glibc/misc/Jamfile
index 937e164..52189e1 100644
--- a/src/system/libroot/posix/glibc/misc/Jamfile
+++ b/src/system/libroot/posix/glibc/misc/Jamfile
@@ -14,6 +14,9 @@ UsePrivateHeaders libroot ;
 
 
 SubDirCcFlags -D_GNU_SOURCE -DUSE_IN_LIBIO ;
+if $(HAIKU_GCC_VERSION[1]) >= 4 {
+       SubDirCcFlags -fgnu89-inline ;
+}
 
 MergeObject posix_gnu_misc.o :
        hsearch.c
diff --git a/src/system/libroot/posix/glibc/stdio-common/Jamfile 
b/src/system/libroot/posix/glibc/stdio-common/Jamfile
index bea6ede..d75419f 100644
--- a/src/system/libroot/posix/glibc/stdio-common/Jamfile
+++ b/src/system/libroot/posix/glibc/stdio-common/Jamfile
@@ -1,6 +1,9 @@
 SubDir HAIKU_TOP src system libroot posix glibc stdio-common ;
 
 SubDirCcFlags -D_GNU_SOURCE -DUSE_IN_LIBIO ;
+if $(HAIKU_GCC_VERSION[1]) >= 4 {
+       SubDirCcFlags -fgnu89-inline ;
+}
 
 SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc libio ;
 SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc include arch
diff --git a/src/system/libroot/posix/glibc/stdio-common/printf_fp.c 
b/src/system/libroot/posix/glibc/stdio-common/printf_fp.c
index 4c68c5e..7009741 100644
--- a/src/system/libroot/posix/glibc/stdio-common/printf_fp.c
+++ b/src/system/libroot/posix/glibc/stdio-common/printf_fp.c
@@ -38,6 +38,7 @@
 #include <limits.h>
 #include <math.h>
 #include <printf.h>
+#include <setjmp.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -200,11 +201,13 @@ __printf_fp (FILE *fp,
   /* Nonzero if this is output on a wide character stream.  */
   int wide = info->wide;
 
-  auto wchar_t hack_digit (void);
+  wchar_t hack_digit_ret;
+  jmp_buf hack_digit_caller;
 
-  wchar_t hack_digit (void)
+  while (0)
     {
       mp_limb_t hi;
+hack_digit:
 
       if (expsign != 0 && type == 'f' && exponent-- > 0)
        hi = 0;
@@ -232,7 +235,8 @@ __printf_fp (FILE *fp,
                  /* We're not prepared for an mpn variable with zero
                     limbs.  */
                  fracsize = 1;
-                 return L'0' + hi;
+                 hack_digit_ret = L'0' + hi;
+                 goto hack_digit_end;
                }
            }
 
@@ -241,7 +245,9 @@ __printf_fp (FILE *fp,
            frac[fracsize++] = cy;
        }
 
-      return L'0' + hi;
+      hack_digit_ret = L'0' + hi;
+hack_digit_end:
+      longjmp(hack_digit_caller, 1);
     }
 
 
@@ -885,7 +891,10 @@ __printf_fp (FILE *fp,
        while (intdig_no < intdig_max)
          {
            ++intdig_no;
-           *wcp++ = hack_digit ();
+           if (setjmp(hack_digit_caller))
+             *wcp++ = hack_digit_ret;
+           else
+             goto hack_digit;
          }
        significant = 1;
        if (info->alt
@@ -907,7 +916,10 @@ __printf_fp (FILE *fp,
           || (fracdig_no < fracdig_max && (fracsize > 1 || frac[0] != 0)))
       {
        ++fracdig_no;
-       *wcp = hack_digit ();
+       if (setjmp(hack_digit_caller))
+         *wcp++ = hack_digit_ret;
+       else
+         goto hack_digit;
        if (*wcp != L'0')
          significant = 1;
        else if (significant == 0)
@@ -920,7 +932,10 @@ __printf_fp (FILE *fp,
       }
 
     /* Do rounding.  */
-    digit = hack_digit ();
+    if (setjmp(hack_digit_caller))
+      digit = hack_digit_ret;
+    else
+      goto hack_digit;
     if (digit > L'4')
       {
        wchar_t *wtp = wcp;
diff --git a/src/system/libroot/posix/glibc/stdlib/Jamfile 
b/src/system/libroot/posix/glibc/stdlib/Jamfile
index fe91aa1..22cdd31 100644
--- a/src/system/libroot/posix/glibc/stdlib/Jamfile
+++ b/src/system/libroot/posix/glibc/stdlib/Jamfile
@@ -10,6 +10,9 @@ SubDirSysHdrs $(HAIKU_TOP) src system libroot posix glibc ;
 UsePrivateHeaders libroot ;
 
 SubDirCcFlags -D_GNU_SOURCE -DUSE_IN_LIBIO ;
+if $(HAIKU_GCC_VERSION[1]) >= 4 {
+       SubDirCcFlags -fgnu89-inline ;
+}
 
 MergeObject posix_gnu_stdlib.o :
        drand48.c
diff --git a/src/system/libroot/posix/glibc/wcsmbs/Jamfile 
b/src/system/libroot/posix/glibc/wcsmbs/Jamfile
index 66ce9e3..d2def89 100644
--- a/src/system/libroot/posix/glibc/wcsmbs/Jamfile
+++ b/src/system/libroot/posix/glibc/wcsmbs/Jamfile
@@ -16,6 +16,9 @@ UsePrivateHeaders libroot ;
 
 
 SubDirCcFlags -D_GNU_SOURCE -DUSE_IN_LIBIO ;
+if $(HAIKU_GCC_VERSION[1]) >= 4 {
+       SubDirCcFlags -fgnu89-inline ;
+}
 
 MergeObject posix_gnu_wcsmbs.o :
        wcsmbsload.c


Other related posts: