Wed Mar 20 05:25:58 2013 UTC ()
Fixes build on some situations:
* use C++ style header files
* fixes bogus NULL usage, as Integer 0.
(obache)
diff -r1.1.1.1 -r1.2 pkgsrc/inputmethod/novel-pinyin/distinfo
diff -r1.1.1.1 -r1.2 pkgsrc/inputmethod/novel-pinyin/patches/patch-ac
diff -r0 -r1.1 pkgsrc/inputmethod/novel-pinyin/patches/patch-modules_scim_novel__pinyin__imengine.cpp
diff -r0 -r1.1 pkgsrc/inputmethod/novel-pinyin/patches/patch-src_lookup_lookup.h
diff -r0 -r1.1 pkgsrc/inputmethod/novel-pinyin/patches/patch-src_lookup_pinyin__lookup.cpp
--- pkgsrc/inputmethod/novel-pinyin/distinfo 2009/11/24 12:13:02 1.1.1.1
+++ pkgsrc/inputmethod/novel-pinyin/distinfo 2013/03/20 05:25:58 1.2
--- pkgsrc/inputmethod/novel-pinyin/patches/patch-ac 2009/11/24 12:13:02 1.1.1.1
+++ pkgsrc/inputmethod/novel-pinyin/patches/patch-ac 2013/03/20 05:25:58 1.2
$NetBSD: patch-modules_scim_novel__pinyin__imengine.cpp,v 1.1 2013/03/20 05:25:58 obache Exp $
* fixes bogus NULL usage, as Integer 0.
--- modules/scim/novel_pinyin_imengine.cpp.orig 2008-10-05 07:55:31.000000000 +0000
+++ modules/scim/novel_pinyin_imengine.cpp
@@ -1690,7 +1690,7 @@ PinyinInstance::calc_lookup_table (){
}
}
}else
- last_token = NULL;
+ last_token = 0;
PhraseItemWithFreq item;
@@ -1782,7 +1782,7 @@ PinyinInstance::calc_lookup_table (){
}
}
g_array_sort(m_phrase_items_with_freq, lookup_table_sort);
- phrase_token_t last_token = NULL;
+ phrase_token_t last_token = 0;
for ( size_t m = 0; m < m_phrase_items_with_freq->len; ++m){
PhraseItemWithFreq * item = &g_array_index(m_phrase_items_with_freq, PhraseItemWithFreq, m);
if ( last_token != item->m_token )
$NetBSD: patch-src_lookup_lookup.h,v 1.1 2013/03/20 05:25:58 obache Exp $
* fixes bogus NULL usage, as Integer 0.
--- src/lookup/lookup.h.orig 2008-07-30 12:38:00.000000000 +0000
+++ src/lookup/lookup.h
@@ -42,7 +42,7 @@ struct lookup_value_t{
gfloat m_poss;
gint32 m_last_step;
lookup_value_t(gfloat poss = FLT_MAX){
- m_handles[0] = NULL; m_handles[1] = NULL;
+ m_handles[0] = 0; m_handles[1] = 0;
m_poss = poss;
m_last_step = -1;
}
$NetBSD: patch-src_lookup_pinyin__lookup.cpp,v 1.1 2013/03/20 05:25:58 obache Exp $
* use C++ style include files.
* fixes bogus NULL usage, as Integer 0.
--- src/lookup/pinyin_lookup.cpp.orig 2009-03-08 03:43:51.000000000 +0000
+++ src/lookup/pinyin_lookup.cpp
@@ -20,8 +20,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <math.h>
-#include <assert.h>
+#include <cmath>
+#include <cassert>
#include <iostream>
#include "stl_lite.h"
#include "novel_types.h"
@@ -379,7 +379,7 @@ bool PinyinLookup::final_step(MatchResul
g_array_set_size(results, m_steps_content->len);
for ( size_t i = 0 ; i < m_steps_content->len ; ++i){
phrase_token_t * token = &g_array_index(results, phrase_token_t, i);
- *token = NULL;
+ *token = 0;
}
//find max element
size_t last_step_pos = m_steps_content->len - 1;
@@ -430,7 +430,7 @@ bool PinyinLookup::train_result(PinyinKe
guint32 train_factor = 23;
for ( size_t i = 0; i < constraints->len; ++i){
phrase_token_t * token = &g_array_index(results, phrase_token_t, i);
- if ( *token == NULL )
+ if ( *token == 0 )
continue;
lookup_constraint_t * constraint = &g_array_index(constraints, lookup_constraint_t, i);
if (train_next || CONSTRAINT_ONESTEP == constraint->m_type ){
@@ -484,7 +484,7 @@ bool PinyinLookup::convert_to_utf8(Match
result_string = g_strdup("");
for ( size_t i = 0; i < results->len; ++i){
phrase_token_t * token = &g_array_index(results, phrase_token_t, i);
- if ( NULL == *token )
+ if ( 0 == *token )
continue;
m_phrase_index->get_phrase_item(*token, m_cache_phrase_item);
utf16_t buffer[MAX_PHRASE_LENGTH];