Tue Apr 21 13:59:31 2015 UTC ()
Fix build break with gcc.


(hiramatsu)
diff -r1.2 -r1.3 pkgsrc/inputmethod/librime/distinfo
diff -r1.1 -r1.2 pkgsrc/inputmethod/librime/patches/patch-src_dict_table.cc

cvs diff -r1.2 -r1.3 pkgsrc/inputmethod/librime/distinfo (expand / switch to unified diff)

--- pkgsrc/inputmethod/librime/distinfo 2015/04/14 14:38:05 1.2
+++ pkgsrc/inputmethod/librime/distinfo 2015/04/21 13:59:31 1.3
@@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
1$NetBSD: distinfo,v 1.2 2015/04/14 14:38:05 joerg Exp $ 1$NetBSD: distinfo,v 1.3 2015/04/21 13:59:31 hiramatsu Exp $
2 2
3SHA1 (librime-1.0.tar.gz) = 5fd6db95b039e08dadfe547e3e63962aeaa97d8c 3SHA1 (librime-1.0.tar.gz) = 5fd6db95b039e08dadfe547e3e63962aeaa97d8c
4RMD160 (librime-1.0.tar.gz) = 0e5972bfcf179d464a8e58f9ddce3bf55708865b 4RMD160 (librime-1.0.tar.gz) = 0e5972bfcf179d464a8e58f9ddce3bf55708865b
5Size (librime-1.0.tar.gz) = 2576401 bytes 5Size (librime-1.0.tar.gz) = 2576401 bytes
6SHA1 (patch-CMakeLists.txt) = 3e478dda0da10ecfc31f1cb7849a5fd0bd21a065 6SHA1 (patch-CMakeLists.txt) = 3e478dda0da10ecfc31f1cb7849a5fd0bd21a065
7SHA1 (patch-src_dict_table.cc) = 259704b015c1f6cffd7a5918c1a93c77384e4be7 7SHA1 (patch-src_dict_table.cc) = d8c952bd5b897d8d05b86b6c515daa3d19b2ba6d

cvs diff -r1.1 -r1.2 pkgsrc/inputmethod/librime/patches/Attic/patch-src_dict_table.cc (expand / switch to unified diff)

--- pkgsrc/inputmethod/librime/patches/Attic/patch-src_dict_table.cc 2015/04/14 14:38:05 1.1
+++ pkgsrc/inputmethod/librime/patches/Attic/patch-src_dict_table.cc 2015/04/21 13:59:31 1.2
@@ -1,22 +1,26 @@ @@ -1,22 +1,26 @@
1$NetBSD: patch-src_dict_table.cc,v 1.1 2015/04/14 14:38:05 joerg Exp $ 1$NetBSD: patch-src_dict_table.cc,v 1.2 2015/04/21 13:59:31 hiramatsu Exp $
2 2
3--- src/dict/table.cc.orig 2013-11-10 10:20:21.000000000 +0000 3Entries in the output file are generally not correctly aligned,
4+++ src/dict/table.cc 4so tell the compiler explicitly about this fact and use memcpy
5@@ -403,14 +403,15 @@ bool Table::BuildEntryList(const DictEnt 5for writing the data.
 6
 7--- src/dict/table.cc.orig 2013-11-10 19:20:21.000000000 +0900
 8+++ src/dict/table.cc 2015-04-18 12:14:33.000000000 +0900
 9@@ -403,14 +403,15 @@
6 return true; 10 return true;
7 } 11 }
8  12
9-bool Table::BuildEntry(const DictEntry &dict_entry, table::Entry *entry) { 13-bool Table::BuildEntry(const DictEntry &dict_entry, table::Entry *entry) {
10+bool Table::BuildEntry(const DictEntry &dict_entry, __attribute__((aligned(1))) table::Entry *entry) { 14+bool Table::BuildEntry(const DictEntry &dict_entry, table::Entry * __attribute__((aligned(1))) entry) {
11 if (!entry) 15 if (!entry)
12 return false; 16 return false;
13 if (!CopyString(dict_entry.text, &entry->text)) { 17 if (!CopyString(dict_entry.text, &entry->text)) {
14 LOG(ERROR) << "Error creating table entry '" << dict_entry.text << "'; file size: " << file_size(); 18 LOG(ERROR) << "Error creating table entry '" << dict_entry.text << "'; file size: " << file_size();
15 return false; 19 return false;
16 } 20 }
17- entry->weight = static_cast<float>(dict_entry.weight); 21- entry->weight = static_cast<float>(dict_entry.weight);
18+ float weight = static_cast<float>(dict_entry.weight); 22+ float weight = static_cast<float>(dict_entry.weight);
19+ memcpy(&entry->weight, &weight, sizeof(weight)); 23+ memcpy(&entry->weight, &weight, sizeof(weight));
20 return true; 24 return true;
21 } 25 }
22  26