Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
a9fa67cb
Unverified
Commit
a9fa67cb
authored
Jan 03, 2018
by
Gennadiy Civil
Committed by
GitHub
Jan 03, 2018
Browse files
Merge branch 'master' into fix-issue-776-support-autoconf-as-submodule
parents
ec2b0c39
1414d71a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
googletest/include/gtest/gtest.h
googletest/include/gtest/gtest.h
+4
-0
googletest/samples/prime_tables.h
googletest/samples/prime_tables.h
+6
-2
No files found.
googletest/include/gtest/gtest.h
View file @
a9fa67cb
...
...
@@ -259,7 +259,9 @@ class GTEST_API_ AssertionResult {
// Used in EXPECT_TRUE/FALSE(assertion_result).
AssertionResult
(
const
AssertionResult
&
other
);
#if defined(_MSC_VER) && _MSC_VER < 1910
GTEST_DISABLE_MSC_WARNINGS_PUSH_
(
4800
/* forcing value to bool */
)
#endif
// Used in the EXPECT_TRUE/FALSE(bool_expression).
//
...
...
@@ -276,7 +278,9 @@ class GTEST_API_ AssertionResult {
/*enabler*/
=
NULL
)
:
success_
(
success
)
{}
#if defined(_MSC_VER) && _MSC_VER < 1910
GTEST_DISABLE_MSC_WARNINGS_POP_
()
#endif
// Assignment operator.
AssertionResult
&
operator
=
(
AssertionResult
other
)
{
...
...
googletest/samples/prime_tables.h
View file @
a9fa67cb
...
...
@@ -103,11 +103,15 @@ class PreCalculatedPrimeTable : public PrimeTable {
::
std
::
fill
(
is_prime_
,
is_prime_
+
is_prime_size_
,
true
);
is_prime_
[
0
]
=
is_prime_
[
1
]
=
false
;
for
(
int
i
=
2
;
i
<=
max
;
i
++
)
{
// Checks every candidate for prime number (we know that 2 is the only even
// prime).
for
(
int
i
=
2
;
i
*
i
<=
max
;
i
+=
i
%
2
+
1
)
{
if
(
!
is_prime_
[
i
])
continue
;
// Marks all multiples of i (except i itself) as non-prime.
for
(
int
j
=
2
*
i
;
j
<=
max
;
j
+=
i
)
{
// We are starting here from i-th multiplier, because all smaller
// complex numbers were already marked.
for
(
int
j
=
i
*
i
;
j
<=
max
;
j
+=
i
)
{
is_prime_
[
j
]
=
false
;
}
}
...
...
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