Skip to content

Commit 37b2383

Browse files
committed
Style cleanup of javadoc-style comments
This changes javadoc-style documenting comments from: /** Text starts here * and continues here */ to: /** * Test starts here * and continues here */ which looks a little better, and also matches the javadoc-recommended way of writing documenting comments.
1 parent b8ac438 commit 37b2383

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

include/pybind11/attr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ struct process_attribute<arithmetic> : process_attribute_default<arithmetic> {};
415415
template <typename... Ts>
416416
struct process_attribute<call_guard<Ts...>> : process_attribute_default<call_guard<Ts...>> { };
417417

418-
/***
418+
/**
419419
* Process a keep_alive call policy -- invokes keep_alive_impl during the
420420
* pre-call handler if both Nurse, Patient != 0 and use the post-call handler
421421
* otherwise

include/pybind11/cast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct type_info {
3434
std::vector<bool (*)(PyObject *, void *&)> *direct_conversions;
3535
buffer_info *(*get_buffer)(PyObject *, void *) = nullptr;
3636
void *get_buffer_data = nullptr;
37-
/** A simple type never occurs as a (direct or indirect) parent
37+
/* A simple type never occurs as a (direct or indirect) parent
3838
* of a class that makes use of multiple inheritance */
3939
bool simple_type : 1;
4040
/* True if there is no multiple inheritance in this type's inheritance tree */

include/pybind11/class_support.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ extern "C" inline int pybind11_meta_setattro(PyObject* obj, PyObject* name, PyOb
150150
}
151151

152152
#if PY_MAJOR_VERSION >= 3
153-
/** Python 3's PyInstanceMethod_Type hides itself via its tp_descr_get, which prevents aliasing
153+
/**
154+
* Python 3's PyInstanceMethod_Type hides itself via its tp_descr_get, which prevents aliasing
154155
* methods via cls.attr("m2") = cls.attr("m1"): instead the tp_descr_get returns a plain function,
155156
* when called on a class, or a PyMethod, when called on an instance. Override that behaviour here
156157
* to do a special case bypass for PyInstanceMethod_Types.

include/pybind11/numpy.h

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,8 @@ ssize_t byte_offset_unsafe(const Strides &strides, ssize_t i, Ix... index) {
304304
return i * strides[Dim] + byte_offset_unsafe<Dim + 1>(strides, index...);
305305
}
306306

307-
/** Proxy class providing unsafe, unchecked const access to array data. This is constructed through
307+
/**
308+
* Proxy class providing unsafe, unchecked const access to array data. This is constructed through
308309
* the `unchecked<T, N>()` method of `array` or the `unchecked<N>()` method of `array_t<T>`. `Dims`
309310
* will be -1 for dimensions determined at runtime.
310311
*/
@@ -335,7 +336,8 @@ class unchecked_reference {
335336
: data_{reinterpret_cast<const unsigned char *>(data)}, shape_{shape}, strides_{strides}, dims_{dims} {}
336337

337338
public:
338-
/** Unchecked const reference access to data at the given indices. For a compile-time known
339+
/**
340+
* Unchecked const reference access to data at the given indices. For a compile-time known
339341
* number of dimensions, this requires the correct number of arguments; for run-time
340342
* dimensionality, this is not checked (and so is up to the caller to use safely).
341343
*/
@@ -344,7 +346,8 @@ class unchecked_reference {
344346
"Invalid number of indices for unchecked array reference");
345347
return *reinterpret_cast<const T *>(data_ + byte_offset_unsafe(strides_, ssize_t(index)...));
346348
}
347-
/** Unchecked const reference access to data; this operator only participates if the reference
349+
/**
350+
* Unchecked const reference access to data; this operator only participates if the reference
348351
* is to a 1-dimensional array. When present, this is exactly equivalent to `obj(index)`.
349352
*/
350353
template <ssize_t D = Dims, typename = enable_if_t<D == 1 || Dynamic>>
@@ -392,7 +395,8 @@ class unchecked_mutable_reference : public unchecked_reference<T, Dims> {
392395
"Invalid number of indices for unchecked array reference");
393396
return const_cast<T &>(ConstBase::operator()(index...));
394397
}
395-
/** Mutable, unchecked access data at the given index; this operator only participates if the
398+
/**
399+
* Mutable, unchecked access data at the given index; this operator only participates if the
396400
* reference is to a 1-dimensional array (or has runtime dimensions). When present, this is
397401
* exactly equivalent to `obj(index)`.
398402
*/
@@ -679,7 +683,8 @@ class array : public buffer {
679683
return offset_at(index...) / itemsize();
680684
}
681685

