aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-12-04 11:19:59 -0800
committerChris Robinson <[email protected]>2020-12-04 11:19:59 -0800
commit3a3094c88762dbeadda6418bbb6a060a85e29f3f (patch)
tree17dbd5c6c1d29c94e9ef3950f064a95a39a01637
parent69d55d7e03996484cc899de1e21172a7a4532d6b (diff)
Fix some tabs and missing cast
-rw-r--r--examples/altonegen.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/examples/altonegen.c b/examples/altonegen.c
index 849ab7ee..75db2d6b 100644
--- a/examples/altonegen.c
+++ b/examples/altonegen.c
@@ -44,9 +44,7 @@
#include "common/alhelpers.h"
-#ifdef _WIN32
-# include "win_main_utf8.h"
-#endif
+#include "win_main_utf8.h"
#ifndef M_PI
#define M_PI (3.14159265358979323846)
@@ -146,9 +144,11 @@ static ALuint CreateWave(enum WaveType type, ALuint freq, ALuint srate, ALfloat
break;
}
- if (gain != 1.0)
- for(i = 0;i < srate;i++)
- data[i] *= gain;
+ if(gain != 1.0f)
+ {
+ for(i = 0;i < srate;i++)
+ data[i] *= gain;
+ }
/* Buffer the audio data into a new buffer object. */
buffer = 0;
@@ -197,9 +197,8 @@ int main(int argc, char *argv[])
for(i = 0;i < argc;i++)
{
- if (strcmp(argv[i], "-h") == 0
- || strcmp(argv[i], "-?") == 0
- || strcmp(argv[i], "--help") == 0)
+ if(strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-?") == 0
+ || strcmp(argv[i], "--help") == 0)
{
fprintf(stderr, "OpenAL Tone Generator\n"
"\n"
@@ -254,8 +253,8 @@ int main(int argc, char *argv[])
else if(i+1 < argc && (strcmp(argv[i], "--gain") == 0 || strcmp(argv[i], "-g") == 0))
{
i++;
- gain = atof(argv[i]);
- if (gain < 0.0f || gain > 1.0f)
+ gain = (ALfloat)atof(argv[i]);
+ if(gain < 0.0f || gain > 1.0f)
{
fprintf(stderr, "Invalid gain: %s (min: 0.0, max 1.0)\n", argv[i]);
gain = 1.0f;