]> gitweb @ CieloNegro.org - pkgsrc-xorg-server.git/blob - patches/patch-aa
At least it compiles now. Hope it works too...
[pkgsrc-xorg-server.git] / patches / patch-aa
1 $NetBSD$
2
3 --- dix/atom.c.orig     2009-03-06 19:05:09.000000000 +0900
4 +++ dix/atom.c
5 @@ -74,98 +74,6 @@ static NodePtr *nodeTable;
6  
7  void FreeAtom(NodePtr patom);
8  
9 -_X_EXPORT Atom 
10 -MakeAtom(char *string, unsigned len, Bool makeit)
11 -{
12 -    NodePtr * np;
13 -    unsigned i;
14 -    int comp;
15 -    unsigned int fp = 0;
16 -
17 -    np = &atomRoot;
18 -    for (i = 0; i < (len+1)/2; i++)
19 -    {
20 -       fp = fp * 27 + string[i];
21 -       fp = fp * 27 + string[len - 1 - i];
22 -    }
23 -    while (*np != (NodePtr) NULL)
24 -    {
25 -       if (fp < (*np)->fingerPrint)
26 -           np = &((*np)->left);
27 -       else if (fp > (*np)->fingerPrint)
28 -           np = &((*np)->right);
29 -       else
30 -       {                              /* now start testing the strings */
31 -           comp = strncmp(string, (*np)->string, (int)len);
32 -           if ((comp < 0) || ((comp == 0) && (len < strlen((*np)->string))))
33 -               np = &((*np)->left);
34 -           else if (comp > 0)
35 -               np = &((*np)->right);
36 -           else
37 -               return(*np)->a;
38 -           }
39 -    }
40 -    if (makeit)
41 -    {
42 -       NodePtr nd;
43 -
44 -       nd = (NodePtr) xalloc(sizeof(NodeRec));
45 -       if (!nd)
46 -           return BAD_RESOURCE;
47 -       if (lastAtom < XA_LAST_PREDEFINED)
48 -       {
49 -           nd->string = string;
50 -       }
51 -       else
52 -       {
53 -           nd->string = (char *) xalloc(len + 1);
54 -           if (!nd->string) {
55 -               xfree(nd);
56 -               return BAD_RESOURCE;
57 -           }
58 -           strncpy(nd->string, string, (int)len);
59 -           nd->string[len] = 0;
60 -       }
61 -       if ((lastAtom + 1) >= tableLength) {
62 -           NodePtr *table;
63 -
64 -           table = (NodePtr *) xrealloc(nodeTable,
65 -                                        tableLength * (2 * sizeof(NodePtr)));
66 -           if (!table) {
67 -               if (nd->string != string)
68 -                   xfree(nd->string);
69 -               xfree(nd);
70 -               return BAD_RESOURCE;
71 -           }
72 -           tableLength <<= 1;
73 -           nodeTable = table;
74 -       }
75 -       *np = nd;
76 -       nd->left = nd->right = (NodePtr) NULL;
77 -       nd->fingerPrint = fp;
78 -       nd->a = (++lastAtom);
79 -       *(nodeTable+lastAtom) = nd;
80 -       return nd->a;
81 -    }
82 -    else
83 -       return None;
84 -}
85 -
86 -_X_EXPORT Bool
87 -ValidAtom(Atom atom)
88 -{
89 -    return (atom != None) && (atom <= lastAtom);
90 -}
91 -
92 -_X_EXPORT char *
93 -NameForAtom(Atom atom)
94 -{
95 -    NodePtr node;
96 -    if (atom > lastAtom) return 0;
97 -    if ((node = nodeTable[atom]) == (NodePtr)NULL) return 0;
98 -    return node->string;
99 -}
100 -
101  void
102  AtomError(void)
103  {