Loading [MathJax]/extensions/tex2jax.js
mightymandel
v16
GPU-based Mandelbrot set explorer
mightymandel
INDEX
README
CHANGES
BENCHMARKS
TESTING
HACKING
BUGS
TODO
WINDOWS
CODE
Namespaces
Data Structures
Files
File List
atom.c
atom.h
blob_set.c
blob_set.h
completion.c
completion.h
complex.c
complex.h
config.glsl
crc.c
crc.h
filename.c
filename.h
find_ref.c
find_ref.h
fp32_colour.c
fp32_colour.h
fp32_colour2_frag.glsl
fp32_colour2_vert.glsl
fp32_colour_frag.glsl
fp32_colour_vert.glsl
fp32_complex.glsl
fp32_escaped.c
fp32_escaped.h
fp32_escaped_frag.glsl
fp32_escaped_geom.glsl
fp32_escaped_vert.glsl
fp32_fillc.c
fp32_fillc.h
fp32_fillc_frag.glsl
fp32_fillc_vert.glsl
fp32_init.c
fp32_init.h
fp32_init_vert.glsl
fp32_preamble.glsl
fp32_step.c
fp32_step.h
fp32_step_vert.glsl
fp32_unescaped.c
fp32_unescaped.h
fp32_unescaped_geom.glsl
fp32_unescaped_vert.glsl
fp64_complex.glsl
fp64_escaped.c
fp64_escaped.h
fp64_escaped_frag.glsl
fp64_escaped_geom.glsl
fp64_escaped_vert.glsl
fp64_init.c
fp64_init.h
fp64_init_vert.glsl
fp64_preamble.glsl
fp64_step.c
fp64_step.h
fp64_step_vert.glsl
fp64_unescaped.c
fp64_unescaped.h
fp64_unescaped_geom.glsl
fp64_unescaped_vert.glsl
fpxx_approx.c
fpxx_approx.h
fpxx_approx_vert.glsl
fpxx_escaped.c
fpxx_escaped.h
fpxx_escaped_frag.glsl
fpxx_escaped_geom.glsl
fpxx_escaped_vert.glsl
fpxx_init.c
fpxx_init.h
fpxx_init_frag.glsl
fpxx_init_geom.glsl
fpxx_init_vert.glsl
fpxx_step.c
fpxx_step.h
fpxx_step_vert.glsl
fpxx_unescaped.c
fpxx_unescaped.h
fpxx_unescaped_geom.glsl
fpxx_unescaped_vert.glsl
image.c
image.h
interact.c
interact.h
logging.c
logging.h
metadata.c
metadata.h
mightymandel.c
mightymandel.h
parse.c
parse.h
parse_gif.c
parse_gif.h
parse_kfr.c
parse_kfr.h
parse_mdz_center.c
parse_mdz_center.h
parse_mdz_corners.c
parse_mdz_corners.h
parse_mm.c
parse_mm.h
parse_png.c
parse_png.h
parse_ppar_center.c
parse_ppar_center.h
parse_ppar_corners.c
parse_ppar_corners.h
parse_ppm.c
parse_ppm.h
parse_sft.c
parse_sft.h
png.c
png.h
poll.c
poll.h
record.c
record.h
ref_set.c
ref_set.h
render.c
render.h
shader.c
shader.h
slice.c
slice.h
startup.c
startup.h
stopwatch.c
stopwatch.h
texture.c
texture.h
tiling.c
tiling.h
utility.c
utility.h
version.c
version.h
vram.c
vram.h
zoom.c
zoom.h
Globals
crc.c
Go to the documentation of this file.
1
20
/* Table of CRCs of all 8-bit messages. */
21
unsigned
long
crc_table
[256];
22
23
/* Flag: has the table been computed? Initially false. */
24
int
crc_table_computed
= 0;
25
26
/* Make the table for a fast CRC. */
27
void
make_crc_table
(
void
)
28
{
29
unsigned
long
c;
30
int
n, k;
31
32
for
(n = 0; n < 256; n++) {
33
c = (
unsigned
long) n;
34
for
(k = 0; k < 8; k++) {
35
if
(c & 1)
36
c = 0xedb88320L ^ (c >> 1);
37
else
38
c = c >> 1;
39
}
40
crc_table
[n] = c;
41
}
42
crc_table_computed
= 1;
43
}
44
45
46
/* Update a running CRC with the bytes buf[0..len-1]--the CRC
47
should be initialized to all 1's, and the transmitted value
48
is the 1's complement of the final running CRC (see the
49
crc() routine below). */
50
51
/* {{{ modified by Claude Heiland-Allen 2015-01-08 (added const) */
52
unsigned
long
update_crc
(
unsigned
long
crc
,
const
unsigned
char
*buf,
53
/* }}} modified by Claude Heiland-Allen 2015-01-08 (added const) */
54
int
len)
55
{
56
unsigned
long
c =
crc
;
57
int
n;
58
59
if
(!
crc_table_computed
)
60
make_crc_table
();
61
for
(n = 0; n < len; n++) {
62
c =
crc_table
[(c ^ buf[n]) & 0xff] ^ (c >> 8);
63
}
64
return
c;
65
}
66
67
/* Return the CRC of the bytes buf[0..len-1]. */
68
/* {{{ modified by Claude Heiland-Allen 2015-01-08 (added const) */
69
unsigned
long
crc
(
const
unsigned
char
*buf,
int
len)
70
/* }}} modified by Claude Heiland-Allen 2015-01-08 (added const) */
71
{
72
return
update_crc
(0xffffffffL, buf, len) ^ 0xffffffffL;
73
}
src
crc.c
Generated on Mon Jan 19 2015 16:18:12 for mightymandel by
1.8.1.2