[libvirt PATCH] esx: Same order of arguments in definition and declaration

Rikard Falkeborn posted 1 patch 4 years, 2 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20200222232225.192648-1-rikard.falkeborn@gmail.com
src/esx/esx_vi.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[libvirt PATCH] esx: Same order of arguments in definition and declaration
Posted by Rikard Falkeborn 4 years, 2 months ago
The order of arguments were not the same in the definition and
declaration. All callers use the same order as the definition, so there
is no bug, but change the function declaration to match the
implementation to avoid confusion.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 src/esx/esx_vi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h
index 5c60fd58f4..b960c0900a 100644
--- a/src/esx/esx_vi.h
+++ b/src/esx/esx_vi.h
@@ -204,8 +204,8 @@ struct _esxVI_Context {
 
 int esxVI_Context_Alloc(esxVI_Context **ctx);
 void esxVI_Context_Free(esxVI_Context **ctx);
-int esxVI_Context_Connect(esxVI_Context *ctx, const char *ipAddress,
-                          const char *url, const char *username,
+int esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
+                          const char *ipAddress, const char *username,
                           const char *password, esxUtil_ParsedUri *parsedUri);
 int esxVI_Context_LookupManagedObjects(esxVI_Context *ctx);
 int esxVI_Context_LookupManagedObjectsByPath(esxVI_Context *ctx, const char *path);
-- 
2.25.1


Re: [libvirt PATCH] esx: Same order of arguments in definition and declaration
Posted by Ján Tomko 4 years, 2 months ago
On Sun, Feb 23, 2020 at 12:22:25AM +0100, Rikard Falkeborn wrote:
>The order of arguments were not the same in the definition and
>declaration. All callers use the same order as the definition, so there
>is no bug, but change the function declaration to match the
>implementation to avoid confusion.
>

Did you find it visually, or using cppcheck? :)

>Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
>---
> src/esx/esx_vi.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

and pushed. Congrats on your first patch!

Jano