From b5852623a3326debfd509da4735f3ac8462e0b87 Mon Sep 17 00:00:00 2001 From: malaterre Date: Thu, 6 Jan 2005 19:39:24 +0000 Subject: [PATCH] COMP: Some minor fix on Win32 --- src/gdcmUtil.cxx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 0bde99df..ad20827e 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmUtil.cxx,v $ Language: C++ - Date: $Date: 2005/01/06 19:20:23 $ - Version: $Revision: 1.75 $ + Date: $Date: 2005/01/06 19:39:24 $ + Version: $Revision: 1.76 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -312,7 +312,6 @@ bool Util::IsCurrentProcessorBigEndian() #include #include #include -#include #ifdef _WIN32 #include @@ -365,7 +364,7 @@ long GetMacAddrSys ( u_char *addr) WSADATA WinsockData; if (WSAStartup(MAKEWORD(2, 0), &WinsockData) != 0) { fprintf(stderr, "This program requires Winsock 2.x!\n"); - return; + return -1; } HINSTANCE m_hInst; @@ -414,7 +413,7 @@ long GetMacAddrSys ( u_char *addr) m_hInst = LoadLibrary("inetmib1.dll"); if (m_hInst < (HINSTANCE) HINSTANCE_ERROR) { m_hInst = NULL; - return; + return -1; } m_Init = (pSnmpExtensionInit) GetProcAddress(m_hInst, "SnmpExtensionInit"); @@ -440,8 +439,8 @@ long GetMacAddrSys ( u_char *addr) ret = m_Query(ASN_RFC1157_GETNEXTREQUEST, &varBindList, &errorStatus, &errorIndex); -// printf("# of adapters in this system : %i\n", -// varBind[0].value.asnValue.number); varBindList.len = 2; + printf("# of adapters in this system : %i\n", + varBind[0].value.asnValue.number); varBindList.len = 2; /* Copy in the OID of ifType, the type of interface */ SNMP_oidcpy(&varBind[0].name, &MIB_ifEntryType); @@ -465,7 +464,7 @@ long GetMacAddrSys ( u_char *addr) MIB_ifEntryType.idLength); if (!ret) { j++; dtmp = varBind[0].value.asnValue.number; - //printf("Interface #%i type : %i\n", j, dtmp); + printf("Interface #%i type : %i\n", j, dtmp); /* Type 6 describes ethernet interfaces */ if (dtmp == 6) { @@ -489,7 +488,7 @@ long GetMacAddrSys ( u_char *addr) 0x00)) { /* Ignore all dial-up networking adapters */ - //printf("Interface #%i is a DUN adapter\n", j); + printf("Interface #%i is a DUN adapter\n", j); continue; } if ( @@ -508,17 +507,17 @@ long GetMacAddrSys ( u_char *addr) /* Ignore NULL addresses returned by other network interfaces */ - //printf("Interface #%i is a NULL address\n", j); + printf("Interface #%i is a NULL address\n", j); continue; } - sprintf(addr, "%02x%02x%02x%02x%02x%02x", + sprintf((char*)addr, "%02x%02x%02x%02x%02x%02x", varBind[1].value.asnValue.address.stream[0], varBind[1].value.asnValue.address.stream[1], varBind[1].value.asnValue.address.stream[2], varBind[1].value.asnValue.address.stream[3], varBind[1].value.asnValue.address.stream[4], varBind[1].value.asnValue.address.stream[5]); - //printf("MAC Address of interface #%i: %s\n", j, TempEthernet); + printf("MAC Address of interface #%i: %s\n", j, TempEthernet); } } } -- 2.48.1