From 981906ecd1b25012ca5aeafb678f6ec4a42aa9a2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 3 Jan 2013 10:58:39 +0100 Subject: [PATCH] output_print: convert to C++ --- Makefile.am | 3 +-- src/OutputCommands.cxx | 2 +- src/{output_print.c => OutputPrint.cxx} | 9 ++++++--- src/{output_print.h => OutputPrint.hxx} | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) rename src/{output_print.c => OutputPrint.cxx} (89%) rename src/{output_print.h => OutputPrint.hxx} (88%) diff --git a/Makefile.am b/Makefile.am index 0c1ffe6e9..85077c668 100644 --- a/Makefile.am +++ b/Makefile.am @@ -56,7 +56,6 @@ mpd_headers = \ src/output_all.h \ src/output_thread.h \ src/output_control.h \ - src/output_print.h \ src/output_command.h \ src/filter_internal.h \ src/filter_config.h \ @@ -800,7 +799,7 @@ OUTPUT_API_SRC = \ src/output_error.h \ src/output_control.c \ src/OutputState.cxx src/OutputState.hxx \ - src/output_print.c \ + src/OutputPrint.cxx src/OutputPrint.hxx \ src/output_command.c \ src/output_plugin.c src/output_plugin.h \ src/output_finish.c \ diff --git a/src/OutputCommands.cxx b/src/OutputCommands.cxx index 88cb95ac4..235bf976a 100644 --- a/src/OutputCommands.cxx +++ b/src/OutputCommands.cxx @@ -19,12 +19,12 @@ #include "config.h" #include "OutputCommands.hxx" +#include "OutputPrint.hxx" extern "C" { #include "protocol/argparser.h" #include "protocol/result.h" #include "output_command.h" -#include "output_print.h" } #include diff --git a/src/output_print.c b/src/OutputPrint.cxx similarity index 89% rename from src/output_print.c rename to src/OutputPrint.cxx index 483648ca2..aa3c4c043 100644 --- a/src/output_print.c +++ b/src/OutputPrint.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -23,15 +23,18 @@ */ #include "config.h" -#include "output_print.h" +#include "OutputPrint.hxx" #include "output_internal.h" + +extern "C" { #include "output_all.h" #include "client.h" +} void printAudioDevices(struct client *client) { - unsigned n = audio_output_count(); + const unsigned n = audio_output_count(); for (unsigned i = 0; i < n; ++i) { const struct audio_output *ao = audio_output_get(i); diff --git a/src/output_print.h b/src/OutputPrint.hxx similarity index 88% rename from src/output_print.h rename to src/OutputPrint.hxx index e02f4e9f5..5be7fe79a 100644 --- a/src/output_print.h +++ b/src/OutputPrint.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -22,8 +22,8 @@ * */ -#ifndef OUTPUT_PRINT_H -#define OUTPUT_PRINT_H +#ifndef MPD_OUTPUT_PRINT_HXX +#define MPD_OUTPUT_PRINT_HXX struct client;