GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_system_animation_free.c Lines: 10 10 100.0 %
Date: 2026-03-06 19:21:09 Branches: 12 12 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
10
 **************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** GUIX Component                                                        */
17
/**                                                                       */
18
/**   System Management (System)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_system.h"
29
#include "gx_animation.h"
30
31
/* Bring in externs for caller checking code.  */
32
GX_CALLER_CHECKING_EXTERNS
33
34
/**************************************************************************/
35
/*                                                                        */
36
/*  FUNCTION                                               RELEASE        */
37
/*                                                                        */
38
/*    _gxe_system_animation_free                          PORTABLE C      */
39
/*                                                           6.1          */
40
/*  AUTHOR                                                                */
41
/*                                                                        */
42
/*    Kenneth Maxwell, Microsoft Corporation                              */
43
/*                                                                        */
44
/*  DESCRIPTION                                                           */
45
/*                                                                        */
46
/*    This function checks for errors in system_animation_free call.      */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    animation                             Pointer to animation struct   */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    status                                Completion status             */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*   _gx_system_animation_free              Actual animation free call    */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
62
/*    GUIX Application                                                    */
63
/*                                                                        */
64
/**************************************************************************/
65
#if (GX_ANIMATION_POOL_SIZE > 0)
66
7
UINT  _gxe_system_animation_free(GX_ANIMATION *animation)
67
{
68
UINT status;
69
70
    /* Check for invalid caller.  */
71

7
    GX_INIT_AND_THREADS_CALLER_CHECKING
72
73
    /* Check for invalid pointer.  */
74
5
    if (animation == GX_NULL)
75
    {
76
2
        return(GX_PTR_ERROR);
77
    }
78
79
3
    if (animation->gx_animation_system_allocated == 0)
80
    {
81
1
        return (GX_INVALID_ANIMATION);
82
    }
83
84
2
    if (animation->gx_animation_status != GX_ANIMATION_IDLE)
85
    {
86
1
        return (GX_INVALID_ANIMATION);
87
    }
88
89
    /* Call actual animation get  */
90
1
    status = _gx_system_animation_free(animation);
91
92
    /* Return status.  */
93
1
    return(status);
94
}
95
#endif