[vdr] [RFC] [PATCH] tools.c: use C++ headers instead of deprecated C headers

2010-12-12 Thread Paul Menzel
Looking at Henning Heinhold’s patch [1] he changed the includes to the C++ 
headers instead of the C headers. At least Wikipedia says [2], that the C 
headers are deprecated.

C++ provides this functionality in the header cstdarg; the C header, though 
permitted, is deprecated in C++.

Is it desirable to change the includes in all files? If yes, is there a tool 
which would accomplish this, since after the substitution a reordering is 
needed?

[1] 
http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/vdr/files/cplusplus.patch?id=97e1b707d6504343f02e683f49eb2cb6db2cc091
[2] https://secure.wikimedia.org/wikipedia/en/wiki/Stdarg.h

Signed-off-by: Paul Menzel paulepan...@users.sourceforge.net
---
 tools.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools.c b/tools.c
index 3ce12ec..9a400a8 100644
--- a/tools.c
+++ b/tools.c
@@ -8,9 +8,12 @@
  */
 
 #include tools.h
-#include ctype.h
+#include cctype
+#include cerrno
+#include cstdarg
+#include cstdlib
+#include ctime
 #include dirent.h
-#include errno.h
 extern C {
 #ifdef boolean
 #define HAVE_BOOLEAN
@@ -18,11 +21,8 @@ extern C {
 #include jpeglib.h
 #undef boolean
 }
-#include stdarg.h
-#include stdlib.h
 #include sys/time.h
 #include sys/vfs.h
-#include time.h
 #include unistd.h
 #include utime.h
 #include i18n.h
-- 
1.7.2.3


signature.asc
Description: This is a digitally signed message part
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [RFC] [PATCH] tools.c: use C++ headers instead of deprecated C headers

2010-12-12 Thread Klaus Schmidinger
On 12.12.2010 23:13, Paul Menzel wrote:
 Looking at Henning Heinhold’s patch [1] he changed the includes to the C++ 
 headers instead of the C headers. At least Wikipedia says [2], that the C 
 headers are deprecated.
 
 C++ provides this functionality in the header cstdarg; the C header, 
 though permitted, is deprecated in C++.
 
 Is it desirable to change the includes in all files? If yes, is there a tool 
 which would accomplish this, since after the substitution a reordering is 
 needed?

I like the classic headers more, so unless they are completely eradicated
(which I doubt will ever happen, because it would simply break too many
sources) I'm not going to switch to C++ headers.

Klaus

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr