Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
15d7e617
"vscode:/vscode.git/clone" did not exist on "4e0af5efd42edacda09f6569f063cbfb1fe56fe9"
Commit
15d7e617
authored
Mar 14, 2018
by
Otmar Ertl
Browse files
fixed compilation error when using clang as reported by michael-grunder
parent
97bde9f6
Changes
1
Show whitespace changes
Inline
Side-by-side
src/hyperloglog.c
View file @
15d7e617
...
@@ -386,6 +386,7 @@ static char *invalid_hll_err = "-INVALIDOBJ Corrupted HLL object detected\r\n";
...
@@ -386,6 +386,7 @@ static char *invalid_hll_err = "-INVALIDOBJ Corrupted HLL object detected\r\n";
*(p) = (_l>>8) | HLL_SPARSE_XZERO_BIT; \
*(p) = (_l>>8) | HLL_SPARSE_XZERO_BIT; \
*((p)+1) = (_l&0xff); \
*((p)+1) = (_l&0xff); \
} while(0)
} while(0)
#define HLL_ALPHA_INF 0.721347520444481703680
/* constant for 0.5/ln(2) */
/* ========================= HyperLogLog algorithm ========================= */
/* ========================= HyperLogLog algorithm ========================= */
...
@@ -1012,7 +1013,6 @@ uint64_t hllCount(struct hllhdr *hdr, int *invalid) {
...
@@ -1012,7 +1013,6 @@ uint64_t hllCount(struct hllhdr *hdr, int *invalid) {
double
m
=
HLL_REGISTERS
;
double
m
=
HLL_REGISTERS
;
double
E
;
double
E
;
int
j
;
int
j
;
static
double
alphaInf
=
0
.
5
/
log
(
2
.);
int
regHisto
[
HLL_Q
+
2
]
=
{
0
};
int
regHisto
[
HLL_Q
+
2
]
=
{
0
};
/* Compute register histogram */
/* Compute register histogram */
...
@@ -1036,7 +1036,7 @@ uint64_t hllCount(struct hllhdr *hdr, int *invalid) {
...
@@ -1036,7 +1036,7 @@ uint64_t hllCount(struct hllhdr *hdr, int *invalid) {
z
*=
0
.
5
;
z
*=
0
.
5
;
}
}
z
+=
m
*
hllSigma
(
regHisto
[
0
]
/
(
double
)
m
);
z
+=
m
*
hllSigma
(
regHisto
[
0
]
/
(
double
)
m
);
E
=
llroundl
(
alphaInf
*
m
*
m
/
z
);
E
=
llroundl
(
HLL_ALPHA_INF
*
m
*
m
/
z
);
return
(
uint64_t
)
E
;
return
(
uint64_t
)
E
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment