From f14feefeb0ae73feb392b5ee2e7b510b1b2b12c6 Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Wed, 6 Jan 2016 21:02:06 +0100 Subject: [PATCH] Using #pragma once instead of include guards Just looks cleaner --- src/NiceCmdLineOutput.h | 5 +---- src/Phone.h | 5 +---- src/Shape.h | 5 +---- src/TablePrinter.h | 5 +---- src/appInfo.h | 5 +---- src/audioInput/AudioStream.h | 5 +---- src/audioInput/ChannelDownmixer.h | 5 +---- src/audioInput/SampleRateConverter.h | 5 +---- src/audioInput/WaveFileReader.h | 5 +---- src/audioInput/ioTools.h | 5 +---- src/audioInput/waveFileWriting.h | 5 +---- src/centiseconds.h | 5 +---- src/mouthAnimation.h | 5 +---- src/phoneExtraction.h | 5 +---- src/platformTools.h | 5 +---- src/stringTools.h | 5 +---- src/tools.h | 5 +---- 17 files changed, 17 insertions(+), 68 deletions(-) diff --git a/src/NiceCmdLineOutput.h b/src/NiceCmdLineOutput.h index a1d787a..a9aa581 100644 --- a/src/NiceCmdLineOutput.h +++ b/src/NiceCmdLineOutput.h @@ -1,5 +1,4 @@ -#ifndef RHUBARB_LIP_SYNC_NICECMDLINEOUTPUT_H -#define RHUBARB_LIP_SYNC_NICECMDLINEOUTPUT_H +#pragma once #include @@ -15,5 +14,3 @@ private: // Writes a longer usage message with long and short args, providing descriptions void printLongUsage(TCLAP::CmdLineInterface& cli, std::ostream& outStream) const; }; - -#endif //RHUBARB_LIP_SYNC_NICECMDLINEOUTPUT_H diff --git a/src/Phone.h b/src/Phone.h index 7b0eba2..e88b1c7 100644 --- a/src/Phone.h +++ b/src/Phone.h @@ -1,5 +1,4 @@ -#ifndef LIPSYNC_PHONE_H -#define LIPSYNC_PHONE_H +#pragma once // Defines a subset of the Arpabet enum class Phone { @@ -75,5 +74,3 @@ Phone stringToPhone(const std::string& s); std::string phoneToString(Phone phone); std::ostream& operator <<(std::ostream& stream, const Phone phone); - -#endif //LIPSYNC_PHONE_H diff --git a/src/Shape.h b/src/Shape.h index 759fa41..1c2a6db 100644 --- a/src/Shape.h +++ b/src/Shape.h @@ -1,5 +1,4 @@ -#ifndef LIPSYNC_SHAPE_H -#define LIPSYNC_SHAPE_H +#pragma once #include @@ -21,5 +20,3 @@ enum class Shape { std::string shapeToString(Shape shape); std::ostream& operator <<(std::ostream& stream, const Shape shape); - -#endif //LIPSYNC_SHAPE_H diff --git a/src/TablePrinter.h b/src/TablePrinter.h index 467dffc..5173e66 100644 --- a/src/TablePrinter.h +++ b/src/TablePrinter.h @@ -1,5 +1,4 @@ -#ifndef RHUBARB_LIP_SYNC_TABLEPRINTER_H -#define RHUBARB_LIP_SYNC_TABLEPRINTER_H +#pragma once #include @@ -15,5 +14,3 @@ private: const std::vector columnWidths; const int columnSpacing; }; - -#endif //RHUBARB_LIP_SYNC_TABLEPRINTER_H diff --git a/src/appInfo.h b/src/appInfo.h index 0c3defd..79d3892 100644 --- a/src/appInfo.h +++ b/src/appInfo.h @@ -1,9 +1,6 @@ -#ifndef APP_INFO_H -#define APP_INFO_H +#pragma once #include extern const std::string appName; extern const std::string appVersion; - -#endif //APP_INFO_H diff --git a/src/audioInput/AudioStream.h b/src/audioInput/AudioStream.h index 634def6..59efb41 100644 --- a/src/audioInput/AudioStream.h +++ b/src/audioInput/AudioStream.h @@ -1,5 +1,4 @@ -#ifndef LIPSYNC_AUDIOSTREAM_H -#define LIPSYNC_AUDIOSTREAM_H +#pragma once class AudioStream { public: @@ -8,5 +7,3 @@ public: virtual int getChannelCount() = 0; virtual bool getNextSample(float &sample) = 0; }; - -#endif //LIPSYNC_AUDIOSTREAM_H diff --git a/src/audioInput/ChannelDownmixer.h b/src/audioInput/ChannelDownmixer.h index 7b299d9..6b52ce1 100644 --- a/src/audioInput/ChannelDownmixer.h +++ b/src/audioInput/ChannelDownmixer.h @@ -1,5 +1,4 @@ -#ifndef LIPSYNC_CHANNELDOWNMIXER_H -#define LIPSYNC_CHANNELDOWNMIXER_H +#pragma once #include "AudioStream.h" #include @@ -17,5 +16,3 @@ private: std::unique_ptr inputStream; int inputChannelCount; }; - -#endif //LIPSYNC_CHANNELDOWNMIXER_H diff --git a/src/audioInput/SampleRateConverter.h b/src/audioInput/SampleRateConverter.h index 36e3cd3..4777fe8 100644 --- a/src/audioInput/SampleRateConverter.h +++ b/src/audioInput/SampleRateConverter.h @@ -1,5 +1,4 @@ -#ifndef LIPSYNC_SAMPLERATECONVERTER_H -#define LIPSYNC_SAMPLERATECONVERTER_H +#pragma once #include #include @@ -30,5 +29,3 @@ private: float mean(double start, double end); float getInputSample(int sampleIndex); }; - -#endif //LIPSYNC_SAMPLERATECONVERTER_H diff --git a/src/audioInput/WaveFileReader.h b/src/audioInput/WaveFileReader.h index 1eaeadf..171defc 100644 --- a/src/audioInput/WaveFileReader.h +++ b/src/audioInput/WaveFileReader.h @@ -1,5 +1,4 @@ -#ifndef LIPSYNC_WAVFILEREADER_H -#define LIPSYNC_WAVFILEREADER_H +#pragma once #include #include @@ -31,5 +30,3 @@ private: int channelCount; int remainingSamples; }; - -#endif //LIPSYNC_WAVFILEREADER_H diff --git a/src/audioInput/ioTools.h b/src/audioInput/ioTools.h index 812dff1..7568462 100644 --- a/src/audioInput/ioTools.h +++ b/src/audioInput/ioTools.h @@ -1,5 +1,4 @@ -#ifndef LIPSYNC_IOTOOLS_H -#define LIPSYNC_IOTOOLS_H +#pragma once #include @@ -40,5 +39,3 @@ namespace little_endian { } } - -#endif //LIPSYNC_IOTOOLS_H diff --git a/src/audioInput/waveFileWriting.h b/src/audioInput/waveFileWriting.h index 85884e2..36b64dc 100644 --- a/src/audioInput/waveFileWriting.h +++ b/src/audioInput/waveFileWriting.h @@ -1,10 +1,7 @@ -#ifndef LIPSYNC_WAVEFILEWRITER_H -#define LIPSYNC_WAVEFILEWRITER_H +#pragma once #include #include #include "AudioStream.h" void createWaveFile(std::unique_ptr inputStream, std::string fileName); - -#endif //LIPSYNC_WAVEFILEWRITER_H diff --git a/src/centiseconds.h b/src/centiseconds.h index d2ab2e5..ff1f769 100644 --- a/src/centiseconds.h +++ b/src/centiseconds.h @@ -1,10 +1,7 @@ -#ifndef LIPSYNC_CENTISECONDS_H -#define LIPSYNC_CENTISECONDS_H +#pragma once #include typedef std::chrono::duration centiseconds; std::ostream& operator <<(std::ostream& stream, const centiseconds cs); - -#endif //LIPSYNC_CENTISECONDS_H diff --git a/src/mouthAnimation.h b/src/mouthAnimation.h index 489d2af..1e4d820 100644 --- a/src/mouthAnimation.h +++ b/src/mouthAnimation.h @@ -1,5 +1,4 @@ -#ifndef LIPSYNC_MOUTH_ANIMATION_H -#define LIPSYNC_MOUTH_ANIMATION_H +#pragma once #include #include "Phone.h" @@ -7,5 +6,3 @@ #include "Shape.h" std::map animate(const std::map& phones); - -#endif //LIPSYNC_MOUTH_ANIMATION_H diff --git a/src/phoneExtraction.h b/src/phoneExtraction.h index ce5a7a3..e410c42 100644 --- a/src/phoneExtraction.h +++ b/src/phoneExtraction.h @@ -1,5 +1,4 @@ -#ifndef LIPSYNC_PHONE_EXTRACTION_H -#define LIPSYNC_PHONE_EXTRACTION_H +#pragma once #include #include @@ -10,5 +9,3 @@ #include "centiseconds.h" std::map detectPhones(std::unique_ptr audioStream); - -#endif //LIPSYNC_PHONE_EXTRACTION_H diff --git a/src/platformTools.h b/src/platformTools.h index ee5abc2..c70753f 100644 --- a/src/platformTools.h +++ b/src/platformTools.h @@ -1,9 +1,6 @@ -#ifndef LIPSYNC_PLATFORM_TOOLS_H -#define LIPSYNC_PLATFORM_TOOLS_H +#pragma once #include boost::filesystem::path getBinPath(); boost::filesystem::path getBinDirectory(); - -#endif //LIPSYNC_PLATFORM_TOOLS_H diff --git a/src/stringTools.h b/src/stringTools.h index d29947d..646ef5e 100644 --- a/src/stringTools.h +++ b/src/stringTools.h @@ -1,5 +1,4 @@ -#ifndef RHUBARB_LIP_SYNC_STRING_TOOLS_H -#define RHUBARB_LIP_SYNC_STRING_TOOLS_H +#pragma once #include #include @@ -9,5 +8,3 @@ std::vector splitIntoLines(const std::string& s); std::vector wrapSingleLineString(const std::string& s, int lineLength); std::vector wrapString(const std::string& s, int lineLength); - -#endif //RHUBARB_LIP_SYNC_STRING_TOOLS_H diff --git a/src/tools.h b/src/tools.h index 87e77f9..61cac9f 100644 --- a/src/tools.h +++ b/src/tools.h @@ -1,5 +1,4 @@ -#ifndef LIPSYNC_TOOLS_H -#define LIPSYNC_TOOLS_H +#pragma once #include #include @@ -35,5 +34,3 @@ final_act finally(const F &f) noexcept { return final_act(f); } template final_act finally(F &&f) noexcept { return final_act(std::forward(f)); } - -#endif //LIPSYNC_TOOLS_H