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 1 commit
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 for 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
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/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
8 changes: 4 additions & 4 deletions src_c/mask.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ 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 +1382,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 +1409,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 +1586,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
4 changes: 2 additions & 2 deletions src_c/simd_transform_sse2.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ filter_expand_Y_SSE2(Uint8 *srcpix, Uint8 *dstpix, int width, int srcpitch,
{
// This filter parallelizes math operations using SSE2, but it also runs
// through each row 2 pixels at a time. The 2x pixels at a time strategy
// was a 23% performance improvment for Y-expand over 1x at a time.
// was a 23% performance improvement for Y-expand over 1x at a time.

int x, y;
__m128i src0, src1, dst, ymult0_mm, ymult1_mm;
Expand Down Expand Up @@ -433,7 +433,7 @@ grayscale_sse2(SDL_Surface *src, SDL_Surface *newsurf)
* We also need to calculate a 'skip value' in case our surface's rows are
* not contiguous in memory. For surfaces, a single row's worth of pixel
* data is always contiguous (i.e. each pixel is next to each other).
* However, a surface's rows may be seperated from one another in memory,
* However, a surface's rows may be separated from one another in memory,
* most commonly this happens with sub surfaces.
* The vast majority of surfaces used in applications will probably also
* have contiguous rows as that is what happens when you create a standard
Expand Down
2 changes: 1 addition & 1 deletion src_py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def PixelArray(surface): # pylint: disable=unused-argument
except (ImportError, OSError):
font = MissingModule("font", urgent=0)

# try and load pygame.mixer_music before mixer, for py2app...
# try to load pygame.mixer_music before mixer, for py2app...
try:
import pygame.mixer_music

Expand Down
2 changes: 1 addition & 1 deletion src_py/_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def attempt_import(module, function_name, output_str=""):
Args:
module: string representing module name
function_name: string representing function name to be imported
output_str: optional string to prepend error messagess to if one occurs
output_str: optional string to prepend error messages to if one occurs

Returns:
tuple(str, bool, Any):
Expand Down
2 changes: 1 addition & 1 deletion src_py/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def quit():


if __name__ == "__main__":
# try and use this camera stuff with the pygame camera example.
# try to use this camera stuff with the pygame camera example.
import pygame.examples.camera

# pygame.camera.Camera = Camera
Expand Down
2 changes: 1 addition & 1 deletion src_py/sysfont.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _font_finder_darwin():

def initsysfonts_darwin():
"""Read the fonts on macOS, and OS X."""
# if the X11 binary exists... try and use that.
# if the X11 binary exists... try to use that.
# Not likely to be there on pre 10.4.x ... or macOS 10.10+
if exists("/usr/X11/bin/fc-list"):
fonts = initsysfonts_unix("/usr/X11/bin/fc-list")
Expand Down
2 changes: 1 addition & 1 deletion test/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ these module level tags.
Class Level Tags
----------------

If you want to override a specifig tag then you can use negation. ::
If you want to override a specific tag then you can use negation. ::

class SomeTest(unittest.TestCase):
__tags__ = ['-interactive']
Expand Down
2 changes: 1 addition & 1 deletion test/constants_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
def create_overlap_set(constant_names):
"""Helper function to find overlapping constant values/names.

Returns a set of fronzensets:
Returns a set of frozensets:
set(frozenset(names of overlapping constants), ...)
"""
# Create an overlap dict.
Expand Down
Loading
Loading