Skip to content

Commit 4f0df66

Browse files
Fix typos
1 parent e51b219 commit 4f0df66

5 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎doc/source/whatsnew.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ v1.3.1
780780

781781
* Some parsing details, notably ``volatile`` is passed along like
782782
``const`` and ``restrict``. Also, older versions of pycparser
783-
mis-parse some pointer-to-pointer types like ``char * const *``: the
783+
misparse some pointer-to-pointer types like ``char * const *``: the
784784
"const" ends up at the wrong place. Added a workaround.
785785

786786

‎src/c/malloc_closure.h‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ static Py_ssize_t allocate_num_pages = 0;
7777

7878
/******************************************************************/
7979

80-
union mmaped_block {
80+
union mmapped_block {
8181
ffi_closure closure;
82-
union mmaped_block *next;
82+
union mmapped_block *next;
8383
};
8484

85-
static union mmaped_block *free_list = 0;
85+
static union mmapped_block *free_list = 0;
8686
static Py_ssize_t _pagesize = 0;
8787

8888
static void more_core(void)
8989
{
90-
union mmaped_block *item;
90+
union mmapped_block *item;
9191
Py_ssize_t count, i;
9292

9393
/* determine the pagesize */
@@ -113,13 +113,13 @@ static void more_core(void)
113113
allocate_num_pages = 1 + (
114114
(Py_ssize_t)(allocate_num_pages * PAGE_ALLOCATION_GROWTH_RATE));
115115

116-
/* calculate the number of mmaped_blocks to allocate */
117-
count = (allocate_num_pages * _pagesize) / sizeof(union mmaped_block);
116+
/* calculate the number of mmapped_blocks to allocate */
117+
count = (allocate_num_pages * _pagesize) / sizeof(union mmapped_block);
118118

119119
/* allocate a memory block */
120120
#ifdef MS_WIN32
121-
item = (union mmaped_block *)VirtualAlloc(NULL,
122-
count * sizeof(union mmaped_block),
121+
item = (union mmapped_block *)VirtualAlloc(NULL,
122+
count * sizeof(union mmapped_block),
123123
MEM_COMMIT,
124124
PAGE_EXECUTE_READWRITE);
125125
if (item == NULL)
@@ -129,7 +129,7 @@ static void more_core(void)
129129
int prot = PROT_READ | PROT_WRITE | PROT_EXEC;
130130
if (is_emutramp_enabled ())
131131
prot &= ~PROT_EXEC;
132-
item = (union mmaped_block *)mmap(NULL,
132+
item = (union mmapped_block *)mmap(NULL,
133133
allocate_num_pages * _pagesize,
134134
prot,
135135
MAP_PRIVATE | MAP_ANONYMOUS,
@@ -141,7 +141,7 @@ static void more_core(void)
141141
#endif
142142

143143
#ifdef MALLOC_CLOSURE_DEBUG
144-
printf("block at %p allocated (%ld bytes), %ld mmaped_blocks\n",
144+
printf("block at %p allocated (%ld bytes), %ld mmapped_blocks\n",
145145
item, (long)(allocate_num_pages * _pagesize), (long)count);
146146
#endif
147147
/* put them into the free list */
@@ -167,7 +167,7 @@ static PyMutex malloc_closure_lock;
167167
static void cffi_closure_free(ffi_closure *p)
168168
{
169169
MALLOC_CLOSURE_LOCK();
170-
union mmaped_block *item = (union mmaped_block *)p;
170+
union mmapped_block *item = (union mmapped_block *)p;
171171
item->next = free_list;
172172
free_list = item;
173173
MALLOC_CLOSURE_UNLOCK();
@@ -176,7 +176,7 @@ static void cffi_closure_free(ffi_closure *p)
176176
/* return one item from the free list, allocating more if needed */
177177
static ffi_closure *cffi_closure_alloc(void)
178178
{
179-
union mmaped_block *item;
179+
union mmapped_block *item;
180180
MALLOC_CLOSURE_LOCK();
181181
if (!free_list)
182182
more_core();

‎src/c/test_c.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2602,7 +2602,7 @@ def test_cast_invalid():
26022602
s = p[0]
26032603
pytest.raises(TypeError, cast, BStruct, s)
26042604

2605-
def test_bug_float_convertion():
2605+
def test_bug_float_conversion():
26062606
BDouble = new_primitive_type("double")
26072607
BDoubleP = new_pointer_type(BDouble)
26082608
pytest.raises(TypeError, newp, BDoubleP, "foobar")

‎testing/cffi0/test_version.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ def test_embedding_h():
6262
loc = content.find('cffi version: ')
6363
assert loc > 0, "Cannot find cffi version string in _embedding.h"
6464
context = content[loc-100:loc+100]
65-
msg = f"CFFI verison is incorrect, context for current version string is:\n{context}"
65+
msg = f"CFFI version is incorrect, context for current version string is:\n{context}"
6666
assert (f'cffi version: {v}"') in context, msg

‎testing/cffi1/test_re_python.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def test_rec_structs_1():
318318
#
319319
from _rec_structs_1 import ffi
320320
# the following line used to raise TypeError
321-
# unless preceeded by 'ffi.sizeof("struct C")'.
321+
# unless preceded by 'ffi.sizeof("struct C")'.
322322
sz = ffi.sizeof("struct B")
323323
assert sz == ffi.sizeof("int *")
324324

0 commit comments

Comments
 (0)