Re: [PATCH 2/2] winmm: Parse MCI colon notation as in T:MM:SS:F
14 Mar
2011
14 Mar
'11
3:06 p.m.
<Joerg-Cyril.Hoehle(a)t-systems.com> writes:
@@ -975,18 +975,31 @@ static WORD MCI_GetMessage(LPCWSTR lpCmd) */ static BOOL MCI_GetDWord(DWORD* data, LPWSTR* ptr) { - DWORD val; - LPWSTR ret; + DWORD val, total = 0; + LPWSTR ret, src = *ptr; + int shift = 0;
- val = strtoulW(*ptr, &ret, 10); + colonized: + val = strtoulW(src, &ret, 10); + if (ret == src) return FALSE;
switch (*ret) { case '\0': break; + case '\t': case ' ': ret++; break; + case ':': { + if ((val >= 256) || (shift >= 24)) return FALSE; + total |= val << shift; + shift += 8; + src = ret + 1; + goto colonized; + }
Please use a proper loop, not a goto. -- Alexandre Julliard julliard(a)winehq.org
5390
Age (days ago)
5390
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard