Browse Source

Restoring authorship annotation for <hr0nix@yandex-team.ru>. Commit 2 of 2.

hr0nix 3 years ago
parent
commit
bee0f5f332

+ 14 - 14
library/cpp/getopt/small/modchooser.cpp

@@ -69,15 +69,15 @@ TModChooser::TMode::TMode(const TString& name, TMainClass* main, const TString&
 {
 }
 
-TModChooser::TModChooser() 
+TModChooser::TModChooser()
     : ModesHelpOption("-?") // Default help option in last_getopt
     , VersionHandler(nullptr)
     , ShowSeparated(true)
     , SvnRevisionOptionDisabled(false)
     , PrintShortCommandInUsage(false)
-{ 
-} 
- 
+{
+}
+
 TModChooser::~TModChooser() = default;
 
 void TModChooser::AddMode(const TString& mode, const TMainFunctionRawPtr func, const TString& description, bool hidden, bool noCompletion) {
@@ -133,13 +133,13 @@ void TModChooser::SetDescription(const TString& descr) {
 }
 
 void TModChooser::SetModesHelpOption(const TString& helpOption) {
-    ModesHelpOption = helpOption; 
-} 
- 
-void TModChooser::SetVersionHandler(TVersionHandlerPtr handler) { 
-    VersionHandler = handler; 
-} 
- 
+    ModesHelpOption = helpOption;
+}
+
+void TModChooser::SetVersionHandler(TVersionHandlerPtr handler) {
+    VersionHandler = handler;
+}
+
 void TModChooser::SetSeparatedMode(bool separated) {
     ShowSeparated = separated;
 }
@@ -185,9 +185,9 @@ int TModChooser::Run(const int argc, const char** argv) const {
         return 0;
     }
     if (VersionHandler && (modeName == "-v" || modeName == "--version")) {
-        VersionHandler(); 
-        return 0; 
-    } 
+        VersionHandler();
+        return 0;
+    }
     if (!SvnRevisionOptionDisabled && modeName == "--svnrevision") {
         NLastGetopt::PrintVersionAndExit(nullptr);
     }

+ 15 - 15
library/cpp/getopt/small/modchooser.h

@@ -30,9 +30,9 @@ public:
     virtual ~TMainClass() = default;
 };
 
-//! Function to handle '--version' parameter 
-typedef void (*TVersionHandlerPtr)(); 
- 
+//! Function to handle '--version' parameter
+typedef void (*TVersionHandlerPtr)();
+
 /*! Main class for handling different modes in single tool.
  *
  * You can add modes for this class, use autogenerated help with
@@ -43,7 +43,7 @@ typedef void (*TVersionHandlerPtr)();
  */
 class TModChooser {
 public:
-    TModChooser(); 
+    TModChooser();
     ~TModChooser();
 
 public:
@@ -67,10 +67,10 @@ public:
 
     //! Set modes help option name (-? is by default)
     void SetModesHelpOption(const TString& helpOption);
- 
-    //! Specify handler for '--version' parameter 
-    void SetVersionHandler(TVersionHandlerPtr handler); 
- 
+
+    //! Specify handler for '--version' parameter
+    void SetVersionHandler(TVersionHandlerPtr handler);
+
     //! Set description show mode
     void SetSeparatedMode(bool separated = true);
 
@@ -89,9 +89,9 @@ public:
      * In this method following things happen:
      *   1) If first argument is -h/--help/-? then print short description of
      *      all modes and exit with zero code.
-     *   2) If first argument is -v/--version and version handler is specified, 
+     *   2) If first argument is -v/--version and version handler is specified,
      *      then call it and exit with zero code.
-     *   3) Find mode with the same name as first argument. If it's found then 
+     *   3) Find mode with the same name as first argument. If it's found then
      *      call it and return its return code.
      *   4) If appropriate mode is not found - return non-zero code.
      */
@@ -138,19 +138,19 @@ private:
     //! Main program description.
     TString Description;
 
