source: rtems/contrib/crossrpms/patches/newlib-1.15.0-rtems4.8-20070202.diff @ 92b61a71

4.104.114.84.95
Last change on this file since 92b61a71 was 91350690, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/02/07 at 15:07:55

Yet another attempt.

  • Property mode set to 100644
File size: 29.8 KB
RevLine 
[91350690]1diff -uNr newlib-1.15.0.orig/newlib/libc/include/inttypes.h newlib-1.15.0/newlib/libc/include/inttypes.h
2--- newlib-1.15.0.orig/newlib/libc/include/inttypes.h   2005-12-16 20:03:12.000000000 +0100
3+++ newlib-1.15.0/newlib/libc/include/inttypes.h        2007-02-01 18:21:19.000000000 +0100
4@@ -242,9 +242,12 @@
5 #define SCNxMAX                __SCNMAX(x)
6 
7 /* ptr types */
8-#if __have_longlong64
9-#define __PRIPTR(x) __STRINGIFY(ll##x)
10-#define __SCNPTR(x) __STRINGIFY(ll##x)
11+#if __ptrint_t_long_defined
12+#define __PRIPTR(x) __STRINGIFY(l##x)
13+#define __SCNPTR(x) __STRINGIFY(l##x)
14+#elif __ptrint_t_int_defined
15+#define __PRIPTR(x) __STRINGIFY(x)
16+#define __SCNPTR(x) __STRINGIFY(x)
17 #elif __have_long64
18 #define __PRIPTR(x) __STRINGIFY(l##x)
19 #define __SCNPTR(x) __STRINGIFY(l##x)
20diff -uNr newlib-1.15.0.orig/newlib/libc/include/machine/setjmp.h newlib-1.15.0/newlib/libc/include/machine/setjmp.h
21--- newlib-1.15.0.orig/newlib/libc/include/machine/setjmp.h     2006-12-18 17:48:03.000000000 +0100
22+++ newlib-1.15.0/newlib/libc/include/machine/setjmp.h  2007-02-01 18:21:19.000000000 +0100
23@@ -27,7 +27,7 @@
24 
25 /* necv70 was 9 as well. */
26 
27-#ifdef __mc68000__
28+#if defined(__m68k__) || defined(__mc68000__)
29 /*
30  * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6,
31  * fp2-fp7     for 68881.
32diff -uNr newlib-1.15.0.orig/newlib/libc/include/stdint.h newlib-1.15.0/newlib/libc/include/stdint.h
33--- newlib-1.15.0.orig/newlib/libc/include/stdint.h     2006-08-16 23:39:43.000000000 +0200
34+++ newlib-1.15.0/newlib/libc/include/stdint.h  2007-02-01 18:21:19.000000000 +0100
35@@ -393,6 +393,9 @@
36 #define UINTMAX_C(x)   x##UL
37 #endif
38 
39+#ifdef __rtems__
40+#include <machine/stdint.h>
41+#endif
42 
43 #ifdef __cplusplus
44 }
45diff -uNr newlib-1.15.0.orig/newlib/libc/include/sys/errno.h newlib-1.15.0/newlib/libc/include/sys/errno.h
46--- newlib-1.15.0.orig/newlib/libc/include/sys/errno.h  2002-09-24 16:10:12.000000000 +0200
47+++ newlib-1.15.0/newlib/libc/include/sys/errno.h       2007-02-01 18:21:19.000000000 +0100
48@@ -148,6 +148,7 @@
49 #define ECASECLASH 137  /* Filename exists with different case */
50 #define EILSEQ 138
51 #define EOVERFLOW 139  /* Value too large for defined data type */
52+#define ECANCELED 140  /* Operation canceled. */
53 
54 /* From cygwin32.  */
55 #define EWOULDBLOCK EAGAIN     /* Operation would block */
56diff -uNr newlib-1.15.0.orig/newlib/libc/include/sys/_types.h newlib-1.15.0/newlib/libc/include/sys/_types.h
57--- newlib-1.15.0.orig/newlib/libc/include/sys/_types.h 2004-06-11 22:37:09.000000000 +0200
58+++ newlib-1.15.0/newlib/libc/include/sys/_types.h      2007-02-01 18:21:19.000000000 +0100
59@@ -39,4 +39,7 @@
60 /* Iconv descriptor type */
61 typedef void *_iconv_t;
62 
63+typedef long * __intptr_t;
64+typedef unsigned long* __uintptr_t;
65+
66 #endif /* _SYS__TYPES_H */
67diff -uNr newlib-1.15.0.orig/newlib/libc/machine/arm/machine/endian.h newlib-1.15.0/newlib/libc/machine/arm/machine/endian.h
68--- newlib-1.15.0.orig/newlib/libc/machine/arm/machine/endian.h 2004-05-07 22:29:24.000000000 +0200
69+++ newlib-1.15.0/newlib/libc/machine/arm/machine/endian.h      1970-01-01 01:00:00.000000000 +0100
70@@ -1,12 +0,0 @@
71-/* ARM configuration file */
72-
73-#ifndef _MACHINE_ENDIAN_H
74-# define _MACHINE_ENDIAN_H
75-
76-#ifdef __ARMEB__
77-#define BYTE_ORDER BIG_ENDIAN
78-#else
79-#define BYTE_ORDER LITTLE_ENDIAN
80-#endif
81-
82-#endif
83diff -uNr newlib-1.15.0.orig/newlib/libc/search/db_local.h newlib-1.15.0/newlib/libc/search/db_local.h
84--- newlib-1.15.0.orig/newlib/libc/search/db_local.h    2002-06-25 01:05:08.000000000 +0200
85+++ newlib-1.15.0/newlib/libc/search/db_local.h 2007-02-01 18:21:19.000000000 +0100
86@@ -50,7 +50,7 @@
87 #define        MAX_PAGE_NUMBER 0xffffffff      /* >= # of pages in a file */
88 typedef __uint32_t     pgno_t;
89 #define        MAX_PAGE_OFFSET 65535           /* >= # of bytes in a page */
90-typedef __uint16_t     indx_t;
91+typedef __uint_least16_t       indx_t;
92 #define        MAX_REC_NUMBER  0xffffffff      /* >= # of records in a tree */
93 typedef __uint32_t     recno_t;
94 
95@@ -191,12 +191,12 @@
96  *     P_16_COPY       swap from one location to another
97  */
98 #define        M_16_SWAP(a) {                                                  \
99-       __uint16_t _tmp = a;                                            \
100+       __uint_least16_t _tmp = a;                                              \
101        ((char *)&a)[0] = ((char *)&_tmp)[1];                           \
102        ((char *)&a)[1] = ((char *)&_tmp)[0];                           \
103 }
104 #define        P_16_SWAP(a) {                                                  \
105-       __uint16_t _tmp = *(__uint16_t *)a;                             \
106+       __uint_least16_t _tmp = *(__uint_least16_t *)a;                         \
107        ((char *)a)[0] = ((char *)&_tmp)[1];                            \
108        ((char *)a)[1] = ((char *)&_tmp)[0];                            \
109 }
110diff -uNr newlib-1.15.0.orig/newlib/libc/search/extern.h newlib-1.15.0/newlib/libc/search/extern.h
111--- newlib-1.15.0.orig/newlib/libc/search/extern.h      2002-06-20 21:51:31.000000000 +0200
112+++ newlib-1.15.0/newlib/libc/search/extern.h   2007-02-01 18:21:19.000000000 +0100
113@@ -48,7 +48,7 @@
114 int     __delpair(HTAB *, BUFHEAD *, int);
115 int     __expand_table(HTAB *);
116 int     __find_bigpair(HTAB *, BUFHEAD *, int, char *, int);
117-__uint16_t      __find_last_page(HTAB *, BUFHEAD **);
118+__uint_least16_t        __find_last_page(HTAB *, BUFHEAD **);
119 void    __free_ovflpage(HTAB *, BUFHEAD *);
120 BUFHEAD        *__get_buf(HTAB *, __uint32_t, BUFHEAD *, int);
121 int     __get_page(HTAB *, char *, __uint32_t, int, int, int);
122diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_bigkey.c newlib-1.15.0/newlib/libc/search/hash_bigkey.c
123--- newlib-1.15.0.orig/newlib/libc/search/hash_bigkey.c 2006-06-07 21:22:59.000000000 +0200
124+++ newlib-1.15.0/newlib/libc/search/hash_bigkey.c      2007-02-01 18:21:19.000000000 +0100
125@@ -92,13 +92,13 @@
126        BUFHEAD *bufp;
127        const DBT *key, *val;
128 {
129-       __uint16_t *p;
130+       __uint_least16_t *p;
131        int key_size, n, val_size;
132-       __uint16_t space, move_bytes, off;
133+       __uint_least16_t space, move_bytes, off;
134        char *cp, *key_data, *val_data;
135 
136        cp = bufp->page;                /* Character pointer of p. */
137-       p = (__uint16_t *)cp;
138+       p = (__uint_least16_t *)cp;
139 
140        key_data = (char *)key->data;
141        key_size = key->size;
142@@ -136,7 +136,7 @@
143                                OFFSET(p) = off;
144                        } else
145                                p[n - 2] = FULL_KEY;
146-               p = (__uint16_t *)bufp->page;
147+               p = (__uint_least16_t *)bufp->page;
148                cp = bufp->page;
149                bufp->flags |= BUF_MOD;
150        }
151@@ -166,7 +166,7 @@
152                        if (!bufp)
153                                return (-1);
154                        cp = bufp->page;
155-                       p = (__uint16_t *)cp;
156+                       p = (__uint_least16_t *)cp;
157                } else
158                        p[n] = FULL_KEY_DATA;
159                bufp->flags |= BUF_MOD;
160@@ -191,12 +191,12 @@
161        BUFHEAD *bufp;
162 {
163        BUFHEAD *last_bfp, *rbufp;
164-       __uint16_t *bp, pageno;
165+       __uint_least16_t *bp, pageno;
166        int key_done, n;
167 
168        rbufp = bufp;
169        last_bfp = NULL;
170-       bp = (__uint16_t *)bufp->page;
171+       bp = (__uint_least16_t *)bufp->page;
172        pageno = 0;
173        key_done = 0;
174 
175@@ -219,7 +219,7 @@
176                last_bfp = rbufp;
177                if (!rbufp)
178                        return (-1);            /* Error. */
179-               bp = (__uint16_t *)rbufp->page;
180+               bp = (__uint_least16_t *)rbufp->page;
181        }
182 
183        /*
184@@ -234,7 +234,7 @@
185        pageno = bp[n - 1];
186 
187        /* Now, bp is the first page of the pair. */
188-       bp = (__uint16_t *)bufp->page;
189+       bp = (__uint_least16_t *)bufp->page;
190        if (n > 2) {
191                /* There is an overflow page. */
192                bp[1] = pageno;
193@@ -272,13 +272,13 @@
194        char *key;
195        int size;
196 {
197-       __uint16_t *bp;
198+       __uint_least16_t *bp;
199        char *p;
200        int ksize;
201-       __uint16_t bytes;
202+       __uint_least16_t bytes;
203        char *kkey;
204 
205-       bp = (__uint16_t *)bufp->page;
206+       bp = (__uint_least16_t *)bufp->page;
207        p = bufp->page;
208        ksize = size;
209        kkey = key;
210@@ -294,7 +294,7 @@
211                if (!bufp)
212                        return (-3);
213                p = bufp->page;
214-               bp = (__uint16_t *)p;
215+               bp = (__uint_least16_t *)p;
216                ndx = 1;
217        }
218 
219@@ -316,17 +316,17 @@
220  * of the pair; 0 if there isn't any (i.e. big pair is the last key in the
221  * bucket)
222  */
223-extern __uint16_t
224+extern __uint_least16_t
225 __find_last_page(hashp, bpp)
226        HTAB *hashp;
227        BUFHEAD **bpp;
228 {
229        BUFHEAD *bufp;
230-       __uint16_t *bp, pageno;
231+       __uint_least16_t *bp, pageno;
232        int n;
233 
234        bufp = *bpp;
235-       bp = (__uint16_t *)bufp->page;
236+       bp = (__uint_least16_t *)bufp->page;
237        for (;;) {
238                n = bp[0];
239 
240@@ -343,7 +343,7 @@
241                bufp = __get_buf(hashp, pageno, bufp, 0);
242                if (!bufp)
243                        return (0);     /* Need to indicate an error! */
244-               bp = (__uint16_t *)bufp->page;
245+               bp = (__uint_least16_t *)bufp->page;
246        }
247 
248        *bpp = bufp;
249@@ -366,15 +366,15 @@
250        int set_current;
251 {
252        BUFHEAD *save_p;
253-       __uint16_t *bp, len, off, save_addr;
254+       __uint_least16_t *bp, len, off, save_addr;
255        char *tp;
256 
257-       bp = (__uint16_t *)bufp->page;
258+       bp = (__uint_least16_t *)bufp->page;
259        while (bp[ndx + 1] == PARTIAL_KEY) {
260                bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
261                if (!bufp)
262                        return (-1);
263-               bp = (__uint16_t *)bufp->page;
264+               bp = (__uint_least16_t *)bufp->page;
265                ndx = 1;
266        }
267 
268@@ -382,7 +382,7 @@
269                bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
270                if (!bufp)
271                        return (-1);
272-               bp = (__uint16_t *)bufp->page;
273+               bp = (__uint_least16_t *)bufp->page;
274                save_p = bufp;
275                save_addr = save_p->addr;
276                off = bp[1];
277@@ -403,7 +403,7 @@
278                        bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
279                        if (!bufp)
280                                return (-1);
281-                       bp = (__uint16_t *)bufp->page;
282+                       bp = (__uint_least16_t *)bufp->page;
283                } else {
284                        /* The data is all on one page. */
285                        tp = (char *)bp;
286@@ -422,7 +422,7 @@
287                                        if (!hashp->cpage)
288                                                return (-1);
289                                        hashp->cndx = 1;
290-                                       if (!((__uint16_t *)
291+                                       if (!((__uint_least16_t *)
292                                            hashp->cpage->page)[0]) {
293                                                hashp->cbucket++;
294                                                hashp->cpage = NULL;
295@@ -454,14 +454,14 @@
296        BUFHEAD *bufp;
297        int len, set;
298 {
299-       __uint16_t *bp;
300+       __uint_least16_t *bp;
301        char *p;
302        BUFHEAD *xbp;
303-       __uint16_t save_addr;
304+       __uint_least16_t save_addr;
305        int mylen, totlen;
306 
307        p = bufp->page;
308-       bp = (__uint16_t *)p;
309+       bp = (__uint_least16_t *)p;
310        mylen = hashp->BSIZE - bp[1];
311        save_addr = bufp->addr;
312 
313@@ -481,7 +481,7 @@
314                                    __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
315                                if (!hashp->cpage)
316                                        return (-1);
317-                               else if (!((__uint16_t *)hashp->cpage->page)[0]) {
318+                               else if (!((__uint_least16_t *)hashp->cpage->page)[0]) {
319                                        hashp->cbucket++;
320                                        hashp->cpage = NULL;
321                                }
322@@ -533,10 +533,10 @@
323        BUFHEAD *xbp;
324        char *p;
325        int mylen, totlen;
326-       __uint16_t *bp, save_addr;
327+       __uint_least16_t *bp, save_addr;
328 
329        p = bufp->page;
330-       bp = (__uint16_t *)p;
331+       bp = (__uint_least16_t *)p;
332        mylen = hashp->BSIZE - bp[1];
333 
334        save_addr = bufp->addr;
335@@ -579,11 +579,11 @@
336        SPLIT_RETURN *ret;
337 {
338        BUFHEAD *tmpp;
339-       __uint16_t *tp;
340+       __uint_least16_t *tp;
341        BUFHEAD *bp;
342        DBT key, val;
343        __uint32_t change;
344-       __uint16_t free_space, n, off;
345+       __uint_least16_t free_space, n, off;
346 
347        bp = big_keyp;
348 
349@@ -615,14 +615,14 @@
350            (tmpp->ovfl ? tmpp->ovfl->addr : 0), (bp ? bp->addr : 0));
351 #endif
352        tmpp->ovfl = bp;        /* one of op/np point to big_keyp */
353-       tp = (__uint16_t *)tmpp->page;
354+       tp = (__uint_least16_t *)tmpp->page;
355 #ifdef DEBUG
356        assert(FREESPACE(tp) >= OVFLSIZE);
357 #endif
358        n = tp[0];
359        off = OFFSET(tp);
360        free_space = FREESPACE(tp);
361-       tp[++n] = (__uint16_t)addr;
362+       tp[++n] = (__uint_least16_t)addr;
363        tp[++n] = OVFLPAGE;
364        tp[0] = n;
365        OFFSET(tp) = off;
366@@ -638,7 +638,7 @@
367        ret->newp = np;
368        ret->oldp = op;
369 
370-       tp = (__uint16_t *)big_keyp->page;
371+       tp = (__uint_least16_t *)big_keyp->page;
372        big_keyp->flags |= BUF_MOD;
373        if (tp[0] > 2) {
374                /*
375diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_buf.c newlib-1.15.0/newlib/libc/search/hash_buf.c
376--- newlib-1.15.0.orig/newlib/libc/search/hash_buf.c    2004-05-26 19:57:10.000000000 +0200
377+++ newlib-1.15.0/newlib/libc/search/hash_buf.c 2007-02-01 18:21:19.000000000 +0100
378@@ -176,7 +176,7 @@
379        BUFHEAD *next_xbp;
380        SEGMENT segp;
381        int segment_ndx;
382-       __uint16_t oaddr, *shortp;
383+       __uint_least16_t oaddr, *shortp;
384 
385        oaddr = 0;
386        bp = LRU;
387@@ -212,7 +212,7 @@
388                         * Set oaddr before __put_page so that you get it
389                         * before bytes are swapped.
390                         */
391-                       shortp = (__uint16_t *)bp->page;
392+                       shortp = (__uint_least16_t *)bp->page;
393                        if (shortp[0])
394                                oaddr = shortp[shortp[0] - 1];
395                        if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page,
396@@ -255,7 +255,7 @@
397                                    (oaddr != xbp->addr))
398                                        break;
399 
400-                               shortp = (__uint16_t *)xbp->page;
401+                               shortp = (__uint_least16_t *)xbp->page;
402                                if (shortp[0])
403                                        /* set before __put_page */
404                                        oaddr = shortp[shortp[0] - 1];
405diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash.c newlib-1.15.0/newlib/libc/search/hash.c
406--- newlib-1.15.0.orig/newlib/libc/search/hash.c        2004-05-26 19:57:10.000000000 +0200
407+++ newlib-1.15.0/newlib/libc/search/hash.c     2007-02-01 18:21:19.000000000 +0100
408@@ -628,10 +628,10 @@
409 {
410        BUFHEAD *rbufp;
411        BUFHEAD *bufp, *save_bufp;
412-       __uint16_t *bp;
413+       __uint_least16_t *bp;
414        int n, ndx, off, size;
415        char *kp;
416-       __uint16_t pageno;
417+       __uint_least16_t pageno;
418 
419 #ifdef HASH_STATISTICS
420        hash_accesses++;
421@@ -647,7 +647,7 @@
422 
423        /* Pin the bucket chain */
424        rbufp->flags |= BUF_PIN;
425-       for (bp = (__uint16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
426+       for (bp = (__uint_least16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
427                if (bp[1] >= REAL_KEY) {
428                        /* Real key/data pair */
429                        if (size == off - *bp &&
430@@ -666,7 +666,7 @@
431                                return (ERROR);
432                        }
433                        /* FOR LOOP INIT */
434-                       bp = (__uint16_t *)rbufp->page;
435+                       bp = (__uint_least16_t *)rbufp->page;
436                        n = *bp++;
437                        ndx = 1;
438                        off = hashp->BSIZE;
439@@ -688,7 +688,7 @@
440                                        return (ERROR);
441                                }
442                                /* FOR LOOP INIT */
443-                               bp = (__uint16_t *)rbufp->page;
444+                               bp = (__uint_least16_t *)rbufp->page;
445                                n = *bp++;
446                                ndx = 1;
447                                off = hashp->BSIZE;
448@@ -722,7 +722,7 @@
449                save_bufp->flags &= ~BUF_PIN;
450                return (ABNORMAL);
451        case HASH_GET:
452-               bp = (__uint16_t *)rbufp->page;
453+               bp = (__uint_least16_t *)rbufp->page;
454                if (bp[ndx + 1] < REAL_KEY) {
455                        if (__big_return(hashp, rbufp, ndx, val, 0))
456                                return (ERROR);
457@@ -758,7 +758,7 @@
458        __uint32_t bucket;
459        BUFHEAD *bufp;
460        HTAB *hashp;
461-       __uint16_t *bp, ndx;
462+       __uint_least16_t *bp, ndx;
463 
464        hashp = (HTAB *)dbp->internal;
465        if (flag && flag != R_FIRST && flag != R_NEXT) {
466@@ -783,7 +783,7 @@
467                                if (!bufp)
468                                        return (ERROR);
469                                hashp->cpage = bufp;
470-                               bp = (__uint16_t *)bufp->page;
471+                               bp = (__uint_least16_t *)bufp->page;
472                                if (bp[0])
473                                        break;
474                        }
475@@ -793,7 +793,7 @@
476                                return (ABNORMAL);
477                        }
478                } else
479-                       bp = (__uint16_t *)hashp->cpage->page;
480+                       bp = (__uint_least16_t *)hashp->cpage->page;
481 
482 #ifdef DEBUG
483                assert(bp);
484@@ -804,7 +804,7 @@
485                            __get_buf(hashp, bp[hashp->cndx], bufp, 0);
486                        if (!bufp)
487                                return (ERROR);
488-                       bp = (__uint16_t *)(bufp->page);
489+                       bp = (__uint_least16_t *)(bufp->page);
490                        hashp->cndx = 1;
491                }
492                if (!bp[0]) {
493diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash.h newlib-1.15.0/newlib/libc/search/hash.h
494--- newlib-1.15.0.orig/newlib/libc/search/hash.h        2002-07-02 20:18:58.000000000 +0200
495+++ newlib-1.15.0/newlib/libc/search/hash.h     2007-02-01 18:21:19.000000000 +0100
496@@ -102,7 +102,7 @@
497 #define NCACHED        32                      /* number of bit maps and spare
498                                         * points */
499        int             spares[NCACHED];/* spare pages for overflow */
500-       __uint16_t      bitmaps[NCACHED];       /* address of overflow page
501+       __uint_least16_t        bitmaps[NCACHED];       /* address of overflow page
502                                                 * bitmaps */
503 } HASHHDR;
504 
505diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_page.c newlib-1.15.0/newlib/libc/search/hash_page.c
506--- newlib-1.15.0.orig/newlib/libc/search/hash_page.c   2002-09-19 23:28:51.000000000 +0200
507+++ newlib-1.15.0/newlib/libc/search/hash_page.c        2007-02-01 18:21:19.000000000 +0100
508@@ -77,16 +77,16 @@
509 static __uint32_t      *fetch_bitmap(HTAB *, int);
510 static __uint32_t       first_free(__uint32_t);
511 static int      open_temp(HTAB *);
512-static __uint16_t       overflow_page(HTAB *);
513+static __uint_least16_t         overflow_page(HTAB *);
514 static void     putpair(char *, const DBT *, const DBT *);
515-static void     squeeze_key(__uint16_t *, const DBT *, const DBT *);
516+static void     squeeze_key(__uint_least16_t *, const DBT *, const DBT *);
517 static int      ugly_split
518 (HTAB *, __uint32_t, BUFHEAD *, BUFHEAD *, int, int);
519 
520 #define        PAGE_INIT(P) { \
521-       ((__uint16_t *)(P))[0] = 0; \
522-       ((__uint16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint16_t); \
523-       ((__uint16_t *)(P))[2] = hashp->BSIZE; \
524+       ((__uint_least16_t *)(P))[0] = 0; \
525+       ((__uint_least16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint_least16_t); \
526+       ((__uint_least16_t *)(P))[2] = hashp->BSIZE; \
527 }
528 
529 /*
530@@ -99,9 +99,9 @@
531        char *p;
532        const DBT *key, *val;
533 {
534-       __uint16_t *bp, n, off;
535+       __uint_least16_t *bp, n, off;
536 
537-       bp = (__uint16_t *)p;
538+       bp = (__uint_least16_t *)p;
539 
540        /* Enter the key first. */
541        n = bp[0];
542@@ -117,7 +117,7 @@
543 
544        /* Adjust page info. */
545        bp[0] = n;
546-       bp[n + 1] = off - ((n + 3) * sizeof(__uint16_t));
547+       bp[n + 1] = off - ((n + 3) * sizeof(__uint_least16_t));
548        bp[n + 2] = off;
549 }
550 
551@@ -132,11 +132,11 @@
552        BUFHEAD *bufp;
553        int ndx;
554 {
555-       __uint16_t *bp, newoff;
556+       __uint_least16_t *bp, newoff;
557        int n;
558-       __uint16_t pairlen;
559+       __uint_least16_t pairlen;
560 
561-       bp = (__uint16_t *)bufp->page;
562+       bp = (__uint_least16_t *)bufp->page;
563        n = bp[0];
564 
565        if (bp[ndx + 1] < REAL_KEY)
566@@ -167,7 +167,7 @@
567        }
568        /* Finally adjust the page data */
569        bp[n] = OFFSET(bp) + pairlen;
570-       bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(__uint16_t);
571+       bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(__uint_least16_t);
572        bp[0] = n - 2;
573        hashp->NKEYS--;
574 
575@@ -185,15 +185,15 @@
576        __uint32_t obucket, nbucket;
577 {
578        BUFHEAD *new_bufp, *old_bufp;
579-       __uint16_t *ino;
580+       __uint_least16_t *ino;
581        char *np;
582        DBT key, val;
583        int n, ndx, retval;
584-       __uint16_t copyto, diff, off, moved;
585+       __uint_least16_t copyto, diff, off, moved;
586        char *op;
587 
588-       copyto = (__uint16_t)hashp->BSIZE;
589-       off = (__uint16_t)hashp->BSIZE;
590+       copyto = (__uint_least16_t)hashp->BSIZE;
591+       off = (__uint_least16_t)hashp->BSIZE;
592        old_bufp = __get_buf(hashp, obucket, NULL, 0);
593        if (old_bufp == NULL)
594                return (-1);
595@@ -204,7 +204,7 @@
596        old_bufp->flags |= (BUF_MOD | BUF_PIN);
597        new_bufp->flags |= (BUF_MOD | BUF_PIN);
598 
599-       ino = (__uint16_t *)(op = old_bufp->page);
600+       ino = (__uint_least16_t *)(op = old_bufp->page);
601        np = new_bufp->page;
602 
603        moved = 0;
604@@ -246,13 +246,13 @@
605 
606        /* Now clean up the page */
607        ino[0] -= moved;
608-       FREESPACE(ino) = copyto - sizeof(__uint16_t) * (ino[0] + 3);
609+       FREESPACE(ino) = copyto - sizeof(__uint_least16_t) * (ino[0] + 3);
610        OFFSET(ino) = copyto;
611 
612 #ifdef DEBUG3
613        (void)fprintf(stderr, "split %d/%d\n",
614-           ((__uint16_t *)np)[0] / 2,
615-           ((__uint16_t *)op)[0] / 2);
616+           ((__uint_least16_t *)np)[0] / 2,
617+           ((__uint_least16_t *)op)[0] / 2);
618 #endif
619        /* unpin both pages */
620        old_bufp->flags &= ~BUF_PIN;
621@@ -284,22 +284,22 @@
622        int moved;              /* Number of pairs moved to new page. */
623 {
624        BUFHEAD *bufp;          /* Buffer header for ino */
625-       __uint16_t *ino;                /* Page keys come off of */
626-       __uint16_t *np;         /* New page */
627-       __uint16_t *op;         /* Page keys go on to if they aren't moving */
628+       __uint_least16_t *ino;          /* Page keys come off of */
629+       __uint_least16_t *np;           /* New page */
630+       __uint_least16_t *op;           /* Page keys go on to if they aren't moving */
631 
632        BUFHEAD *last_bfp;      /* Last buf header OVFL needing to be freed */
633        DBT key, val;
634        SPLIT_RETURN ret;
635-       __uint16_t n, off, ov_addr, scopyto;
636+       __uint_least16_t n, off, ov_addr, scopyto;
637        char *cino;             /* Character value of ino */
638 
639        bufp = old_bufp;
640-       ino = (__uint16_t *)old_bufp->page;
641-       np = (__uint16_t *)new_bufp->page;
642-       op = (__uint16_t *)old_bufp->page;
643+       ino = (__uint_least16_t *)old_bufp->page;
644+       np = (__uint_least16_t *)new_bufp->page;
645+       op = (__uint_least16_t *)old_bufp->page;
646        last_bfp = NULL;
647-       scopyto = (__uint16_t)copyto;   /* ANSI */
648+       scopyto = (__uint_least16_t)copyto;     /* ANSI */
649 
650        n = ino[0] - 1;
651        while (n < ino[0]) {
652@@ -310,16 +310,16 @@
653                        old_bufp = ret.oldp;
654                        if (!old_bufp)
655                                return (-1);
656-                       op = (__uint16_t *)old_bufp->page;
657+                       op = (__uint_least16_t *)old_bufp->page;
658                        new_bufp = ret.newp;
659                        if (!new_bufp)
660                                return (-1);
661-                       np = (__uint16_t *)new_bufp->page;
662+                       np = (__uint_least16_t *)new_bufp->page;
663                        bufp = ret.nextp;
664                        if (!bufp)
665                                return (0);
666                        cino = (char *)bufp->page;
667-                       ino = (__uint16_t *)cino;
668+                       ino = (__uint_least16_t *)cino;
669                        last_bfp = ret.nextp;
670                } else if (ino[n + 1] == OVFLPAGE) {
671                        ov_addr = ino[n];
672@@ -329,14 +329,14 @@
673                         */
674                        ino[0] -= (moved + 2);
675                        FREESPACE(ino) =
676-                           scopyto - sizeof(__uint16_t) * (ino[0] + 3);
677+                           scopyto - sizeof(__uint_least16_t) * (ino[0] + 3);
678                        OFFSET(ino) = scopyto;
679 
680                        bufp = __get_buf(hashp, ov_addr, bufp, 0);
681                        if (!bufp)
682                                return (-1);
683 
684-                       ino = (__uint16_t *)bufp->page;
685+                       ino = (__uint_least16_t *)bufp->page;
686                        n = 1;
687                        scopyto = hashp->BSIZE;
688                        moved = 0;
689@@ -364,7 +364,7 @@
690                                            __add_ovflpage(hashp, old_bufp);
691                                        if (!old_bufp)
692                                                return (-1);
693-                                       op = (__uint16_t *)old_bufp->page;
694+                                       op = (__uint_least16_t *)old_bufp->page;
695                                        putpair((char *)op, &key, &val);
696                                }
697                                old_bufp->flags |= BUF_MOD;
698@@ -377,7 +377,7 @@
699                                            __add_ovflpage(hashp, new_bufp);
700                                        if (!new_bufp)
701                                                return (-1);
702-                                       np = (__uint16_t *)new_bufp->page;
703+                                       np = (__uint_least16_t *)new_bufp->page;
704                                        putpair((char *)np, &key, &val);
705                                }
706                                new_bufp->flags |= BUF_MOD;
707@@ -402,10 +402,10 @@
708        BUFHEAD *bufp;
709        const DBT *key, *val;
710 {
711-       __uint16_t *bp, *sop;
712+       __uint_least16_t *bp, *sop;
713        int do_expand;
714 
715-       bp = (__uint16_t *)bufp->page;
716+       bp = (__uint_least16_t *)bufp->page;
717        do_expand = 0;
718        while (bp[0] && (bp[2] < REAL_KEY || bp[bp[0]] < REAL_KEY))
719                /* Exception case */
720@@ -417,7 +417,7 @@
721                        bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
722                        if (!bufp)
723                                return (-1);
724-                       bp = (__uint16_t *)bufp->page;
725+                       bp = (__uint_least16_t *)bufp->page;
726                } else
727                        /* Try to squeeze key on this page */
728                        if (FREESPACE(bp) > PAIRSIZE(key, val)) {
729@@ -427,7 +427,7 @@
730                                bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
731                                if (!bufp)
732                                        return (-1);
733-                               bp = (__uint16_t *)bufp->page;
734+                               bp = (__uint_least16_t *)bufp->page;
735                        }
736 
737        if (PAIRFITS(bp, key, val))
738@@ -437,7 +437,7 @@
739                bufp = __add_ovflpage(hashp, bufp);
740                if (!bufp)
741                        return (-1);
742-               sop = (__uint16_t *)bufp->page;
743+               sop = (__uint_least16_t *)bufp->page;
744 
745                if (PAIRFITS(sop, key, val))
746                        putpair((char *)sop, key, val);
747@@ -468,12 +468,12 @@
748        HTAB *hashp;
749        BUFHEAD *bufp;
750 {
751-       __uint16_t *sp;
752-       __uint16_t ndx, ovfl_num;
753+       __uint_least16_t *sp;
754+       __uint_least16_t ndx, ovfl_num;
755 #ifdef DEBUG1
756        int tmp1, tmp2;
757 #endif
758-       sp = (__uint16_t *)bufp->page;
759+       sp = (__uint_least16_t *)bufp->page;
760 
761        /* Check if we are dynamically determining the fill factor */
762        if (hashp->FFACTOR == DEF_FFACTOR) {
763@@ -525,7 +525,7 @@
764 {
765        int fd, page, size;
766        int rsize;
767-       __uint16_t *bp;
768+       __uint_least16_t *bp;
769 
770        fd = hashp->fp;
771        size = hashp->BSIZE;
772@@ -541,7 +541,7 @@
773        if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
774            ((rsize = read(fd, p, size)) == -1))
775                return (-1);
776-       bp = (__uint16_t *)p;
777+       bp = (__uint_least16_t *)p;
778        if (!rsize)
779                bp[0] = 0;      /* We hit the EOF, so initialize a new page */
780        else
781@@ -600,9 +600,9 @@
782                        for (i = 0; i < max; i++)
783                                M_32_SWAP(((int *)p)[i]);
784                } else {
785-                       max = ((__uint16_t *)p)[0] + 2;
786+                       max = ((__uint_least16_t *)p)[0] + 2;
787                        for (i = 0; i <= max; i++)
788-                               M_16_SWAP(((__uint16_t *)p)[i]);
789+                               M_16_SWAP(((__uint_least16_t *)p)[i]);
790                }
791        }
792        if (is_bucket)
793@@ -643,7 +643,7 @@
794            hashp->BSIZE - clearbytes);
795        ip[clearints - 1] = ALL_SET << (nbits & BYTE_MASK);
796        SETBIT(ip, 0);
797-       hashp->BITMAPS[ndx] = (__uint16_t)pnum;
798+       hashp->BITMAPS[ndx] = (__uint_least16_t)pnum;
799        hashp->mapp[ndx] = ip;
800        return (0);
801 }
802@@ -663,13 +663,13 @@
803        return (i);
804 }
805 
806-static __uint16_t
807+static __uint_least16_t
808 overflow_page(hashp)
809        HTAB *hashp;
810 {
811        __uint32_t *freep;
812        int max_free, offset, splitnum;
813-       __uint16_t addr;
814+       __uint_least16_t addr;
815        int bit, first_page, free_bit, free_page, i, in_use_bits, j;
816 #ifdef DEBUG2
817        int tmp1, tmp2;
818@@ -816,16 +816,16 @@
819        HTAB *hashp;
820        BUFHEAD *obufp;
821 {
822-       __uint16_t addr;
823+       __uint_least16_t addr;
824        __uint32_t *freep;
825        int bit_address, free_page, free_bit;
826-       __uint16_t ndx;
827+       __uint_least16_t ndx;
828 
829        addr = obufp->addr;
830 #ifdef DEBUG1
831        (void)fprintf(stderr, "Freeing %d\n", addr);
832 #endif
833-       ndx = (((__uint16_t)addr) >> SPLITSHIFT);
834+       ndx = (((__uint_least16_t)addr) >> SPLITSHIFT);
835        bit_address =
836            (ndx ? hashp->SPARES[ndx - 1] : 0) + (addr & SPLITMASK) - 1;
837         if (bit_address < hashp->LAST_FREED)
838@@ -883,11 +883,11 @@
839  */
840 static void
841 squeeze_key(sp, key, val)
842-       __uint16_t *sp;
843+       __uint_least16_t *sp;
844        const DBT *key, *val;
845 {
846        char *p;
847-       __uint16_t free_space, n, off, pageno;
848+       __uint_least16_t free_space, n, off, pageno;
849 
850        p = (char *)sp;
851        n = sp[0];
852diff -uNr newlib-1.15.0.orig/newlib/libc/search/page.h newlib-1.15.0/newlib/libc/search/page.h
853--- newlib-1.15.0.orig/newlib/libc/search/page.h        2002-06-20 21:51:31.000000000 +0200
854+++ newlib-1.15.0/newlib/libc/search/page.h     2007-02-01 18:21:19.000000000 +0100
855@@ -74,20 +74,20 @@
856  * You might as well do this up front.
857  */
858 
859-#define        PAIRSIZE(K,D)   (2*sizeof(__uint16_t) + (K)->size + (D)->size)
860-#define BIGOVERHEAD    (4*sizeof(__uint16_t))
861-#define KEYSIZE(K)     (4*sizeof(__uint16_t) + (K)->size);
862-#define OVFLSIZE       (2*sizeof(__uint16_t))
863+#define        PAIRSIZE(K,D)   (2*sizeof(__uint_least16_t) + (K)->size + (D)->size)
864+#define BIGOVERHEAD    (4*sizeof(__uint_least16_t))
865+#define KEYSIZE(K)     (4*sizeof(__uint_least16_t) + (K)->size);
866+#define OVFLSIZE       (2*sizeof(__uint_least16_t))
867 #define FREESPACE(P)   ((P)[(P)[0]+1])
868 #define        OFFSET(P)       ((P)[(P)[0]+2])
869 #define PAIRFITS(P,K,D) \
870        (((P)[2] >= REAL_KEY) && \
871            (PAIRSIZE((K),(D)) + OVFLSIZE) <= FREESPACE((P)))
872-#define PAGE_META(N)   (((N)+3) * sizeof(__uint16_t))
873+#define PAGE_META(N)   (((N)+3) * sizeof(__uint_least16_t))
874 
875 typedef struct {
876        BUFHEAD *newp;
877        BUFHEAD *oldp;
878        BUFHEAD *nextp;
879-       __uint16_t next_addr;
880+       __uint_least16_t next_addr;
881 }       SPLIT_RETURN;
882diff -uNr newlib-1.15.0.orig/newlib/libc/sys/rtems/machine/stdint.h newlib-1.15.0/newlib/libc/sys/rtems/machine/stdint.h
883--- newlib-1.15.0.orig/newlib/libc/sys/rtems/machine/stdint.h   1970-01-01 01:00:00.000000000 +0100
884+++ newlib-1.15.0/newlib/libc/sys/rtems/machine/stdint.h        2007-02-01 18:21:19.000000000 +0100
885@@ -0,0 +1,31 @@
886+/*
887+ *
888+ */
889+#ifndef _MACHINE_STDINT_H
890+#define _MACHINE_STDINT_H
891+
892+#ifndef _STDINT_H
893+#error machine/stdint.h is an internal file and  must not be directly included
894+#endif
895+
896+#if defined(__sparc__) \
897+  || defined(__powerpc__) || defined(__PPC__) \
898+  || defined(__mips__) \
899+  || defined(__sh__) \
900+  || defined(__AVR__) \
901+  || defined(_C4x) || defined(_C3x) \
902+  || defined(__H8300__)
903+/* PTRDIFF_TYPE = int */
904+#define __ptrint_t_int_defined 1
905+#endif
906+
907+#if defined(__i386__) \
908+  || defined(__m68k__) \
909+  || defined(__bfin__) \
910+  || defined(__arm__) \
911+  || defined(__H8300S__) || defined(__H8300H__)
912+/* PTRDIFF_TYPE = long */
913+#define __ptrint_t_long_defined 1
914+#endif
915+
916+#endif
917diff -uNr newlib-1.15.0.orig/newlib/Makefile.am newlib-1.15.0/newlib/Makefile.am
918--- newlib-1.15.0.orig/newlib/Makefile.am       2006-06-05 19:42:57.000000000 +0200
919+++ newlib-1.15.0/newlib/Makefile.am    2007-02-02 12:19:24.000000000 +0100
920@@ -81,7 +81,7 @@
921        libc.a
922 endif
923 
924-noinst_DATA = stmp-targ-include
925+BUILT_SOURCES = stmp-targ-include
926 
927 toollib_DATA = $(CRT0) $(CRT1)
928 
929@@ -186,9 +186,6 @@
930 
931 $(CRT1_DIR)$(CRT1): ; @true
932 
933-
934-all-recursive: stmp-targ-include
935-
936 # The targ-include directory just holds the includes files for the
937 # particular system and machine we have been configured for.  It is
938 # used while building.
939diff -uNr newlib-1.15.0.orig/newlib/Makefile.in newlib-1.15.0/newlib/Makefile.in
940--- newlib-1.15.0.orig/newlib/Makefile.in       2006-12-18 21:32:41.000000000 +0100
941+++ newlib-1.15.0/newlib/Makefile.in    2007-02-02 12:19:43.000000000 +0100
942@@ -103,7 +103,7 @@
943        pdf-recursive ps-recursive uninstall-info-recursive \
944        uninstall-recursive
945 toollibDATA_INSTALL = $(INSTALL_DATA)
946-DATA = $(noinst_DATA) $(toollib_DATA)
947+DATA = $(toollib_DATA)
948 ETAGS = etags
949 CTAGS = ctags
950 DEJATOOL = $(PACKAGE)
951@@ -205,12 +205,7 @@
952 USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
953 USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
954 VERSION = @VERSION@
955-ac_ct_AR = @ac_ct_AR@
956-ac_ct_AS = @ac_ct_AS@
957 ac_ct_CC = @ac_ct_CC@
958-ac_ct_RANLIB = @ac_ct_RANLIB@
959-ac_ct_READELF = @ac_ct_READELF@
960-ac_ct_STRIP = @ac_ct_STRIP@
961 aext = @aext@
962 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
963 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
964@@ -226,12 +221,16 @@
965 build_os = @build_os@
966 build_vendor = @build_vendor@
967 datadir = @datadir@
968+datarootdir = @datarootdir@
969+docdir = @docdir@
970+dvidir = @dvidir@
971 exec_prefix = @exec_prefix@
972 host = @host@
973 host_alias = @host_alias@
974 host_cpu = @host_cpu@
975 host_os = @host_os@
976 host_vendor = @host_vendor@
977+htmldir = @htmldir@
978 includedir = @includedir@
979 infodir = @infodir@
980 install_sh = @install_sh@
981@@ -240,6 +239,7 @@
982 libdir = @libdir@
983 libexecdir = @libexecdir@
984 libm_machine_dir = @libm_machine_dir@
985+localedir = @localedir@
986 localstatedir = @localstatedir@
987 lpfx = @lpfx@
988 machine_dir = @machine_dir@
989@@ -248,8 +248,10 @@
990 newlib_basedir = @newlib_basedir@
991 oext = @oext@
992 oldincludedir = @oldincludedir@
993+pdfdir = @pdfdir@
994 prefix = @prefix@
995 program_transform_name = @program_transform_name@
996+psdir = @psdir@
997 sbindir = @sbindir@
998 sharedstatedir = @sharedstatedir@
999 subdirs = @subdirs@
1000@@ -323,7 +325,7 @@
1001 @USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \
1002 @USE_LIBTOOL_FALSE@    libc.a
1003 
1004-noinst_DATA = stmp-targ-include
1005+BUILT_SOURCES = stmp-targ-include
1006 toollib_DATA = $(CRT0) $(CRT1)
1007 
1008 # The functions ldexp, frexp and modf are traditionally supplied in
1009@@ -382,7 +384,7 @@
1010 
1011 # dejagnu support
1012 RUNTESTFLAGS =
1013-all: newlib.h
1014+all: $(BUILT_SOURCES) newlib.h
1015        $(MAKE) $(AM_MAKEFLAGS) all-recursive
1016 
1017 .SUFFIXES:
1018@@ -687,14 +689,16 @@
1019        done
1020 check-am:
1021        $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
1022-check: check-recursive
1023+check: $(BUILT_SOURCES)
1024+       $(MAKE) $(AM_MAKEFLAGS) check-recursive
1025 all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h
1026 installdirs: installdirs-recursive
1027 installdirs-am:
1028        for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \
1029          test -z "$$dir" || $(mkdir_p) "$$dir"; \
1030        done
1031-install: install-recursive
1032+install: $(BUILT_SOURCES)
1033+       $(MAKE) $(AM_MAKEFLAGS) install-recursive
1034 install-exec: install-exec-recursive
1035 install-data: install-data-recursive
1036 uninstall: uninstall-recursive
1037@@ -719,6 +723,7 @@
1038 maintainer-clean-generic:
1039        @echo "This command is intended for maintainers to use"
1040        @echo "it deletes files that may require special tools to rebuild."
1041+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
1042 clean: clean-recursive
1043 
1044 clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \
1045@@ -837,8 +842,6 @@
1046 
1047 $(CRT1_DIR)$(CRT1): ; @true
1048 
1049-all-recursive: stmp-targ-include
1050-
1051 # The targ-include directory just holds the includes files for the
1052 # particular system and machine we have been configured for.  It is
1053 # used while building.
Note: See TracBrowser for help on using the repository browser.