qcap: Use BOOL type where appropriate

Frédéric Delanoy frederic.delanoy at gmail.com
Fri Mar 21 04:21:01 CDT 2014


---
 dlls/qcap/v4l.c | 19 +++++++++++--------
 dlls/qcap/yuv.c |  5 +++--
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c
index 0880499..4e19b71 100644
--- a/dlls/qcap/v4l.c
+++ b/dlls/qcap/v4l.c
@@ -110,7 +110,7 @@ struct _Capture
 
     IPin *pOut;
     int fd, mmap;
-    int iscommitted, stopped;
+    BOOL iscommitted, stopped;
     struct video_picture pict;
     int dbrightness, dhue, dcolour, dcontrast;
 
@@ -661,7 +661,8 @@ cfail:
     LeaveCriticalSection(&capBox->CritSect);
 
 fail:
-    capBox->thread = 0; capBox->stopped = 1;
+    capBox->thread = 0;
+    capBox->stopped = TRUE;
     FIXME("Stop IFilterGraph\n");
     return 0;
 }
@@ -677,16 +678,18 @@ HRESULT qcap_driver_run(Capture *capBox, FILTER_STATE *state)
 
     EnterCriticalSection(&capBox->CritSect);
 
-    capBox->stopped = 0;
+    capBox->stopped = FALSE;
 
     if (*state == State_Stopped)
     {
         *state = State_Running;
-        if (!capBox->iscommitted++)
+        if (!capBox->iscommitted)
         {
             ALLOCATOR_PROPERTIES ap, actual;
             BaseOutputPin *out;
 
+            capBox->iscommitted = TRUE;
+
             ap.cBuffers = 3;
             if (!capBox->swresize)
                 ap.cbBuffer = capBox->width * capBox->height;
@@ -755,14 +758,14 @@ HRESULT qcap_driver_stop(Capture *capBox, FILTER_STATE *state)
     {
         if (*state == State_Paused)
             ResumeThread(capBox->thread);
-        capBox->stopped = 1;
+        capBox->stopped = TRUE;
         capBox->thread = 0;
         if (capBox->iscommitted)
         {
             BaseOutputPin *out;
             HRESULT hr;
 
-            capBox->iscommitted = 0;
+            capBox->iscommitted = FALSE;
 
             out = (BaseOutputPin*)capBox->pOut;
 
@@ -894,9 +897,9 @@ Capture * qcap_driver_init( IPin *pOut, USHORT card )
     capBox->bitDepth = 24;
     capBox->pOut = pOut;
     capBox->fps = 3;
-    capBox->stopped = 0;
+    capBox->stopped = FALSE;
     capBox->curframe = 0;
-    capBox->iscommitted = 0;
+    capBox->iscommitted = FALSE;
 
     TRACE("format: %d bits - %d x %d\n", capBox->bitDepth, capBox->width, capBox->height);
 
diff --git a/dlls/qcap/yuv.c b/dlls/qcap/yuv.c
index 6b8ff29..7e17add 100644
--- a/dlls/qcap/yuv.c
+++ b/dlls/qcap/yuv.c
@@ -41,7 +41,7 @@ static int yuv_gu[256]; /* Green U */
 static int yuv_bu[256]; /* Blue  U */
 static int yuv_rv[256]; /* Red   V */
 static int yuv_gv[256]; /* Green V */
-static int initialised = 0;
+static BOOL initialised = FALSE;
 
 static inline int ValidRange(int in) {
    if (in > 255) in = 255;
@@ -67,7 +67,8 @@ void YUV_Init(void) {
    float y, u, v;
    int y_, cb, cr;
 
-   if (initialised++) return;
+   if (initialised) return;
+   initialised = TRUE;
 
    for (y_ = 0; y_ <= 255; y_++)
    {
-- 
1.9.1




More information about the wine-patches mailing list