GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gxe_utility_rectangle_point_detect.c Lines: 8 8 100.0 %
Date: 2026-03-06 19:21:09 Branches: 6 6 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
/**   Utility (Utility)                                                   */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_utility.h"
29
30
/**************************************************************************/
31
/*                                                                        */
32
/*  FUNCTION                                               RELEASE        */
33
/*                                                                        */
34
/*    _gxe_utility_rectangle_point_detect                 PORTABLE C      */
35
/*                                                           6.1          */
36
/*  AUTHOR                                                                */
37
/*                                                                        */
38
/*    Kenneth Maxwell, Microsoft Corporation                              */
39
/*                                                                        */
40
/*  DESCRIPTION                                                           */
41
/*                                                                        */
42
/*    This function checks for errors in the utility rectangle point      */
43
/*    detect function call.                                               */
44
/*                                                                        */
45
/*  INPUT                                                                 */
46
/*                                                                        */
47
/*    rectangle                             Rectangle                     */
48
/*    point                                 Point                         */
49
/*                                                                        */
50
/*  OUTPUT                                                                */
51
/*                                                                        */
52
/*    [GX_TRUE | GX_FALSE]                                                */
53
/*                                                                        */
54
/*  CALLS                                                                 */
55
/*                                                                        */
56
/*    _gx_utility_rectangle_point_detect    Actual utility rectangle      */
57
/*                                          point detect function         */
58
/*                                                                        */
59
/*  CALLED BY                                                             */
60
/*                                                                        */
61
/*    Application Code                                                    */
62
/*                                                                        */
63
/**************************************************************************/
64
5
GX_BOOL  _gxe_utility_rectangle_point_detect(GX_RECTANGLE *rectangle, GX_POINT point)
65
{
66
GX_BOOL status;
67
68
    /* Check for invalid input pointers.  */
69
5
    if (rectangle == GX_NULL)
70
    {
71
2
        return(GX_FALSE);
72
    }
73
74
    /* Check for valid rectangle.  */
75
3
    if ((rectangle -> gx_rectangle_left > rectangle -> gx_rectangle_right) ||
76
2
        (rectangle -> gx_rectangle_top > rectangle -> gx_rectangle_bottom))
77
    {
78
2
        return(GX_FALSE);
79
    }
80
81
    /* Call the actual utility rectangle point detect function.  */
82
1
    status = _gx_utility_rectangle_point_detect(rectangle, point);
83
84
    /* Return completion status.  */
85
1
    return status;
86
}
87