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 |
|
|
GX_CALLER_CHECKING_EXTERNS |
31 |
|
|
|
32 |
|
|
/**************************************************************************/ |
33 |
|
|
/* */ |
34 |
|
|
/* FUNCTION RELEASE */ |
35 |
|
|
/* */ |
36 |
|
|
/* _gxe_utility_rectangle_compare PORTABLE C */ |
37 |
|
|
/* 6.1 */ |
38 |
|
|
/* AUTHOR */ |
39 |
|
|
/* */ |
40 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
41 |
|
|
/* */ |
42 |
|
|
/* DESCRIPTION */ |
43 |
|
|
/* */ |
44 |
|
|
/* This function checks for errors in the utility rectangle compare */ |
45 |
|
|
/* function call. */ |
46 |
|
|
/* */ |
47 |
|
|
/* INPUT */ |
48 |
|
|
/* */ |
49 |
|
|
/* first_rectangle First rectangle */ |
50 |
|
|
/* second_rectangle Second rectangle */ |
51 |
|
|
/* */ |
52 |
|
|
/* OUTPUT */ |
53 |
|
|
/* */ |
54 |
|
|
/* [GX_TRUE | GX_FALSE] */ |
55 |
|
|
/* */ |
56 |
|
|
/* CALLS */ |
57 |
|
|
/* */ |
58 |
|
|
/* _gx_utility_rectangle_compare Actual utility rectangle */ |
59 |
|
|
/* compare function */ |
60 |
|
|
/* */ |
61 |
|
|
/* CALLED BY */ |
62 |
|
|
/* */ |
63 |
|
|
/* Application Code */ |
64 |
|
|
/* */ |
65 |
|
|
/**************************************************************************/ |
66 |
|
7 |
GX_BOOL _gxe_utility_rectangle_compare(GX_RECTANGLE *first_rectangle, GX_RECTANGLE *second_rectangle) |
67 |
|
|
{ |
68 |
|
|
/* Check for invalid input pointers. */ |
69 |
✓✓✓✓
|
7 |
if ((first_rectangle == GX_NULL) || (second_rectangle == GX_NULL)) |
70 |
|
|
{ |
71 |
|
2 |
return GX_FALSE; |
72 |
|
|
} |
73 |
|
|
|
74 |
|
|
/* Check for valid rectangle. */ |
75 |
✓✓ |
5 |
if ((first_rectangle -> gx_rectangle_left > first_rectangle -> gx_rectangle_right) || |
76 |
✓✓ |
4 |
(first_rectangle -> gx_rectangle_top > first_rectangle -> gx_rectangle_bottom) || |
77 |
✓✓ |
3 |
(second_rectangle -> gx_rectangle_left > second_rectangle -> gx_rectangle_right) || |
78 |
✓✓ |
2 |
(second_rectangle -> gx_rectangle_top > second_rectangle -> gx_rectangle_bottom)) |
79 |
|
|
{ |
80 |
|
4 |
return GX_FALSE; |
81 |
|
|
} |
82 |
|
|
|
83 |
|
|
/* Call the actual utility rectangle compare function. */ |
84 |
|
1 |
return(_gx_utility_rectangle_compare(first_rectangle, second_rectangle)); |
85 |
|
|
} |
86 |
|
|
|