Fixed general failings with everything. Fixes #211.
My editor fixed some extra tabs in globals.
This commit is contained in:
parent
9701a7fb84
commit
f7c9230106
@ -12,24 +12,24 @@
|
|||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
// MSVC produces warning C4481 on the override keyword usage, so disable the warning altogether
|
// MSVC produces warning C4481 on the override keyword usage, so disable the warning altogether
|
||||||
#pragma warning(disable:4481)
|
#pragma warning(disable:4481)
|
||||||
|
|
||||||
// Disable some warnings that we don't care about:
|
// Disable some warnings that we don't care about:
|
||||||
#pragma warning(disable:4100)
|
#pragma warning(disable:4100)
|
||||||
|
|
||||||
#define OBSOLETE __declspec(deprecated)
|
#define OBSOLETE __declspec(deprecated)
|
||||||
|
|
||||||
// No alignment needed in MSVC
|
// No alignment needed in MSVC
|
||||||
#define ALIGN_8
|
#define ALIGN_8
|
||||||
#define ALIGN_16
|
#define ALIGN_16
|
||||||
|
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
|
|
||||||
// TODO: Can GCC explicitly mark classes as abstract (no instances can be created)?
|
// TODO: Can GCC explicitly mark classes as abstract (no instances can be created)?
|
||||||
#define abstract
|
#define abstract
|
||||||
|
|
||||||
// TODO: Can GCC mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class)
|
// TODO: Can GCC mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class)
|
||||||
#define override
|
#define override
|
||||||
|
|
||||||
#define OBSOLETE __attribute__((deprecated))
|
#define OBSOLETE __attribute__((deprecated))
|
||||||
|
|
||||||
#define ALIGN_8 __attribute__((aligned(8)))
|
#define ALIGN_8 __attribute__((aligned(8)))
|
||||||
@ -41,13 +41,13 @@
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler"
|
#error "You are using an unsupported compiler, you might need to #define some stuff here for your compiler"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Copy and uncomment this into another #elif section based on your compiler identification
|
// Copy and uncomment this into another #elif section based on your compiler identification
|
||||||
|
|
||||||
// Explicitly mark classes as abstract (no instances can be created)
|
// Explicitly mark classes as abstract (no instances can be created)
|
||||||
#define abstract
|
#define abstract
|
||||||
|
|
||||||
// Mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class)
|
// Mark virtual methods as overriding (forcing them to have a virtual function of the same signature in the base class)
|
||||||
#define override
|
#define override
|
||||||
|
|
||||||
@ -92,17 +92,17 @@ typedef unsigned short UInt16;
|
|||||||
// OS-dependent stuff:
|
// OS-dependent stuff:
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
#define _WIN32_WINNT 0x501 // We want to target WinXP and higher
|
#define _WIN32_WINNT 0x501 // We want to target WinXP and higher
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <Ws2tcpip.h> // IPv6 stuff
|
#include <Ws2tcpip.h> // IPv6 stuff
|
||||||
|
|
||||||
// Windows SDK defines min and max macros, messing up with our std::min and std::max usage
|
// Windows SDK defines min and max macros, messing up with our std::min and std::max usage
|
||||||
#undef min
|
#undef min
|
||||||
#undef max
|
#undef max
|
||||||
|
|
||||||
// Windows SDK defines GetFreeSpace as a constant, probably a Win16 API remnant
|
// Windows SDK defines GetFreeSpace as a constant, probably a Win16 API remnant
|
||||||
#ifdef GetFreeSpace
|
#ifdef GetFreeSpace
|
||||||
#undef GetFreeSpace
|
#undef GetFreeSpace
|
||||||
@ -161,6 +161,7 @@ typedef unsigned short UInt16;
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -404,8 +404,8 @@ AString cWebAdmin::GetHTMLEscapedString( const AString& a_Input )
|
|||||||
std::stringstream dst;
|
std::stringstream dst;
|
||||||
|
|
||||||
// Loop over input and substitute HTML characters for their alternatives.
|
// Loop over input and substitute HTML characters for their alternatives.
|
||||||
for (char workingCharacter : a_Input) {
|
for (int i = 0; i < a_Input.length(); i++) {
|
||||||
switch (workingCharacter)
|
switch ( a_Input[i] )
|
||||||
{
|
{
|
||||||
case '&':
|
case '&':
|
||||||
dst << "&";
|
dst << "&";
|
||||||
@ -423,7 +423,7 @@ AString cWebAdmin::GetHTMLEscapedString( const AString& a_Input )
|
|||||||
dst << ">";
|
dst << ">";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dst << workingCharacter;
|
dst << a_Input[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user