OSDN Git Service

Reduce Level 4 Build Warnings (4)
authorGreyMerlin <GreyMerlin@gmail.com>
Thu, 26 Jul 2018 21:18:45 +0000 (14:18 -0700)
committerGreyMerlin <GreyMerlin@gmail.com>
Thu, 26 Jul 2018 21:18:45 +0000 (14:18 -0700)
* declare an `enum` as unsigned or long, especially for bit masking
values.

Externals/crystaledit/editlib/ccrystaltextbuffer.h
Externals/crystaledit/editlib/ccrystaltextview.h
Src/DiffItem.h
Src/MergeLineFlags.h
Src/markdown.h

index 4337c33..d85ee88 100644 (file)
@@ -43,7 +43,7 @@
 #include <afxtempl.h>
 #endif
 
-enum LINEFLAGS
+enum LINEFLAGS: unsigned long
 {
   LF_BOOKMARK_FIRST = 0x00000001UL,
   LF_EXECUTION = 0x00010000UL,
@@ -129,7 +129,7 @@ protected :
     int FindLineWithFlag (DWORD dwFlag) const;
 
 protected :
-    enum
+    enum : unsigned
     {
       UNDO_INSERT = 0x0001U,
       UNDO_BEGINGROUP = 0x0100U
index e78f06a..048f06f 100644 (file)
@@ -52,7 +52,7 @@ class CCrystalTextMarkers;
 // CCrystalTextView class declaration
 
 //  CCrystalTextView::FindText() flags
-enum
+enum : unsigned
 {
   FIND_MATCH_CASE = 0x0001U,
   FIND_WHOLE_WORD = 0x0002U,
@@ -64,7 +64,7 @@ enum
 };
 
 //  CCrystalTextView::UpdateView() flags
-enum
+enum : unsigned
 {
   UPDATE_HORZRANGE = 0x0001U,  //  update horz scrollbar
   UPDATE_VERTRANGE = 0x0002U, //  update vert scrollbar
index 408830c..54037f9 100644 (file)
@@ -43,7 +43,7 @@ struct DIFFCODE
        /**
         * @brief values for DIFFITEM.diffcode
         */
-       enum
+       enum : unsigned long
        {
                // We use extra bits so that no valid values are 0
                // and each set of flags is in a different hex digit
index a7b25cc..f7b9ca4 100644 (file)
@@ -12,7 +12,7 @@
  information; here are the list of WinMerge flags.
  So, these constants are used with the SetLineFlag(2) calls.
 */
-enum MERGE_LINEFLAGS
+enum MERGE_LINEFLAGS : DWORD
 {
        LF_DIFF = 0x00200000UL,
 //     LF_GHOST = 0x00400000UL, 
index 93fbb22..475dbe6 100644 (file)
@@ -21,7 +21,7 @@ public:
        const char *lower;      // beginning of enclosed text (valid after Move)
        const char *upper;      // end of enclosed text (initially beginning of file)
        const char *ahead;      // last char of file
-       enum
+       enum : unsigned
        {
                IgnoreCase = 0x10,
                HtmlUTags = 0x20,                       // check for unbalanced tags
@@ -54,7 +54,7 @@ public:
        size_t cbImage;
        void *pImage;
        void *pCopy;
-       enum
+       enum : unsigned
        {
                Octets = 0x02 + 0x04,
                Mapping = 0x40