Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
41 lines (31 loc) · 1.13 KB

File metadata and controls

41 lines (31 loc) · 1.13 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include"strglob.h"
/*!
* @fn void float_range(const FLOAT_RANGE *const frang, STR_GLOB *restrict ugfrn)
*
* @brief create a `float` array for each value in the desired floating point range
*
* @details the `out` member of the `ugfrn` structure is assigned an array of strings instead of a value being returned
*
* @param [in] frang structure containing the begrt and end of the floating-point range
* @param [out] ugfrn the current element of the glob string's linked list that is being operated on
*
* @see cons_float2str
*/
void float_range(const FLOAT_RANGE *const frang, STR_GLOB *restrict ugfrn) {
assert(frang);
assert(ugfrn);
register size_t szrgs = 1;
for(register const FLOAT_RANGE *frs = frang;frs && frs->beg;++frs) {
szrgs += (frs->end- frs->beg);
szrgs++;
}
ugfrn->out = malloc(szrgs * sizeof(*(ugfrn->out)));
if(!ugfrn->out)
exit_verbose("malloc", __FILE__, __LINE__);
register char **pp = ugfrn->out;
for(register const FLOAT_RANGE *frp = frang;frp && frp->beg;++frp)
for(register int c = frp->beg;c <= frp->end;++c)
*pp++ = cons_float2str(c);
*pp = NULL;
return;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.