GCC Code Coverage Report


Directory: common/src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 4 / 0 / 4
Functions: 100.0% 1 / 0 / 1
Branches: 100.0% 2 / 0 / 2

fx_utility_memory_set.c
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 /** FileX Component */
17 /** */
18 /** Utility */
19 /** */
20 /**************************************************************************/
21 /**************************************************************************/
22
23 #define FX_SOURCE_CODE
24
25
26 /* Include necessary system files. */
27
28 #include "fx_api.h"
29 #include "fx_system.h"
30 #include "fx_utility.h"
31 #include "string.h"
32
33
34 /* Remove any previous remapping for memory copy when compiling this
35 module. */
36
37 #undef _fx_utility_memory_set
38
39
40 /**************************************************************************/
41 /* */
42 /* FUNCTION RELEASE */
43 /* */
44 /* _fx_utility_memory_set PORTABLE C */
45 /* 6.1 */
46 /* AUTHOR */
47 /* */
48 /* William E. Lamie, Microsoft Corporation */
49 /* */
50 /* DESCRIPTION */
51 /* */
52 /* This function copies the specified number of bytes from the source */
53 /* to the destination. */
54 /* */
55 /* INPUT */
56 /* */
57 /* dest_ptr Destination memory pointer */
58 /* value Value to fill */
59 /* size Number of bytes to set */
60 /* */
61 /* OUTPUT */
62 /* */
63 /* None */
64 /* */
65 /* CALLS */
66 /* */
67 /* None */
68 /* */
69 /* CALLED BY */
70 /* */
71 /* FileX System Functions */
72 /* */
73 /**************************************************************************/
74 36 VOID _fx_utility_memory_set(UCHAR *dest_ptr, UCHAR value, ULONG size)
75 {
76
77 /* Loop to set memory. */
78
2/2
✓ Branch 4 → 3 taken 432 times.
✓ Branch 4 → 5 taken 36 times.
468 while (size--)
79 {
80
81 /* Set byte. */
82 432 *dest_ptr++ = value;
83 }
84 36 }
85
86