~ubuntu-branches/ubuntu/karmic/enchant/karmic

« back to all changes in this revision

Viewing changes to tests/enchant-ispell.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-07-28 17:03:53 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090728170353-z3y1dltvvh9xut17
Tags: 1.5.0-0ubuntu1
* New upstream version
* debian/libenchant1c2a.shlibs:
  - updated shlibs version

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
#include <stdio.h>
43
43
#include <stdlib.h>
44
44
#include <string.h>
 
45
#include <locale.h>
45
46
#include <glib.h>
46
 
#include <glib/gstdio.h>
47
47
 
48
48
#include "enchant.h"
49
49
#include "enchant-provider.h"
137
137
 
138
138
        if (word->len <= MIN_WORD_LENGTH || enchant_dict_check (dict, word->str, word->len) == 0) {
139
139
                if (lineCount)
140
 
                        fprintf (out, "* %ld\n", lineCount);
 
140
                        fprintf (out, "* %u\n", (unsigned int)lineCount);
141
141
                else
142
142
                        fwrite ("*\n", 1, 2, out);
143
143
        }
147
147
                if (!n_suggs || !suggs) {
148
148
                        fwrite ("# ", 1, 2, out);
149
149
                        if (lineCount)
150
 
                                fprintf (out, "%ld ", lineCount);
 
150
                                fprintf (out, "%u ", (unsigned int)lineCount);
151
151
                        print_utf (out, word->str);
152
 
                        fprintf (out, " %ld\n", start_pos);
 
152
                        fprintf (out, " %u\n", (unsigned int)start_pos);
153
153
                }
154
154
                else {
155
155
                        size_t i = 0;
156
156
                        
157
157
                        fwrite ("& ", 1, 2, out);
158
158
                        if (lineCount)
159
 
                                fprintf (out, "%ld ", lineCount);
 
159
                                fprintf (out, "%u ", (unsigned int)lineCount);
160
160
                        print_utf (out, word->str);
161
 
                        fprintf (out, " %ld %ld:", n_suggs, start_pos);
 
161
                        fprintf (out, " %u %u:", (unsigned int)n_suggs, (unsigned int)start_pos);
162
162
                        
163
163
                        for (i = 0; i < n_suggs; i++) {
164
164
                                fprintf (out, " ");
180
180
{
181
181
        if (enchant_dict_check (dict, word->str, word->len) != 0) {
182
182
                if (lineCount)
183
 
                        fprintf (out, "%ld ", lineCount);
 
183
                        fprintf (out, "%u ", (unsigned int)lineCount);
184
184
                print_utf (out, word->str);
185
185
                fwrite ("\n", 1, 1, out);
186
186
        }
465
465
        int countLines = 0;
466
466
        gchar *dictionary = 0;  /* -d dictionary */
467
467
 
 
468
        /* Initialize system locale */
 
469
        setlocale(LC_ALL, "");
468
470
 
469
471
        for (i = 1; i < argc; i++) {
470
472
                char * arg = argv[i];
511
513
        }
512
514
        else {
513
515
                if (file) {
514
 
                        fp = g_fopen (file, "rb");
 
516
                        fp = enchant_fopen (file, "rb");
515
517
                        if (!fp) {
516
518
                                fprintf (stderr, "Error: Could not open the file \"%s\" for reading.\n", file);
517
519
                                exit (1);