From 7de8db2960e374e34bd48cd26d22315e63d17ebb Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 23 Jan 2016 21:47:43 -0800 Subject: Replace multiple fputc calls with one fwrite --- Alc/backends/wave.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Alc') 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); } -- cgit v1.2.3