Author: janderwald Date: Thu Dec 7 11:54:16 2006 New Revision: 25078
URL: http://svn.reactos.org/svn/reactos?rev=25078&view=rev Log: - fix a few warnings - make it compilable with msvc and gcc4.1.1
Modified: trunk/reactos/base/services/dhcp/dhclient.c trunk/reactos/base/services/dhcp/dhcp.rbuild trunk/reactos/base/services/dhcp/include/rosdhcp.h trunk/reactos/base/services/dhcp/options.c trunk/reactos/base/services/dhcp/util.c
Modified: trunk/reactos/base/services/dhcp/dhclient.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/dhclient... ============================================================================== --- trunk/reactos/base/services/dhcp/dhclient.c (original) +++ trunk/reactos/base/services/dhcp/dhclient.c Thu Dec 7 11:54:16 2006 @@ -2044,7 +2044,7 @@ for (; dp < data + len; dp++) { if (!isascii(*dp) || !isprint(*dp)) { if (dp + 1 != data + len || *dp != 0) { - snprintf(op, opleft, "\%03o", *dp); + _snprintf(op, opleft, "\%03o", *dp); op += 4; opleft -= 4; }
Modified: trunk/reactos/base/services/dhcp/dhcp.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/dhcp.rbu... ============================================================================== --- trunk/reactos/base/services/dhcp/dhcp.rbuild (original) +++ trunk/reactos/base/services/dhcp/dhcp.rbuild Thu Dec 7 11:54:16 2006 @@ -1,4 +1,4 @@ -<module name="dhcp" type="win32gui" installbase="system32" installname="dhcp.exe" allowwarnings="true"> +<module name="dhcp" type="win32cui" installbase="system32" installname="dhcp.exe" allowwarnings="true"> <include base="dhcp">.</include> <include base="dhcp">include</include> <define name="__USE_W32API" />
Modified: trunk/reactos/base/services/dhcp/include/rosdhcp.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/include/... ============================================================================== --- trunk/reactos/base/services/dhcp/include/rosdhcp.h (original) +++ trunk/reactos/base/services/dhcp/include/rosdhcp.h Thu Dec 7 11:54:16 2006 @@ -9,6 +9,7 @@ #include <iphlpapi.h> #include <dhcpcsdk.h> #include <stdio.h> +#include <io.h> #include <setjmp.h> #include "stdint.h" #include "predec.h"
Modified: trunk/reactos/base/services/dhcp/options.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/options.... ============================================================================== --- trunk/reactos/base/services/dhcp/options.c (original) +++ trunk/reactos/base/services/dhcp/options.c Thu Dec 7 11:54:16 2006 @@ -566,7 +566,7 @@ !isprint(*dp)) { if (dp + 1 != data + len || *dp != 0) { - snprintf(op, opleft, + _snprintf(op, opleft, "\%03o", *dp); op += 4; opleft -= 4; @@ -602,7 +602,7 @@ dp += 4; break; case 'l': - opcount = snprintf(op, opleft, "%ld", + opcount = _snprintf(op, opleft, "%ld", (long)getLong(dp)); if (opcount >= opleft || opcount == -1) goto toobig; @@ -610,7 +610,7 @@ dp += 4; break; case 'L': - opcount = snprintf(op, opleft, "%ld", + opcount = _snprintf(op, opleft, "%ld", (unsigned long)getULong(dp)); if (opcount >= opleft || opcount == -1) goto toobig; @@ -618,7 +618,7 @@ dp += 4; break; case 's': - opcount = snprintf(op, opleft, "%d", + opcount = _snprintf(op, opleft, "%d", getShort(dp)); if (opcount >= opleft || opcount == -1) goto toobig; @@ -626,7 +626,7 @@ dp += 2; break; case 'S': - opcount = snprintf(op, opleft, "%d", + opcount = _snprintf(op, opleft, "%d", getUShort(dp)); if (opcount >= opleft || opcount == -1) goto toobig; @@ -634,20 +634,20 @@ dp += 2; break; case 'b': - opcount = snprintf(op, opleft, "%d", + opcount = _snprintf(op, opleft, "%d", *(char *)dp++); if (opcount >= opleft || opcount == -1) goto toobig; opleft -= opcount; break; case 'B': - opcount = snprintf(op, opleft, "%d", *dp++); + opcount = _snprintf(op, opleft, "%d", *dp++); if (opcount >= opleft || opcount == -1) goto toobig; opleft -= opcount; break; case 'x': - opcount = snprintf(op, opleft, "%x", *dp++); + opcount = _snprintf(op, opleft, "%x", *dp++); if (opcount >= opleft || opcount == -1) goto toobig; opleft -= opcount;
Modified: trunk/reactos/base/services/dhcp/util.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/dhcp/util.c?r... ============================================================================== --- trunk/reactos/base/services/dhcp/util.c (original) +++ trunk/reactos/base/services/dhcp/util.c Thu Dec 7 11:54:16 2006 @@ -100,6 +100,7 @@ /* What a strage dance */ struct client_config *config; char ComputerName [MAX_COMPUTERNAME_LENGTH + 1]; + LPSTR lpCompName; DWORD ComputerNameSize = sizeof ComputerName / sizeof ComputerName[0];
if ((ifi!= NULL) && (ifi->client->config != NULL)) @@ -113,12 +114,12 @@
GetComputerName(ComputerName, & ComputerNameSize); /* This never gets freed since it's only called once */ - LPSTR lpCompName = + lpCompName = HeapAlloc(GetProcessHeap(), 0, strlen(ComputerName) + 1); if (lpCompName !=NULL) { GetComputerName(lpCompName, & ComputerNameSize); /* Send our hostname, some dhcpds use this to update DNS */ - config->send_options[DHO_HOST_NAME].data = strlwr(lpCompName); + config->send_options[DHO_HOST_NAME].data = (u_int8_t*)strlwr(lpCompName); config->send_options[DHO_HOST_NAME].len = strlen(ComputerName); debug("Hostname: %s, length: %d", config->send_options[DHO_HOST_NAME].data,