This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] setup.exe SEGV on WinXP/Pro


Corinna Vinschen writes:
> Patch applied.

As a follow-up on the discussion I've checked why this is a conversion
operator in the first place and the answer is "no particularly good
reason".  I propose to keep the implementation unchanged, but as a plain
member function str() instead, which should be easier to grok some time
later.  This is the only path the conversion operator got invoked
through anyway.

>From 296273b76f6913c49bab363b08fb18865eec4351 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Sat, 10 Aug 2013 15:24:41 +0200
Subject: [PATCH] remove conversion operator std::string(), instead use its
 implementation for str() member function

       * csu_util/MD5Sum.h (MD5Sum): Remove declaration for conversion
       operator std::string().  Remove implementation of member
       function str() using the conversion operator.
       * csu_util/MD5Sum.cc (MD5Sum::str): Reuse implementation of
       conversion operator std::String to implement member function
       str() with.
---
 csu_util/MD5Sum.cc | 3 ++-
 csu_util/MD5Sum.h  | 3 +--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/csu_util/MD5Sum.cc b/csu_util/MD5Sum.cc
index eb679b5..1d9c362 100644
--- a/csu_util/MD5Sum.cc
+++ b/csu_util/MD5Sum.cc
@@ -80,7 +80,8 @@ MD5Sum::finish()
   delete internalData; internalData = 0;
 }
 
-MD5Sum::operator std::string() const
+std::string
+MD5Sum::str() const
 {
   std::ostringstream hexdigest;
 
diff --git a/csu_util/MD5Sum.h b/csu_util/MD5Sum.h
index ff9021e..5c51bbc 100644
--- a/csu_util/MD5Sum.h
+++ b/csu_util/MD5Sum.h
@@ -44,8 +44,7 @@ class MD5Sum
     void finish();
 
     bool isSet() const { return (state == Set); };
-    operator std::string() const;
-    std::string str() const { return (std::string)(*this); };
+    std::string str() const;
     bool operator == (const MD5Sum& other) const;
     bool operator != (const MD5Sum& other) const { return !(*this == other); };
 
-- 
1.8.3.1


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]