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
gaoqiong
pybind11
Commits
e9bb843e
Commit
e9bb843e
authored
Aug 22, 2017
by
Jason Rhinelander
Browse files
Fix clang5 warnings
parent
b9751038
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
include/pybind11/numpy.h
include/pybind11/numpy.h
+2
-2
tests/test_factory_constructors.cpp
tests/test_factory_constructors.cpp
+1
-1
No files found.
include/pybind11/numpy.h
View file @
e9bb843e
...
@@ -342,7 +342,7 @@ public:
...
@@ -342,7 +342,7 @@ public:
* dimensionality, this is not checked (and so is up to the caller to use safely).
* dimensionality, this is not checked (and so is up to the caller to use safely).
*/
*/
template
<
typename
...
Ix
>
const
T
&
operator
()(
Ix
...
index
)
const
{
template
<
typename
...
Ix
>
const
T
&
operator
()(
Ix
...
index
)
const
{
static_assert
(
sizeof
...(
Ix
)
==
Dims
||
Dynamic
,
static_assert
(
ssize_t
{
sizeof
...(
Ix
)
}
==
Dims
||
Dynamic
,
"Invalid number of indices for unchecked array reference"
);
"Invalid number of indices for unchecked array reference"
);
return
*
reinterpret_cast
<
const
T
*>
(
data_
+
byte_offset_unsafe
(
strides_
,
ssize_t
(
index
)...));
return
*
reinterpret_cast
<
const
T
*>
(
data_
+
byte_offset_unsafe
(
strides_
,
ssize_t
(
index
)...));
}
}
...
@@ -391,7 +391,7 @@ class unchecked_mutable_reference : public unchecked_reference<T, Dims> {
...
@@ -391,7 +391,7 @@ class unchecked_mutable_reference : public unchecked_reference<T, Dims> {
public:
public:
/// Mutable, unchecked access to data at the given indices.
/// Mutable, unchecked access to data at the given indices.
template
<
typename
...
Ix
>
T
&
operator
()(
Ix
...
index
)
{
template
<
typename
...
Ix
>
T
&
operator
()(
Ix
...
index
)
{
static_assert
(
sizeof
...(
Ix
)
==
Dims
||
Dynamic
,
static_assert
(
ssize_t
{
sizeof
...(
Ix
)
}
==
Dims
||
Dynamic
,
"Invalid number of indices for unchecked array reference"
);
"Invalid number of indices for unchecked array reference"
);
return
const_cast
<
T
&>
(
ConstBase
::
operator
()(
index
...));
return
const_cast
<
T
&>
(
ConstBase
::
operator
()(
index
...));
}
}
...
...
tests/test_factory_constructors.cpp
View file @
e9bb843e
...
@@ -177,7 +177,7 @@ TEST_SUBMODULE(factory_constructors, m) {
...
@@ -177,7 +177,7 @@ TEST_SUBMODULE(factory_constructors, m) {
// Stateful & reused:
// Stateful & reused:
int
c
=
1
;
int
c
=
1
;
auto
c4a
=
[
c
](
pointer_tag
,
TF4_tag
,
int
a
)
{
return
new
TestFactory4
(
a
);};
auto
c4a
=
[
c
](
pointer_tag
,
TF4_tag
,
int
a
)
{
(
void
)
c
;
return
new
TestFactory4
(
a
);};
// test_init_factory_basic, test_init_factory_casting
// test_init_factory_basic, test_init_factory_casting
py
::
class_
<
TestFactory3
,
std
::
shared_ptr
<
TestFactory3
>>
(
m
,
"TestFactory3"
)
py
::
class_
<
TestFactory3
,
std
::
shared_ptr
<
TestFactory3
>>
(
m
,
"TestFactory3"
)
...
...
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