inlined getter functions

This commit is contained in:
Christian Kroll 2010-12-14 22:58:16 +00:00
parent b36bb8289e
commit fd016d9950
2 changed files with 16 additions and 24 deletions

View File

@ -66,26 +66,6 @@ void tetris_piece_rotate(tetris_piece_t *pPc,
} }
void tetris_piece_setShape(tetris_piece_t *pPc,
tetris_piece_shape_t shape)
{
assert(pPc != NULL);
assert((shape >= 0) && (shape <= TETRIS_PC_Z));
pPc->shape = shape;
}
void tetris_piece_setAngle(tetris_piece_t *pPc,
tetris_piece_angle_t angle)
{
assert(pPc != NULL);
assert((angle >= TETRIS_PC_ANGLE_0) && (angle <= TETRIS_PC_ANGLE_270));
pPc->angle = angle;
}
int8_t tetris_piece_getAngleCount(tetris_piece_t *pPc) int8_t tetris_piece_getAngleCount(tetris_piece_t *pPc)
{ {
assert(pPc != NULL); assert(pPc != NULL);

View File

@ -112,8 +112,14 @@ void tetris_piece_rotate(tetris_piece_t *pPc,
* @param pPc piece to change * @param pPc piece to change
* @param shape the shape of interest * @param shape the shape of interest
*/ */
void tetris_piece_setShape(tetris_piece_t *pPc, inline static void tetris_piece_setShape(tetris_piece_t *pPc,
tetris_piece_shape_t shape); tetris_piece_shape_t shape)
{
assert(pPc != NULL);
assert((shape >= 0) && (shape <= TETRIS_PC_Z));
pPc->shape = shape;
}
/** /**
@ -121,8 +127,14 @@ void tetris_piece_setShape(tetris_piece_t *pPc,
* @param pPc piece to change * @param pPc piece to change
* @param angle the angle of interest * @param angle the angle of interest
*/ */
void tetris_piece_setAngle(tetris_piece_t *pPc, inline static void tetris_piece_setAngle(tetris_piece_t *pPc,
tetris_piece_angle_t angle); tetris_piece_angle_t angle)
{
assert(pPc != NULL);
assert((angle >= TETRIS_PC_ANGLE_0) && (angle <= TETRIS_PC_ANGLE_270));
pPc->angle = angle;
}
/** /**