@@ -87,7 +87,7 @@ MoaError Formats::Format::createTempFile(PIMoaFile tempFileInterfacePointer) {
8787 // "ExFi" gives some clue where the temporary file came from if a crash occurs
8888 // use extension of .tmp for a further clue to the file's purpose
8989 // unless other specific extension required
90- const std::string PREFIX = " ~ExFi" ;
90+ static const std::string PREFIX = " ~ExFi" ;
9191 const std::string PERIOD_TEMP_FILE_EXTENSION = " ." + TEMP_FILE_EXTENSION;
9292
9393 std::string filename = PREFIX + PERIOD_TEMP_FILE_EXTENSION;
@@ -112,7 +112,7 @@ MoaError Formats::Format::createTempFile(PIMoaFile tempFileInterfacePointer) {
112112 // we also can't put this in the system temporary directory
113113 // because later we'll call SwapFile on this, which requires
114114 // that it be on the same volume as the file we're swapping with
115- const size_t ABC_SIZE = 4 ;
115+ static const size_t ABC_SIZE = 4 ;
116116 char abc[ABC_SIZE] = " " ;
117117
118118 size_t index = 2 ;
@@ -194,7 +194,7 @@ MoaError Formats::Format::setTempFileAttributeHidden(bool hidden, PIMoaFile temp
194194 };
195195
196196 MoaSystemFileSpec sysSpec = " " ;
197- const MoaLong SYS_SPEC_SIZE = sizeof (sysSpec);
197+ static const MoaLong SYS_SPEC_SIZE = sizeof (sysSpec);
198198
199199 RETURN_ERR (tempFileInterfacePointer->GetSysSpec (sysSpec, SYS_SPEC_SIZE));
200200
@@ -508,7 +508,7 @@ MoaError Formats::WinPALETTEFormat::getPaletteGlobalHandleLock(std::unique_ptr<G
508508 RETURN_NULL (paletteGlobalHandleLockPointer);
509509
510510 // RIFF is word-aligned
511- const DWORD WORD_SIZE = sizeof (WORD);
511+ static const DWORD WORD_SIZE = sizeof (WORD);
512512
513513 MMIOINFO mmioinfo = {};
514514 mmioinfo.pchBuffer = paletteGlobalHandleLockPointer->get ();
@@ -564,7 +564,7 @@ MoaError Formats::WinPALETTEFormat::writeFile(bool agent, PIMoaFile writeFileInt
564564 }
565565
566566 MoaSystemFileSpec sysSpec = " " ;
567- const MoaLong SYS_SPEC_SIZE = sizeof (sysSpec);
567+ static const MoaLong SYS_SPEC_SIZE = sizeof (sysSpec);
568568
569569 RETURN_ERR (this ->writeFileInterfacePointer ->GetSysSpec (sysSpec, SYS_SPEC_SIZE));
570570
@@ -984,7 +984,7 @@ MoaError Formats::XtraMediaSWFFormat::seekStream(Stream &stream, MoaUlong &size)
984984 // of the Flash Asset's StreamInMedia method
985985 // first, read a ChunkID
986986 CHUNK_ID chunkID = 0 ;
987- const MoaStreamCount CHUNK_ID_SIZE = sizeof (chunkID);
987+ static const MoaStreamCount CHUNK_ID_SIZE = sizeof (chunkID);
988988
989989 RETURN_ERR (stream.readSafe (&chunkID, CHUNK_ID_SIZE));
990990
@@ -997,8 +997,8 @@ MoaError Formats::XtraMediaSWFFormat::seekStream(Stream &stream, MoaUlong &size)
997997 chunkID &= 0x00FFFFFF ;
998998
999999 // check if the ChunkID is SWF or SWC
1000- const CHUNK_ID SWF_CHUNK_ID = 0x00535746 ;
1001- const CHUNK_ID SWC_CHUNK_ID = 0x00535743 ;
1000+ static const CHUNK_ID SWF_CHUNK_ID = 0x00535746 ;
1001+ static const CHUNK_ID SWC_CHUNK_ID = 0x00535743 ;
10021002
10031003 if (chunkID == SWF_CHUNK_ID || chunkID == SWC_CHUNK_ID) {
10041004 // if it is, the entire stream is the SWF
@@ -1009,12 +1009,12 @@ MoaError Formats::XtraMediaSWFFormat::seekStream(Stream &stream, MoaUlong &size)
10091009 // this value is 1 if the SWF is embedded, FLLK if it's linked
10101010 // it is unused when reading the asset stream
10111011 uint32_t unused = 0 ;
1012- const MoaStreamCount UNUSED_SIZE = sizeof (unused);
1012+ static const MoaStreamCount UNUSED_SIZE = sizeof (unused);
10131013
10141014 RETURN_ERR (stream.readSafe (&unused, UNUSED_SIZE));
10151015
10161016 // the SWF size
1017- const MoaStreamCount SIZE_SIZE = sizeof (size);
1017+ static const MoaStreamCount SIZE_SIZE = sizeof (size);
10181018
10191019 RETURN_ERR (stream.readSafe (&size, SIZE_SIZE));
10201020
@@ -1046,7 +1046,7 @@ MoaError Formats::XtraMediaW3DFormat::seekStream(Stream &stream, MoaUlong &size)
10461046 // of the Shockwave 3D Asset's StreamInMedia method
10471047 // first, read a ChunkID
10481048 CHUNK_ID chunkID = 0 ;
1049- const MoaStreamCount CHUNK_ID_SIZE = sizeof (chunkID);
1049+ static const MoaStreamCount CHUNK_ID_SIZE = sizeof (chunkID);
10501050
10511051 RETURN_ERR (stream.readSafe (&chunkID, CHUNK_ID_SIZE));
10521052
@@ -1062,22 +1062,22 @@ MoaError Formats::XtraMediaW3DFormat::seekStream(Stream &stream, MoaUlong &size)
10621062 // if the W3D size is less than 16 bytes, it is invalid
10631063 // the 3DMD ChunkID is likely just a placeholder
10641064 // so that the stream is not empty
1065- const CHUNK_ID THREEDEM_CHUNK_ID = 0x3344454D ;
1066- const uint32_t MIN_W3D_SIZE = 16 ;
1065+ static const CHUNK_ID THREEDEM_CHUNK_ID = 0x3344454D ;
1066+ static const uint32_t MIN_W3D_SIZE = 16 ;
10671067
10681068 if (chunkID == THREEDEM_CHUNK_ID) {
10691069 // the next two values are unused when reading the asset stream
10701070 // I suspect they are only used for integration with 3DS Max
10711071 // the size and constant value 0x20000000 look suspiciously similar to
10721072 // the ID tags used in the 3DS model format
10731073 uint32_t unused = 0 ;
1074- const MoaStreamCount UNUSED_SIZE = sizeof (unused);
1074+ static const MoaStreamCount UNUSED_SIZE = sizeof (unused);
10751075
10761076 RETURN_ERR (stream.readSafe (&unused, UNUSED_SIZE));
10771077 RETURN_ERR (stream.readSafe (&unused, UNUSED_SIZE));
10781078
10791079 // the W3D size
1080- const MoaStreamCount SIZE_SIZE = sizeof (size);
1080+ static const MoaStreamCount SIZE_SIZE = sizeof (size);
10811081
10821082 RETURN_ERR (stream.readSafe (&size, SIZE_SIZE));
10831083
@@ -1267,7 +1267,7 @@ MoaError Formats::XtraMediaMixerAsyncFormat::writeFile(bool agent, PIMoaFile wri
12671267 RETURN_NULL (writeStreamInterfacePointer);
12681268
12691269 // CallFunction demands that the first argument be left empty
1270- const MoaLong ARGS_SIZE = 2 ;
1270+ static const MoaLong ARGS_SIZE = 2 ;
12711271 MoaMmValue args[ARGS_SIZE] = { kVoidMoaMmValueInitializer , kVoidMoaMmValueInitializer };
12721272
12731273 MoaChar pathnameSpec[MOA_MAX_PATHNAME] = " " ;
@@ -1322,7 +1322,7 @@ MoaError Formats::XtraMediaMixerAsyncFormat::cancelFile() {
13221322
13231323 // don't call Stop if we didn't call Save first
13241324 if (saveStatus == kMoaStatus_False ) {
1325- const MoaLong ARGS_SIZE = 1 ;
1325+ static const MoaLong ARGS_SIZE = 1 ;
13261326 MoaMmValue args[ARGS_SIZE] = { kVoidMoaMmValueInitializer };
13271327
13281328 RETURN_ERR (drCastMemInterfacePointer->CallFunction (symbols.Stop , ARGS_SIZE, args, NULL ));
0 commit comments