aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-01-23 21:47:43 -0800
committerChris Robinson <[email protected]>2016-01-23 21:47:43 -0800
commit7de8db2960e374e34bd48cd26d22315e63d17ebb (patch)
treecf8f03bd8d756afc2794968574fa0d1ea646d3c1 /Alc/backends
parent5d552980a4e16a8266a59a2ebb35a1ce2a09de4e (diff)
Replace multiple fputc calls with one fwrite
Diffstat (limited to 'Alc/backends')
-rw-r--r--Alc/backends/wave.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/Alc/backends/wave.c b/Alc/backends/wave.c
index 6b47c611..d54e21eb 100644
--- a/Alc/backends/wave.c
+++ b/Alc/backends/wave.c
@@ -56,16 +56,14 @@ static const ALubyte SUBTYPE_BFORMAT_FLOAT[] = {
static void fwrite16le(ALushort val, FILE *f)
{
- fputc(val&0xff, f);
- fputc((val>>8)&0xff, f);
+ ALubyte data[2] = { val&0xff, (val>>8)&0xff };
+ fwrite(data, 1, 2, f);
}
static void fwrite32le(ALuint val, FILE *f)
{
- fputc(val&0xff, f);
- fputc((val>>8)&0xff, f);
- fputc((val>>16)&0xff, f);
- fputc((val>>24)&0xff, f);
+ ALubyte data[4] = { val&0xff, (val>>8)&0xff, (val>>16)&0xff, (val>>24)&0xff };
+ fwrite(data, 1, 4, f);
}