• Bug#265528: netpanzer: FTBFS with gcc-3.4: invalid conversion

    From Andreas Jochens@1:229/2 to All on Fri Aug 13 17:30:15 2004
    From: [email protected]

    Package: netpanzer
    Severity: normal
    Tags: patch

    When building 'netpanzer' with gcc-3.4 I get the following error:

    C++ ./out/x86_64-pc-linux-gnu/opt/src/Lib/Util/FileSystem.o src/Lib/Util/FileSystem.cpp: In member function `int64_t ReadFile::readSLE64()':
    src/Lib/Util/FileSystem.cpp:382: error: invalid conversion from `int64_t*' to `PHYSFS_sint64*'
    src/Lib/Util/FileSystem.cpp:382: error: initializing argument 2 of `int PHYSFS_readSLE64(PHYSFS_file*, PHYSFS_sint64*)'
    src/Lib/Util/FileSystem.cpp: In member function `uint64_t ReadFile::readULE64()':
    src/Lib/Util/FileSystem.cpp:390: error: invalid conversion from `uint64_t*' to `PHYSFS_uint64*'
    src/Lib/Util/FileSystem.cpp:390: error: initializing argument 2 of `int PHYSFS_readULE64(PHYSFS_file*, PHYSFS_uint64*)'
    src/Lib/Util/FileSystem.cpp: In member function `int64_t ReadFile::readSBE64()':
    src/Lib/Util/FileSystem.cpp:398: error: invalid conversion from `int64_t*' to `PHYSFS_sint64*'
    src/Lib/Util/FileSystem.cpp:398: error: initializing argument 2 of `int PHYSFS_readSBE64(PHYSFS_file*, PHYSFS_sint64*)'
    src/Lib/Util/FileSystem.cpp: In member function `uint64_t ReadFile::readUBE64()':
    src/Lib/Util/FileSystem.cpp:406: error: invalid conversion from `uint64_t*' to `PHYSFS_uint64*'
    src/Lib/Util/FileSystem.cpp:406: error: initializing argument 2 of `int PHYSFS_readUBE64(PHYSFS_file*, PHYSFS_uint64*)'

    With the attached patch 'netpanzer' can be compiled using gcc-3.4.

    Regards
    Andreas Jochens

    diff -urN ../tmp-orig/netpanzer-0.1.5/src/Lib/ArrayUtil/LinkListDoubleTemplate.hpp ./src/Lib/ArrayUtil/LinkListDoubleTemplate.hpp
    --- ../tmp-orig/netpanzer-0.1.5/src/Lib/ArrayUtil/LinkListDoubleTemplate.hpp 2003-12-02 12:40:14.000000000 +0100
    +++ ./src/Lib/ArrayUtil/LinkListDoubleTemplate.hpp 2004-08-13 16:42:48.211179873 +0200
    @@ -203,7 +203,7 @@
    object->prev->next = before;
    }

    - if(delete_ptr == front) {
    + if(this->delete_ptr == front) {
    front = before;
    }

    diff -urN ../tmp-orig/netpanzer-0.1.5/src/Lib/ArrayUtil/QueueTemplate.hpp ./src/Lib/ArrayUtil/QueueTemplate.hpp
    --- ../tmp-orig/netpanzer-0.1.5/src/Lib/ArrayUtil/QueueTemplate.hpp 2003-12-21 01:48:03.000000000 +0100
    +++ ./src/Lib/ArrayUtil/QueueTemplate.hpp 2004-08-13 16:45:10.486550729 +0200
    @@ -42,8 +42,8 @@

    bool enqueue(const TYPE& object )
    {
    - add( object, (rear + 1) % size );
    - rear = (rear + 1) % size;
    + add( object, (rear + 1) % this->size );
    + rear = (rear + 1) % this->size;

    if ( front == rear )
    return( false );
    @@ -55,29 +55,29 @@