-    //! Help option for modes. 
+    //! Help option for modes.
     TString ModesHelpOption;
- 
+
     //! Wrappers around all modes.
     TVector<THolder<TMainClass>> Wrappers;
 
     //! Modes
     TMap<TString, TMode*> Modes;
- 
+
     TString DefaultMode;
 
-    //! Handler for '--version' parameter 
-    TVersionHandlerPtr VersionHandler; 
+    //! Handler for '--version' parameter
+    TVersionHandlerPtr VersionHandler;
 
     //! When set to true, show descriptions unsorted and display separators
     bool ShowSeparated;

+ 4 - 4
library/cpp/svnversion/svnversion.cpp

@@ -7,10 +7,10 @@
 
 #include <util/generic/strbuf.h>
 
-extern "C" void PrintProgramSvnVersion() { 
-    puts(GetProgramSvnVersion()); 
-} 
- 
+extern "C" void PrintProgramSvnVersion() {
+    puts(GetProgramSvnVersion());
+}
+
 extern "C" void PrintSvnVersionAndExit0() {
     PrintProgramSvnVersion();
     exit(0);

+ 1 - 1
util/draft/matrix.h

@@ -1,7 +1,7 @@
 #pragma once
 
 #include <util/generic/noncopyable.h>
-#include <util/system/yassert.h> 
+#include <util/system/yassert.h>
 #include <util/system/defaults.h>
 #include <string.h>
 

+ 18 - 18
util/generic/algorithm.h

@@ -437,7 +437,7 @@ template <class I, class T>
 static inline void Fill(I f, I l, const T& v) {
     std::fill(f, l, v);
 }
- 
+
 template <typename I, typename S, typename T>
 static inline I FillN(I f, S n, const T& v) {
     return std::fill_n(f, n, v);
@@ -446,12 +446,12 @@ static inline I FillN(I f, S n, const T& v) {
 template <class T>
 static inline void Reverse(T f, T l) {
     std::reverse(f, l);
-} 
- 
+}
+
 template <class T>
 static inline void Rotate(T f, T m, T l) {
     std::rotate(f, m, l);
-} 
+}
 
 template <typename It, typename Val>
 Val Accumulate(It begin, It end, Val val) {
@@ -464,7 +464,7 @@ Val Accumulate(It begin, It end, Val val, BinOp binOp) {
     // std::move since C++20
     return std::accumulate(begin, end, std::move(val), binOp);
 }
- 
+
 template <typename C, typename Val>
 Val Accumulate(const C& c, Val val) {
     // std::move since C++20
@@ -498,25 +498,25 @@ static inline typename TVectorType::value_type InnerProduct(const TVectorType& l
 }
 
 template <class T>
-static inline T MinElement(T begin, T end) { 
+static inline T MinElement(T begin, T end) {
     return std::min_element(begin, end);
-} 
- 
+}
+
 template <class T, class C>
-static inline T MinElement(T begin, T end, C comp) { 
+static inline T MinElement(T begin, T end, C comp) {
     return std::min_element(begin, end, comp);
-} 
- 
+}
+
 template <class T>
-static inline T MaxElement(T begin, T end) { 
+static inline T MaxElement(T begin, T end) {
     return std::max_element(begin, end);
-} 
- 
+}
+
 template <class T, class C>
-static inline T MaxElement(T begin, T end, C comp) { 
+static inline T MaxElement(T begin, T end, C comp) {
     return std::max_element(begin, end, comp);
-} 
- 
+}
+
 template <class I, class F>
 I MaxElementBy(I begin, I end, F&& func) {
     using TValue = decltype(func(*begin));
@@ -558,7 +558,7 @@ void ApplyToMany(TOp op, TArgs&&... args) {
 template <class TI, class TOp>
 inline void ForEach(TI f, TI l, TOp op) {
     std::for_each(f, l, op);
-} 
+}
 
 namespace NPrivate {
     template <class T, class TOp, size_t... Is>