~snowball-yiddish-dev/snowball-yiddish/trunk

« back to all changes in this revision

Viewing changes to snowball/compiler/space.c

  • Committer: richard
  • Date: 2004-02-25 11:41:49 UTC
  • Revision ID: svn-v4:633ccae0-01f4-0310-8c99-d3591da6f01f:trunk:244
Add german2 stemmer, and fixes for some of the compiler warnings reported.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
#define HEAD 2*sizeof(int)
9
9
#define EXTENDER 40
10
 
#define DEBUG 0
11
10
 
12
11
 
13
12
/*  This modules provides a simple mechanism for arbitrary length writable
55
54
{   symbol * p = (symbol *) (HEAD + (char *) MALLOC(HEAD + (n + 1) * sizeof(symbol)));
56
55
    CAPACITY(p) = n;
57
56
    SIZE(p) = 0;
58
 
    if (DEBUG) printf("<-- %d\n", p);
59
57
    return p;
60
58
}
61
59
 
66
64
 
67
65
extern void lose_b(symbol * p)
68
66
{   if (p == 0) return;
69
 
    if (DEBUG) printf("--> %d\n", p);
70
67
    FREE((char *) p - HEAD);
71
68
}
72
69
 
73
70
extern symbol * increase_capacity(symbol * p, int n)
74
71
{   symbol * q = create_b(CAPACITY(p) + n + EXTENDER);
75
 
    if (DEBUG) printf("%d --> %d\n", p, q);
76
72
    memmove(q, p, CAPACITY(p) * sizeof(symbol));
77
73
    SIZE(q) = SIZE(p);
78
74
    lose_b(p); return q;