Fix FX_BOOL compilation errors under windows

 - Bool functions should not return -1 for error.
 - Bool variables should not be assigned 2
 - Bool / int32_t prototypes should match.

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1254973004 .
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index a856433..951085b 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -344,16 +344,11 @@
 #define PDFPARSE_TYPEONLY	1
 #define PDFPARSE_NOSTREAM	2
 struct PARSE_CONTEXT {
-
-    FX_BOOL		m_Flags;
-
-    FX_FILESIZE	m_DictStart;
-
-    FX_FILESIZE	m_DictEnd;
-
-    FX_FILESIZE	m_DataStart;
-
-    FX_FILESIZE	m_DataEnd;
+    uint32_t m_Flags;
+    FX_FILESIZE m_DictStart;
+    FX_FILESIZE m_DictEnd;
+    FX_FILESIZE m_DataStart;
+    FX_FILESIZE m_DataEnd;
 };
 
 #define PDFPARSE_ERROR_SUCCESS		0
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index 22826a3..7b7b61a 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -751,14 +751,14 @@
     offset += len + 7;
     if (m_PrevOffset > 0) {
         if (pFile->AppendString(FX_BSTRC("/Prev ")) < 0) {
-            return -1;
+            return FALSE;
         }
         FX_CHAR offset_buf[20];
         FXSYS_memset(offset_buf, 0, sizeof(offset_buf));
         FXSYS_i64toa(m_PrevOffset, offset_buf, 10);
         int32_t len = (int32_t)FXSYS_strlen(offset_buf);
         if (pFile->AppendBlock(offset_buf, len) < 0) {
-            return -1;
+            return FALSE;
         }
         offset += len + 6;
     }
@@ -786,7 +786,7 @@
     offset += len + 8;
     if (bEOF) {
         if ((len = PDF_CreatorWriteTrailer(pCreator->m_pDocument, pFile, pCreator->m_pIDArray, pCreator->m_bCompress)) < 0) {
-            return -1;
+            return FALSE;
         }
         offset += len;
         if (pCreator->m_pEncryptDict) {
@@ -795,7 +795,7 @@
                 dwEncryptObjNum = pCreator->m_dwEnryptObjNum;
             }
             if ((len = PDF_CreatorWriteEncrypt(pCreator->m_pEncryptDict, dwEncryptObjNum, pFile)) < 0) {
-                return -1;
+                return FALSE;
             }
             offset += len;
         }
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
index c1aaad8..0e9c5ba 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -712,7 +712,7 @@
     FPDF_SEGMENT	segment;
     segment.m_Start = 0;
     segment.m_nCount = 0;
-    FX_BOOL		segmentStatus = 0;
+    int  		segmentStatus = 0;
     FX_BOOL		IsContainPreChar = FALSE;
     while (pos < nCount) {
         PAGECHAR_INFO charinfo = *(PAGECHAR_INFO*)m_charList.GetAt(pos);
diff --git a/core/src/fpdftext/text_int.h b/core/src/fpdftext/text_int.h
index ce52371..7f15be1 100644
--- a/core/src/fpdftext/text_int.h
+++ b/core/src/fpdftext/text_int.h
@@ -129,7 +129,7 @@
     SEGMENT_Array					m_Segment;
     CFX_RectArray					m_SelRects;
     LINEOBJ							m_LineObj;
-    FX_BOOL							m_TextlineDir;
+    int32_t							m_TextlineDir;
     CFX_FloatRect					m_CurlineRect;
 };
 class CPDF_TextPageFind: public IPDF_TextPageFind
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index 18bcc59..f05594e 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -25,7 +25,7 @@
     ~CWin32FontInfo();
     virtual void		Release();
     virtual	FX_BOOL		EnumFontList(CFX_FontMapper* pMapper);
-    virtual void*		MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, FX_BOOL& bExact);
+    virtual void*		MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* face, int& iExact);
     virtual void*		GetFont(const FX_CHAR* face)
     {
         return NULL;
@@ -285,7 +285,7 @@
         face = "MS PMincho";
     }
 }
-void* CWin32FontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, FX_BOOL& bExact)
+void* CWin32FontInfo::MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* cstr_face, int& iExact)
 {
     CFX_ByteString face = cstr_face;
     int iBaseFont;
@@ -294,7 +294,7 @@
             face = Base14Substs[iBaseFont].m_pWinName;
             weight = Base14Substs[iBaseFont].m_bBold ? FW_BOLD : FW_NORMAL;
             bItalic = Base14Substs[iBaseFont].m_bItalic;
-            bExact = TRUE;
+            iExact = TRUE;
             break;
         }
     if (charset == ANSI_CHARSET || charset == SYMBOL_CHARSET) {
@@ -594,7 +594,7 @@
 
     return TRUE;
 }
-BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect)
+FX_BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect)
 {
     return ::GetClipBox(m_hDC, (RECT*)pRect);
 }
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp
index d76d52e..d90215a 100644
--- a/core/src/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/src/fxge/win32/fx_win32_gdipext.cpp
@@ -821,7 +821,7 @@
     CallFunc(GdipSetPenMiterLimit)(pPen, pGraphState->m_MiterLimit);
     return pPen;
 }
-static BOOL IsSmallTriangle(PointF* points, const CFX_AffineMatrix* pMatrix, int& v1, int& v2)
+static FX_BOOL IsSmallTriangle(PointF* points, const CFX_AffineMatrix* pMatrix, int& v1, int& v2)
 {
     int pairs[] = {1, 2, 0, 2, 0, 1};
     for (int i = 0; i < 3; i ++) {
@@ -844,7 +844,7 @@
     }
     return FALSE;
 }
-BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
+FX_BOOL CGdiplusExt::DrawPath(HDC hDC, const CFX_PathData* pPathData,
                            const CFX_AffineMatrix* pObject2Device,
                            const CFX_GraphStateData* pGraphState,
                            FX_DWORD fill_argb,
diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h
index f7e9add..b8bc3d2 100644
--- a/fpdfsdk/include/pdfwindow/PWL_IconList.h
+++ b/fpdfsdk/include/pdfwindow/PWL_IconList.h
@@ -87,7 +87,7 @@
 	void								SelectItem(int32_t nItemIndex, FX_BOOL bSelect);
 	int32_t							FindItemIndex(const CPDF_Point& point);
 
-	FX_BOOL								m_nSelectIndex;
+	int32_t								m_nSelectIndex;
 	IPWL_IconList_Notify*				m_pNotify;
 	FX_BOOL								m_bEnableNotify;
 	FX_BOOL								m_bMouseDown;