[systemd-commits] 2 commits - src/journal src/shared

Kay Sievers kay at kemper.freedesktop.org
Sun Jul 15 05:59:57 PDT 2012


 src/journal/journal-internal.h |    3 ---
 src/journal/sd-journal.c       |    2 +-
 src/shared/macro.h             |    1 +
 3 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 19d1e4eeb6501b77ba34a29e6a632fcf775fccd5
Author: Kay Sievers <kay at vrfy.org>
Date:   Sun Jul 15 14:58:29 2012 +0200

    journal: align byte-buffer that gets cased to an object
    
    On Sun, Jul 15, 2012 at 2:00 PM, Koen Kooi <koen at dominion.thruhere.net> wrote:
    > | src/journal/sd-journal.c: In function 'sd_journal_process':
    > | src/journal/sd-journal.c:1891:21: warning: cast increases required alignment of target type [-Wcast-align]
    > | src/journal/sd-journal.c:1900:29: warning: cast increases required alignment of target type [-Wcast-align]

diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 57572d4..a2900fb 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -1868,7 +1868,7 @@ static int determine_change(sd_journal *j) {
 }
 
 _public_ int sd_journal_process(sd_journal *j) {
-        uint8_t buffer[sizeof(struct inotify_event) + FILENAME_MAX];
+        uint8_t buffer[sizeof(struct inotify_event) + FILENAME_MAX] _alignas_(struct inotify_event);
         bool got_something = false;
 
         if (!j)
diff --git a/src/shared/macro.h b/src/shared/macro.h
index 1c0aa91..97eebbc 100644
--- a/src/shared/macro.h
+++ b/src/shared/macro.h
@@ -45,6 +45,7 @@
 #define _hidden_ __attribute__ ((visibility("hidden")))
 #define _weakref_(x) __attribute__((weakref(#x)))
 #define _introspect_(x) __attribute__((section("introspect." x)))
+#define _alignas_(x) __attribute__((aligned(__alignof(x))))
 
 #define XSTRINGIFY(x) #x
 #define STRINGIFY(x) XSTRINGIFY(x)

commit dbfd9122583baea644fc727466ce30a6b5fd2706
Author: Kay Sievers <kay at vrfy.org>
Date:   Sun Jul 15 14:56:57 2012 +0200

    journal: avoid re-definition of enums for older gcc versions
    
    On Sun, Jul 15, 2012 at 2:00 PM, Koen Kooi <koen at dominion.thruhere.net> wrote:
    > | In file included from src/journal/sd-journal.c:37:0:
    > | src/journal/journal-internal.h:47:3: error: redefinition of typedef 'MatchType'
    > | src/journal/journal-internal.h:36:24: note: previous declaration of 'MatchType' was here
    > | src/journal/journal-internal.h:67:3: error: redefinition of typedef 'LocationType'
    > | src/journal/journal-internal.h:37:27: note: previous declaration of 'LocationType' was here

diff --git a/src/journal/journal-internal.h b/src/journal/journal-internal.h
index 482ef61..64d05f0 100644
--- a/src/journal/journal-internal.h
+++ b/src/journal/journal-internal.h
@@ -33,9 +33,6 @@
 #include "hashmap.h"
 #include "journal-file.h"
 
-typedef enum MatchType MatchType;
-typedef enum LocationType LocationType;
-
 typedef struct Match Match;
 typedef struct Location Location;
 typedef struct Directory Directory;



More information about the systemd-commits mailing list