From 3db02c64fa611ecd99c5a3d0d89f82ccab2827b3 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 10 Apr 2017 23:04:34 +0200 Subject: [PATCH] Fix issue with even stricter atomic implementation (without even the set operator for atomics). --- m-snapshot.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/m-snapshot.h b/m-snapshot.h index a94f5e89..a56aaec2 100644 --- a/m-snapshot.h +++ b/m-snapshot.h @@ -67,7 +67,7 @@ * - b: Boolean indicating that the read buffer shall be updated */ #define SNAPSHOTI_FLAG(r, w, f, b) \ - ( ( (r) << 4) | ((w) << 2) | ((f)) | ((b) << 6)) + ((unsigned char)( ( (r) << 4) | ((w) << 2) | ((f)) | ((b) << 6))) #define SNAPSHOTI_R(flags) \ (((flags) >> 4) & 0x03u) #define SNAPSHOTI_W(flags) \ @@ -135,7 +135,7 @@ for(int i = 0; i < 3; i++) { \ M_GET_INIT_SET oplist(snap->data[i], org->data[i]); \ } \ - snap->flags = org->flags; \ + atomic_init (&snap->flags, atomic_load(&org->flags)); \ SNAPSHOTI_CONTRACT(snap); \ } \ \ @@ -147,7 +147,7 @@ for(int i = 0; i < 3; i++) { \ M_GET_SET oplist(snap->data[i], org->data[i]); \ } \ - snap->flags = org->flags; \ + atomic_init (&snap->flags, atomic_load(&org->flags)); \ SNAPSHOTI_CONTRACT(snap); \ } \ \