[gtk-osx] Patch enchant to correct gsize->size_t implicit cast errors.



commit 7f19669f9239bdcf619563707a4c653f9cb15129
Author: John Ralls <jralls ceridwen us>
Date:   Tue Feb 25 15:33:26 2014 -0800

    Patch enchant to correct gsize->size_t implicit cast errors.

 modulesets-stable/gtk-osx-unsupported.modules |    4 +-
 patches/enchant-gsize.patch                   |   97 +++++++++++++++++++++++++
 2 files changed, 100 insertions(+), 1 deletions(-)
---
diff --git a/modulesets-stable/gtk-osx-unsupported.modules b/modulesets-stable/gtk-osx-unsupported.modules
index 4a63454..8586a35 100644
--- a/modulesets-stable/gtk-osx-unsupported.modules
+++ b/modulesets-stable/gtk-osx-unsupported.modules
@@ -123,7 +123,9 @@
   <autotools id="enchant" autogen-sh="configure"
             autogenargs="--with-myspell-dir=/Library/Dictionaries">
     <branch module="1.6.0/enchant-1.6.0.tar.gz" version="1.6.0"
-           repo="abisource/enchant"/>
+           repo="abisource/enchant">
+ <patch file="http://git.gnome.org/browse/gtk-osx/plain/patches/enchant-gsize.patch"; strip="1"/>
+    </branch>
     <dependencies>
       <dep package="glib"/>
     </dependencies>
diff --git a/patches/enchant-gsize.patch b/patches/enchant-gsize.patch
new file mode 100644
index 0000000..5bfba14
--- /dev/null
+++ b/patches/enchant-gsize.patch
@@ -0,0 +1,97 @@
+--- a/src/ispell/ispell_checker.cpp    Thu Apr  1 13:53:37 2010
++++ b/src/ispell/ispell_checker.cpp    Mon Feb 24 15:35:49 2014
+@@ -162,7 +162,7 @@
+       else
+               {
+                       /* convert to 8bit string and null terminate */
+-                      size_t len_in, len_out, result;
++                      gsize len_in, len_out, result;
+                       // the 8bit encodings use precomposed forms
+                       char *normalizedWord = g_utf8_normalize (utf8Word, length, G_NORMALIZE_NFC);
+                       char *In = normalizedWord;
+@@ -172,7 +172,7 @@
+                       len_out = sizeof( szWord ) - 1;
+                       result = g_iconv(m_translate_in, &In, &len_in, &Out, &len_out);
+                       g_free(normalizedWord);
+-                      if ((size_t)-1 == result)
++                      if ((gsize)-1 == result)
+                               return false;
+                       *Out = '\0';
+               }
+@@ -210,7 +210,7 @@
+               {
+                       /* convert to 8bit string and null terminate */
+                       
+-                      size_t len_in, len_out, result;
++                      gsize len_in, len_out, result;
+                       // the 8bit encodings use precomposed forms
+                       char *normalizedWord = g_utf8_normalize (utf8Word, length, G_NORMALIZE_NFC);
+                       char *In = normalizedWord;
+@@ -219,7 +219,7 @@
+                       len_out = sizeof( word8 ) - 1;
+                       result = g_iconv(m_translate_in, &In, &len_in, &Out, &len_out);
+                       g_free(normalizedWord);
+-                      if ((size_t)-1 == result)
++                      if ((gsize)-1 == result)
+                               return NULL;
+                       *Out = '\0';
+               }
+@@ -252,13 +252,13 @@
+                                       {
+                                               /* convert to 32bit string and null terminate */
+                                               
+-                                              size_t len_in, len_out;
++                                              gsize len_in, len_out;
+                                               char *In = m_possibilities[c];
+                                               char *Out = reinterpret_cast<char *>(utf8Sugg);
+                                               
+                                               len_in = l;
+                                               len_out = INPUTWORDLEN + MAXAFFIXLEN;
+-                                              if ((size_t)-1 == g_iconv(m_translate_out, &In, &len_in, 
&Out, &len_out)) {
++                                              if ((gsize)-1 == g_iconv(m_translate_out, &In, &len_in, &Out, 
&len_out)) {
+                                                       *out_n_suggestions = c;
+                                                       return sugg_arr;
+                                               }
+--- a/src/myspell/myspell_checker.cpp  Thu Apr  1 13:53:37 2010
++++ b/src/myspell/myspell_checker.cpp  Mon Feb 24 15:37:56 2014
+@@ -159,11 +159,11 @@
+       char *in = normalizedWord;
+       char word8[MAXWORDLEN + 1];
+       char *out = word8;
+-      size_t len_in = strlen(in);
+-      size_t len_out = sizeof( word8 ) - 1;
+-      size_t result = g_iconv(m_translate_in, &in, &len_in, &out, &len_out);
++      gsize len_in = strlen(in);
++      gsize len_out = sizeof( word8 ) - 1;
++      gsize result = g_iconv(m_translate_in, &in, &len_in, &out, &len_out);
+       g_free(normalizedWord);
+-      if ((size_t)-1 == result)
++      if ((gsize)-1 == result)
+               return false;
+       *out = '\0';
+       if (myspell->spell(word8))
+@@ -185,11 +185,11 @@
+       char *in = normalizedWord;
+       char word8[MAXWORDLEN + 1];
+       char *out = word8;
+-      size_t len_in = strlen(in);
+-      size_t len_out = sizeof(word8) - 1;
+-      size_t result = g_iconv(m_translate_in, &in, &len_in, &out, &len_out);
++      gsize len_in = strlen(in);
++      gsize len_out = sizeof(word8) - 1;
++      gsize result = g_iconv(m_translate_in, &in, &len_in, &out, &len_out);
+       g_free(normalizedWord);
+-      if ((size_t)-1 == result)
++      if ((gsize)-1 == result)
+               return NULL;
+ 
+       *out = '\0';
+@@ -203,7 +203,7 @@
+                       len_out = MAXWORDLEN;
+                       char *word = g_new0(char, len_out + 1);
+                       out = reinterpret_cast<char *>(word);
+-                      if ((size_t)-1 == g_iconv(m_translate_out, &in, &len_in, &out, &len_out)) {
++                      if ((gsize)-1 == g_iconv(m_translate_out, &in, &len_in, &out, &len_out)) {
+                               for (size_t j = i; j < *nsug; j++)
+                                       free(sugMS[j]);
+                               free(sugMS);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]