From: Mikko Rasa Date: Wed, 24 Sep 2008 16:16:43 +0000 (+0000) Subject: Convert C-style casts to C++-style X-Git-Tag: io-1.1~4 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=21bf2db4f8600a576dc8d6bfa82bb83e64d8424f;p=libs%2Fcore.git Convert C-style casts to C++-style --- diff --git a/source/file.h b/source/file.h index df5105d..4e86e29 100644 --- a/source/file.h +++ b/source/file.h @@ -55,13 +55,13 @@ protected: }; inline File::CreateMode operator|(File::CreateMode m, File::CreateMode n) -{ return File::CreateMode((int)m|(int)n); } +{ return File::CreateMode(static_cast(m)|static_cast(n)); } inline File::CreateMode operator&(File::CreateMode m, File::CreateMode n) -{ return File::CreateMode((int)m&(int)n); } +{ return File::CreateMode(static_cast(m)&static_cast(n)); } inline File::CreateMode operator~(File::CreateMode m) -{ return File::CreateMode(~(int)m); } +{ return File::CreateMode(~static_cast(m)); } typedef Filtered BufferedFile; diff --git a/source/mode.h b/source/mode.h index 1d944b1..c58ecb0 100644 --- a/source/mode.h +++ b/source/mode.h @@ -21,13 +21,13 @@ enum Mode }; inline Mode operator|(Mode m, Mode n) -{ return Mode((int)m|(int)n); } +{ return Mode(static_cast(m)|static_cast(n)); } inline Mode operator&(Mode m, Mode n) -{ return Mode((int)m&(int)n); } +{ return Mode(static_cast(m)&static_cast(n)); } inline Mode operator~(Mode m) -{ return Mode(~(int)m); } +{ return Mode(~static_cast(m)); } } // namespace IO } // namespace Msp diff --git a/source/poll.h b/source/poll.h index 6ac6149..3bc1470 100644 --- a/source/poll.h +++ b/source/poll.h @@ -31,13 +31,13 @@ enum PollEvent }; inline PollEvent operator|(PollEvent e, PollEvent f) -{ return PollEvent((int)e|(int)f); } +{ return PollEvent(static_cast(e)|static_cast(f)); } inline PollEvent operator&(PollEvent e, PollEvent f) -{ return PollEvent((int)e&(int)f); } +{ return PollEvent(static_cast(e)&static_cast(f)); } inline PollEvent operator~(PollEvent e) -{ return PollEvent(~(int)e); } +{ return PollEvent(~static_cast(e)); } class Poller {