ports/palm/palm-db-tools/files/patch-libflatfile_JFile3.cpp
Jan Beich 2e4fb02fad palm/palm-db-tools: unbreak with libc++ 3.9
DB.cpp:224:31: error: reinterpret_cast from 'const void *' to 'pi_char_t *' (aka 'unsigned char *')
      casts away qualifiers
        pi_char_t* null_ptr = reinterpret_cast<pi_char_t*>
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
JFile3.cpp:470:20: error: reinterpret_cast from 'const void *' to 'pi_char_t *'
      (aka 'unsigned char *') casts away qualifiers
        null_ptr = reinterpret_cast<pi_char_t*> (memchr(p, 0, 21));
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JFile3.cpp:521:16: error: reinterpret_cast from 'const void *' to 'pi_char_t *'
      (aka 'unsigned char *') casts away qualifiers
    null_ptr = reinterpret_cast<pi_char_t*> (memchr(p, 0, 16));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JFile3.cpp:529:16: error: reinterpret_cast from 'const void *' to 'pi_char_t *'
      (aka 'unsigned char *') casts away qualifiers
    null_ptr = reinterpret_cast<pi_char_t*> (memchr(p, 0, 16));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JFile3.cpp:545:16: error: reinterpret_cast from 'const void *' to 'pi_char_t *'
      (aka 'unsigned char *') casts away qualifiers
    null_ptr = reinterpret_cast<pi_char_t*> (memchr(p, 0, 12));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MobileDB.cpp:224:24: error: reinterpret_cast from 'const void *' to 'pi_char_t *'
      (aka 'unsigned char *') casts away qualifiers
        pi_char_t* q = reinterpret_cast<pi_char_t*>
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reported by:	pkg-fallout
2017-02-01 20:21:20 +00:00

47 lines
1.9 KiB
C++

--- libflatfile/JFile3.cpp.orig 2003-06-19 23:37:46 UTC
+++ libflatfile/JFile3.cpp
@@ -454,7 +454,7 @@ PalmLib::FlatFile::JFile3::getOptions(vo
void PalmLib::FlatFile::JFile3::JFileAppInfoType::unpack(const PalmLib::Block& block)
{
unsigned i;
- pi_char_t* null_ptr;
+ const pi_char_t* null_ptr;
// Ensure that we have enough space to extract information from.
if (block.size() < ( (20 * (20+1)) + 20*2 + 2 + 2 + 20*2 + 2
@@ -467,7 +467,7 @@ void PalmLib::FlatFile::JFile3::JFileApp
// Extract the field names.
for (i = 0; i < 20; ++i) {
/* Find the trailing null byte and extract the string. */
- null_ptr = reinterpret_cast<pi_char_t*> (memchr(p, 0, 21));
+ null_ptr = reinterpret_cast<const pi_char_t*> (memchr(p, 0, 21));
if (null_ptr)
fieldNames[i] = std::string((char *) p, null_ptr - p);
else
@@ -518,7 +518,7 @@ void PalmLib::FlatFile::JFile3::JFileApp
p += sizeof(pi_uint16_t);
// Extract the string used last by Find.
- null_ptr = reinterpret_cast<pi_char_t*> (memchr(p, 0, 16));
+ null_ptr = reinterpret_cast<const pi_char_t*> (memchr(p, 0, 16));
if (null_ptr)
findString = std::string((char *) p, null_ptr - p);
else
@@ -526,7 +526,7 @@ void PalmLib::FlatFile::JFile3::JFileApp
p += 16;
// Extract the string used last by Filter.
- null_ptr = reinterpret_cast<pi_char_t*> (memchr(p, 0, 16));
+ null_ptr = reinterpret_cast<const pi_char_t*> (memchr(p, 0, 16));
if (null_ptr)
filterString = std::string((char *) p, null_ptr - p);
else
@@ -542,7 +542,7 @@ void PalmLib::FlatFile::JFile3::JFileApp
p += sizeof(pi_uint16_t);
// Extract the password (if any).
- null_ptr = reinterpret_cast<pi_char_t*> (memchr(p, 0, 12));
+ null_ptr = reinterpret_cast<const pi_char_t*> (memchr(p, 0, 12));
if (null_ptr)
password = std::string((char *) p, null_ptr - p);
else