diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-04-15 22:06:56 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-04-15 22:06:56 +0200 |
commit | c78cb17e2a8055f71d210e719e72ace7e9fb7b2e (patch) | |
tree | b763599952d8ae94f6b32f1f2f5aea87e4f764fa /src/blueshift_w32gdi_c.c | |
parent | Cython side of Windows GDI support (diff) | |
download | blueshift-c78cb17e2a8055f71d210e719e72ace7e9fb7b2e.tar.gz blueshift-c78cb17e2a8055f71d210e719e72ace7e9fb7b2e.tar.bz2 blueshift-c78cb17e2a8055f71d210e719e72ace7e9fb7b2e.tar.xz |
fix errors and warnings
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/blueshift_w32gdi_c.c')
-rw-r--r-- | src/blueshift_w32gdi_c.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/blueshift_w32gdi_c.c b/src/blueshift_w32gdi_c.c index 3b05569..d304b25 100644 --- a/src/blueshift_w32gdi_c.c +++ b/src/blueshift_w32gdi_c.c @@ -38,6 +38,7 @@ static HDC* crtcs; int blueshift_w32gdi_open(void) { int c; + HDC hDC; DISPLAY_DEVICE display; display.cb = sizeof(DISPLAY_DEVICE); @@ -47,7 +48,7 @@ int blueshift_w32gdi_open(void) if (crtc_count == 0) { - crtcs == NULL; + crtcs = NULL; return 0; } @@ -73,8 +74,8 @@ int blueshift_w32gdi_open(void) crtc_count = c; return 1; } - *(crtcs + c) = CreateDC(TEXT("DISPLAY"), display.DeviceName, NULL, NULL); - if (*(crtcs + c) == NULL) + hDC = *(crtcs + c) = CreateDC(TEXT("DISPLAY"), display.DeviceName, NULL, NULL); + if (hDC == NULL) { fprintf(stderr, "Unable to open device context\n"); crtc_count = c; @@ -85,7 +86,7 @@ int blueshift_w32gdi_open(void) if (GetDeviceCaps(hDC, COLORMGMTCAPS) != CM_GAMMA_RAMP) { fprintf(stderr, "CRTC %i does not support gamma ramps\n", c); - ReleaseDC(NULL, *(crtcs + c)); + ReleaseDC(NULL, hDC); crtc_count = c; return 1; } @@ -171,6 +172,7 @@ int blueshift_w32gdi_apply(int use_crtc, uint16_t* rgb_curves) */ void blueshift_w32gdi_close(void) { + int c; for (c = 0; c < crtc_count; c++) ReleaseDC(NULL, *(crtcs + c)); if (crtcs != NULL) |