summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2021-05-09 02:33:00 -0700
committerFrediano Ziglio <freddy77@gmail.com>2021-08-26 07:35:09 +0100
commit5513bce73eefe8113f730ea223ef9abd1339c850 (patch)
treebc50c4d64d3ea489f9112dc777c40e459220d193
parent24f67439e4050235f8fac926557780b18eed70b3 (diff)
clang-tidy: replace C headers with C++
Found with modernize-deprecated-headers Signed-off-by: Rosen Penev <rosenp@gmail.com> Acked-by: Frediano Ziglio <freddy77@gmail.com>
-rw-r--r--server/char-device.cpp3
-rw-r--r--server/dispatcher.cpp11
-rw-r--r--server/inputs-channel.cpp3
-rw-r--r--server/main-channel-client.cpp1
-rw-r--r--server/main-dispatcher.cpp9
-rw-r--r--server/red-channel-client.cpp9
-rw-r--r--server/red-parse-qxl.cpp2
-rw-r--r--server/red-qxl.cpp13
-rw-r--r--server/red-stream.cpp5
-rw-r--r--server/red-worker.cpp17
-rw-r--r--server/reds.cpp11
-rw-r--r--server/sound.cpp5
-rw-r--r--server/spicevmc.cpp5
-rw-r--r--server/tests/test-dispatcher.cpp5
-rw-r--r--server/tests/test-display-base.cpp15
-rw-r--r--server/tests/test-stream-device.cpp9
16 files changed, 68 insertions, 55 deletions
diff --git a/server/char-device.cpp b/server/char-device.cpp
index 68f8d33a..742e815d 100644
--- a/server/char-device.cpp
+++ b/server/char-device.cpp
@@ -19,9 +19,8 @@
License along with this library; if not, see <http:www.gnu.org/licenses/>.
*/
-
#include <config.h>
-#include <inttypes.h>
+
#include <list>
#include "char-device.h"
diff --git a/server/dispatcher.cpp b/server/dispatcher.cpp
index 63ae330b..8be35283 100644
--- a/server/dispatcher.cpp
+++ b/server/dispatcher.cpp
@@ -16,12 +16,13 @@
*/
#include <config.h>
-#include <unistd.h>
-#include <errno.h>
-#include <assert.h>
-#include <string.h>
-#include <pthread.h>
+#include <cassert>
+#include <cerrno>
+#include <cstring>
+
#include <fcntl.h>
+#include <pthread.h>
+#include <unistd.h>
#ifndef _WIN32
#include <poll.h>
#endif
diff --git a/server/inputs-channel.cpp b/server/inputs-channel.cpp
index 1e4d6dd9..bdab4cdc 100644
--- a/server/inputs-channel.cpp
+++ b/server/inputs-channel.cpp
@@ -17,10 +17,9 @@
*/
#include <config.h>
-#include <stddef.h> // NULL
#include <spice/macros.h>
-#include <spice/vd_agent.h>
#include <spice/protocol.h>
+#include <spice/vd_agent.h>
#include <common/marshaller.h>
#include <common/messages.h>
diff --git a/server/main-channel-client.cpp b/server/main-channel-client.cpp
index c922ee5c..054f100b 100644
--- a/server/main-channel-client.cpp
+++ b/server/main-channel-client.cpp
@@ -16,7 +16,6 @@
*/
#include <config.h>
-#include <inttypes.h>
#include <common/generated_server_marshallers.h>
#include "main-channel-client.h"
diff --git a/server/main-dispatcher.cpp b/server/main-dispatcher.cpp
index 680dc960..e448921e 100644
--- a/server/main-dispatcher.cpp
+++ b/server/main-dispatcher.cpp
@@ -15,11 +15,14 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
#include <config.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
+
+#include <cerrno>
+#include <cstring>
+
#include <pthread.h>
+#include <unistd.h>
#include "red-common.h"
#include "dispatcher.h"
diff --git a/server/red-channel-client.cpp b/server/red-channel-client.cpp
index b97f38b1..30b50042 100644
--- a/server/red-channel-client.cpp
+++ b/server/red-channel-client.cpp
@@ -17,12 +17,13 @@
#include <config.h>
-#include <glib.h>
-#include <stdio.h>
-#include <stdint.h>
+#include <cerrno>
+#include <cstdint>
+#include <cstdio>
+
#include <fcntl.h>
+#include <glib.h>
#include <unistd.h>
-#include <errno.h>
#ifndef _WIN32
#include <netinet/in.h>
#include <netinet/tcp.h>
diff --git a/server/red-parse-qxl.cpp b/server/red-parse-qxl.cpp
index 87b6448d..9cccff31 100644
--- a/server/red-parse-qxl.cpp
+++ b/server/red-parse-qxl.cpp
@@ -17,8 +17,8 @@
*/
#include <config.h>
-#include <inttypes.h>
#include <glib.h>
+
#include <common/lz_common.h>
#include "glib-compat.h"
diff --git a/server/red-qxl.cpp b/server/red-qxl.cpp
index 910c2299..37b9e540 100644
--- a/server/red-qxl.cpp
+++ b/server/red-qxl.cpp
@@ -16,13 +16,14 @@
*/
#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
+#include <cerrno>
+#include <cinttypes>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
#include <pthread.h>
-#include <inttypes.h>
+#include <unistd.h>
#include <spice/qxl_dev.h>
#include <common/quic.h>
diff --git a/server/red-stream.cpp b/server/red-stream.cpp
index 4b11cd17..6ce5dc62 100644
--- a/server/red-stream.cpp
+++ b/server/red-stream.cpp
@@ -17,9 +17,10 @@
*/
#include <config.h>
-#include <errno.h>
-#include <unistd.h>
+#include <cerrno>
+
#include <fcntl.h>
+#include <unistd.h>
#ifndef _WIN32
#include <netdb.h>
#include <sys/socket.h>
diff --git a/server/red-worker.cpp b/server/red-worker.cpp
index 2696c305..86580f46 100644
--- a/server/red-worker.cpp
+++ b/server/red-worker.cpp
@@ -20,15 +20,16 @@
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <pthread.h>
-#include <inttypes.h>
+#include <cerrno>
+#include <cinttypes>
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
#include <glib.h>
+#include <pthread.h>
+#include <unistd.h>
#include <spice/protocol.h>
#include <spice/qxl_dev.h>
diff --git a/server/reds.cpp b/server/reds.cpp
index 8b0161f4..1232e3bb 100644
--- a/server/reds.cpp
+++ b/server/reds.cpp
@@ -17,12 +17,13 @@
*/
#include <config.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <limits.h>
+#include <cctype>
+#include <climits>
+#include <cstdint>
+#include <cstdio>
+
#include <pthread.h>
-#include <ctype.h>
+#include <unistd.h>
#ifndef _WIN32
#include <sys/socket.h>
#include <sys/uio.h>
diff --git a/server/sound.cpp b/server/sound.cpp
index ef6e69d5..f52042c2 100644
--- a/server/sound.cpp
+++ b/server/sound.cpp
@@ -17,9 +17,10 @@
*/
#include <config.h>
+#include <cerrno>
+#include <climits>
+
#include <fcntl.h>
-#include <errno.h>
-#include <limits.h>
#include <sys/types.h>
#ifndef _WIN32
#include <netinet/in.h>
diff --git a/server/spicevmc.cpp b/server/spicevmc.cpp
index 55e217de..0f4ecf9f 100644
--- a/server/spicevmc.cpp
+++ b/server/spicevmc.cpp
@@ -20,8 +20,9 @@
*/
#include <config.h>
-#include <assert.h>
-#include <string.h>
+#include <cassert>
+#include <cstring>
+
#ifdef USE_LZ4
#include <lz4.h>
#endif
diff --git a/server/tests/test-dispatcher.cpp b/server/tests/test-dispatcher.cpp
index 92488361..b6a933b3 100644
--- a/server/tests/test-dispatcher.cpp
+++ b/server/tests/test-dispatcher.cpp
@@ -20,8 +20,9 @@
*/
#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
+
+#include <cstdio>
+#include <cstdlib>
#include "basic-event-loop.h"
#include "test-glib-compat.h"
diff --git a/server/tests/test-display-base.cpp b/server/tests/test-display-base.cpp
index 81455998..fc0c49ee 100644
--- a/server/tests/test-display-base.cpp
+++ b/server/tests/test-display-base.cpp
@@ -15,19 +15,22 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
#include <config.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <stdio.h>
-#include <unistd.h>
+
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
#ifndef _WIN32
#include <sys/wait.h>
#include <sys/select.h>
#endif
-#include <sys/types.h>
#include <getopt.h>
#include <pthread.h>
+#include <sys/types.h>
+#include <unistd.h>
#include "spice-wrapped.h"
#include <spice/qxl_dev.h>
diff --git a/server/tests/test-stream-device.cpp b/server/tests/test-stream-device.cpp
index 9f009f88..0892a3c9 100644
--- a/server/tests/test-stream-device.cpp
+++ b/server/tests/test-stream-device.cpp
@@ -20,10 +20,11 @@
*/
#include <config.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdbool.h>
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
#include <unistd.h>
#include <spice/protocol.h>