~ubuntu-branches/ubuntu/utopic/ibus-qt/utopic

« back to all changes in this revision

Viewing changes to qtim/ibus-input-context.cpp

  • Committer: Bazaar Package Importer
  • Author(s): LI Daobing
  • Date: 2010-04-10 16:25:47 UTC
  • mfrom: (5.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100410162547-9k8zunomsq7nre2c
Tags: 1.3.0-1
* New upstream release.
* debian/control: bump standards version to 3.8.4.
* debian/source/format: 3.0.
* Fix "FTBFS with binutils-gold" (Closes: #554862)
  - debian/patches/binutils-gold: added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
typedef struct _IBusComposeTableCompact IBusComposeTableCompact;
46
46
struct _IBusComposeTableCompact {
47
 
    const quint16 *data;
 
47
    const quint32 *data;
48
48
    int max_seq_len;
49
49
    int n_index_size;
50
50
    int n_index_stride;
324
324
static int
325
325
compare_seq_index (const void *key, const void *value) {
326
326
    const uint *keysyms = (const uint *)key;
327
 
    const quint16 *seq = (const quint16 *)value;
 
327
    const quint32 *seq = (const quint32 *)value;
328
328
 
329
329
    if (keysyms[0] < seq[0])
330
330
        return -1;
337
337
compare_seq (const void *key, const void *value) {
338
338
    int i = 0;
339
339
    const uint *keysyms = (const uint *)key;
340
 
    const quint16 *seq = (const quint16 *)value;
 
340
    const quint32 *seq = (const quint32 *)value;
341
341
 
342
342
    while (keysyms[i]) {
343
343
        if (keysyms[i] < seq[i])
355
355
IBusInputContext::checkCompactTable (const IBusComposeTableCompact *table)
356
356
{
357
357
    int row_stride;
358
 
    const quint16 *seq_index;
359
 
    const quint16 *seq;
 
358
    const quint32 *seq_index;
 
359
    const quint32 *seq;
360
360
    int i;
361
361
 
362
362
    /* Will never match, if the sequence in the compose buffer is longer
365
365
    if (m_n_compose > table->max_seq_len)
366
366
        return false;
367
367
 
368
 
    seq_index = (const quint16 *)bsearch (m_compose_buffer,
 
368
    seq_index = (const quint32 *)bsearch (m_compose_buffer,
369
369
                                          table->data, table->n_index_size,
370
 
                                          sizeof (quint16) * table->n_index_stride,
 
370
                                          sizeof (quint32) * table->n_index_stride,
371
371
                                          compare_seq_index);
372
372
 
373
373
    if (!seq_index) {
383
383
        row_stride = i + 1;
384
384
 
385
385
        if (seq_index[i+1] - seq_index[i] > 0) {
386
 
            seq = (const quint16 *) bsearch (m_compose_buffer + 1,
 
386
            seq = (const quint32 *) bsearch (m_compose_buffer + 1,
387
387
                                             table->data + seq_index[i], (seq_index[i+1] - seq_index[i]) / row_stride,
388
 
                                             sizeof (quint16) *  row_stride,
 
388
                                             sizeof (quint32) *  row_stride,
389
389
                                             compare_seq);
390
390
            if (seq) {
391
391
                if (i == m_n_compose - 1)