Skip to content

Commit

Permalink
windows: Fix type of hostname_size parameter
Browse files Browse the repository at this point in the history
Avoids warning: passing argument 2 of 'GetComputerNameA' from incompatible
pointer type [-Wincompatible-pointer-types]

Signed-off-by: Evan Ramos <evan@hpccharm.com>
  • Loading branch information
evan-charmworks authored and bgoglin committed Jun 25, 2023
1 parent d94bca7 commit 49b940c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion hwloc/topology-windows.c
Expand Up @@ -989,7 +989,11 @@ hwloc_look_windows(struct hwloc_backend *backend, struct hwloc_disc_status *dsta
OSVERSIONINFOEX osvi;
char versionstr[20];
char hostname[122] = "";
unsigned hostname_size = sizeof(hostname);
#if !defined(__CYGWIN__)
DWORD hostname_size = sizeof(hostname);
#else
size_t hostname_size = sizeof(hostname);
#endif
int has_efficiencyclass = 0;
struct hwloc_win_efficiency_classes eclasses;
char *env = getenv("HWLOC_WINDOWS_PROCESSOR_GROUP_OBJS");
Expand Down
6 changes: 5 additions & 1 deletion utils/lstopo/lstopo-draw.c
Expand Up @@ -1737,7 +1737,11 @@ output_draw(struct lstopo_output *loutput)
unsigned maxtextwidth = 0, textwidth;
unsigned ndl = 0;
char hostname[122] = "";
unsigned long hostname_size = sizeof(hostname);
#if defined(HWLOC_WIN_SYS) && !defined(__CYGWIN__)
DWORD hostname_size = sizeof(hostname);
#else
size_t hostname_size = sizeof(hostname);
#endif
unsigned infocount = 0;

/* prepare legend lines and compute the width */
Expand Down

0 comments on commit 49b940c

Please sign in to comment.