Remove transfer container in ibus_engine_simple_add_table.
authorfujiwarat <takao.fujiwara1@gmail.com>
Fri, 7 Dec 2012 21:43:00 +0000 (06:43 +0900)
committerfujiwarat <takao.fujiwara1@gmail.com>
Fri, 7 Dec 2012 21:43:00 +0000 (06:43 +0900)
Review URL: https://codereview.appspot.com/6909049

engine/main.vala
src/ibusenginesimple.c
src/ibusenginesimple.h

index 4dc3734..da6d5ee 100644 (file)
@@ -87,7 +87,7 @@ public int main(string[] args) {
         if (lang != null && 
             lang.ascii_ncasecmp("pt_br", "pt_br".length) == 0) {
             IBus.EngineSimple? simple = (IBus.EngineSimple ?) engine; 
-            simple.add_table((uint16[]) cedilla_compose_seqs,
+            simple.add_table(cedilla_compose_seqs,
                              4,
                              cedilla_compose_seqs.length / (4 + 2));
         }
index 5dd78f3..5bacd5e 100644 (file)
@@ -892,7 +892,7 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
 
 void
 ibus_engine_simple_add_table (IBusEngineSimple *simple,
-                              guint16          *data,
+                              const guint16    *data,
                               gint              max_seq_len,
                               gint              n_seqs)
 {
index 6e0e5cc..0a7b55f 100644 (file)
@@ -97,8 +97,8 @@ GType   ibus_engine_simple_get_type       (void);
 /**
  * ibus_engine_simple_add_table:
  * @simple: An IBusEngineSimple.
- * @data: (transfer container) (element-type guint16) (array):
- *      The table.
+ * @data: (element-type guint16) (array): The table which must be available
+ *      during the whole life of the simple engine.
  * @max_seq_len: Maximum length of a swquence in the table (cannot be greater
  *      than %IBUS_MAX_COMPOSE_LEN)
  *
@@ -111,7 +111,7 @@ GType   ibus_engine_simple_get_type       (void);
  * symbol fields. (Values beyond the length of the sequence should be zero.)
  */
 void    ibus_engine_simple_add_table      (IBusEngineSimple     *simple,
-                                           guint16              *data,
+                                           const guint16        *data,
                                            gint                  max_seq_len,
                                            gint                  n_seqs);