GCC Code Coverage Report


Directory: ./
File: libfprint/nbis/mindtct/free.c
Date: 2024-09-16 14:36:32
Exec Total Coverage
Lines: 27 27 100.0%
Functions: 4 4 100.0%
Branches: 6 6 100.0%

Line Branch Exec Source
1 /*******************************************************************************
2
3 License:
4 This software and/or related materials was developed at the National Institute
5 of Standards and Technology (NIST) by employees of the Federal Government
6 in the course of their official duties. Pursuant to title 17 Section 105
7 of the United States Code, this software is not subject to copyright
8 protection and is in the public domain.
9
10 This software and/or related materials have been determined to be not subject
11 to the EAR (see Part 734.3 of the EAR for exact details) because it is
12 a publicly available technology and software, and is freely distributed
13 to any interested party with no licensing requirements. Therefore, it is
14 permissible to distribute this software as a free download from the internet.
15
16 Disclaimer:
17 This software and/or related materials was developed to promote biometric
18 standards and biometric technology testing for the Federal Government
19 in accordance with the USA PATRIOT Act and the Enhanced Border Security
20 and Visa Entry Reform Act. Specific hardware and software products identified
21 in this software were used in order to perform the software development.
22 In no case does such identification imply recommendation or endorsement
23 by the National Institute of Standards and Technology, nor does it imply that
24 the products and equipment identified are necessarily the best available
25 for the purpose.
26
27 This software and/or related materials are provided "AS-IS" without warranty
28 of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
29 NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
30 or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
31 licensed product, however used. In no event shall NIST be liable for any
32 damages and/or costs, including but not limited to incidental or consequential
33 damages of any kind, including economic damage or injury to property and lost
34 profits, regardless of whether NIST shall be advised, have reason to know,
35 or in fact shall know of the possibility.
36
37 By using this software, you agree to bear all risk relating to quality,
38 use and performance of the software and/or related materials. You agree
39 to hold the Government harmless from any claim arising from your use
40 of the software.
41
42 *******************************************************************************/
43
44
45 /***********************************************************************
46 LIBRARY: LFS - NIST Latent Fingerprint System
47
48 FILE: FREE.C
49 AUTHOR: Michael D. Garris
50 DATE: 03/16/1999
51
52 Contains routines responsible for deallocating
53 memories required by the NIST Latent Fingerprint System (LFS).
54
55 ***********************************************************************
56 ROUTINES:
57 free_dir2rad()
58 free_dftwaves()
59 free_rotgrids()
60 free_dir_powers()
61 ***********************************************************************/
62
63 #include <stdio.h>
64 #include <lfs.h>
65
66 /*************************************************************************
67 **************************************************************************
68 #cat: free_dir2rad - Deallocates memory associated with a DIR2RAD structure
69
70 Input:
71 dir2rad - pointer to memory to be freed
72 *************************************************************************/
73 48 void free_dir2rad(DIR2RAD *dir2rad)
74 {
75 48 g_free(dir2rad->cos);
76 48 g_free(dir2rad->sin);
77 48 g_free(dir2rad);
78 48 }
79
80 /*************************************************************************
81 **************************************************************************
82 #cat: free_dftwaves - Deallocates the memory associated with a DFTWAVES
83 #cat: structure
84
85 Input:
86 dftwaves - pointer to memory to be freed
87 **************************************************************************/
88 48 void free_dftwaves(DFTWAVES *dftwaves)
89 {
90 48 int i;
91
92
2/2
✓ Branch 0 taken 192 times.
✓ Branch 1 taken 48 times.
240 for(i = 0; i < dftwaves->nwaves; i++){
93 192 g_free(dftwaves->waves[i]->cos);
94 192 g_free(dftwaves->waves[i]->sin);
95 192 g_free(dftwaves->waves[i]);
96 }
97 48 g_free(dftwaves->waves);
98 48 g_free(dftwaves);
99 48 }
100
101 /*************************************************************************
102 **************************************************************************
103 #cat: free_rotgrids - Deallocates the memory associated with a ROTGRIDS
104 #cat: structure
105
106 Input:
107 rotgrids - pointer to memory to be freed
108 **************************************************************************/
109 96 void free_rotgrids(ROTGRIDS *rotgrids)
110 {
111 96 int i;
112
113
2/2
✓ Branch 0 taken 1536 times.
✓ Branch 1 taken 96 times.
1632 for(i = 0; i < rotgrids->ngrids; i++)
114 1536 g_free(rotgrids->grids[i]);
115 96 g_free(rotgrids->grids);
116 96 g_free(rotgrids);
117 96 }
118
119 /*************************************************************************
120 **************************************************************************
121 #cat: free_dir_powers - Deallocate memory associated with DFT power vectors
122
123 Input:
124 powers - vectors of DFT power values (N Waves X M Directions)
125 nwaves - number of DFT wave forms used
126 **************************************************************************/
127 48 void free_dir_powers(double **powers, const int nwaves)
128 {
129 48 int w;
130
131
2/2
✓ Branch 0 taken 192 times.
✓ Branch 1 taken 48 times.
240 for(w = 0; w < nwaves; w++)
132 192 g_free(powers[w]);
133
134 48 g_free(powers);
135 48 }
136
137