diff OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp @ 4199:fbc49a65340a

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 16 Sep 2020 20:28:20 +0200
parents bf7b9edf6b81
children 6b58ceed959e
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp	Wed Sep 16 18:13:13 2020 +0200
+++ b/OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp	Wed Sep 16 20:28:20 2020 +0200
@@ -137,20 +137,17 @@
   const char* transferSyntax,
   T_ASC_SC_ROLE acceptedRole)
 {
-  OFCondition cond = EC_Normal;
   int n, i, k;
   DUL_PRESENTATIONCONTEXT *dpc;
   T_ASC_PresentationContext pc;
-  OFBool accepted = OFFalse;
-  OFBool abstractOK = OFFalse;
 
   n = ASC_countPresentationContexts(params);
   for (i = 0; i < n; i++)
   {
-    cond = ASC_getPresentationContext(params, i, &pc);
+    OFCondition cond = ASC_getPresentationContext(params, i, &pc);
     if (cond.bad()) return cond;
-    abstractOK = OFFalse;
-    accepted = OFFalse;
+    OFBool abstractOK = OFFalse;
+    OFBool accepted = OFFalse;
 
     if (dcmFindNameOfUID(pc.abstractSyntax) == NULL)
     {
@@ -178,7 +175,7 @@
       /* do not refuse if already accepted */
       dpc = findPresentationContextID(params->DULparams.acceptedPresentationContext,
                                       pc.presentationContextID);
-      if ((dpc == NULL) || ((dpc != NULL) && (dpc->result != ASC_P_ACCEPTANCE)))
+      if (dpc == NULL || dpc->result != ASC_P_ACCEPTANCE)
       {
 
         if (abstractOK) {