1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 12:41:29 +00:00

Fix all the compiler warnings when building with Visual C++ 2008.

This commit is contained in:
david
2009-04-29 17:56:30 +00:00
parent 3a06a43a24
commit b4243e23f2
6 changed files with 6 additions and 11 deletions

View File

@@ -118,8 +118,8 @@
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
# define __flexarr [] # define __flexarr []
# elif defined(_WIN32) # elif defined(_WIN32)
/* MS VC++ */ /* MS VC++ -- using [] works but gives a "nonstandard extension" warning */
# define __flexarr [] # define __flexarr [1]
# else # else
/* Some other non-C99 compiler. Approximate with [1]. */ /* Some other non-C99 compiler. Approximate with [1]. */
# define __flexarr [1] # define __flexarr [1]

View File

@@ -50,7 +50,6 @@
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4" DebugInformationFormat="4"
/> />
<Tool <Tool
@@ -113,7 +112,6 @@
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
/> />
<Tool <Tool

View File

@@ -53,7 +53,6 @@
RuntimeTypeInfo="false" RuntimeTypeInfo="false"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4" DebugInformationFormat="4"
CallingConvention="0" CallingConvention="0"
CompileAs="1" CompileAs="1"
@@ -125,7 +124,6 @@
RuntimeTypeInfo="false" RuntimeTypeInfo="false"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="0" DebugInformationFormat="0"
CompileAs="1" CompileAs="1"
/> />

View File

@@ -47,7 +47,6 @@
RuntimeLibrary="1" RuntimeLibrary="1"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4" DebugInformationFormat="4"
CompileAs="1" CompileAs="1"
/> />
@@ -109,7 +108,6 @@
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3" DebugInformationFormat="3"
CompileAs="1" CompileAs="1"
/> />

View File

@@ -82,7 +82,7 @@
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/nmap.pdb" ProgramDatabaseFile=".\Debug/nmap.pdb"
SubSystem="1" SubSystem="1"
OptimizeForWindows98="1" OptimizeForWindows98="0"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
TargetMachine="1" TargetMachine="1"

View File

@@ -1322,15 +1322,16 @@ static void write_xml_initial_hostinfo(Target *currenths,
/* Convert a number to a string, keeping the given number of significant digits. /* Convert a number to a string, keeping the given number of significant digits.
The result is returned in a static buffer. */ The result is returned in a static buffer. */
static char *num_to_string_sigdigits(double d, unsigned int digits) { static char *num_to_string_sigdigits(double d, int digits) {
static char buf[32]; static char buf[32];
int shift; int shift;
int n; int n;
assert(digits >= 0);
if (d == 0.0) { if (d == 0.0) {
shift = -digits; shift = -digits;
} else { } else {
shift = floor(log10(fabs(d))) - digits + 1; shift = (int) floor(log10(fabs(d))) - digits + 1;
d = floor(d / pow(10.0, shift) + 0.5); d = floor(d / pow(10.0, shift) + 0.5);
d = d * pow(10.0, shift); d = d * pow(10.0, shift);
} }