Skip to content

Commit 49b940c

Browse files
evan-charmworksbgoglin
authored andcommitted
windows: Fix type of hostname_size parameter
Avoids warning: passing argument 2 of 'GetComputerNameA' from incompatible pointer type [-Wincompatible-pointer-types] Signed-off-by: Evan Ramos <[email protected]>
1 parent d94bca7 commit 49b940c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

hwloc/topology-windows.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,11 @@ hwloc_look_windows(struct hwloc_backend *backend, struct hwloc_disc_status *dsta
989989
OSVERSIONINFOEX osvi;
990990
char versionstr[20];
991991
char hostname[122] = "";
992-
unsigned hostname_size = sizeof(hostname);
992+
#if !defined(__CYGWIN__)
993+
DWORD hostname_size = sizeof(hostname);
994+
#else
995+
size_t hostname_size = sizeof(hostname);
996+
#endif
993997
int has_efficiencyclass = 0;
994998
struct hwloc_win_efficiency_classes eclasses;
995999
char *env = getenv("HWLOC_WINDOWS_PROCESSOR_GROUP_OBJS");

utils/lstopo/lstopo-draw.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,11 @@ output_draw(struct lstopo_output *loutput)
17371737
unsigned maxtextwidth = 0, textwidth;
17381738
unsigned ndl = 0;
17391739
char hostname[122] = "";
1740-
unsigned long hostname_size = sizeof(hostname);
1740+
#if defined(HWLOC_WIN_SYS) && !defined(__CYGWIN__)
1741+
DWORD hostname_size = sizeof(hostname);
1742+
#else
1743+
size_t hostname_size = sizeof(hostname);
1744+
#endif
17411745
unsigned infocount = 0;
17421746

17431747
/* prepare legend lines and compute the width */

0 commit comments

Comments
 (0)