]> git.llucax.com Git - software/eventxx.git/blobdiff - eventxx
Revert "Add flattr widget to home page"
[software/eventxx.git] / eventxx
diff --git a/eventxx b/eventxx
index 7b4d950d087255d735fb7a550f32d8b0a8fd0d21..2aeb0d0c6562349229dbed6cc437812ff1b40ff0 100644 (file)
--- a/eventxx
+++ b/eventxx
@@ -201,9 +201,7 @@ inline
 type operator| (const type& t1, const type& t2)
 {
        int r = static_cast< int >(t1) | static_cast< int >(t2);
-       int* pr = &r; // Avoid some weird warning about dereferencing
-                     // type-punned pointer will break strict-aliasing rules
-       return *reinterpret_cast< type* >(pr);
+       return static_cast< type >(r);
 }
 
 
@@ -322,10 +320,7 @@ struct event: basic_event
                        F& handler = *reinterpret_cast< F* >(h);
                        // Hackish, but this way the handler can get a clean
                        // event type
-                       short* pev = &ev; // Avoid some weird warning about
-                                         // dereferencing type-punned pointer
-                                         // will break strict-aliasing rules
-                       handler(fd, *reinterpret_cast< type* >(pev));
+                       handler(fd, static_cast< type >(ev));
                }
 
 }; // struct event< F >
@@ -796,6 +791,11 @@ struct dispatcher
                        handler(fd, *reinterpret_cast< type* >(&ev));
                }
 
+       private:
+               // Hide nonsense copy-constructor and operator=
+               dispatcher(const dispatcher&);
+               dispatcher& operator=(const dispatcher&);
+
 }; // struct dispatcher
 
 } // namespace eventxx