diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst index 85546e07..bfe8f907 100644 --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -780,7 +780,7 @@ v1.3.1 * Some parsing details, notably ``volatile`` is passed along like ``const`` and ``restrict``. Also, older versions of pycparser - mis-parse some pointer-to-pointer types like ``char * const *``: the + misparse some pointer-to-pointer types like ``char * const *``: the "const" ends up at the wrong place. Added a workaround. diff --git a/src/c/malloc_closure.h b/src/c/malloc_closure.h index f51a70c6..d39b9327 100644 --- a/src/c/malloc_closure.h +++ b/src/c/malloc_closure.h @@ -77,17 +77,17 @@ static Py_ssize_t allocate_num_pages = 0; /******************************************************************/ -union mmaped_block { +union mmapped_block { ffi_closure closure; - union mmaped_block *next; + union mmapped_block *next; }; -static union mmaped_block *free_list = 0; +static union mmapped_block *free_list = 0; static Py_ssize_t _pagesize = 0; static void more_core(void) { - union mmaped_block *item; + union mmapped_block *item; Py_ssize_t count, i; /* determine the pagesize */ @@ -113,13 +113,13 @@ static void more_core(void) allocate_num_pages = 1 + ( (Py_ssize_t)(allocate_num_pages * PAGE_ALLOCATION_GROWTH_RATE)); - /* calculate the number of mmaped_blocks to allocate */ - count = (allocate_num_pages * _pagesize) / sizeof(union mmaped_block); + /* calculate the number of mmapped_blocks to allocate */ + count = (allocate_num_pages * _pagesize) / sizeof(union mmapped_block); /* allocate a memory block */ #ifdef MS_WIN32 - item = (union mmaped_block *)VirtualAlloc(NULL, - count * sizeof(union mmaped_block), + item = (union mmapped_block *)VirtualAlloc(NULL, + count * sizeof(union mmapped_block), MEM_COMMIT, PAGE_EXECUTE_READWRITE); if (item == NULL) @@ -129,7 +129,7 @@ static void more_core(void) int prot = PROT_READ | PROT_WRITE | PROT_EXEC; if (is_emutramp_enabled ()) prot &= ~PROT_EXEC; - item = (union mmaped_block *)mmap(NULL, + item = (union mmapped_block *)mmap(NULL, allocate_num_pages * _pagesize, prot, MAP_PRIVATE | MAP_ANONYMOUS, @@ -141,7 +141,7 @@ static void more_core(void) #endif #ifdef MALLOC_CLOSURE_DEBUG - printf("block at %p allocated (%ld bytes), %ld mmaped_blocks\n", + printf("block at %p allocated (%ld bytes), %ld mmapped_blocks\n", item, (long)(allocate_num_pages * _pagesize), (long)count); #endif /* put them into the free list */ @@ -167,7 +167,7 @@ static PyMutex malloc_closure_lock; static void cffi_closure_free(ffi_closure *p) { MALLOC_CLOSURE_LOCK(); - union mmaped_block *item = (union mmaped_block *)p; + union mmapped_block *item = (union mmapped_block *)p; item->next = free_list; free_list = item; MALLOC_CLOSURE_UNLOCK(); @@ -176,7 +176,7 @@ static void cffi_closure_free(ffi_closure *p) /* return one item from the free list, allocating more if needed */ static ffi_closure *cffi_closure_alloc(void) { - union mmaped_block *item; + union mmapped_block *item; MALLOC_CLOSURE_LOCK(); if (!free_list) more_core(); diff --git a/src/c/test_c.py b/src/c/test_c.py index b2ae3a47..c8a88c9f 100644 --- a/src/c/test_c.py +++ b/src/c/test_c.py @@ -2602,7 +2602,7 @@ def test_cast_invalid(): s = p[0] pytest.raises(TypeError, cast, BStruct, s) -def test_bug_float_convertion(): +def test_bug_float_conversion(): BDouble = new_primitive_type("double") BDoubleP = new_pointer_type(BDouble) pytest.raises(TypeError, newp, BDoubleP, "foobar") diff --git a/testing/cffi0/test_version.py b/testing/cffi0/test_version.py index ad952342..b1e1293c 100644 --- a/testing/cffi0/test_version.py +++ b/testing/cffi0/test_version.py @@ -62,5 +62,5 @@ def test_embedding_h(): loc = content.find('cffi version: ') assert loc > 0, "Cannot find cffi version string in _embedding.h" context = content[loc-100:loc+100] - msg = f"CFFI verison is incorrect, context for current version string is:\n{context}" + msg = f"CFFI version is incorrect, context for current version string is:\n{context}" assert (f'cffi version: {v}"') in context, msg diff --git a/testing/cffi1/test_re_python.py b/testing/cffi1/test_re_python.py index fbca325e..5f1f85ab 100644 --- a/testing/cffi1/test_re_python.py +++ b/testing/cffi1/test_re_python.py @@ -318,7 +318,7 @@ def test_rec_structs_1(): # from _rec_structs_1 import ffi # the following line used to raise TypeError - # unless preceeded by 'ffi.sizeof("struct C")'. + # unless preceded by 'ffi.sizeof("struct C")'. sz = ffi.sizeof("struct B") assert sz == ffi.sizeof("int *")