Correct minor build problems under Ubuntu 10.04.diff -r1.2 -r1.3 pkgsrc/databases/palm-db-tools/distinfo
(dsainty)
@@ -1,10 +1,12 @@ | @@ -1,10 +1,12 @@ | |||
1 | $NetBSD: distinfo,v 1.2 2007/10/21 03:53:45 dsainty Exp $ | 1 | $NetBSD: distinfo,v 1.3 2010/08/11 12:21:56 dsainty Exp $ | |
2 | 2 | |||
3 | SHA1 (palm-db-tools-0_3_6.tar.gz) = b8ef6ed7059f5f71571622af6ece86b61cfacee6 | 3 | SHA1 (palm-db-tools-0_3_6.tar.gz) = b8ef6ed7059f5f71571622af6ece86b61cfacee6 | |
4 | RMD160 (palm-db-tools-0_3_6.tar.gz) = 26a5ce1ab9d558a4b42f3278be809b31eefb19b4 | 4 | RMD160 (palm-db-tools-0_3_6.tar.gz) = 26a5ce1ab9d558a4b42f3278be809b31eefb19b4 | |
5 | Size (palm-db-tools-0_3_6.tar.gz) = 201644 bytes | 5 | Size (palm-db-tools-0_3_6.tar.gz) = 201644 bytes | |
6 | SHA1 (patch-aa) = 63810ff29c59b3abb48f43b55ca92968711ec943 | 6 | SHA1 (patch-aa) = 63810ff29c59b3abb48f43b55ca92968711ec943 | |
7 | SHA1 (patch-ab) = cc36b595666e8843728485a804f74322adb38b07 | 7 | SHA1 (patch-ab) = cc36b595666e8843728485a804f74322adb38b07 | |
8 | SHA1 (patch-ac) = 27389d2f7dff02407d60a9f3a1a8d34b188df797 | 8 | SHA1 (patch-ac) = 15e13a574ccd5c800eac4216baac38692ee16ed7 | |
9 | SHA1 (patch-ad) = 0c8d624367a135fb5b0cf7ab5514f52f8cf3ac16 | 9 | SHA1 (patch-ad) = 0c8d624367a135fb5b0cf7ab5514f52f8cf3ac16 | |
10 | SHA1 (patch-ae) = 17a8f9b67cbc89177b05ac1ee63c77c22fa6704f | 10 | SHA1 (patch-ae) = cf899b708386c7404bd6181aff97e5eaa2e573a2 | |
11 | SHA1 (patch-af) = d44e4198c50153b141e233b0e002ead0ae3c5b3f | |||
12 | SHA1 (patch-ag) = d5478dbc12cf1da3eb0ca3c2d4e9d8dff09b8034 |
@@ -1,34 +1,34 @@ | @@ -1,34 +1,34 @@ | |||
1 | $NetBSD: patch-ac,v 1.2 2007/10/21 03:53:45 dsainty Exp $ | 1 | $NetBSD: patch-ac,v 1.3 2010/08/11 12:21:56 dsainty Exp $ | |
2 | 2 | |||
3 | Defining _XOPEN_SOURCE breaks the build under NetBSD. | 3 | Defining _XOPEN_SOURCE breaks the build under NetBSD. | |
4 | 4 | |||
5 | The default C++ precision of 6 digits is Very risky in a database context. | 5 | The default C++ precision of 6 digits is Very risky in a database context. | |
6 | 6 | |||
7 | As with DATE fields, if a TIME field is unset (hour value 24+), output an | 7 | As with DATE fields, if a TIME field is unset (hour value 24+), output an | |
8 | empty string. | 8 | empty string. | |
9 | 9 | |||
10 | --- libsupport/csvfile.cpp.orig 2003-06-20 11:37:47.000000000 +1200 | 10 | --- libsupport/csvfile.cpp.orig 2003-06-20 11:37:47.000000000 +1200 | |
11 | +++ libsupport/csvfile.cpp 2007-02-19 21:19:46.000000000 +1300 | 11 | +++ libsupport/csvfile.cpp 2010-08-09 22:30:58.306485980 +1200 | |
12 | @@ -1,5 +1,3 @@ | 12 | @@ -1,4 +1,4 @@ | |
13 | -#define _XOPEN_SOURCE | 13 | -#define _XOPEN_SOURCE | |
14 | - | 14 | +#include <string.h> | |
15 | ||||
15 | #include <iostream> | 16 | #include <iostream> | |
16 | #include <fstream> | 17 | #include <fstream> | |
17 | #include <sstream> | 18 | @@ -299,6 +299,7 @@ | |
18 | @@ -299,6 +297,7 @@ | |||
19 | break; | 19 | break; | |
20 | 20 | |||
21 | case PalmLib::FlatFile::Field::FLOAT: | 21 | case PalmLib::FlatFile::Field::FLOAT: | |
22 | + fldstr.precision(12); | 22 | + fldstr.precision(12); | |
23 | fldstr << field.v_float; | 23 | fldstr << field.v_float; | |
24 | break; | 24 | break; | |
25 | 25 | |||
26 | @@ -329,7 +328,7 @@ | 26 | @@ -329,7 +330,7 @@ | |
27 | break; | 27 | break; | |
28 | 28 | |||
29 | case PalmLib::FlatFile::Field::TIME: | 29 | case PalmLib::FlatFile::Field::TIME: | |
30 | - { | 30 | - { | |
31 | + if (field.v_time.hour <= 23) { | 31 | + if (field.v_time.hour <= 23) { | |
32 | char buf[1024]; | 32 | char buf[1024]; | |
33 | struct tm tm; | 33 | struct tm tm; | |
34 | const struct tm * tm_ptr; | 34 | const struct tm * tm_ptr; |
@@ -1,16 +1,27 @@ | @@ -1,16 +1,27 @@ | |||
1 | $NetBSD: patch-ae,v 1.1 2007/10/21 03:53:45 dsainty Exp $ | 1 | $NetBSD: patch-ae,v 1.2 2010/08/11 12:21:56 dsainty Exp $ | |
2 | ||||
3 | Don't unnecessarily remove const, which complicates casting. | |||
2 | 4 | |||
3 | Correctly terminate default string values on NUL. | 5 | Correctly terminate default string values on NUL. | |
4 | 6 | |||
5 | --- libflatfile/DB.cpp.orig 2003-06-20 11:37:46.000000000 +1200 | 7 | --- libflatfile/DB.cpp.orig 2003-06-20 11:37:46.000000000 +1200 | |
6 | +++ libflatfile/DB.cpp 2007-10-12 17:57:05.000000000 +1300 | 8 | +++ libflatfile/DB.cpp 2010-08-08 23:26:16.387306351 +1200 | |
7 | @@ -275,7 +276,8 @@ | 9 | @@ -221,7 +221,7 @@ | |
10 | throw PalmLib::error("list view is corrupt"); | |||
11 | ||||
12 | // Determine the length of the name string. | |||
13 | - pi_char_t* null_ptr = reinterpret_cast<pi_char_t*> | |||
14 | + const pi_char_t* null_ptr = reinterpret_cast<const pi_char_t*> | |||
15 | (memchr(chunk.data() + 4, 0, 32)); | |||
16 | if (null_ptr) | |||
17 | lv.name = std::string((char *) (chunk.data() + 4), | |||
18 | @@ -275,7 +275,8 @@ | |||
8 | switch (type) { | 19 | switch (type) { | |
9 | 20 | |||
10 | case PalmLib::FlatFile::Field::STRING: | 21 | case PalmLib::FlatFile::Field::STRING: | |
11 | - theReturn << std::string((const char *)chunk.data()+2, chunk.size() - 2); | 22 | - theReturn << std::string((const char *)chunk.data()+2, chunk.size() - 2); | |
12 | + // c_str: The default value is (or at least may be) NUL terminated. | 23 | + // c_str: The default value is (or at least may be) NUL terminated. | |
13 | + theReturn << std::string((const char *)chunk.data()+2, chunk.size() - 2).c_str(); | 24 | + theReturn << std::string((const char *)chunk.data()+2, chunk.size() - 2).c_str(); | |
14 | break; | 25 | break; | |
15 | 26 | |||
16 | case PalmLib::FlatFile::Field::BOOLEAN: | 27 | case PalmLib::FlatFile::Field::BOOLEAN: |
$NetBSD: patch-af,v 1.1 2010/08/11 12:21:56 dsainty Exp $
Don't unnecessarily remove const, which complicates casting.
--- libflatfile/JFile3.cpp.orig 2010-08-08 23:28:31.059277789 +1200
+++ libflatfile/JFile3.cpp 2010-08-08 23:30:12.583338045 +1200
@@ -454,7 +454,7 @@
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 @@
// 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 @@
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 @@
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 @@
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
$NetBSD: patch-ag,v 1.1 2010/08/11 12:21:56 dsainty Exp $
Don't unnecessarily remove const, which complicates casting.
--- libflatfile/MobileDB.cpp.orig 2010-08-08 23:23:04.940277744 +1200
+++ libflatfile/MobileDB.cpp 2010-08-08 23:24:13.267340616 +1200
@@ -221,7 +221,7 @@
if (field + 1 > fields.size()) fields.resize(field + 1);
// Now search for the end of the current field.
- pi_char_t* q = reinterpret_cast<pi_char_t*>
+ const pi_char_t* q = reinterpret_cast<const pi_char_t*>
(memchr(p, 0, rec.end() - p));
if (!q)
throw PalmLib::error("field terminiator is missing");