diff --git a/src/glcontext.c b/src/glcontext.c index 0392c37..7cb49fe 100644 --- a/src/glcontext.c +++ b/src/glcontext.c @@ -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); } } /* }}} */ diff --git a/src/mouse.c b/src/mouse.c index ce4ed62..23af147 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -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); @@ -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); } } /* }}} */ diff --git a/src/mutex.c b/src/mutex.c index 72aba04..f9781d0 100644 --- a/src/mutex.c +++ b/src/mutex.c @@ -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); } } /* }}} */ @@ -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); } } /* }}} */ @@ -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); } } /* }}} */ diff --git a/src/pixels.c b/src/pixels.c index 50c87a5..7951cb8 100644 --- a/src/pixels.c +++ b/src/pixels.c @@ -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); } } /* }}} */ @@ -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); } } /* }}} */ @@ -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); @@ -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)); @@ -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); @@ -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 { diff --git a/src/rwops.c b/src/rwops.c index 87485cb..1a1a3a0 100644 --- a/src/rwops.c +++ b/src/rwops.c @@ -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); } } /* }}} */ diff --git a/src/shape.c b/src/shape.c index 58c6bd5..756bc19 100644 --- a/src/shape.c +++ b/src/shape.c @@ -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); } } /* }}} */ diff --git a/src/surface.c b/src/surface.c index 330ef51..3215f4d 100644 --- a/src/surface.c +++ b/src/surface.c @@ -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); } } /* }}} */ diff --git a/src/window.c b/src/window.c index 8ea9c11..61edf2b 100644 --- a/src/window.c +++ b/src/window.c @@ -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); } } /* }}} */