Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typos #2847

Merged
merged 3 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reST/c_api/color.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Header file: src_c/include/pygame.h

.. c:function:: PyObject* pgColor_New(Uint8 rgba[])

Return a new :py:class:`pygame.Color` instance for the the four element array *rgba*.
Return a new :py:class:`pygame.Color` instance from the four element array *rgba*.
On failure, raise a Python exception and return ``NULL``.

.. c:function:: PyObject* pgColor_NewLength(Uint8 rgba[], Uint8 length)
Expand Down
6 changes: 3 additions & 3 deletions docs/reST/ref/font.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ solves no longer exists, it will likely be removed in the future.
| :sg:`point_size -> int`

Returns the point size of the font. Will not be accurate upon initializing
the font object when the font name is initalized as ``None``.
the font object when the font name is initialized as ``None``.

.. versionadded:: 2.3.1

Expand Down Expand Up @@ -527,7 +527,7 @@ solves no longer exists, it will likely be removed in the future.
| :sg:`set_point_size(size, /) -> int`

Sets the point size of the font, which is the value that was used to
initalize this font.
initialize this font.

.. versionadded:: 2.3.1

Expand All @@ -539,7 +539,7 @@ solves no longer exists, it will likely be removed in the future.
| :sg:`get_point_size() -> int`

Returns the point size of the font. Will not be accurate upon
initializing the font object when the font name is initalized
initializing the font object when the font name is initialized
as ``None``.

.. versionadded:: 2.3.1
Expand Down
4 changes: 2 additions & 2 deletions docs/reST/ref/pixelarray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if pxarray[0, 0] == surface.map_rgb((0, 0, 255)):
...

When assigning to a range of of pixels, a non tuple sequence of colors or
When assigning to a range of pixels, a non tuple sequence of colors or
a PixelArray can be used as the value. For a sequence, the length must
match the PixelArray width.

Expand Down Expand Up @@ -79,7 +79,7 @@
pxarray[::2] = (0, 0, 0) # Same as [::2, :]

During its lifetime, the PixelArray locks the surface, thus you explicitly
have to close() it once its not used any more and the surface should perform
have to close() it once it's not used any more and the surface should perform
operations in the same scope. It is best to use it as a context manager
using the with PixelArray(surf) as pixel_array: style. So it works on pypy too.

Expand Down
8 changes: 4 additions & 4 deletions docs/reST/ref/sdl2_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ events related to controllers.

.. versionchangedold:: 2.0.2: Return type changed from ``str`` to ``dict``

.. ## Contorller.get_mapping ##
.. ## Controller.get_mapping ##

.. method:: set_mapping

Expand Down Expand Up @@ -252,7 +252,7 @@ events related to controllers.
.. versionchangedold:: 2.0.2: Renamed from ``add_mapping`` to ``set_mapping``
.. versionchangedold:: 2.0.2: Argument type changed from ``str`` to ``dict``

.. ## Contorller.set_mapping ##
.. ## Controller.set_mapping ##

.. method:: rumble

Expand All @@ -270,7 +270,7 @@ events related to controllers.

.. versionaddedold:: 2.0.2

.. ## Contorller.rumble ##
.. ## Controller.rumble ##

.. method:: stop_rumble

Expand All @@ -282,6 +282,6 @@ events related to controllers.

.. versionaddedold:: 2.0.2

.. ## Contorller.stop_rumble ##
.. ## Controller.stop_rumble ##

.. ## pygame._sdl2.controller ##
8 changes: 4 additions & 4 deletions docs/reST/ref/sprite.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Sprites are not thread safe. So lock them yourself if using threads.
Add any number of Sprites to this Group. This will only add Sprites that
are not already members of the Group.

Each sprite argument can also be a iterator containing Sprites.
Each sprite argument can also be an iterator containing Sprites.

.. ## Group.add ##

Expand All @@ -256,7 +256,7 @@ Sprites are not thread safe. So lock them yourself if using threads.
Remove any number of Sprites from the Group. This will only remove
Sprites that are already members of the Group.

Each sprite argument can also be a iterator containing Sprites.
Each sprite argument can also be an iterator containing Sprites.

.. ## Group.remove ##

Expand All @@ -269,7 +269,7 @@ Sprites are not thread safe. So lock them yourself if using threads.
similar to using the "in" operator on the Group ("if sprite in group:
..."), which tests if a single Sprite belongs to a Group.

Each sprite argument can also be a iterator containing Sprites.
Each sprite argument can also be an iterator containing Sprites.

.. ## Group.has ##

Expand Down Expand Up @@ -395,7 +395,7 @@ Sprites are not thread safe. So lock them yourself if using threads.

.. method:: sprites

| :sl:`returns a ordered list of sprites (first back, last top).`
| :sl:`returns an ordered list of sprites (first back, last top).`
| :sg:`sprites() -> sprites`

.. ## LayeredUpdates.sprites ##
Expand Down
2 changes: 1 addition & 1 deletion docs/reST/ref/transform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Instead, always begin with the original image and scale to the desired size.)
| :sl:`return smoothscale filter version in use: 'GENERIC', 'MMX', 'SSE', 'SSE2', or 'NEON'`
| :sg:`get_smoothscale_backend() -> string`

