From f3b5e080308f179485e10bcc2fbc23296bd60c7c Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Fri, 1 Jul 2005 22:53:03 +0000 Subject: [PATCH] CStr: VC2005 fix - mustn't dereference end() snd: Only open device once This was SVN commit r2452. --- source/lib/res/snd.cpp | 3 ++- source/ps/CStr.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/lib/res/snd.cpp b/source/lib/res/snd.cpp index 547b5dcaf3..a50e80a4b7 100755 --- a/source/lib/res/snd.cpp +++ b/source/lib/res/snd.cpp @@ -220,9 +220,10 @@ static int alc_init() { debug_assert(!"hit me"); } +#else + alc_dev = alcOpenDevice((ALubyte*)alc_dev_name); #endif - alc_dev = alcOpenDevice((ALubyte*)alc_dev_name); if(alc_dev) { alc_ctx = alcCreateContext(alc_dev, 0); // no attrlist needed diff --git a/source/ps/CStr.cpp b/source/ps/CStr.cpp index 2bea9163e9..9cce436e80 100755 --- a/source/ps/CStr.cpp +++ b/source/ps/CStr.cpp @@ -94,7 +94,7 @@ CStrW CStr8::FromUTF8() const CStrW result; const unsigned char* source = (const unsigned char*)&*begin(); - const unsigned char* sourceEnd = (const unsigned char*)&*end(); + const unsigned char* sourceEnd = source + length(); while (source < sourceEnd) { wchar_t ch = 0;