mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-03 19:28:01 +02:00
[skiplist] Move static variable out of function
Part of my secrect plan to make cairo compilable with: #define static Useful for some weird debugging purposes.
This commit is contained in:
parent
d40126f5ab
commit
8997b3a023
1 changed files with 8 additions and 7 deletions
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
/* Four 256 element lookup tables back to back implementing a linear
|
||||
* feedback shift register of degree 32. */
|
||||
static unsigned const lfsr_lut[1024] = {
|
||||
static unsigned const _cairo_lfsr_random_lut[1024] = {
|
||||
0x00000000, 0x9a795537, 0xae8bff59, 0x34f2aa6e, 0xc76eab85, 0x5d17feb2,
|
||||
0x69e554dc, 0xf39c01eb, 0x14a4023d, 0x8edd570a, 0xba2ffd64, 0x2056a853,
|
||||
0xd3caa9b8, 0x49b3fc8f, 0x7d4156e1, 0xe73803d6, 0x2948047a, 0xb331514d,
|
||||
|
|
@ -207,16 +207,17 @@ static unsigned const lfsr_lut[1024] = {
|
|||
0xeaa6b0df, 0x6a98c0b4, 0x184c1316, 0x9872637d, 0x8249a6f7, 0x0277d69c,
|
||||
0xb63e2de3, 0x36005d88, 0x2c3b9802, 0xac05e869};
|
||||
|
||||
static unsigned _cairo_lfsr_random_state = 0x12345678;
|
||||
|
||||
static unsigned
|
||||
lfsr_random(void)
|
||||
{
|
||||
static unsigned state = 0x12345678;
|
||||
unsigned next;
|
||||
next = lfsr_lut[((state>> 0) & 0xFF) + 0*256];
|
||||
next ^= lfsr_lut[((state>> 8) & 0xFF) + 1*256];
|
||||
next ^= lfsr_lut[((state>>16) & 0xFF) + 2*256];
|
||||
next ^= lfsr_lut[((state>>24) & 0xFF) + 3*256];
|
||||
return state = next;
|
||||
next = _cairo_lfsr_random_lut[((_cairo_lfsr_random_state>> 0) & 0xFF) + 0*256];
|
||||
next ^= _cairo_lfsr_random_lut[((_cairo_lfsr_random_state>> 8) & 0xFF) + 1*256];
|
||||
next ^= _cairo_lfsr_random_lut[((_cairo_lfsr_random_state>>16) & 0xFF) + 2*256];
|
||||
next ^= _cairo_lfsr_random_lut[((_cairo_lfsr_random_state>>24) & 0xFF) + 3*256];
|
||||
return _cairo_lfsr_random_state = next;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue