source:
rtems/contrib/crossrpms/patches/newlib-1.14.0-rtems-20060707.diff
@
2dd8aa1e
Last change on this file since 2dd8aa1e was 2dd8aa1e, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/11/06 at 11:32:10 | |
---|---|
|
|
File size: 23.4 KB |
-
newlib/libc/include/machine/setjmp.h
diff -uNr --exclude CVS --exclude .cvsignore newlib-1.14.0/newlib/libc/include/machine/setjmp.h newlib-rtems/newlib/libc/include/machine/setjmp.h
old new 23 23 24 24 /* necv70 was 9 as well. */ 25 25 26 #if def __mc68000__26 #if defined(__m68k__) || defined(__mc68000__) 27 27 /* 28 28 * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6, 29 29 * fp2-fp7 for 68881. -
newlib/libc/include/sys/_types.h
diff -uNr --exclude CVS --exclude .cvsignore newlib-1.14.0/newlib/libc/include/sys/_types.h newlib-rtems/newlib/libc/include/sys/_types.h
old new 39 39 /* Iconv descriptor type */ 40 40 typedef void *_iconv_t; 41 41 42 typedef long * __intptr_t; 43 typedef unsigned long* __uintptr_t; 44 42 45 #endif /* _SYS__TYPES_H */ -
newlib/libc/search/db_local.h
diff -uNr --exclude CVS --exclude .cvsignore newlib-1.14.0/newlib/libc/search/db_local.h newlib-rtems/newlib/libc/search/db_local.h
old new 50 50 #define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */ 51 51 typedef __uint32_t pgno_t; 52 52 #define MAX_PAGE_OFFSET 65535 /* >= # of bytes in a page */ 53 typedef __uint 16_t indx_t;53 typedef __uint_least16_t indx_t; 54 54 #define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */ 55 55 typedef __uint32_t recno_t; 56 56 … … 191 191 * P_16_COPY swap from one location to another 192 192 */ 193 193 #define M_16_SWAP(a) { \ 194 __uint 16_t _tmp = a; \194 __uint_least16_t _tmp = a; \ 195 195 ((char *)&a)[0] = ((char *)&_tmp)[1]; \ 196 196 ((char *)&a)[1] = ((char *)&_tmp)[0]; \ 197 197 } 198 198 #define P_16_SWAP(a) { \ 199 __uint 16_t _tmp = *(__uint16_t *)a; \199 __uint_least16_t _tmp = *(__uint_least16_t *)a; \ 200 200 ((char *)a)[0] = ((char *)&_tmp)[1]; \ 201 201 ((char *)a)[1] = ((char *)&_tmp)[0]; \ 202 202 } -
newlib/libc/search/extern.h
diff -uNr --exclude CVS --exclude .cvsignore newlib-1.14.0/newlib/libc/search/extern.h newlib-rtems/newlib/libc/search/extern.h
old new 48 48 int __delpair(HTAB *, BUFHEAD *, int); 49 49 int __expand_table(HTAB *); 50 50 int __find_bigpair(HTAB *, BUFHEAD *, int, char *, int); 51 __uint 16_t __find_last_page(HTAB *, BUFHEAD **);51 __uint_least16_t __find_last_page(HTAB *, BUFHEAD **); 52 52 void __free_ovflpage(HTAB *, BUFHEAD *); 53 53 BUFHEAD *__get_buf(HTAB *, __uint32_t, BUFHEAD *, int); 54 54 int __get_page(HTAB *, char *, __uint32_t, int, int, int); -
newlib/libc/search/hash_bigkey.c
diff -uNr --exclude CVS --exclude .cvsignore newlib-1.14.0/newlib/libc/search/hash_bigkey.c newlib-rtems/newlib/libc/search/hash_bigkey.c
old new 96 96 BUFHEAD *bufp; 97 97 const DBT *key, *val; 98 98 { 99 __uint 16_t *p;99 __uint_least16_t *p; 100 100 int key_size, n, val_size; 101 __uint 16_t space, move_bytes, off;101 __uint_least16_t space, move_bytes, off; 102 102 char *cp, *key_data, *val_data; 103 103 104 104 cp = bufp->page; /* Character pointer of p. */ 105 p = (__uint 16_t *)cp;105 p = (__uint_least16_t *)cp; 106 106 107 107 key_data = (char *)key->data; 108 108 key_size = key->size; … … 140 140 OFFSET(p) = off; 141 141 } else 142 142 p[n - 2] = FULL_KEY; 143 p = (__uint 16_t *)bufp->page;143 p = (__uint_least16_t *)bufp->page; 144 144 cp = bufp->page; 145 145 bufp->flags |= BUF_MOD; 146 146 } … … 170 170 if (!bufp) 171 171 return (-1); 172 172 cp = bufp->page; 173 p = (__uint 16_t *)cp;173 p = (__uint_least16_t *)cp; 174 174 } else 175 175 p[n] = FULL_KEY_DATA; 176 176 bufp->flags |= BUF_MOD; … … 195 195 BUFHEAD *bufp; 196 196 { 197 197 BUFHEAD *last_bfp, *rbufp; 198 __uint 16_t *bp, pageno;198 __uint_least16_t *bp, pageno; 199 199 int key_done, n; 200 200 201 201 rbufp = bufp; 202 202 last_bfp = NULL; 203 bp = (__uint 16_t *)bufp->page;203 bp = (__uint_least16_t *)bufp->page; 204 204 pageno = 0; 205 205 key_done = 0; 206 206 … … 223 223 last_bfp = rbufp; 224 224 if (!rbufp) 225 225 return (-1); /* Error. */ 226 bp = (__uint 16_t *)rbufp->page;226 bp = (__uint_least16_t *)rbufp->page; 227 227 } 228 228 229 229 /* … … 238 238 pageno = bp[n - 1]; 239 239 240 240 /* Now, bp is the first page of the pair. */ 241 bp = (__uint 16_t *)bufp->page;241 bp = (__uint_least16_t *)bufp->page; 242 242 if (n > 2) { 243 243 /* There is an overflow page. */ 244 244 bp[1] = pageno; … … 276 276 char *key; 277 277 int size; 278 278 { 279 __uint 16_t *bp;279 __uint_least16_t *bp; 280 280 char *p; 281 281 int ksize; 282 __uint 16_t bytes;282 __uint_least16_t bytes; 283 283 char *kkey; 284 284 285 bp = (__uint 16_t *)bufp->page;285 bp = (__uint_least16_t *)bufp->page; 286 286 p = bufp->page; 287 287 ksize = size; 288 288 kkey = key; … … 298 298 if (!bufp) 299 299 return (-3); 300 300 p = bufp->page; 301 bp = (__uint 16_t *)p;301 bp = (__uint_least16_t *)p; 302 302 ndx = 1; 303 303 } 304 304 … … 320 320 * of the pair; 0 if there isn't any (i.e. big pair is the last key in the 321 321 * bucket) 322 322 */ 323 extern __uint 16_t323 extern __uint_least16_t 324 324 __find_last_page(hashp, bpp) 325 325 HTAB *hashp; 326 326 BUFHEAD **bpp; 327 327 { 328 328 BUFHEAD *bufp; 329 __uint 16_t *bp, pageno;329 __uint_least16_t *bp, pageno; 330 330 int n; 331 331 332 332 bufp = *bpp; 333 bp = (__uint 16_t *)bufp->page;333 bp = (__uint_least16_t *)bufp->page; 334 334 for (;;) { 335 335 n = bp[0]; 336 336 … … 347 347 bufp = __get_buf(hashp, pageno, bufp, 0); 348 348 if (!bufp) 349 349 return (0); /* Need to indicate an error! */ 350 bp = (__uint 16_t *)bufp->page;350 bp = (__uint_least16_t *)bufp->page; 351 351 } 352 352 353 353 *bpp = bufp; … … 370 370 int set_current; 371 371 { 372 372 BUFHEAD *save_p; 373 __uint 16_t *bp, len, off, save_addr;373 __uint_least16_t *bp, len, off, save_addr; 374 374 char *tp; 375 375 376 bp = (__uint 16_t *)bufp->page;376 bp = (__uint_least16_t *)bufp->page; 377 377 while (bp[ndx + 1] == PARTIAL_KEY) { 378 378 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); 379 379 if (!bufp) 380 380 return (-1); 381 bp = (__uint 16_t *)bufp->page;381 bp = (__uint_least16_t *)bufp->page; 382 382 ndx = 1; 383 383 } 384 384 … … 386 386 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); 387 387 if (!bufp) 388 388 return (-1); 389 bp = (__uint 16_t *)bufp->page;389 bp = (__uint_least16_t *)bufp->page; 390 390 save_p = bufp; 391 391 save_addr = save_p->addr; 392 392 off = bp[1]; … … 407 407 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); 408 408 if (!bufp) 409 409 return (-1); 410 bp = (__uint 16_t *)bufp->page;410 bp = (__uint_least16_t *)bufp->page; 411 411 } else { 412 412 /* The data is all on one page. */ 413 413 tp = (char *)bp; … … 426 426 if (!hashp->cpage) 427 427 return (-1); 428 428 hashp->cndx = 1; 429 if (!((__uint 16_t *)429 if (!((__uint_least16_t *) 430 430 hashp->cpage->page)[0]) { 431 431 hashp->cbucket++; 432 432 hashp->cpage = NULL; … … 458 458 BUFHEAD *bufp; 459 459 int len, set; 460 460 { 461 __uint 16_t *bp;461 __uint_least16_t *bp; 462 462 char *p; 463 463 BUFHEAD *xbp; 464 __uint 16_t save_addr;464 __uint_least16_t save_addr; 465 465 int mylen, totlen; 466 466 467 467 p = bufp->page; 468 bp = (__uint 16_t *)p;468 bp = (__uint_least16_t *)p; 469 469 mylen = hashp->BSIZE - bp[1]; 470 470 save_addr = bufp->addr; 471 471 … … 485 485 __get_buf(hashp, bp[bp[0] - 1], bufp, 0); 486 486 if (!hashp->cpage) 487 487 return (-1); 488 else if (!((__uint 16_t *)hashp->cpage->page)[0]) {488 else if (!((__uint_least16_t *)hashp->cpage->page)[0]) { 489 489 hashp->cbucket++; 490 490 hashp->cpage = NULL; 491 491 } … … 537 537 BUFHEAD *xbp; 538 538 char *p; 539 539 int mylen, totlen; 540 __uint 16_t *bp, save_addr;540 __uint_least16_t *bp, save_addr; 541 541 542 542 p = bufp->page; 543 bp = (__uint 16_t *)p;543 bp = (__uint_least16_t *)p; 544 544 mylen = hashp->BSIZE - bp[1]; 545 545 546 546 save_addr = bufp->addr; … … 583 583 SPLIT_RETURN *ret; 584 584 { 585 585 BUFHEAD *tmpp; 586 __uint 16_t *tp;586 __uint_least16_t *tp; 587 587 BUFHEAD *bp; 588 588 DBT key, val; 589 589 __uint32_t change; 590 __uint 16_t free_space, n, off;590 __uint_least16_t free_space, n, off; 591 591 592 592 bp = big_keyp; 593 593 … … 619 619 (tmpp->ovfl ? tmpp->ovfl->addr : 0), (bp ? bp->addr : 0)); 620 620 #endif 621 621 tmpp->ovfl = bp; /* one of op/np point to big_keyp */ 622 tp = (__uint 16_t *)tmpp->page;622 tp = (__uint_least16_t *)tmpp->page; 623 623 #ifdef DEBUG 624 624 assert(FREESPACE(tp) >= OVFLSIZE); 625 625 #endif 626 626 n = tp[0]; 627 627 off = OFFSET(tp); 628 628 free_space = FREESPACE(tp); 629 tp[++n] = (__uint 16_t)addr;629 tp[++n] = (__uint_least16_t)addr; 630 630 tp[++n] = OVFLPAGE; 631 631 tp[0] = n; 632 632 OFFSET(tp) = off; … … 642 642 ret->newp = np; 643 643 ret->oldp = op; 644 644 645 tp = (__uint 16_t *)big_keyp->page;645 tp = (__uint_least16_t *)big_keyp->page; 646 646 big_keyp->flags |= BUF_MOD; 647 647 if (tp[0] > 2) { 648 648 /* -
newlib/libc/search/hash_buf.c
diff -uNr --exclude CVS --exclude .cvsignore newlib-1.14.0/newlib/libc/search/hash_buf.c newlib-rtems/newlib/libc/search/hash_buf.c
old new 176 176 BUFHEAD *next_xbp; 177 177 SEGMENT segp; 178 178 int segment_ndx; 179 __uint 16_t oaddr, *shortp;179 __uint_least16_t oaddr, *shortp; 180 180 181 181 oaddr = 0; 182 182 bp = LRU; … … 212 212 * Set oaddr before __put_page so that you get it 213 213 * before bytes are swapped. 214 214 */ 215 shortp = (__uint 16_t *)bp->page;215 shortp = (__uint_least16_t *)bp->page; 216 216 if (shortp[0]) 217 217 oaddr = shortp[shortp[0] - 1]; 218 218 if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page, … … 255 255 (oaddr != xbp->addr)) 256 256 break; 257 257 258 shortp = (__uint 16_t *)xbp->page;258 shortp = (__uint_least16_t *)xbp->page; 259 259 if (shortp[0]) 260 260 /* set before __put_page */ 261 261 oaddr = shortp[shortp[0] - 1]; -
newlib/libc/search/hash.c
diff -uNr --exclude CVS --exclude .cvsignore newlib-1.14.0/newlib/libc/search/hash.c newlib-rtems/newlib/libc/search/hash.c
old new 628 628 { 629 629 BUFHEAD *rbufp; 630 630 BUFHEAD *bufp, *save_bufp; 631 __uint 16_t *bp;631 __uint_least16_t *bp; 632 632 int n, ndx, off, size; 633 633 char *kp; 634 __uint 16_t pageno;634 __uint_least16_t pageno; 635 635 636 636 #ifdef HASH_STATISTICS 637 637 hash_accesses++; … … 647 647 648 648 /* Pin the bucket chain */ 649 649 rbufp->flags |= BUF_PIN; 650 for (bp = (__uint 16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)650 for (bp = (__uint_least16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;) 651 651 if (bp[1] >= REAL_KEY) { 652 652 /* Real key/data pair */ 653 653 if (size == off - *bp && … … 666 666 return (ERROR); 667 667 } 668 668 /* FOR LOOP INIT */ 669 bp = (__uint 16_t *)rbufp->page;669 bp = (__uint_least16_t *)rbufp->page; 670 670 n = *bp++; 671 671 ndx = 1; 672 672 off = hashp->BSIZE; … … 688 688 return (ERROR); 689 689 } 690 690 /* FOR LOOP INIT */ 691 bp = (__uint 16_t *)rbufp->page;691 bp = (__uint_least16_t *)rbufp->page; 692 692 n = *bp++; 693 693 ndx = 1; 694 694 off = hashp->BSIZE; … … 722 722 save_bufp->flags &= ~BUF_PIN; 723 723 return (ABNORMAL); 724 724 case HASH_GET: 725 bp = (__uint 16_t *)rbufp->page;725 bp = (__uint_least16_t *)rbufp->page; 726 726 if (bp[ndx + 1] < REAL_KEY) { 727 727 if (__big_return(hashp, rbufp, ndx, val, 0)) 728 728 return (ERROR); … … 758 758 __uint32_t bucket; 759 759 BUFHEAD *bufp; 760 760 HTAB *hashp; 761 __uint 16_t *bp, ndx;761 __uint_least16_t *bp, ndx; 762 762 763 763 hashp = (HTAB *)dbp->internal; 764 764 if (flag && flag != R_FIRST && flag != R_NEXT) { … … 783 783 if (!bufp) 784 784 return (ERROR); 785 785 hashp->cpage = bufp; 786 bp = (__uint 16_t *)bufp->page;786 bp = (__uint_least16_t *)bufp->page; 787 787 if (bp[0]) 788 788 break; 789 789 } … … 793 793 return (ABNORMAL); 794 794 } 795 795 } else 796 bp = (__uint 16_t *)hashp->cpage->page;796 bp = (__uint_least16_t *)hashp->cpage->page; 797 797 798 798 #ifdef DEBUG 799 799 assert(bp); … … 804 804 __get_buf(hashp, bp[hashp->cndx], bufp, 0); 805 805 if (!bufp) 806 806 return (ERROR); 807 bp = (__uint 16_t *)(bufp->page);807 bp = (__uint_least16_t *)(bufp->page); 808 808 hashp->cndx = 1; 809 809 } 810 810 if (!bp[0]) { -
newlib/libc/search/hash.h
diff -uNr --exclude CVS --exclude .cvsignore newlib-1.14.0/newlib/libc/search/hash.h newlib-rtems/newlib/libc/search/hash.h
old new 102 102 #define NCACHED 32 /* number of bit maps and spare 103 103 * points */ 104 104 int spares[NCACHED];/* spare pages for overflow */ 105 __uint 16_t bitmaps[NCACHED]; /* address of overflow page105 __uint_least16_t bitmaps[NCACHED]; /* address of overflow page 106 106 * bitmaps */ 107 107 } HASHHDR; 108 108 -
newlib/libc/search/hash_page.c
diff -uNr --exclude CVS --exclude .cvsignore newlib-1.14.0/newlib/libc/search/hash_page.c newlib-rtems/newlib/libc/search/hash_page.c
old new 77 77 static __uint32_t *fetch_bitmap(HTAB *, int); 78 78 static __uint32_t first_free(__uint32_t); 79 79 static int open_temp(HTAB *); 80 static __uint 16_t overflow_page(HTAB *);80 static __uint_least16_t overflow_page(HTAB *); 81 81 static void putpair(char *, const DBT *, const DBT *); 82 static void squeeze_key(__uint 16_t *, const DBT *, const DBT *);82 static void squeeze_key(__uint_least16_t *, const DBT *, const DBT *); 83 83 static int ugly_split 84 84 (HTAB *, __uint32_t, BUFHEAD *, BUFHEAD *, int, int); 85 85 86 86 #define PAGE_INIT(P) { \ 87 ((__uint 16_t *)(P))[0] = 0; \88 ((__uint 16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint16_t); \89 ((__uint 16_t *)(P))[2] = hashp->BSIZE; \87 ((__uint_least16_t *)(P))[0] = 0; \ 88 ((__uint_least16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint_least16_t); \ 89 ((__uint_least16_t *)(P))[2] = hashp->BSIZE; \ 90 90 } 91 91 92 92 /* … … 99 99 char *p; 100 100 const DBT *key, *val; 101 101 { 102 __uint 16_t *bp, n, off;102 __uint_least16_t *bp, n, off; 103 103 104 bp = (__uint 16_t *)p;104 bp = (__uint_least16_t *)p; 105 105 106 106 /* Enter the key first. */ 107 107 n = bp[0]; … … 117 117 118 118 /* Adjust page info. */ 119 119 bp[0] = n; 120 bp[n + 1] = off - ((n + 3) * sizeof(__uint 16_t));120 bp[n + 1] = off - ((n + 3) * sizeof(__uint_least16_t)); 121 121 bp[n + 2] = off; 122 122 } 123 123 … … 132 132 BUFHEAD *bufp; 133 133 int ndx; 134 134 { 135 __uint 16_t *bp, newoff;135 __uint_least16_t *bp, newoff; 136 136 int n; 137 __uint 16_t pairlen;137 __uint_least16_t pairlen; 138 138 139 bp = (__uint 16_t *)bufp->page;139 bp = (__uint_least16_t *)bufp->page; 140 140 n = bp[0]; 141 141 142 142 if (bp[ndx + 1] < REAL_KEY) … … 167 167 } 168 168 /* Finally adjust the page data */ 169 169 bp[n] = OFFSET(bp) + pairlen; 170 bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(__uint 16_t);170 bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(__uint_least16_t); 171 171 bp[0] = n - 2; 172 172 hashp->NKEYS--; 173 173 … … 185 185 __uint32_t obucket, nbucket; 186 186 { 187 187 BUFHEAD *new_bufp, *old_bufp; 188 __uint 16_t *ino;188 __uint_least16_t *ino; 189 189 char *np; 190 190 DBT key, val; 191 191 int n, ndx, retval; 192 __uint 16_t copyto, diff, off, moved;192 __uint_least16_t copyto, diff, off, moved; 193 193 char *op; 194 194 195 copyto = (__uint 16_t)hashp->BSIZE;196 off = (__uint 16_t)hashp->BSIZE;195 copyto = (__uint_least16_t)hashp->BSIZE; 196 off = (__uint_least16_t)hashp->BSIZE; 197 197 old_bufp = __get_buf(hashp, obucket, NULL, 0); 198 198 if (old_bufp == NULL) 199 199 return (-1); … … 204 204 old_bufp->flags |= (BUF_MOD | BUF_PIN); 205 205 new_bufp->flags |= (BUF_MOD | BUF_PIN); 206 206 207 ino = (__uint 16_t *)(op = old_bufp->page);207 ino = (__uint_least16_t *)(op = old_bufp->page); 208 208 np = new_bufp->page; 209 209 210 210 moved = 0; … … 246 246 247 247 /* Now clean up the page */ 248 248 ino[0] -= moved; 249 FREESPACE(ino) = copyto - sizeof(__uint 16_t) * (ino[0] + 3);249 FREESPACE(ino) = copyto - sizeof(__uint_least16_t) * (ino[0] + 3); 250 250 OFFSET(ino) = copyto; 251 251 252 252 #ifdef DEBUG3 253 253 (void)fprintf(stderr, "split %d/%d\n", 254 ((__uint 16_t *)np)[0] / 2,255 ((__uint 16_t *)op)[0] / 2);254 ((__uint_least16_t *)np)[0] / 2, 255 ((__uint_least16_t *)op)[0] / 2); 256 256 #endif 257 257 /* unpin both pages */ 258 258 old_bufp->flags &= ~BUF_PIN; … … 284 284 int moved; /* Number of pairs moved to new page. */ 285 285 { 286 286 BUFHEAD *bufp; /* Buffer header for ino */ 287 __uint 16_t *ino; /* Page keys come off of */288 __uint 16_t *np; /* New page */289 __uint 16_t *op; /* Page keys go on to if they aren't moving */287 __uint_least16_t *ino; /* Page keys come off of */ 288 __uint_least16_t *np; /* New page */ 289 __uint_least16_t *op; /* Page keys go on to if they aren't moving */ 290 290 291 291 BUFHEAD *last_bfp; /* Last buf header OVFL needing to be freed */ 292 292 DBT key, val; 293 293 SPLIT_RETURN ret; 294 __uint 16_t n, off, ov_addr, scopyto;294 __uint_least16_t n, off, ov_addr, scopyto; 295 295 char *cino; /* Character value of ino */ 296 296 297 297 bufp = old_bufp; 298 ino = (__uint 16_t *)old_bufp->page;299 np = (__uint 16_t *)new_bufp->page;300 op = (__uint 16_t *)old_bufp->page;298 ino = (__uint_least16_t *)old_bufp->page; 299 np = (__uint_least16_t *)new_bufp->page; 300 op = (__uint_least16_t *)old_bufp->page; 301 301 last_bfp = NULL; 302 scopyto = (__uint 16_t)copyto; /* ANSI */302 scopyto = (__uint_least16_t)copyto; /* ANSI */ 303 303 304 304 n = ino[0] - 1; 305 305 while (n < ino[0]) { … … 310 310 old_bufp = ret.oldp; 311 311 if (!old_bufp) 312 312 return (-1); 313 op = (__uint 16_t *)old_bufp->page;313 op = (__uint_least16_t *)old_bufp->page; 314 314 new_bufp = ret.newp; 315 315 if (!new_bufp) 316 316 return (-1); 317 np = (__uint 16_t *)new_bufp->page;317 np = (__uint_least16_t *)new_bufp->page; 318 318 bufp = ret.nextp; 319 319 if (!bufp) 320 320 return (0); 321 321 cino = (char *)bufp->page; 322 ino = (__uint 16_t *)cino;322 ino = (__uint_least16_t *)cino; 323 323 last_bfp = ret.nextp; 324 324 } else if (ino[n + 1] == OVFLPAGE) { 325 325 ov_addr = ino[n]; … … 329 329 */ 330 330 ino[0] -= (moved + 2); 331 331 FREESPACE(ino) = 332 scopyto - sizeof(__uint 16_t) * (ino[0] + 3);332 scopyto - sizeof(__uint_least16_t) * (ino[0] + 3); 333 333 OFFSET(ino) = scopyto; 334 334 335 335 bufp = __get_buf(hashp, ov_addr, bufp, 0); 336 336 if (!bufp) 337 337 return (-1); 338 338 339 ino = (__uint 16_t *)bufp->page;339 ino = (__uint_least16_t *)bufp->page; 340 340 n = 1; 341 341 scopyto = hashp->BSIZE; 342 342 moved = 0; … … 364 364 __add_ovflpage(hashp, old_bufp); 365 365 if (!old_bufp) 366 366 return (-1); 367 op = (__uint 16_t *)old_bufp->page;367 op = (__uint_least16_t *)old_bufp->page; 368 368 putpair((char *)op, &key, &val); 369 369 } 370 370 old_bufp->flags |= BUF_MOD; … … 377 377 __add_ovflpage(hashp, new_bufp); 378 378 if (!new_bufp) 379 379 return (-1); 380 np = (__uint 16_t *)new_bufp->page;380 np = (__uint_least16_t *)new_bufp->page; 381 381 putpair((char *)np, &key, &val); 382 382 } 383 383 new_bufp->flags |= BUF_MOD; … … 402 402 BUFHEAD *bufp; 403 403 const DBT *key, *val; 404 404 { 405 __uint 16_t *bp, *sop;405 __uint_least16_t *bp, *sop; 406 406 int do_expand; 407 407 408 bp = (__uint 16_t *)bufp->page;408 bp = (__uint_least16_t *)bufp->page; 409 409 do_expand = 0; 410 410 while (bp[0] && (bp[2] < REAL_KEY || bp[bp[0]] < REAL_KEY)) 411 411 /* Exception case */ … … 417 417 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); 418 418 if (!bufp) 419 419 return (-1); 420 bp = (__uint 16_t *)bufp->page;420 bp = (__uint_least16_t *)bufp->page; 421 421 } else 422 422 /* Try to squeeze key on this page */ 423 423 if (FREESPACE(bp) > PAIRSIZE(key, val)) { … … 427 427 bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0); 428 428 if (!bufp) 429 429 return (-1); 430 bp = (__uint 16_t *)bufp->page;430 bp = (__uint_least16_t *)bufp->page; 431 431 } 432 432 433 433 if (PAIRFITS(bp, key, val)) … … 437 437 bufp = __add_ovflpage(hashp, bufp); 438 438 if (!bufp) 439 439 return (-1); 440 sop = (__uint 16_t *)bufp->page;440 sop = (__uint_least16_t *)bufp->page; 441 441 442 442 if (PAIRFITS(sop, key, val)) 443 443 putpair((char *)sop, key, val); … … 468 468 HTAB *hashp; 469 469 BUFHEAD *bufp; 470 470 { 471 __uint 16_t *sp;472 __uint 16_t ndx, ovfl_num;471 __uint_least16_t *sp; 472 __uint_least16_t ndx, ovfl_num; 473 473 #ifdef DEBUG1 474 474 int tmp1, tmp2; 475 475 #endif 476 sp = (__uint 16_t *)bufp->page;476 sp = (__uint_least16_t *)bufp->page; 477 477 478 478 /* Check if we are dynamically determining the fill factor */ 479 479 if (hashp->FFACTOR == DEF_FFACTOR) { … … 525 525 { 526 526 int fd, page, size; 527 527 int rsize; 528 __uint 16_t *bp;528 __uint_least16_t *bp; 529 529 530 530 fd = hashp->fp; 531 531 size = hashp->BSIZE; … … 541 541 if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) || 542 542 ((rsize = read(fd, p, size)) == -1)) 543 543 return (-1); 544 bp = (__uint 16_t *)p;544 bp = (__uint_least16_t *)p; 545 545 if (!rsize) 546 546 bp[0] = 0; /* We hit the EOF, so initialize a new page */ 547 547 else … … 600 600 for (i = 0; i < max; i++) 601 601 M_32_SWAP(((int *)p)[i]); 602 602 } else { 603 max = ((__uint 16_t *)p)[0] + 2;603 max = ((__uint_least16_t *)p)[0] + 2; 604 604 for (i = 0; i <= max; i++) 605 M_16_SWAP(((__uint 16_t *)p)[i]);605 M_16_SWAP(((__uint_least16_t *)p)[i]); 606 606 } 607 607 } 608 608 if (is_bucket) … … 643 643 hashp->BSIZE - clearbytes); 644 644 ip[clearints - 1] = ALL_SET << (nbits & BYTE_MASK); 645 645 SETBIT(ip, 0); 646 hashp->BITMAPS[ndx] = (__uint 16_t)pnum;646 hashp->BITMAPS[ndx] = (__uint_least16_t)pnum; 647 647 hashp->mapp[ndx] = ip; 648 648 return (0); 649 649 } … … 663 663 return (i); 664 664 } 665 665 666 static __uint 16_t666 static __uint_least16_t 667 667 overflow_page(hashp) 668 668 HTAB *hashp; 669 669 { 670 670 __uint32_t *freep; 671 671 int max_free, offset, splitnum; 672 __uint 16_t addr;672 __uint_least16_t addr; 673 673 int bit, first_page, free_bit, free_page, i, in_use_bits, j; 674 674 #ifdef DEBUG2 675 675 int tmp1, tmp2; … … 816 816 HTAB *hashp; 817 817 BUFHEAD *obufp; 818 818 { 819 __uint 16_t addr;819 __uint_least16_t addr; 820 820 __uint32_t *freep; 821 821 int bit_address, free_page, free_bit; 822 __uint 16_t ndx;822 __uint_least16_t ndx; 823 823 824 824 addr = obufp->addr; 825 825 #ifdef DEBUG1 826 826 (void)fprintf(stderr, "Freeing %d\n", addr); 827 827 #endif 828 ndx = (((__uint 16_t)addr) >> SPLITSHIFT);828 ndx = (((__uint_least16_t)addr) >> SPLITSHIFT); 829 829 bit_address = 830 830 (ndx ? hashp->SPARES[ndx - 1] : 0) + (addr & SPLITMASK) - 1; 831 831 if (bit_address < hashp->LAST_FREED) … … 883 883 */ 884 884 static void 885 885 squeeze_key(sp, key, val) 886 __uint 16_t *sp;886 __uint_least16_t *sp; 887 887 const DBT *key, *val; 888 888 { 889 889 char *p; 890 __uint 16_t free_space, n, off, pageno;890 __uint_least16_t free_space, n, off, pageno; 891 891 892 892 p = (char *)sp; 893 893 n = sp[0]; -
newlib/libc/search/page.h
diff -uNr --exclude CVS --exclude .cvsignore newlib-1.14.0/newlib/libc/search/page.h newlib-rtems/newlib/libc/search/page.h
old new 74 74 * You might as well do this up front. 75 75 */ 76 76 77 #define PAIRSIZE(K,D) (2*sizeof(__uint 16_t) + (K)->size + (D)->size)78 #define BIGOVERHEAD (4*sizeof(__uint 16_t))79 #define KEYSIZE(K) (4*sizeof(__uint 16_t) + (K)->size);80 #define OVFLSIZE (2*sizeof(__uint 16_t))77 #define PAIRSIZE(K,D) (2*sizeof(__uint_least16_t) + (K)->size + (D)->size) 78 #define BIGOVERHEAD (4*sizeof(__uint_least16_t)) 79 #define KEYSIZE(K) (4*sizeof(__uint_least16_t) + (K)->size); 80 #define OVFLSIZE (2*sizeof(__uint_least16_t)) 81 81 #define FREESPACE(P) ((P)[(P)[0]+1]) 82 82 #define OFFSET(P) ((P)[(P)[0]+2]) 83 83 #define PAIRFITS(P,K,D) \ 84 84 (((P)[2] >= REAL_KEY) && \ 85 85 (PAIRSIZE((K),(D)) + OVFLSIZE) <= FREESPACE((P))) 86 #define PAGE_META(N) (((N)+3) * sizeof(__uint 16_t))86 #define PAGE_META(N) (((N)+3) * sizeof(__uint_least16_t)) 87 87 88 88 typedef struct { 89 89 BUFHEAD *newp; 90 90 BUFHEAD *oldp; 91 91 BUFHEAD *nextp; 92 __uint 16_t next_addr;92 __uint_least16_t next_addr; 93 93 } SPLIT_RETURN; -
newlib/libc/machine/arm/machine/endian.h
diff -uNr newlib-1.14.0.orig/newlib/libc/machine/arm/machine/endian.h newlib-1.14.0/newlib/libc/machine/arm/machine/endian.h
old new 1 /* ARM configuration file */2 3 #ifndef _MACHINE_ENDIAN_H4 # define _MACHINE_ENDIAN_H5 6 #ifdef __ARMEB__7 #define BYTE_ORDER BIG_ENDIAN8 #else9 #define BYTE_ORDER LITTLE_ENDIAN10 #endif11 12 #endif
Note: See TracBrowser
for help on using the repository browser.