File: ladspa-util.c

package info (click to toggle)
swh-plugins 0.4.15%2B1-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 8,268 kB
  • ctags: 12,249
  • sloc: ansic: 72,074; sh: 28,183; xml: 12,247; perl: 769; makefile: 212; sed: 16
file content (22 lines) | stat: -rw-r--r-- 301 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* truncate:

   Truncates a float down to an int without worrying about
   the stack and crap like that.
*/

static const float _truncate_half = 0.5f;

int truncate(float flt) {
	int i;

	i = flt;
/*
	asm (
		"flds 8(%ebp)\n"
		"\tfsubs _truncate_half\n"
		"\tfistpl -4(%ebp)\n"
	);
*/

	return i;
}