682-
/** Returns a proxy object that provides access to the array's data without bounds or
686+
/**
687+
* Returns a proxy object that provides access to the array's data without bounds or
683688
* dimensionality checking. Will throw if the array is missing the `writeable` flag. Use with
684689
* care: the array must not be destroyed or reshaped for the duration of the returned object,
685690
* and the caller must take care not to access invalid dimensions or dimension indices.
@@ -691,7 +696,8 @@ class array : public buffer {
691696
return detail::unchecked_mutable_reference<T, Dims>(mutable_data(), shape(), strides(), ndim());
692697
}
693698

694-
/** Returns a proxy object that provides const access to the array's data without bounds or
699+
/**
700+
* Returns a proxy object that provides const access to the array's data without bounds or
695701
* dimensionality checking. Unlike `mutable_unchecked()`, this does not require that the
696702
* underlying array have the `writable` flag. Use with care: the array must not be destroyed or
697703
* reshaped for the duration of the returned object, and the caller must take care not to access
@@ -851,7 +857,8 @@ template <typename T, int ExtraFlags = array::forcecast> class array_t : public
851857
return *(static_cast<T*>(array::mutable_data()) + byte_offset(ssize_t(index)...) / itemsize());
852858
}
853859

854-
/** Returns a proxy object that provides access to the array's data without bounds or
860+
/**
861+
* Returns a proxy object that provides access to the array's data without bounds or
855862
* dimensionality checking. Will throw if the array is missing the `writeable` flag. Use with
856863
* care: the array must not be destroyed or reshaped for the duration of the returned object,
857864
* and the caller must take care not to access invalid dimensions or dimension indices.
@@ -860,7 +867,8 @@ template <typename T, int ExtraFlags = array::forcecast> class array_t : public
860867
return array::mutable_unchecked<T, Dims>();
861868
}
862869

863-
/** Returns a proxy object that provides const access to the array's data without bounds or
870+
/**
871+
* Returns a proxy object that provides const access to the array's data without bounds or
864872
* dimensionality checking. Unlike `unchecked()`, this does not require that the underlying
865873
* array have the `writable` flag. Use with care: the array must not be destroyed or reshaped
866874
* for the duration of the returned object, and the caller must take care not to access invalid

include/pybind11/pybind11.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,8 @@ void register_exception_translator(ExceptionTranslator&& translator) {
14301430
std::forward<ExceptionTranslator>(translator));
14311431
}
14321432

1433-
/* Wrapper to generate a new Python exception type.
1433+
/**
1434+
* Wrapper to generate a new Python exception type.
14341435
*
14351436
* This should only be used with PyErr_SetString for now.
14361437
* It is not (yet) possible to use as a py::base.
@@ -1455,7 +1456,8 @@ class exception : public object {
14551456
}
14561457
};
14571458

1458-
/** Registers a Python exception in `m` of the given `name` and installs an exception translator to
1459+
/**
1460+
* Registers a Python exception in `m` of the given `name` and installs an exception translator to
14591461
* translate the C++ exception to the created Python exception using the exceptions what() method.
14601462
* This is intended for simple exception translations; for more complex translation, register the
14611463
* exception object and translator directly.

0 commit comments

Comments
 (0)