Shows whether or not smoothscale is using SIMD accleration.
Shows whether or not smoothscale is using SIMD acceleration.
If no acceleration is available then "GENERIC" is returned. The level of
acceleration possible is automatically determined at runtime.

Expand Down
2 changes: 1 addition & 1 deletion examples/aliens.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def load_image(file):


def load_sound(file):
"""because pygame can be be compiled without mixer."""
"""because pygame can be compiled without mixer."""
if not pygame.mixer:
return None
file = os.path.join(main_dir, "data", file)
Expand Down
2 changes: 1 addition & 1 deletion examples/multiplayer_joystick.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def create_surf(size, color):
# disconnect controller
if event.instance_id in active_players:
disconnect_joystick(event.instance_id)
# check if there is at leat one controller connected
# check if there is at least one controller connected
are_no_controllers_connected = True
for player in players:
if player:
Expand Down
2 changes: 1 addition & 1 deletion examples/testsprite.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
It is an abomination of ugly code, and mostly used for testing.


See pygame.examples.aliens for some prettyier code.
See pygame.examples.aliens for some prettier code.
"""

import sys
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def consume_arg(name):

compile_cython = not no_compilation

# does nothing now, but consume the arg anyways for compatibilty
# does nothing now, but consume the arg anyways for compatibility
consume_arg('cython')

cython_only = False
Expand Down
14 changes: 7 additions & 7 deletions src_c/SDL_gfx/SDL_gfxPrimitives.c
Original file line number Diff line number Diff line change
Expand Up @@ -2006,7 +2006,7 @@ int roundedBoxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2,
/*!
\brief Internal clip-encoding routine.

Calculates a segement-based clipping encoding for a point against a rectangle.
Calculates a segment-based clipping encoding for a point against a rectangle.

\param x X coordinate of point.
\param y Y coordinate of point.
Expand Down Expand Up @@ -4196,7 +4196,7 @@ ellipseRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry,

/* ----- AA Ellipse */

/* Visual Studio 2015 and above define the lrint intristic function, but for
/* Visual Studio 2015 and above define the lrint intrinsic function, but for
* compatibility with older windows compilers, we need to define it ourselves
*/
#if defined(_MSC_VER)
Expand Down Expand Up @@ -5818,11 +5818,11 @@ When set to NULL, uses global static temp array.
\param vy array of x vector components
\param n the amount of vectors in the vx and vy array
\param texture the sdl surface to use to fill the polygon
\param texture_dx the offset of the texture relative to the screeen. if you
\param texture_dx the offset of the texture relative to the screen. if you
move the polygon 10 pixels to the left and want the texture to appear the same
you need to increase the texture_dx value \param texture_dy see texture_dx
\param polyInts preallocated temp array storage for vertex sorting (used for
multi-threaded operation) \param polyAllocated flag indicating oif the temp
multi-threaded operation) \param polyAllocated flag indicating if the temp
array was allocated (used for multi-threaded operation)

\returns Returns 0 on success, -1 on failure.
Expand Down Expand Up @@ -6714,7 +6714,7 @@ int _bresenhamIterate(SDL_gfxBresenhamIterator *b)


/*!
\brief Internal function to to draw parallel lines with Murphy algorithm.
\brief Internal function to draw parallel lines with Murphy algorithm.

\param m Pointer to struct for murphy iterator.
\param x X coordinate of point.
Expand Down Expand Up @@ -6769,7 +6769,7 @@ void _murphyParaline(SDL_gfxMurphyIterator *m, Sint16 x, Sint16 y, int d1)
}

/*!
\brief Internal function to to draw one iteration of the Murphy algorithm.
\brief Internal function to draw one iteration of the Murphy algorithm.

\param m Pointer to struct for murphy iterator.
\param miter Iteration count.
Expand Down Expand Up @@ -6902,7 +6902,7 @@ void _murphyIteration(SDL_gfxMurphyIterator *m, Uint8 miter,
#define HYPOT(x, y) sqrt((double)(x) * (double)(x) + (double)(y) * (double)(y))

/*!
\brief Internal function to to draw wide lines with Murphy algorithm.
\brief Internal function to draw wide lines with Murphy algorithm.

Draws lines parallel to ideal line.

Expand Down
2 changes: 1 addition & 1 deletion src_c/_pygame.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ typedef enum {
*
* At a first glance, these may look redundant, but they are really
* important, especially with event blocking. If proxy events are
* not there, blocked events dont make it to our event filter, and
* not there, blocked events don't make it to our event filter, and
* that can break a lot of stuff.
*
* IMPORTANT NOTE: Do not post events directly with these proxy types,
Expand Down
2 changes: 1 addition & 1 deletion src_c/color.c
Original file line number Diff line number Diff line change
Expand Up @@ -2348,7 +2348,7 @@ _pg_pylong_to_uint32(PyObject *val, Uint32 *color, int handle_negative)
}

if (longval == -1 && PyErr_Occurred()) {
/* Some other internal error occured */
/* Some other internal error occurred */
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src_c/cython/pygame/pypm.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import sys
# 0.0.5: (June 1st, 2009)
# Output no longer calls abort when it deallocates.
# Added abort and close methods.
# Need to call Abort() explicityly if you want that to happen.
# Need to call Abort() explicitly if you want that to happen.


#
Expand Down
2 changes: 1 addition & 1 deletion src_c/doc/sprite_doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define DOC_SPRITE_RENDERUPDATES_DRAW "draw(surface) -> Rect_list\nblit the Sprite images and track changed areas"
#define DOC_SPRITE_LAYEREDUPDATES "LayeredUpdates(*sprites, **kwargs) -> LayeredUpdates\nLayeredUpdates is a sprite group that handles layers and draws like RenderUpdates."
#define DOC_SPRITE_LAYEREDUPDATES_ADD "add(*sprites, **kwargs) -> None\nadd a sprite or sequence of sprites to a group"
#define DOC_SPRITE_LAYEREDUPDATES_SPRITES "sprites() -> sprites\nreturns a ordered list of sprites (first back, last top)."
#define DOC_SPRITE_LAYEREDUPDATES_SPRITES "sprites() -> sprites\nreturns an ordered list of sprites (first back, last top)."
#define DOC_SPRITE_LAYEREDUPDATES_DRAW "draw(surface) -> Rect_list\ndraw all sprites in the right order onto the passed surface."
#define DOC_SPRITE_LAYEREDUPDATES_GETSPRITESAT "get_sprites_at(pos) -> colliding_sprites\nreturns a list with all sprites at that position."
#define DOC_SPRITE_LAYEREDUPDATES_GETSPRITE "get_sprite(idx) -> sprite\nreturns the sprite at the index idx from the groups sprites"
Expand Down
2 changes: 1 addition & 1 deletion src_c/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ dict_from_event(SDL_Event *event)
break;
#endif /* (defined(unix) || ... */
} /* switch (event->type) */
/* Events that dont have any attributes are not handled in switch
/* Events that don't have any attributes are not handled in switch
* statement */
SDL_Window *window;
switch (event->type) {
Expand Down
2 changes: 1 addition & 1 deletion src_c/freetype/ft_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ _validate_view_format(const char *format)
{
int i = 0;

/* Check if the format starts with a size/byte order code or a item count
/* Check if the format starts with a size/byte order code or an item count
*/
switch (format[i]) {
case '@':
Expand Down
2 changes: 1 addition & 1 deletion src_c/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ MODINIT_DEFINE(image)
Py_DECREF(extmodule);
}
else {
// if the module could not be loaded, dont treat it like an error
// if the module could not be loaded, don't treat it like an error
PyErr_Clear();
}
return module;
Expand Down
2 changes: 1 addition & 1 deletion src_c/imageext.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ imageext_load_sized_svg(PyObject *self, PyObject *arg, PyObject *kwargs)

if (width <= 0 || height <= 0) {
return RAISE(PyExc_ValueError,
"both components of size must be be positive");
"both components of size must be positive");
}

rw = pgRWops_FromObject(obj, NULL);
Expand Down
12 changes: 6 additions & 6 deletions src_c/include/sse2neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ FORCE_INLINE void _sse2neon_smp_mb(void)
#endif

/* Apple Silicon cache lines are double of what is commonly used by Intel, AMD
* and other Arm microarchtectures use.
* and other Arm microarchitectures use.
* From sysctl -a on Apple M1:
* hw.cachelinesize: 128
*/
Expand Down Expand Up @@ -658,7 +658,7 @@ FORCE_INLINE uint16_t _sse2neon_vaddvq_u16(uint16x8_t a)
* This last part, <data_type>, is a little complicated. It identifies the
* content of the input values, and can be set to any of the following values:
* + ps - vectors contain floats (ps stands for packed single-precision)
* + pd - vectors cantain doubles (pd stands for packed double-precision)
* + pd - vectors contain doubles (pd stands for packed double-precision)
* + epi8/epi16/epi32/epi64 - vectors contain 8-bit/16-bit/32-bit/64-bit
* signed integers
* + epu8/epu16/epu32/epu64 - vectors contain 8-bit/16-bit/32-bit/64-bit
Expand Down Expand Up @@ -8628,9 +8628,9 @@ FORCE_INLINE __m128i _mm_aesenc_si128(__m128i a, __m128i RoundKey)
#define SSE2NEON_AES_B2W(b0, b1, b2, b3) \
(((uint32_t) (b3) << 24) | ((uint32_t) (b2) << 16) | \
((uint32_t) (b1) << 8) | (uint32_t) (b0))
// muliplying 'x' by 2 in GF(2^8)
// multiplying 'x' by 2 in GF(2^8)
#define SSE2NEON_AES_F2(x) ((x << 1) ^ (((x >> 7) & 1) * 0x011b /* WPOLY */))
// muliplying 'x' by 3 in GF(2^8)
// multiplying 'x' by 3 in GF(2^8)
#define SSE2NEON_AES_F3(x) (SSE2NEON_AES_F2(x) ^ x)
#define SSE2NEON_AES_U0(p) \
SSE2NEON_AES_B2W(SSE2NEON_AES_F2(p), p, p, SSE2NEON_AES_F3(p))
Expand Down Expand Up @@ -8708,14 +8708,14 @@ FORCE_INLINE __m128i _mm_aesdec_si128(__m128i a, __m128i RoundKey)
v = vqtbx4q_u8(v, _sse2neon_vld1q_u8_x4(_sse2neon_rsbox + 0xc0), w - 0xc0);

// inverse mix columns
// muliplying 'v' by 4 in GF(2^8)
// multiplying 'v' by 4 in GF(2^8)
w = (v << 1) ^ (uint8x16_t) (((int8x16_t) v >> 7) & 0x1b);
w = (w << 1) ^ (uint8x16_t) (((int8x16_t) w >> 7) & 0x1b);
v ^= w;
v ^= (uint8x16_t) vrev32q_u16((uint16x8_t) w);

w = (v << 1) ^ (uint8x16_t) (((int8x16_t) v >> 7) &
0x1b); // muliplying 'v' by 2 in GF(2^8)
0x1b); // multiplying 'v' by 2 in GF(2^8)
w ^= (uint8x16_t) vrev32q_u16((uint16x8_t) v);
w ^= vqtbl1q_u8(v ^ w, vld1q_u8(ror32by8));

Expand Down
9 changes: 5 additions & 4 deletions src_c/mask.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,8 @@ cc_label(bitmask_t *input, unsigned int *image, unsigned int *ufind,
}
buf++;
}
/* last pixel of the row, if its not also the first pixel of the row */
/* last pixel of the row, if it's not also the first pixel of the row
*/
if (w > 1) {
if (bitmask_getbit(input, x, y)) {
if (*(buf - w)) { /* b label */
Expand Down Expand Up @@ -1382,7 +1383,7 @@ get_bounding_rects(bitmask_t *input, int *num_bounding_boxes,
if (ufind[x_uf] < x_uf) { /* is it a union find root? */
ufind[x_uf] = ufind[ufind[x_uf]]; /* relabel it to its root */
}
else { /* its a root */
else { /* it's a root */
relabel++;
ufind[x_uf] = relabel; /* assign the lowest label available */
}
Expand All @@ -1409,7 +1410,7 @@ get_bounding_rects(bitmask_t *input, int *num_bounding_boxes,
}

for (temp = 0; temp <= relabel; temp++) {
rects[temp].h = 0; /* so we know if its a new rect or not */
rects[temp].h = 0; /* so we know if it's a new rect or not */
}

/* find the bounding rect of each connected component */
Expand Down Expand Up @@ -1586,7 +1587,7 @@ get_connected_components(bitmask_t *mask, bitmask_t ***components, int min)
if (ufind[x_uf] < x_uf) { /* is it a union find root? */
ufind[x_uf] = ufind[ufind[x_uf]]; /* relabel it to its root */
}
else { /* its a root */
else { /* it's a root */
if (largest[x_uf] >= min_cc) {
relabel++;
ufind[x_uf] = relabel; /* assign the lowest label available */
Expand Down
2 changes: 1 addition & 1 deletion src_c/math.c
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ vector_slerp(pgVector *self, PyObject *args)
tmp = (tmp < -1 ? -1 : (tmp > 1 ? 1 : tmp));
angle = acos(tmp);

/* if t < 0 we take the long arch of the greate circle to the destiny */
/* if t < 0 we take the long arch of the great circle to the destiny */
if (t < 0) {
angle -= 2 * M_PI;
t = -t;
Expand Down
Loading
Loading