[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: [PATCH] Changes in Strigi caused build problems in 4.1 BRANCH
From:       James Richard Tyrer <tyrerj () acm ! org>
Date:       2008-08-26 20:24:01
Message-ID: 48B46661.50709 () acm ! org
[Download RAW message or body]

James Richard Tyrer wrote:
> James Richard Tyrer wrote:
>> This is from KDELibs:
>>
>> [ 45%] Building CXX object 
>> kio/kio/dummyanalyzers/CMakeFiles/dummy.dir/dummyanalyzers.o
>> /usr/SVN/branches/KDE/4.1/kdelibs/kio/kio/dummyanalyzers/dummyanalyzers.cpp:43: 
>> error: conflicting return type specified for 'virtual char 
>> DummyEndAnalyzer::analyze(Strigi::AnalysisResult&, Strigi::InputStream*)'
>> /usr/local/KDE-4.1/include/strigi/streamendanalyzer.h:37: error: 
>> overriding 'virtual signed char 
>> Strigi::StreamEndAnalyzer::analyze(Strigi::AnalysisResult&, 
>> Strigi::InputStream*)'
>> make[2]: *** 
>> [kio/kio/dummyanalyzers/CMakeFiles/dummy.dir/dummyanalyzers.o] Error 1
>> make[1]: *** [kio/kio/dummyanalyzers/CMakeFiles/dummy.dir/all] Error 2
>> make: *** [all] Error 2
>>
> It should seem obvious but the types do need to match, and you can't 
> assign the value "-1" to unsigned character.
> 
> ------8<------8<------8<------8<------8<------8<------8<------8<------
> 
> Index: kio/kio/dummyanalyzers/dummyanalyzers.cpp
> ===================================================================
> --- kio/kio/dummyanalyzers/dummyanalyzers.cpp   (revision 852451)
> +++ kio/kio/dummyanalyzers/dummyanalyzers.cpp   (working copy)
> @@ -40,7 +40,7 @@ public:
>       bool checkHeader(const char*, int32_t) const {
>           return false;
>       }
> -    char analyze(Strigi::AnalysisResult&, InputStream*) {
> +    signed char analyze(Strigi::AnalysisResult&, InputStream*) {
>           return -1;
>       }
>       const char* name() const { return "DummyEndAnalyzer"; }
> 
> 
> ------8<------8<------8<------8<------8<------8<------8<------8<------
> 
> Index: strigi-analyzer/rfc822/rfc822endanalyzer.cpp
> ===================================================================
> --- strigi-analyzer/rfc822/rfc822endanalyzer.cpp        (revision 852459)
> +++ strigi-analyzer/rfc822/rfc822endanalyzer.cpp        (working copy)
> @@ -38,7 +38,7 @@ bool Rfc822EndAnalyzer::checkHeader(  co
>       return false;
>   }
> 
> -char Rfc822EndAnalyzer::analyze( Strigi::AnalysisResult& idx, 
> Strigi::InputStream* in )
> +signed char Rfc822EndAnalyzer::analyze( Strigi::AnalysisResult& idx, 
> Strigi::InputStream* in )
>   {
>       char id_from[] = "From: ";
>       char id_to[] = "To: ";
> Index: strigi-analyzer/rfc822/rfc822endanalyzer.h
> ===================================================================
> --- strigi-analyzer/rfc822/rfc822endanalyzer.h  (revision 852459)
> +++ strigi-analyzer/rfc822/rfc822endanalyzer.h  (working copy)
> @@ -36,7 +36,7 @@ public:
> 
>     const char* name() const { return "Rfc822EndAnalyzer"; }
>     bool checkHeader( const char* header, int32_t headersize ) const;
> -  char analyze(  Strigi::AnalysisResult& idx, Strigi::InputStream* in );
> +  signed char analyze(  Strigi::AnalysisResult& idx, 
> Strigi::InputStream* in );
> 
>   private:
>     const Rfc822EndAnalyzerFactory* m_factory;
> Index: strigi-analyzer/ics/icsendanalyzer.h
> ===================================================================
> --- strigi-analyzer/ics/icsendanalyzer.h        (revision 852459)
> +++ strigi-analyzer/ics/icsendanalyzer.h        (working copy)
> @@ -36,7 +36,7 @@ public:
> 
>     const char* name() const { return "IcsEndAnalyzer"; }
>     bool checkHeader( const char* header, int32_t headersize ) const;
> -  char analyze(  Strigi::AnalysisResult& idx, Strigi::InputStream* in );
> +  signed char analyze(  Strigi::AnalysisResult& idx, 
> Strigi::InputStream* in );
> 
>   private:
>     const IcsEndAnalyzerFactory* m_factory;
> Index: strigi-analyzer/ics/icsendanalyzer.cpp
> ===================================================================
> --- strigi-analyzer/ics/icsendanalyzer.cpp      (revision 852459)
> +++ strigi-analyzer/ics/icsendanalyzer.cpp      (working copy)
> @@ -51,7 +51,7 @@ bool IcsEndAnalyzer::checkHeader( const
>   I chose to use libkcal instead of reading the calendar manually. It's 
> easier to
>   maintain this way.
>   */
> -char IcsEndAnalyzer::analyze( Strigi::AnalysisResult& idx, 
> Strigi::InputStream* in )
> +signed char IcsEndAnalyzer::analyze( Strigi::AnalysisResult& idx, 
> Strigi::InputStream* in )
>   {
>     CalendarLocal cal( QString::fromLatin1( "UTC" ) );
> 
> Index: strigi-analyzer/vcf/vcfendanalyzer.h
> ===================================================================
> --- strigi-analyzer/vcf/vcfendanalyzer.h        (revision 852459)
> +++ strigi-analyzer/vcf/vcfendanalyzer.h        (working copy)
> @@ -37,7 +37,7 @@ class PIMSTRIGI_ANALYZER_EXPORT VcfEndAn
> 
>       const char* name() const { return "VcfEndAnalyzer"; }
>       bool checkHeader( const char* header, int32_t headersize ) const;
> -    char analyze(  Strigi::AnalysisResult& idx, Strigi::InputStream* in );
> +    signed char analyze(  Strigi::AnalysisResult& idx, 
> Strigi::InputStream* in );
> 
>     private:
>       const VcfEndAnalyzerFactory* m_factory;
> Index: strigi-analyzer/vcf/vcfendanalyzer.cpp
> ===================================================================
> --- strigi-analyzer/vcf/vcfendanalyzer.cpp      (revision 852459)
> +++ strigi-analyzer/vcf/vcfendanalyzer.cpp      (working copy)
> @@ -43,7 +43,7 @@ bool VcfEndAnalyzer::checkHeader( const
>    * It's easier to use KABC::VCardConverter to extract the single 
> fields from the vCard
>    * than doing it manually.
>    */
> -char VcfEndAnalyzer::analyze( Strigi::AnalysisResult& idx, 
> Strigi::InputStream* in )
> +signed char VcfEndAnalyzer::analyze( Strigi::AnalysisResult& idx, 
> Strigi::InputStream* in )
>   {
>     const char* data;
>     if ( in->read( data, 1, in->size() ) < 0 )
> 
> ------8<------8<------8<------8<------8<------8<------8<------8<------
> 
> Although I don't understand the code -- I only fixed the conflicting 
> types -- and don't know if it is wise to use the signed character type 
> here, this does fix the compilation problems.  If it causes other bugs, 
> then the code needs some work.  Unless we are actually dealing with 7 
> bit signed integer data, I would always suggest using an unsigned 
> character and a Boolean variable.  Such code is simply a better way to 
> do things (easier to understand and maintain, etc.).  If we must have a 
> single return value, use a structure.
> 
And also KDESDK:

------8<------8<------8<------8<------8<------8<------8<------8<------

Index: strigi-analyzer/po/poendanalyzer.cpp
===================================================================
--- strigi-analyzer/po/poendanalyzer.cpp        (revision 852724)
+++ strigi-analyzer/po/poendanalyzer.cpp        (working copy)
@@ -41,7 +41,7 @@ class PoEndAnalyzer : public StreamEndAn
          PoEndAnalyzer(const PoEndAnalyzerFactory* f):factory(f) {}
          const char* name() const {return "PoEndAnalyzer";}
          bool checkHeader(const char* header, int32_t headersize) const;
-        char analyze(Strigi::AnalysisResult& idx,Strigi::InputStream* in);
+        signed char analyze(Strigi::AnalysisResult& 
idx,Strigi::InputStream* in);
      private:
          const PoEndAnalyzerFactory* factory;
  };
@@ -103,7 +103,7 @@ bool PoEndAnalyzer::checkHeader(const ch
  }


-char PoEndAnalyzer::analyze(AnalysisResult& idx, InputStream* in)
+signed char PoEndAnalyzer::analyze(AnalysisResult& idx, InputStream* in)
  {
      if (idx.extension()=="svn-base")
          return Ok;

------8<------8<------8<------8<------8<------8<------8<------8<------

-- 
JRT

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic