Skip to content

Commit b7d6a54

Browse files
[libc++] Fix typos in documentation (#139853)
1 parent 3667f29 commit b7d6a54

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

libcxx/docs/CodingGuidelines.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ Write SFINAE with ``requires`` clauses in C++20-only code
124124
subsume other concepts. This means that overloads based on traits can be written without negating more general cases.
125125
They also show intent better.
126126

127-
Write ``enable_if`` as ``enable_if_t<conditon, int> = 0``
128-
=========================================================
127+
Write ``enable_if`` as ``enable_if_t<condition, int> = 0``
128+
==========================================================
129129

130130
The form ``enable_if_t<condition, int> = 0`` is the only one that works in every language mode and for overload sets
131131
using the same template arguments otherwise. If the code must work in C++11 or C++03, the libc++-internal alias

libcxx/docs/DesignDocs/FileTimeType.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ which is defined as follows:
3333
};
3434
3535
To represent the range and resolution of ``timespec``, we need to (A) have
36-
nanosecond resolution, and (B) use more than 64 bits (assuming a 64 bit ``time_t``).
36+
nanosecond resolution, and (B) use more than 64 bits (assuming a 64-bit ``time_t``).
3737

3838
As the standard requires us to use the ``chrono`` interface, we have to define
3939
our own filesystem clock which specifies the period and representation of
@@ -207,7 +207,7 @@ code in some way:
207207
208208
// Overflow during creation bug.
209209
file_time_type timespec_to_file_time_type(struct timespec ts) {
210-
// woops! chrono::seconds and chrono::nanoseconds use a 64 bit representation
210+
// woops! chrono::seconds and chrono::nanoseconds use a 64-bit representation
211211
// this may overflow before it's converted to a file_time_type.
212212
auto dur = seconds(ts.tv_sec) + nanoseconds(ts.tv_nsec);
213213
return file_time_type(dur);
@@ -272,7 +272,7 @@ look like.
272272
273273
The first thing to notice is that we can't construct ``fs_timespec_rep`` like
274274
a ``timespec`` by passing ``{secs, nsecs}``. Instead we're limited to
275-
constructing it from a single 64 bit integer.
275+
constructing it from a single 64-bit integer.
276276

277277
We also can't allow the user to inspect the ``tv_sec`` or ``tv_nsec`` values
278278
directly. A ``chrono::duration`` represents its value as a tick period and a
@@ -350,12 +350,12 @@ Though the above example may appear silly, I think it follows from the incorrect
350350
notion that using a ``timespec`` rep in chrono actually makes it act as if it
351351
were an actual ``timespec``.
352352

353-
Interactions with 32 bit ``time_t``
353+
Interactions with 32-bit ``time_t``
354354
-----------------------------------
355355

356356
Up until now we've only be considering cases where ``time_t`` is 64 bits, but what
357-
about 32 bit systems/builds where ``time_t`` is 32 bits? (this is the common case
358-
for 32 bit builds).
357+
about 32-bit systems/builds where ``time_t`` is 32 bits? (this is the common case
358+
for 32-bit builds).
359359

360360
When ``time_t`` is 32 bits, we can implement ``file_time_type`` simply using 64-bit
361361
``long long``. There is no need to get either ``__int128_t`` or ``timespec`` emulation
@@ -431,11 +431,11 @@ Pros:
431431
432432
Cons:
433433

434-
* It isn't always available (but on 64 bit machines, it normally is).
434+
* It isn't always available (but on 64-bit machines, it normally is).
435435
* It causes ``file_time_type`` to have a larger range than ``timespec``.
436436
* It doesn't always act the same as other builtin integer types. For example
437437
with ``cout`` or ``to_string``.
438-
* Allows implicit truncation to 64 bit integers.
438+
* Allows implicit truncation to 64-bit integers.
439439
* It can be implicitly converted to a builtin integer type by the user,
440440
truncating its value.
441441

libcxx/docs/TestingLibcxx.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ tests using exceptions. The code to write a test manually would be:
291291

292292
.. code-block:: cpp
293293
294-
void test_excption([[maybe_unused]] int arg) {
294+
void test_exception([[maybe_unused]] int arg) {
295295
#ifndef TEST_HAS_NO_EXCEPTIONS // do nothing when tests are disabled
296296
try {
297297
foo(arg);
@@ -308,7 +308,7 @@ The same test using a macro:
308308

309309
.. code-block:: cpp
310310
311-
void test_excption([[maybe_unused]] int arg) {
311+
void test_exception([[maybe_unused]] int arg) {
312312
TEST_VALIDATE_EXCEPTION(bar,
313313
[](const bar& e) {
314314
LIBCPP_ASSERT(e.what() == what);

0 commit comments

Comments
 (0)