1
0
forked from 0ad/0ad

wdbg: fix FOURCC usage (fixes exception locus reporting)

others: fix various minor warnings

This was SVN commit r3415.
This commit is contained in:
janwas 2006-01-23 08:02:08 +00:00
parent f06f0c8240
commit f8b9114b17
5 changed files with 15 additions and 7 deletions

View File

@ -452,8 +452,12 @@ struct XInfo
static bool isCppException(const EXCEPTION_RECORD* er)
{
#if MSC_VERSION
// note: representation of 'msc' isn't specified, so use FOURCC
if(er->ExceptionCode != FOURCC(0xe0, 'm','s','c'))
// notes:
// - value of multibyte character constants (e.g. 'msc') aren't
// specified by C++, so use FOURCC instead.
// - "MS C" compiler is the only interpretation of this magic value that
// makes sense, so it is apparently stored in big-endian format.
if(er->ExceptionCode != FOURCC_BE(0xe0, 'm','s','c'))
return false;
// exception info = (magic, &thrown_Cpp_object, &XInfo)

View File

@ -35,4 +35,4 @@ typedef unsigned long long uint64_t;
// <sys/types.h>
//
typedef long ssize_t;
typedef long ssize_t;

View File

@ -782,6 +782,11 @@ static void mouse_update()
// don't use DirectInput, because we want to respect the user's mouse
// sensitivity settings. Windows messages are laggy, so poll instead.
// window not created yet or already shut down. no sense reporting
// mouse position, and bail now to avoid ScreenToClient failing.
if(hWnd == INVALID_HANDLE_VALUE)
return;
POINT pt;
WARN_IF_FALSE(GetCursorPos(&pt));
WARN_IF_FALSE(ScreenToClient(hWnd, &pt));

View File

@ -25,7 +25,7 @@
// <unistd.h>
//
IMP(int, gethostname, (char*, int));
IMP(int, gethostname, (char*, int))
//

View File

@ -459,7 +459,7 @@ static LibError hrt_override_impl(HRTOverride ovr, HRTImpl impl)
{
if((ovr != HRT_DISABLE && ovr != HRT_FORCE && ovr != HRT_DEFAULT) ||
(impl != HRT_TSC && impl != HRT_QPC && impl != HRT_GTC && impl != HRT_NONE))
CHECK_ERR(ERR_INVALID_PARAM);
WARN_RETURN(ERR_INVALID_PARAM);
lock();
@ -533,8 +533,7 @@ static void calibrate_lk()
// average all samples in buffer
double freq_sum = std::accumulate(samples.begin(), samples.end(), 0.0);
const int num = (int)samples.size(); // divide-by-0 paranoia
hrt_cur_freq = (num == 0)? 0.0 : freq_sum / num;
hrt_cur_freq = freq_sum / (int)samples.size();
}
else
{