소스 검색

Fix some cosmetic issues picked up by cppccheck

Some minor changes to the code as suggested by cppcheck. None
have any material effect.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 년 전
부모
커밋
1ed48325d6
6개의 변경된 파일7개의 추가작업 그리고 13개의 파일을 삭제
  1. 0 2
      system/jlib/jcomp.cpp
  2. 0 8
      system/jlib/jptree.cpp
  3. 1 1
      system/jlib/jregexp.cpp
  4. 4 0
      system/jlib/jsocket.cpp
  5. 1 1
      system/jlib/junicode.cpp
  6. 1 1
      system/jlib/jutil.cpp

+ 0 - 2
system/jlib/jcomp.cpp

@@ -89,8 +89,6 @@ static const char * CC_OPTION_RELEASE[] = { "/Zm500 /EHsc /GR /Oi /Ob1 /GF /nolo
 static const char * DLL_LINK_OPTION_RELEASE[] = { "/BASE:" BASE_ADDRESS " /NOLOGO /LARGEADDRESSAWARE /INCREMENTAL:NO", "-shared -L. -fPIC -pipe -O0" };
 static const char * EXE_LINK_OPTION_RELEASE[] = { "/BASE:" BASE_ADDRESS " /NOLOGO /LARGEADDRESSAWARE /INCREMENTAL:NO", "-L. -Wl,-E -fPIC -pipe -O0" };
 
-static const char * CC_COMPILE_ONLY[] = { " /c", " <TBD> " };
-
 static const char * LINK_TARGET[] = { " /out:", " -o " };
 static const char * DEFAULT_CC_LOCATION[] = { ".", "." };
 

+ 0 - 8
system/jlib/jptree.cpp

@@ -5147,14 +5147,6 @@ IPropertyTree *createPTreeFromXMLString(unsigned len, const char *xml, byte flag
 //////////////////////////
 /////////////////////////
 
-    
-static int compareStrings(CInterface **ll, CInterface **rr)
-{
-    StringAttrItem *l = (StringAttrItem *) *ll;
-    StringAttrItem *r = (StringAttrItem *) *rr;
-    return stricmp(l->text, r->text);
-};
-
 static void _toXML(const IPropertyTree *tree, IIOStream &out, unsigned indent, byte flags)
 {
     const char *name = tree->queryName();

+ 1 - 1
system/jlib/jregexp.cpp

@@ -1536,7 +1536,7 @@ void addActionList(StringMatcher & matcher, const char * text, unsigned action,
                     }
                     break;
                 default:
-                    ;//otherwise \ just quotes the character e.g. \,
+                    break; //otherwise \ just quotes the character e.g. \,
                 }
             }
             str.append(next);

+ 4 - 0
system/jlib/jsocket.cpp

@@ -3296,6 +3296,7 @@ bool SocketListParser::next(StringAttr & ip, unsigned & port)
                 goto done;
             case '.':
                 ++count;
+                break;
             }
         }
 done:
@@ -4232,6 +4233,7 @@ bool catchReadBuffer(ISocket * socket, MemoryBuffer & buffer)
             break;
         default:
             EXCLOG(e,"catchReadBuffer");
+            break;
         }
         e->Release();
     }
@@ -4253,6 +4255,7 @@ bool catchReadBuffer(ISocket * socket, MemoryBuffer & buffer, unsigned timeoutms
             break;
         default:
             EXCLOG(e,"catchReadBuffer");
+            break;
         }
         e->Release();
     }
@@ -4512,6 +4515,7 @@ public:
                     break;
                 default:
                     state = Scancelled;
+                    break;
                 }
             }
             catch (IException *e) {

+ 1 - 1
system/jlib/junicode.cpp

@@ -605,7 +605,7 @@ void addUtfActionList(StringMatcher & matcher, const char * text, unsigned actio
                     }
                     break;
                 default:
-                    ;//otherwise \ just quotes the character e.g. \,
+                    break; //otherwise \ just quotes the character e.g. \,
                 }
             }
             str.append(next);

+ 1 - 1
system/jlib/jutil.cpp

@@ -2111,7 +2111,7 @@ jlib_decl StringBuffer& encodeUrlUseridPassword(StringBuffer& out, const char* i
           case '&': out.append("%26"); break;
           case ' ': out.append("%20"); break;
         */
-        default: out.append(*p);
+        default: out.append(*p); break;
         }
     }
     return out;