OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [990517-1.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* Extracted from the sdm module in perl.  */
2
typedef struct {
3
        char *dptr;
4
        int dsize;
5
} datum;
6
extern long sdbm_hash  (char *, int)  ;
7
extern void  sdbm__putpair   (char *, datum, datum)  ;
8
void
9
sdbm__splpage (char *pag, char *New, long int sbit)
10
{
11
        datum key;
12
        datum val;
13
        register int n;
14
        register int off = 1024 ;
15
        char cur[1024 ];
16
        register short *ino = (short *) cur;
17
        (void) memcpy(cur, pag, 1024 );
18
        (void) ({ void *__s = ( pag ); __builtin_memset ( __s , '\0',     1024   ) ; __s; });
19
        (void) ({ void *__s = ( New ); __builtin_memset ( __s , '\0',     1024   ) ; __s; });
20
        n = ino[0];
21
        for (ino++; n > 0; ino += 2) {
22
                key.dptr = cur + ino[0];
23
                key.dsize = off - ino[0];
24
                val.dptr = cur + ino[1];
25
                val.dsize = ino[0] - ino[1];
26
                (void) sdbm__putpair ((sdbm_hash(( key ).dptr, ( key ).dsize)  & sbit) ? New : pag, key, val);
27
                off = ino[1];
28
                n -= 2;
29
        }
30
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.