Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/glcontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ PHP_METHOD(SDL_GLContext, __construct)
}
else
{
zend_throw_exception(zend_exception_get_default(), SDL_GetError(), 0);
zend_throw_exception(zend_ce_exception, SDL_GetError(), 0);
}
}
else
{
zend_throw_exception(zend_exception_get_default(), "Invalid SDL_Window object", 0);
zend_throw_exception(zend_ce_exception, "Invalid SDL_Window object", 0);
}
}
/* }}} */
Expand Down
6 changes: 3 additions & 3 deletions src/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ static PHP_METHOD(SDL_Cursor, __construct)

if (w <= 0 || w & 7 || h <= 0)
{
zend_throw_exception(zend_exception_get_default(), "Invalid cursor size", 0);
zend_throw_exception(zend_ce_exception, "Invalid cursor size", 0);
return;
}
size = w / 8 * h;
if (data_len != size || mask_len != size)
{
zend_throw_exception_ex(zend_exception_get_default(), 0, "Invalid data or mask, size must be %ld", size);
zend_throw_exception_ex(zend_ce_exception, 0, "Invalid data or mask, size must be %ld", size);
return;
}
intern->cursor = SDL_CreateCursor((Uint8 *)data, (Uint8 *)mask, (int)w, (int)h, (int)x, (int)y);
Expand All @@ -153,7 +153,7 @@ static PHP_METHOD(SDL_Cursor, __construct)
}
else
{
zend_throw_exception(zend_exception_get_default(), SDL_GetError(), 0);
zend_throw_exception(zend_ce_exception, SDL_GetError(), 0);
}
}
/* }}} */
Expand Down
6 changes: 3 additions & 3 deletions src/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ static PHP_METHOD(SDL_mutex, __construct)
if (intern->mutex) {
intern->flags = 0;
} else {
zend_throw_exception(zend_exception_get_default(), SDL_GetError(), 0);
zend_throw_exception(zend_ce_exception, SDL_GetError(), 0);
}
}
/* }}} */
Expand Down Expand Up @@ -489,7 +489,7 @@ static PHP_METHOD(SDL_sem, __construct)
if (intern->sem) {
intern->flags = 0;
} else {
zend_throw_exception(zend_exception_get_default(), SDL_GetError(), 0);
zend_throw_exception(zend_ce_exception, SDL_GetError(), 0);
}
}
/* }}} */
Expand Down Expand Up @@ -695,7 +695,7 @@ static PHP_METHOD(SDL_cond, __construct)
if (intern->cond) {
intern->flags = 0;
} else {
zend_throw_exception(zend_exception_get_default(), SDL_GetError(), 0);
zend_throw_exception(zend_ce_exception, SDL_GetError(), 0);
}
}
/* }}} */
Expand Down
12 changes: 6 additions & 6 deletions src/pixels.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ static PHP_METHOD(SDL_PixelFormat, __construct)
}
else
{
zend_throw_exception(zend_exception_get_default(), SDL_GetError(), 0);
zend_throw_exception(zend_ce_exception, SDL_GetError(), 0);
}
}
/* }}} */
Expand Down Expand Up @@ -550,7 +550,7 @@ static PHP_METHOD(SDL_Palette, __construct)
}
else
{
zend_throw_exception(zend_exception_get_default(), SDL_GetError(), 0);
zend_throw_exception(zend_ce_exception, SDL_GetError(), 0);
}
}
/* }}} */
Expand Down Expand Up @@ -630,7 +630,7 @@ PHP_METHOD(SDL_Palette, offsetGet)
}
if (!intern->palette || offset < 0 || offset >= (intern->palette->ncolors))
{
zend_throw_exception(zend_exception_get_default(), "Invalid offset in SDL_Pixels", 0);
zend_throw_exception(zend_ce_exception, "Invalid offset in SDL_Pixels", 0);
RETURN_FALSE;
}
sdl_color_to_zval(intern->palette->colors + offset, return_value);
Expand All @@ -655,7 +655,7 @@ PHP_METHOD(SDL_Palette, offsetUnset)
}
if (!intern->palette || offset < 0 || offset >= (intern->palette->ncolors))
{
zend_throw_exception(zend_exception_get_default(), "Invalid offset in SDL_Pixels", 0);
zend_throw_exception(zend_ce_exception, "Invalid offset in SDL_Pixels", 0);
RETURN_FALSE;
}
memset(&color, 0, sizeof(color));
Expand Down Expand Up @@ -683,7 +683,7 @@ PHP_METHOD(SDL_Palette, offsetSet)
}
if (!intern->palette || offset < 0 || offset >= (intern->palette->ncolors))
{
zend_throw_exception(zend_exception_get_default(), "Invalid offset in SDL_Pixels", 0);
zend_throw_exception(zend_ce_exception, "Invalid offset in SDL_Pixels", 0);
RETURN_FALSE;
}
zval_to_sdl_color(z_color, &color);
Expand Down Expand Up @@ -1050,7 +1050,7 @@ static PHP_METHOD(SDL_Pixels, __construct)

if (php_sdl_check_overflow((int)pitch, (int)h, 1))
{
zend_throw_exception(zend_exception_get_default(), "Invalid size", 0);
zend_throw_exception(zend_ce_exception, "Invalid size", 0);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/rwops.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static PHP_METHOD(SDL_RWops, __construct)
if (intern->rwops) {
intern->flags = 0;
} else {
zend_throw_exception(zend_exception_get_default(), SDL_GetError(), 0);
zend_throw_exception(zend_ce_exception, SDL_GetError(), 0);
}
}
/* }}} */
Expand Down
4 changes: 2 additions & 2 deletions src/shape.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ static PHP_METHOD(SDL_WindowShapeMode, __construct)
intern->mode.mode = ShapeModeColorKey;
zval_to_sdl_color(z_param, &intern->mode.parameters.colorKey);
} else {
zend_throw_exception(zend_exception_get_default(), "Invalid parameter for mode=ShapeModeColorKey, SDL_Color object expected", 0);
zend_throw_exception(zend_ce_exception, "Invalid parameter for mode=ShapeModeColorKey, SDL_Color object expected", 0);
}


} else {
zend_throw_exception(zend_exception_get_default(), "Invalid mode for SDL_WindowShapeMode", 0);
zend_throw_exception(zend_ce_exception, "Invalid mode for SDL_WindowShapeMode", 0);
}
}
/* }}} */
Expand Down
2 changes: 1 addition & 1 deletion src/surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static PHP_METHOD(SDL_Surface, __construct)
}
else
{
zend_throw_exception(zend_exception_get_default(), SDL_GetError(), 0);
zend_throw_exception(zend_ce_exception, SDL_GetError(), 0);
}
}
/* }}} */
Expand Down
2 changes: 1 addition & 1 deletion src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ static PHP_METHOD(SDL_Window, __construct)
}
else
{
zend_throw_exception(zend_exception_get_default(), "Can't create window", 0);
zend_throw_exception(zend_ce_exception, "Can't create window", 0);
}
}
/* }}} */
Expand Down