From: Frank Lichtenheld <[email protected]>

Trailing comments lead to some ugliness due
to clang-format formatting. Make nicer.

Change-Id: I39b3b31983a2d6348fd66266448f8d13e53a422c
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Razvan Cojocaru <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1959
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1959
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Razvan Cojocaru <[email protected]>

        
diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c
index 25fa1e4..e510e4d 100644
--- a/src/openvpnmsica/openvpnmsica.c
+++ b/src/openvpnmsica/openvpnmsica.c
@@ -185,9 +185,9 @@
         free(pAdapterAdresses);
         if (ulResult != ERROR_BUFFER_OVERFLOW)
         {
-            SetLastError(
-                ulResult); /* MSDN does not mention GetAdaptersAddresses() to 
set GetLastError().
-                              But we do have an error code. Set last error 
manually. */
+            /* MSDN does not mention GetAdaptersAddresses() to set 
GetLastError().
+             * But we do have an error code. Set last error manually. */
+            SetLastError(ulResult);
             msg(M_NONFATAL | M_ERRNO, "%s: GetAdaptersAddresses() failed", 
__FUNCTION__);
             uiResult = ulResult;
             goto cleanup_pAdapterList;
@@ -290,8 +290,9 @@
     uiResult = MsiSetProperty(hInstall, szActiveAdaptersPropertyName, 
szAdaptersActive);
     if (uiResult != ERROR_SUCCESS)
     {
-        SetLastError(uiResult); /* MSDN does not mention MsiSetProperty() to 
set GetLastError(). But
-                                   we do have an error code. Set last error 
manually. */
+        /* MSDN does not mention MsiSetProperty() to set GetLastError(). But
+         * we do have an error code. Set last error manually. */
+        SetLastError(uiResult);
         msg(M_NONFATAL | M_ERRNO, "%s: MsiSetProperty(\"%s\") failed", 
__FUNCTION__,
             szActiveAdaptersPropertyName);
         goto cleanup_szAdaptersActive;
@@ -386,8 +387,9 @@
     uiResult = MsiRecordSetString(hRecord, 0, L"\"[#bin.openvpn_gui.exe]\"");
     if (uiResult != ERROR_SUCCESS)
     {
-        SetLastError(uiResult); /* MSDN does not mention MsiRecordSetString() 
to set GetLastError().
-                                   But we do have an error code. Set last 
error manually. */
+        /* MSDN does not mention MsiRecordSetString() to set GetLastError().
+         * But we do have an error code. Set last error manually. */
+        SetLastError(uiResult);
         msg(M_NONFATAL | M_ERRNO, "%s: MsiRecordSetString failed", 
__FUNCTION__);
         goto cleanup_MsiCreateRecord;
     }
@@ -412,16 +414,17 @@
     }
     if (uiResult != ERROR_SUCCESS)
     {
-        SetLastError(uiResult); /* MSDN does not mention MsiFormatRecord() to 
set GetLastError().
-                                   But we do have an error code. Set last 
error manually. */
+        /* MSDN does not mention MsiFormatRecord() to set GetLastError().
+         * But we do have an error code. Set last error manually. */
+        SetLastError(uiResult);
         msg(M_NONFATAL | M_ERRNO, "%s: MsiFormatRecord failed", __FUNCTION__);
         goto cleanup_malloc_szPath;
     }
 
     /* Launch the OpenVPN GUI. */
     SHELLEXECUTEINFO sei = { .cbSize = sizeof(SHELLEXECUTEINFO),
-                             .fMask =
-                                 SEE_MASK_FLAG_NO_UI, /* Don't show error UI, 
we'll display it. */
+                             /* Don't show error UI, we'll display it. */
+                             .fMask = SEE_MASK_FLAG_NO_UI,
                              .lpFile = szPath,
                              .nShow = SW_SHOWNORMAL };
     if (!ShellExecuteEx(&sei))
@@ -528,7 +531,8 @@
                     break;
                 }
             }
-            break; /* Adapter names are unique. There should be no other 
adapter with this name. */
+            /* Adapter names are unique. There should be no other adapter with 
this name. */
+            break;
         }
     }
 
@@ -614,7 +618,8 @@
             }
 
             *iTicks += MSICA_ADAPTER_TICK_SIZE;
-            break; /* Adapter names are unique. There should be no other 
adapter with this name. */
+            /* Adapter names are unique. There should be no other adapter with 
this name. */
+            break;
         }
     }
 
@@ -678,9 +683,9 @@
     uiResult = MsiDatabaseOpenView(hDatabase, szQuery, &hViewST);
     if (uiResult != ERROR_SUCCESS)
     {
-        SetLastError(
-            uiResult); /* MSDN does not mention MsiDatabaseOpenView() to set 
GetLastError(). But we
-                          do have an error code. Set last error manually. */
+        /* MSDN does not mention MsiDatabaseOpenView() to set GetLastError(). 
But we
+         * do have an error code. Set last error manually. */
+        SetLastError(uiResult);
         msg(M_NONFATAL | M_ERRNO, "%s: MsiDatabaseOpenView(\"%ls\") failed", 
__FUNCTION__, szQuery);
         goto cleanup_hDatabase;
     }
@@ -689,8 +694,9 @@
     uiResult = MsiViewExecute(hViewST, 0);
     if (uiResult != ERROR_SUCCESS)
     {
-        SetLastError(uiResult); /* MSDN does not mention MsiViewExecute() to 
set GetLastError(). But
-                                   we do have an error code. Set last error 
manually. */
+        /* MSDN does not mention MsiViewExecute() to set GetLastError(). But
+         * we do have an error code. Set last error manually. */
+        SetLastError(uiResult);
         msg(M_NONFATAL | M_ERRNO, "%s: MsiViewExecute(\"%ls\") failed", 
__FUNCTION__, szQuery);
         goto cleanup_hViewST;
     }
@@ -715,8 +721,9 @@
         }
         else if (uiResult != ERROR_SUCCESS)
         {
-            SetLastError(uiResult); /* MSDN does not mention MsiViewFetch() to 
set GetLastError().
-                                       But we do have an error code. Set last 
error manually. */
+            /* MSDN does not mention MsiViewFetch() to set GetLastError().
+             * But we do have an error code. Set last error manually. */
+            SetLastError(uiResult);
             msg(M_NONFATAL | M_ERRNO, "%s: MsiViewFetch failed", __FUNCTION__);
             goto cleanup_hRecordProg;
         }
@@ -735,9 +742,10 @@
             uiResult = MsiGetComponentState(hInstall, szValue, &iInstalled, 
&iAction);
             if (uiResult != ERROR_SUCCESS)
             {
-                SetLastError(uiResult); /* MSDN does not mention 
MsiGetComponentState() to set
-                                           GetLastError(). But we do have an 
error code. Set last
-                                           error manually. */
+                /* MSDN does not mention MsiGetComponentState() to set
+                 * GetLastError(). But we do have an error code. Set last
+                 * error manually. */
+                SetLastError(uiResult);
                 msg(M_NONFATAL | M_ERRNO, "%s: MsiGetComponentState(\"%ls\") 
failed", __FUNCTION__,
                     szValue);
                 free(szValue);


_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to