Skip to content

Commit 2079ca7

Browse files
Fix documentation grammar, typos, and clarity issues (#228)
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent 070c68a commit 2079ca7

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Contact
2929
Testing/development tips
3030
------------------------
3131

32-
After `git clone` or `wget && tar`, we will get a directory called `cffi` or `cffi-x.x.x`. we call it `repo-directory`. To run tests under CPython, run the following in the `repo-directory`:
32+
After `git clone` or `wget && tar`, we will get a directory called `cffi` or `cffi-x.x.x`. We call it `repo-directory`. To run tests under CPython, run the following in the `repo-directory`:
3333

3434
pip install pytest
3535
pip install -e . # editable install of CFFI for local development

doc/source/cdef.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ least ``libraries=['foo']`` in order to link with ``libfoo.so`` or
437437
``libfoo.so.X.Y``, or ``foo.dll`` on Windows. The ``sources`` is a
438438
list of extra .c files compiled and linked together (the file
439439
``module_name.c`` shown above is always generated and automatically added as the
440-
first argument to ``sources``). See the distutils documentations for
440+
first argument to ``sources``). See the distutils documentation for
441441
`more information about the other arguments`__.
442442

443443
.. __: https://setuptools.pypa.io/en/stable/userguide/ext_modules.html#building-extension-modules
@@ -482,7 +482,7 @@ Letting the C compiler fill the gaps
482482

483483
If you are using a C compiler ("API mode"), then:
484484

485-
* functions taking or returning integer or float-point arguments can be
485+
* functions taking or returning integer or floating-point arguments can be
486486
misdeclared: if e.g. a function is declared by ``cdef()`` as taking a
487487
``int``, but actually takes a ``long``, then the C compiler handles the
488488
difference.

doc/source/installation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Quick installation for CPython (cffi is distributed with PyPy):
1010

1111
.. __: http://pypi.python.org/pypi/cffi
1212

13-
In more details:
13+
In more detail:
1414

1515
This code has been developed on Linux, but should work on any POSIX
1616
platform as well as on Windows 32 and 64. (It relies occasionally on
@@ -53,8 +53,8 @@ Download and Installation:
5353
* Or grab the most current version from `GitHub`_:
5454
``git clone https://github.com/python-cffi/cffi``
5555

56-
* running the tests: ``pytest c/ testing/`` (if you didn't
57-
install cffi yet, you need first ``python setup_base.py build_ext -f
56+
* running the tests: ``pytest c/ testing/`` (if you didn't
57+
install cffi yet, you need to first run ``python setup_base.py build_ext -f
5858
-i``)
5959

6060
.. _`GitHub`: https://github.com/python-cffi/cffi
@@ -79,8 +79,8 @@ Platform-specific instructions
7979
``libffi`` is notoriously messy to install and use --- to the point that
8080
CPython includes its own copy to avoid relying on external packages.
8181
CFFI does the same for Windows, but not for other platforms (which should
82-
have their own working libffi's).
83-
Modern Linuxes work out of the box thanks to ``pkg-config``. Here are some
82+
have their own working libffi).
83+
Modern Linux distributions work out of the box thanks to ``pkg-config``. Here are some
8484
(user-supplied) instructions for other platforms.
8585

8686

doc/source/overview.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ with the files ``pi.c`` and ``pi.h``:
308308
# include <math.h>
309309
310310
/* Returns a very crude approximation of Pi
311-
given a int: a number of iteration */
311+
given an int: a number of iterations */
312312
float pi_approx(int n){
313313
314314
double i,x,y,sum=0;
@@ -430,7 +430,7 @@ mode and the in-line ABI mode. It lets you use the ABI mode, with its
430430
advantages (not requiring a C compiler) and problems (crashes more
431431
easily).
432432

433-
This mixture mode lets you massively reduces the import times, because
433+
This mixture mode lets you massively reduce the import times, because
434434
it is slow to parse a large C header. It also allows you to do more
435435
detailed checkings during build-time without worrying about performance
436436
(e.g. calling :ref:`cdef() <cdef>` many times with small pieces of declarations,
@@ -644,7 +644,7 @@ use of a C global variable:
644644
if __name__ == "__main__":
645645
ffibuilder.compile(verbose=True)
646646
647-
The way that the ``increment`` uses the ``value`` global variable is not
647+
The way that ``increment`` uses the ``value`` global variable is not
648648
thread-safe. `Data races
649649
<https://en.wikipedia.org/wiki/Race_condition#Data_race>`_ are possible if two
650650
threads simultaneously call ``increment``. We can engineer that situation with a

doc/source/using.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ pointers, with each of them only valid during the corresponding call. This is
391391
important notably for PyPy which uses many optimizations tweaking the data
392392
underlying a byte string object. CFFI will not make and free a copy of
393393
the whole string at *every* call---it usually won't---but you *cannot*
394-
write code that relies on it: there are cases were that would break.
394+
write code that relies on it: there are cases where that would break.
395395
If you need a pointer to remain valid, you need to make one explicitly,
396396
for example with ``ptr = ffi.new("char[]", x)``.)
397397

@@ -532,7 +532,7 @@ but it makes the next GC occur earlier, which is often enough.
532532

533533
The same applies if the memory allocations are indirect, e.g. the C
534534
function allocates some internal data structures. In that case, call
535-
``__pypy__.add_memory_pressure(n)`` with an argument ``n`` that is an
535+
``__pypy__.add_memory_pressure(n)`` with an argument ``n`` that is a
536536
rough estimation. Knowing the exact size is not important, and memory
537537
pressure doesn't have to be manually brought down again after calling
538538
the freeing function. If you are writing wrappers for the allocating /

doc/source/whatsnew.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ v1.17.1
1919
=======
2020

2121
* Fix failing ``distutils.msvc9compiler`` imports under Windows (`#118`_).
22-
* ``ffibuilder.emit_python_code()`` and ``ffibuiler.emit_c_code()`` accept file-like objects (`#115`_).
22+
* ``ffibuilder.emit_python_code()`` and ``ffibuilder.emit_c_code()`` accept file-like objects (`#115`_).
2323
* ``ffiplatform`` calls are bypassed by ``ffibuilder.emit_python_code()`` and ``ffibuilder.emit_c_code()`` (`#81`_).
2424

2525
.. _`#118`: https://github.com/python-cffi/cffi/pull/118

0 commit comments

Comments
 (0)