From 015e0c753b1f4861680fc48551120c86412efc35 Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Sat, 24 Nov 2007 23:17:01 +0000 Subject: [PATCH] Correctly using __attribute__ ((packed)); some small improvements. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2862 8092fc87-c524-0410-9efc-e669fe64eaf9 --- tools/aif/aif2raw.c | 2 +- tools/aif/aif2raw.h | 14 +++++++------- tools/aif/aif2wav.sh | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/aif/aif2raw.c b/tools/aif/aif2raw.c index 8ddfbd66e..a1ca0ad31 100644 --- a/tools/aif/aif2raw.c +++ b/tools/aif/aif2raw.c @@ -190,7 +190,7 @@ free_chunks(struct aifc_Chunk **chunks) { } void -convert_aif(FILE *in, FILE *out) { +convert_aif(FILE *in, FILE *out) { struct aifc_Chunk **chunks; struct aifc_FormatVersionChunk *fverChunk; struct aifc_ExtCommonChunk *commChunk; diff --git a/tools/aif/aif2raw.h b/tools/aif/aif2raw.h index 97055fa83..81214cdd5 100644 --- a/tools/aif/aif2raw.h +++ b/tools/aif/aif2raw.h @@ -26,7 +26,7 @@ struct aifc_ChunkHeader { struct aifc_Chunk { aifc_ID ckID; /* Chunk ID */ uint32_t ckSize; /* Chunk size, excluding header */ - uint8_t ckData[1]; /* placeholder for data */ + uint8_t ckData[]; /* placeholder for data */ }; struct aifc_ContainerChunk { @@ -46,17 +46,17 @@ struct aifc_ExtCommonChunk { aifc_ID ckID; /* "COMM" */ uint32_t ckSize; /* size of chunk data */ uint16_t numChannels; /* number of channels */ - uint32_t numSampleFrames __attribute__ ((packed)); + uint32_t numSampleFrames; /* number of sample frames */ - uint16_t sampleSize __attribute__ ((packed)); + uint16_t sampleSize; /* number of bits per sample */ - aifc_Extended sampleRate __attribute__ ((packed)); + aifc_Extended sampleRate; /* number of frames per second */ - aifc_ID compressionType __attribute__ ((packed)); + aifc_ID compressionType; /* compression type ID */ char *compressionName; /* compression type name */ -}; +} __attribute__ ((packed)); struct aifc_SoundDataChunk { @@ -64,6 +64,6 @@ struct aifc_SoundDataChunk { uint32_t ckSize; /* size of chunk data */ uint32_t offset; /* offset to sound data */ uint32_t blocksize; /* size of alignment blocks */ - uint8_t data[1]; /* placeholder for data */ + uint8_t data[]; /* placeholder for data */ }; diff --git a/tools/aif/aif2wav.sh b/tools/aif/aif2wav.sh index f1cf902f5..33af9c7a0 100755 --- a/tools/aif/aif2wav.sh +++ b/tools/aif/aif2wav.sh @@ -13,7 +13,7 @@ echo "If this is not the case, files won't be converted correctly." echo "The sample rate is reported, so you can see if it goes wrong." echo "Press ENTER when ready." -read +read DUMMY for FILE in *.aif; do echo "File $FILE"