File: replace_deprecated_C_headers.patch

package info (click to toggle)
gflags 2.2.2-3
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 804 kB
  • sloc: cpp: 3,918; python: 36; sh: 22; makefile: 18
file content (81 lines) | stat: -rw-r--r-- 2,177 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
From 6d224d34b6c318bfa266badb657e77acd8f9ada5 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Thu, 31 Oct 2019 13:16:34 -0700
Subject: [PATCH] [clang-tidy] Replace deprecated C headers

Deprecated with C++14.

Found with modernize-deprecated-headers

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 src/gflags.cc             | 12 ++++++------
 src/gflags_completions.cc |  6 +++---
 src/gflags_reporting.cc   |  8 ++++----
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/gflags.cc b/src/gflags.cc
index 8f5aa0b..04d0f9b 100644
--- a/src/gflags.cc
+++ b/src/gflags.cc
@@ -90,18 +90,18 @@
 #include "config.h"
 #include "gflags/gflags.h"
 
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cassert>
+#include <cctype>
+#include <cerrno>
 #if defined(HAVE_FNMATCH_H)
 #  include <fnmatch.h>
 #elif defined(HAVE_SHLWAPI_H)
 #  define NO_SHLWAPI_ISOS
 #  include <shlwapi.h>
 #endif
-#include <stdarg.h> // For va_list and related operations
-#include <stdio.h>
-#include <string.h>
+#include <cstdarg> // For va_list and related operations
+#include <cstdio>
+#include <cstring>
 
 #include <algorithm>
 #include <map>
diff --git a/src/gflags_completions.cc b/src/gflags_completions.cc
index c53a128..c0ba325 100644
--- a/src/gflags_completions.cc
+++ b/src/gflags_completions.cc
@@ -46,9 +46,9 @@
 //     5a) Force bash to place most-relevent groups at the top of the list
 //     5b) Trim most flag's descriptions to fit on a single terminal line
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>   // for strlen
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>   // for strlen
 
 #include <set>
 #include <string>
diff --git a/src/gflags_reporting.cc b/src/gflags_reporting.cc
index 29be922..6664d64 100644
--- a/src/gflags_reporting.cc
+++ b/src/gflags_reporting.cc
@@ -48,10 +48,10 @@
 // called after all flag-values have been assigned, that is, after
 // parsing the command-line.
 
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
+#include <cstdio>
+#include <cstring>
+#include <cctype>
+#include <cassert>
 #include <string>
 #include <vector>