diff options
author | Koundinya Veluri <kouvel@users.noreply.github.com> | 2015-09-28 14:54:46 -0700 |
---|---|---|
committer | Koundinya Veluri <kouvel@users.noreply.github.com> | 2015-09-28 14:54:46 -0700 |
commit | 99458af30ac18c5b60afa7a68e241ed70b880eca (patch) | |
tree | 46a1ffcb57e0c29731d5db09d441aaef8c7ce1a4 | |
parent | 795786f0ac0e5ea82f288dfeb5b673845e1ef075 (diff) | |
parent | bc99b33602795e4db64bfdc924ce8ef1b6f5cc78 (diff) | |
download | coreclr-99458af30ac18c5b60afa7a68e241ed70b880eca.tar.gz coreclr-99458af30ac18c5b60afa7a68e241ed70b880eca.tar.bz2 coreclr-99458af30ac18c5b60afa7a68e241ed70b880eca.zip |
Merge pull request #1628 from kouvel/CppCheckFixes
Fix a few issues reported by cppcheck
-rw-r--r-- | src/pal/src/misc/perftrace.cpp | 2 | ||||
-rw-r--r-- | src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.c | 6 | ||||
-rw-r--r-- | src/utilcode/utilmessagebox.cpp | 3 | ||||
-rw-r--r-- | src/vm/callingconvention.h | 1 |
4 files changed, 8 insertions, 4 deletions
diff --git a/src/pal/src/misc/perftrace.cpp b/src/pal/src/misc/perftrace.cpp index d2bfd797cf..d4223a629a 100644 --- a/src/pal/src/misc/perftrace.cpp +++ b/src/pal/src/misc/perftrace.cpp @@ -785,7 +785,7 @@ PERFReadSetting( ) //more code is required to deal with corrupted input file. BOOL ret; unsigned int index; - char line[256 /* PAL_PERF_MAX_INPUT */]; // just use it. can define a new one like MAX_LINE=1024; + char line[PAL_PERF_MAX_INPUT]; char * ptr; char function_name[PAL_PERF_MAX_FUNCTION_NAME]; //no function can be longer than 127 bytes. diff --git a/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.c b/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.c index 896934065b..7c825375eb 100644 --- a/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.c +++ b/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.c @@ -317,7 +317,7 @@ void starttests(int threadID) ULONGLONG startTime = 0; ULONGLONG endTime = 0; - LONG volatile * Destination; + LONG volatile Destination; LONG Exchange; LONG Comperand; LONG result; @@ -336,10 +336,10 @@ void starttests(int threadID) for (i=0;i<REPEAT_COUNT;i++) { - *Destination = (LONG volatile) threadID; + Destination = (LONG volatile) threadID; Exchange = (LONG) i; Comperand = (LONG) threadID; - result = InterlockedCompareExchange( Destination, Exchange, Comperand); + result = InterlockedCompareExchange(&Destination, Exchange, Comperand); if( i != result ) { diff --git a/src/utilcode/utilmessagebox.cpp b/src/utilcode/utilmessagebox.cpp index c196ddd68a..8b936daea8 100644 --- a/src/utilcode/utilmessagebox.cpp +++ b/src/utilcode/utilmessagebox.cpp @@ -247,6 +247,9 @@ int MessageBoxImpl( if (hr == S_OK) { result = nButtonPressed; } + else { + result = IDOK; + } _ASSERTE(result == IDOK || result == IDRETRY || result == IDIGNORE); } diff --git a/src/vm/callingconvention.h b/src/vm/callingconvention.h index b1ed3853c6..244a3df878 100644 --- a/src/vm/callingconvention.h +++ b/src/vm/callingconvention.h @@ -1282,6 +1282,7 @@ void ArgIteratorTemplate<ARGITERATOR_BASE>::ForceSigWalk() #ifdef FEATURE_INTERPRETER BYTE callconv = CallConv(); switch (callconv) + { case IMAGE_CEE_CS_CALLCONV_C: case IMAGE_CEE_CS_CALLCONV_STDCALL: numRegistersUsed = NUM_ARGUMENT_REGISTERS; |