|
3 | 3 | #include "include/collisions.h" |
4 | 4 |
|
5 | 5 | #include <limits.h> |
| 6 | +#include <float.h> |
| 7 | +#include <stddef.h> |
6 | 8 | #include <math.h> |
7 | 9 |
|
8 | 10 | static PyTypeObject pgLine_Type; |
@@ -209,7 +211,7 @@ pg_line_copy(pgLineObject *self, PyObject *_null) |
209 | 211 | } |
210 | 212 |
|
211 | 213 | static PyObject * |
212 | | -pg_line_raycast(pgLineObject *self, PyObject* const* args, Py_ssize_t nargs) |
| 214 | +pg_line_raycast(pgLineObject *self, PyObject *const *args, Py_ssize_t nargs) |
213 | 215 | { |
214 | 216 | PyObject **farr; |
215 | 217 | Py_ssize_t loop; |
@@ -267,9 +269,8 @@ pg_line_collideline(pgLineObject *self, PyObject *const *args, |
267 | 269 | pgLineBase B; |
268 | 270 |
|
269 | 271 | if (!pgLine_FromObjectFastcall(args, nargs, &B)) { |
270 | | - RAISE(PyExc_TypeError, |
271 | | - "Line.collideline requires a line or LineLike object"); |
272 | | - return NULL; |
| 272 | + return RAISE(PyExc_TypeError, |
| 273 | + "Line.collideline requires a line or LineLike object"); |
273 | 274 | } |
274 | 275 |
|
275 | 276 | return PyBool_FromLong(pgCollision_LineLine(&self->line, &B)); |
@@ -386,9 +387,8 @@ static PyObject * |
386 | 387 | pg_line_update(pgLineObject *self, PyObject *const *args, Py_ssize_t nargs) |
387 | 388 | { |
388 | 389 | if (!pgLine_FromObjectFastcall(args, nargs, &(self->line))) { |
389 | | - RAISE(PyExc_TypeError, |
390 | | - "Line.update requires a line or LineLike object"); |
391 | | - return NULL; |
| 390 | + return RAISE(PyExc_TypeError, |
| 391 | + "Line.update requires a line or LineLike object"); |
392 | 392 | } |
393 | 393 | Py_RETURN_NONE; |
394 | 394 | } |
@@ -463,9 +463,9 @@ pg_line_contains_seq(pgLineObject *self, PyObject *arg) |
463 | 463 |
|
464 | 464 | pgLineBase B; |
465 | 465 | if (!pgLine_FromObject(arg, &B)) { |
466 | | - RAISE(PyExc_TypeError, |
467 | | - "'in <pygame.Line>' requires line style object" |
468 | | - " or int as left operand"); |
| 466 | + PyErr_SetString(PyExc_TypeError, |
| 467 | + "'in <pygame.Line>' requires line style object" |
| 468 | + " or int as left operand"); |
469 | 469 | return 0; |
470 | 470 | } |
471 | 471 |
|
@@ -586,7 +586,7 @@ pg_line_ass_subscript(pgLineObject *self, PyObject *op, PyObject *value) |
586 | 586 | if (!pg_DoubleFromObj(item, values + i)) { |
587 | 587 | PyErr_Format(PyExc_TypeError, |
588 | 588 | "Expected a number between %lf and %lf", |
589 | | - DBL_TRUE_MIN, DBL_MAX); |
| 589 | + DBL_MIN, DBL_MAX); |
590 | 590 | } |
591 | 591 | } |
592 | 592 | self->line.x1 = values[0]; |
@@ -632,7 +632,7 @@ pg_line_ass_subscript(pgLineObject *self, PyObject *op, PyObject *value) |
632 | 632 | if (!pg_DoubleFromObj(item, values + i)) { |
633 | 633 | PyErr_Format(PyExc_TypeError, |
634 | 634 | "Expected a number between %lf and %lf", |
635 | | - DBL_TRUE_MIN, DBL_MAX); |
| 635 | + DBL_MIN, DBL_MAX); |
636 | 636 | } |
637 | 637 | } |
638 | 638 | for (i = 0; i < slicelen; ++i) { |
@@ -757,7 +757,7 @@ pg_line_iterator(pgLineObject *self) |
757 | 757 | self->line.name = val; \ |
758 | 758 | return 0; \ |
759 | 759 | } \ |
760 | | - RAISE(PyExc_TypeError, "Expected a number"); \ |
| 760 | + PyErr_SetString(PyExc_TypeError, "Expected a number"); \ |
761 | 761 | return -1; \ |
762 | 762 | } |
763 | 763 |
|
|
0 commit comments