aboutsummaryrefslogtreecommitdiff
path: root/c/data.h
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-30 02:19:56 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-30 02:20:23 +0200
commit6832f91958e6c2cc44a8c4a4e126ea20b8c8d5a3 (patch)
tree4f08e1f31429e2e716fa618f550342287a091a0e /c/data.h
parent16ba8f3ae15363e921fca0e97f5c89cf12987b21 (diff)
downloadEpisodeBrowser-6832f91958e6c2cc44a8c4a4e126ea20b8c8d5a3.tar.gz
Fix Unique Good, Bad. Simplify HTML parser.
Good and Bad should obviously do the exact opposite thing to what they did.
Diffstat (limited to 'c/data.h')
-rw-r--r--c/data.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/c/data.h b/c/data.h
index 171edaa..0f00ecb 100644
--- a/c/data.h
+++ b/c/data.h
@@ -120,11 +120,11 @@ struct FileView
{
hf = CreateFile(filename, GENERIC_READ|GENERIC_WRITE,
0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
- if (!hf.Bad(INVALID_HANDLE_VALUE)) {
+ if (hf.Bad(INVALID_HANDLE_VALUE)) {
if (GetLastError() == ERROR_FILE_NOT_FOUND) {
hf = CreateFile(filename, GENERIC_READ|GENERIC_WRITE,
0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr);
- if (!hf.Bad(INVALID_HANDLE_VALUE))
+ if (hf.Bad(INVALID_HANDLE_VALUE))
throw Win32Error();
} else
throw Win32Error();
@@ -134,11 +134,11 @@ struct FileView
cbMap.QuadPart = c*sizeof(T);
hm = CreateFileMapping(hf.v, nullptr, PAGE_READWRITE,
cbMap.HighPart, cbMap.LowPart, nullptr);
- if (!hm.Bad(0))
+ if (hm.Bad(0))
throw Win32Error();
view = reinterpret_cast<T*>(MapViewOfFile(hm.v, FILE_MAP_ALL_ACCESS, 0, 0, 0));
- if (!view.Bad(0))
+ if (view.Bad(0))
throw Win32Error();
}