- finally managed to get rid of the DWORD type.

This one was particularly nasty because Windows also defines a DWORD, but in Windows it is an unsigned long, not an unsigned int so changing types caused type conflicts and not all could be removed.
Those referring to the Windows type have to be kept, fortunately they are mostly in the Win32 directory, with a handful of exceptions elsewhere.
This commit is contained in:
Christoph Oelckers 2017-03-10 19:46:22 +01:00
parent 2b0e9650bb
commit fec958cc0a
54 changed files with 66 additions and 120 deletions

View file

@ -3,15 +3,6 @@
#include <stdint.h> #include <stdint.h>
// windef.h, included by windows.h, has its own incompatible definition
// of DWORD as a long. In files that mix Doom and Windows code, you
// must define USE_WINDOWS_DWORD before including doomtype.h so that
// you are aware that those files have a different DWORD than the rest
// of the source.
#ifndef USE_WINDOWS_DWORD
typedef uint32_t DWORD;
#endif
typedef uint32_t BITFIELD; typedef uint32_t BITFIELD;
typedef int INTBOOL; typedef int INTBOOL;

View file

@ -48,7 +48,7 @@
#include "hu_stuff.h" #include "hu_stuff.h"
#include "i_system.h" #include "i_system.h"
#include "i_video.h" #include "i_video.h"
#include "i_input.h" #include "g_input.h"
#include "m_swap.h" #include "m_swap.h"
#include "v_palette.h" #include "v_palette.h"
#include "v_video.h" #include "v_video.h"

View file

@ -27,7 +27,7 @@
#include "v_video.h" #include "v_video.h"
#include "gi.h" #include "gi.h"
#include "d_gui.h" #include "d_gui.h"
#include "i_input.h" #include "g_input.h"
#include "templates.h" #include "templates.h"
#include "d_net.h" #include "d_net.h"
#include "d_event.h" #include "d_event.h"

View file

@ -33,9 +33,7 @@
** **
*/ */
#ifdef _WIN32 // This also pulls in windows.h
#define USE_WINDOWS_DWORD
#endif
#include "LzmaDec.h" #include "LzmaDec.h"
#include "files.h" #include "files.h"

View file

@ -45,7 +45,6 @@
#include "m_random.h" #include "m_random.h"
#include "m_crc32.h" #include "m_crc32.h"
#include "i_system.h" #include "i_system.h"
#include "i_input.h"
#include "p_saveg.h" #include "p_saveg.h"
#include "p_tick.h" #include "p_tick.h"
#include "d_main.h" #include "d_main.h"

9
src/g_input.h Normal file
View file

@ -0,0 +1,9 @@
#pragma once
// These were in i_input.h, which differed between platforms and on Windows caused problems with its
// inclusion of system specific data, so it has been separated into this platform independent file.
void I_PutInClipboard (const char *str);
FString I_GetFromClipboard (bool use_primary_selection);
void I_SetMouseCapture();
void I_ReleaseMouseCapture();

View file

@ -52,7 +52,6 @@
#include "templates.h" #include "templates.h"
#include "i_system.h" #include "i_system.h"
#include "i_video.h" #include "i_video.h"
#include "i_input.h"
#include "v_pfx.h" #include "v_pfx.h"
#include "stats.h" #include "stats.h"
#include "doomerrors.h" #include "doomerrors.h"

View file

@ -48,7 +48,6 @@
#include "templates.h" #include "templates.h"
#include "i_system.h" #include "i_system.h"
#include "i_video.h" #include "i_video.h"
#include "i_input.h"
#include "v_pfx.h" #include "v_pfx.h"
#include "stats.h" #include "stats.h"
#include "doomerrors.h" #include "doomerrors.h"

View file

@ -39,7 +39,6 @@
#include <windows.h> #include <windows.h>
#include <intrin.h> #include <intrin.h>
#define USE_WINDOWS_DWORD
#elif defined __APPLE__ #elif defined __APPLE__
#include <sys/sysctl.h> #include <sys/sysctl.h>
#endif #endif

View file

@ -36,7 +36,6 @@
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#define USE_WINDOWS_DWORD
#else #else
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif

View file

@ -37,7 +37,6 @@
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
# include <winsock.h> # include <winsock.h>
#define USE_WINDOWS_DWORD
#else #else
# include <sys/socket.h> # include <sys/socket.h>
# include <netinet/in.h> # include <netinet/in.h>

View file

@ -49,7 +49,7 @@
#include "hu_stuff.h" #include "hu_stuff.h"
#include "gi.h" #include "gi.h"
#include "v_palette.h" #include "v_palette.h"
#include "i_input.h" #include "g_input.h"
#include "gameconfigfile.h" #include "gameconfigfile.h"
#include "gstrings.h" #include "gstrings.h"
#include "r_utility.h" #include "r_utility.h"

View file

@ -34,7 +34,7 @@ static FRandom pr_opl;
typedef uintptr_t Bitu; typedef uintptr_t Bitu;
typedef intptr_t Bits; typedef intptr_t Bits;
typedef DWORD Bit32u; typedef uint32_t Bit32u;
typedef int32_t Bit32s; typedef int32_t Bit32s;
typedef uint16_t Bit16u; typedef uint16_t Bit16u;
typedef int16_t Bit16s; typedef int16_t Bit16s;

View file

@ -200,11 +200,11 @@ public:
if (File != NULL) if (File != NULL)
{ {
long where_am_i = ftell(File); long where_am_i = ftell(File);
DWORD len[2]; uint32_t len[2];
fseek(File, 12, SEEK_SET); fseek(File, 12, SEEK_SET);
len[0] = LittleLong(CurIntTime); len[0] = LittleLong(CurIntTime);
len[1] = LittleLong(DWORD(where_am_i - 24)); len[1] = LittleLong(uint32_t(where_am_i - 24));
fwrite(len, 4, 2, File); fwrite(len, 4, 2, File);
fclose(File); fclose(File);
} }

View file

@ -34,7 +34,7 @@
typedef uintptr_t Bitu; typedef uintptr_t Bitu;
typedef intptr_t Bits; typedef intptr_t Bits;
typedef DWORD Bit32u; typedef uint32_t Bit32u;
typedef int32_t Bit32s; typedef int32_t Bit32s;
typedef uint16_t Bit16u; typedef uint16_t Bit16u;
typedef int16_t Bit16s; typedef int16_t Bit16s;

View file

@ -1,10 +0,0 @@
#ifndef __I_INPUT_H__
#define __I_INPUT_H__
void I_PutInClipboard (const char *str);
FString I_GetFromClipboard (bool use_primary_selection);
void I_SetMouseCapture();
void I_ReleaseMouseCapture();
#endif

View file

@ -32,10 +32,8 @@
** **
** **
*/ */
#ifdef _WIN32
#define USE_WINDOWS_DWORD
#endif
// Note that 7z made the unwise decision to include windows.h :(
#include "7z.h" #include "7z.h"
#include "7zCrc.h" #include "7zCrc.h"

View file

@ -39,7 +39,6 @@
#include <windows.h> #include <windows.h>
#include <mmsystem.h> #include <mmsystem.h>
extern HWND Window; extern HWND Window;
#define USE_WINDOWS_DWORD
#else #else
#define FALSE 0 #define FALSE 0
#define TRUE 1 #define TRUE 1

View file

@ -71,7 +71,7 @@ public:
virtual MIDIDevice* CreateMIDIDevice() const override; virtual MIDIDevice* CreateMIDIDevice() const override;
private: private:
DWORD ActiveFMODVersion; uint32_t ActiveFMODVersion;
int SFXPaused; int SFXPaused;
bool InitSuccess; bool InitSuccess;
bool DSPLocked; bool DSPLocked;

View file

@ -1,15 +1,11 @@
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define USE_WINDOWS_DWORD
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0400 #if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0400
#undef _WIN32_WINNT #undef _WIN32_WINNT
#endif #endif
#ifndef _WIN32_WINNT #ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400 #define _WIN32_WINNT 0x0400
#endif #endif
#ifndef USE_WINDOWS_DWORD
#define USE_WINDOWS_DWORD
#endif
#include <windows.h> #include <windows.h>
#include <mmsystem.h> #include <mmsystem.h>
#else #else

View file

@ -36,7 +36,6 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <mmsystem.h> #include <mmsystem.h>
#define USE_WINDOWS_DWORD
#else #else
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>

View file

@ -39,7 +39,6 @@
#include "resource.h" #include "resource.h"
extern HWND Window; extern HWND Window;
extern HINSTANCE g_hInst; extern HINSTANCE g_hInst;
#define USE_WINDOWS_DWORD
#endif #endif
#include <stdio.h> #include <stdio.h>

View file

@ -1,7 +1,6 @@
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#define USE_WINDOWS_DWORD
#endif #endif
#include "mpg123_decoder.h" #include "mpg123_decoder.h"

View file

@ -210,20 +210,20 @@ void AudioToolboxMIDIDevice::Stop()
int AudioToolboxMIDIDevice::PrepareHeader(MidiHeader* data) int AudioToolboxMIDIDevice::PrepareHeader(MidiHeader* data)
{ {
MidiHeader* events = data; MidiHeader* events = data;
DWORD position = 0; uint32_t position = 0;
while (nullptr != events) while (nullptr != events)
{ {
DWORD* const event = reinterpret_cast<DWORD*>(events->lpData + position); uint32_t* const event = reinterpret_cast<uint32_t*>(events->lpData + position);
const DWORD message = event[2]; const uint32_t message = event[2];
if (0 == MEVENT_EVENTTYPE(message)) if (0 == MEVENT_EVENTTYPE(message))
{ {
static const DWORD VOLUME_CHANGE_EVENT = 7; static const uint32_t VOLUME_CHANGE_EVENT = 7;
const DWORD status = message & 0xFF; const uint32_t status = message & 0xFF;
const DWORD param1 = (message >> 8) & 0x7F; const uint32_t param1 = (message >> 8) & 0x7F;
const DWORD param2 = (message >> 16) & 0x7F; const uint32_t param2 = (message >> 16) & 0x7F;
if (nullptr != m_audioUnit && MIDI_CTRLCHANGE == status && VOLUME_CHANGE_EVENT == param1) if (nullptr != m_audioUnit && MIDI_CTRLCHANGE == status && VOLUME_CHANGE_EVENT == param1)
{ {

View file

@ -78,7 +78,7 @@ protected:
typedef struct tagITFILEHEADER typedef struct tagITFILEHEADER
{ {
DWORD id; // 0x4D504D49 uint32_t id; // 0x4D504D49
char songname[26]; char songname[26];
uint16_t reserved1; // 0x1004 uint16_t reserved1; // 0x1004
uint16_t ordnum; uint16_t ordnum;
@ -96,8 +96,8 @@ typedef struct tagITFILEHEADER
uint8_t sep; uint8_t sep;
uint8_t zero; uint8_t zero;
uint16_t msglength; uint16_t msglength;
DWORD msgoffset; uint32_t msgoffset;
DWORD reserved2; uint32_t reserved2;
uint8_t chnpan[64]; uint8_t chnpan[64];
uint8_t chnvol[64]; uint8_t chnvol[64];
} FORCE_PACKED ITFILEHEADER, *PITFILEHEADER; } FORCE_PACKED ITFILEHEADER, *PITFILEHEADER;
@ -274,16 +274,16 @@ static bool ReadIT(const uint8_t * ptr, unsigned size, input_mod *info, bool met
unsigned msgoffset = LittleLong(pifh->msgoffset); unsigned msgoffset = LittleLong(pifh->msgoffset);
unsigned msgend = msgoffset + LittleShort(pifh->msglength); unsigned msgend = msgoffset + LittleShort(pifh->msglength);
DWORD * offset; uint32_t * offset;
// FString name; // FString name;
if (meta) if (meta)
{ {
offset = (DWORD *)(ptr + 0xC0 + LittleShort(pifh->ordnum) + LittleShort(pifh->insnum) * 4); offset = (uint32_t *)(ptr + 0xC0 + LittleShort(pifh->ordnum) + LittleShort(pifh->insnum) * 4);
for (n = 0, l = LittleShort(pifh->smpnum); n < l; n++, offset++) for (n = 0, l = LittleShort(pifh->smpnum); n < l; n++, offset++)
{ {
DWORD offset_n = LittleLong( *offset ); uint32_t offset_n = LittleLong( *offset );
if ( offset_n >= msgoffset && offset_n < msgend ) msgend = offset_n; if ( offset_n >= msgoffset && offset_n < msgend ) msgend = offset_n;
if ((!offset_n) || (offset_n + 0x14 + 26 + 2 >= size)) continue; if ((!offset_n) || (offset_n + 0x14 + 26 + 2 >= size)) continue;
// XXX // XXX
@ -304,11 +304,11 @@ static bool ReadIT(const uint8_t * ptr, unsigned size, input_mod *info, bool met
#endif #endif
} }
offset = (DWORD *)(ptr + 0xC0 + LittleShort(pifh->ordnum)); offset = (uint32_t *)(ptr + 0xC0 + LittleShort(pifh->ordnum));
for (n = 0, l = LittleShort(pifh->insnum); n < l; n++, offset++) for (n = 0, l = LittleShort(pifh->insnum); n < l; n++, offset++)
{ {
DWORD offset_n = LittleLong( *offset ); uint32_t offset_n = LittleLong( *offset );
if ( offset_n >= msgoffset && offset_n < msgend ) msgend = offset_n; if ( offset_n >= msgoffset && offset_n < msgend ) msgend = offset_n;
if ((!offset_n) || (offset_n + 0x20 + 26 >= size)) continue; if ((!offset_n) || (offset_n + 0x20 + 26 >= size)) continue;
#if 0 #if 0
@ -340,9 +340,9 @@ static bool ReadIT(const uint8_t * ptr, unsigned size, input_mod *info, bool met
} }
} }
if ((pos + 8 < size) && (*(DWORD *)(ptr + pos) == MAKE_ID('P','N','A','M'))) if ((pos + 8 < size) && (*(uint32_t *)(ptr + pos) == MAKE_ID('P','N','A','M')))
{ {
unsigned len = LittleLong(*(DWORD *)(ptr + pos + 4)); unsigned len = LittleLong(*(uint32_t *)(ptr + pos + 4));
pos += 8; pos += 8;
if ((pos + len <= size) && (len <= 240 * 32) && (len >= 32)) if ((pos + len <= size) && (len <= 240 * 32) && (len >= 32))
{ {
@ -366,9 +366,9 @@ static bool ReadIT(const uint8_t * ptr, unsigned size, input_mod *info, bool met
} }
} }
if ((pos + 8 < size) && (*(DWORD *)(ptr + pos) == MAKE_ID('C','N','A','M'))) if ((pos + 8 < size) && (*(uint32_t *)(ptr + pos) == MAKE_ID('C','N','A','M')))
{ {
unsigned len = LittleLong(*(DWORD *)(ptr + pos + 4)); unsigned len = LittleLong(*(uint32_t *)(ptr + pos + 4));
pos += 8; pos += 8;
if ((pos + len <= size) && (len <= 64 * 20) && (len >= 20)) if ((pos + len <= size) && (len <= 64 * 20) && (len >= 20))
{ {
@ -393,14 +393,14 @@ static bool ReadIT(const uint8_t * ptr, unsigned size, input_mod *info, bool met
} }
} }
offset = (DWORD *)(ptr + 0xC0 + LittleShort(pifh->ordnum) + LittleShort(pifh->insnum) * 4 + LittleShort(pifh->smpnum) * 4); offset = (uint32_t *)(ptr + 0xC0 + LittleShort(pifh->ordnum) + LittleShort(pifh->insnum) * 4 + LittleShort(pifh->smpnum) * 4);
uint8_t chnmask[64]; uint8_t chnmask[64];
for (n = 0, l = LittleShort(pifh->patnum); n < l; n++) for (n = 0, l = LittleShort(pifh->patnum); n < l; n++)
{ {
memset(chnmask, 0, sizeof(chnmask)); memset(chnmask, 0, sizeof(chnmask));
DWORD offset_n = LittleLong( offset[n] ); uint32_t offset_n = LittleLong( offset[n] );
if ((!offset_n) || (offset_n + 4 >= size)) continue; if ((!offset_n) || (offset_n + 4 >= size)) continue;
unsigned len = LittleShort(*(uint16_t *)(ptr + offset_n)); unsigned len = LittleShort(*(uint16_t *)(ptr + offset_n));
unsigned rows = LittleShort(*(uint16_t *)(ptr + offset_n + 2)); unsigned rows = LittleShort(*(uint16_t *)(ptr + offset_n + 2));
@ -759,7 +759,7 @@ MusInfo *MOD_OpenSong(FileReader &reader)
union union
{ {
uint8_t start[64]; uint8_t start[64];
DWORD dstart[64/4]; uint32_t dstart[64/4];
}; };
dumbfile_mem_status filestate; dumbfile_mem_status filestate;
DUMBFILE *f = NULL; DUMBFILE *f = NULL;
@ -845,7 +845,7 @@ MusInfo *MOD_OpenSong(FileReader &reader)
/*start_order = 0;*/ /*start_order = 0;*/
} }
} }
else if (size >= 4 && dstart[0] == (DWORD)MAKE_ID('P','S','M',254)) else if (size >= 4 && dstart[0] == (uint32_t)MAKE_ID('P','S','M',254))
{ {
if ((f = dumb_read_allfile(&filestate, start, reader, headsize, size))) if ((f = dumb_read_allfile(&filestate, start, reader, headsize, size)))
{ {

View file

@ -10,7 +10,7 @@
#include "v_text.h" #include "v_text.h"
#include "menu/menu.h" #include "menu/menu.h"
static DWORD nummididevices; static uint32_t nummididevices;
static bool nummididevicesset; static bool nummididevicesset;
#ifdef HAVE_FLUIDSYNTH #ifdef HAVE_FLUIDSYNTH
@ -117,7 +117,7 @@ void I_BuildMIDIMenuList (FOptionValues *opt)
{ {
AddDefaultMidiDevices(opt); AddDefaultMidiDevices(opt);
for (DWORD id = 0; id < nummididevices; ++id) for (uint32_t id = 0; id < nummididevices; ++id)
{ {
MIDIOUTCAPS caps; MIDIOUTCAPS caps;
MMRESULT res; MMRESULT res;
@ -133,7 +133,7 @@ void I_BuildMIDIMenuList (FOptionValues *opt)
} }
} }
static void PrintMidiDevice (int id, const char *name, uint16_t tech, DWORD support) static void PrintMidiDevice (int id, const char *name, uint16_t tech, uint32_t support)
{ {
if (id == snd_mididevice) if (id == snd_mididevice)
{ {

View file

@ -56,7 +56,7 @@
// PRIVATE FUNCTION PROTOTYPES --------------------------------------------- // PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
static void WriteVarLen (TArray<uint8_t> &file, DWORD value); static void WriteVarLen (TArray<uint8_t> &file, uint32_t value);
// EXTERNAL DATA DECLARATIONS ---------------------------------------------- // EXTERNAL DATA DECLARATIONS ----------------------------------------------
@ -496,7 +496,7 @@ void MIDIStreamer::MusicVolumeChanged()
if (MIDI != NULL && MIDI->FakeVolume()) if (MIDI != NULL && MIDI->FakeVolume())
{ {
float realvolume = clamp<float>(snd_musicvolume * relative_volume, 0.f, 1.f); float realvolume = clamp<float>(snd_musicvolume * relative_volume, 0.f, 1.f);
Volume = clamp<DWORD>((DWORD)(realvolume * 65535.f), 0, 65535); Volume = clamp<uint32_t>((uint32_t)(realvolume * 65535.f), 0, 65535);
} }
else else
{ {
@ -773,7 +773,7 @@ int MIDIStreamer::FillBuffer(int buffer_num, int max_events, uint32_t max_time)
{ {
// Be more responsive when unpausing by only playing each buffer // Be more responsive when unpausing by only playing each buffer
// for a third of the maximum time. // for a third of the maximum time.
events[0] = MAX<DWORD>(1, (max_time / 3) * Division / Tempo); events[0] = MAX<uint32_t>(1, (max_time / 3) * Division / Tempo);
events[1] = 0; events[1] = 0;
events[2] = MEVENT_NOP << 24; events[2] = MEVENT_NOP << 24;
events += 3; events += 3;
@ -828,7 +828,7 @@ int MIDIStreamer::FillStopBuffer(int buffer_num)
memset(&Buffer[buffer_num], 0, sizeof(MidiHeader)); memset(&Buffer[buffer_num], 0, sizeof(MidiHeader));
Buffer[buffer_num].lpData = (uint8_t*)Events[buffer_num]; Buffer[buffer_num].lpData = (uint8_t*)Events[buffer_num];
Buffer[buffer_num].dwBufferLength = DWORD((uint8_t*)events - Buffer[buffer_num].lpData); Buffer[buffer_num].dwBufferLength = uint32_t((uint8_t*)events - Buffer[buffer_num].lpData);
Buffer[buffer_num].dwBytesRecorded = Buffer[buffer_num].dwBufferLength; Buffer[buffer_num].dwBytesRecorded = Buffer[buffer_num].dwBufferLength;
if (0 != (i = MIDI->PrepareHeader(&Buffer[buffer_num]))) if (0 != (i = MIDI->PrepareHeader(&Buffer[buffer_num])))
{ {
@ -974,7 +974,7 @@ void MIDIStreamer::Precache()
void MIDIStreamer::CreateSMF(TArray<uint8_t> &file, int looplimit) void MIDIStreamer::CreateSMF(TArray<uint8_t> &file, int looplimit)
{ {
DWORD delay = 0; uint32_t delay = 0;
uint8_t running_status = 255; uint8_t running_status = 255;
// Always create songs aimed at GM devices. // Always create songs aimed at GM devices.
@ -1066,7 +1066,7 @@ void MIDIStreamer::CreateSMF(TArray<uint8_t> &file, int looplimit)
file.Push(0); file.Push(0);
// Fill in track length // Fill in track length
DWORD len = file.Size() - 22; uint32_t len = file.Size() - 22;
file[18] = uint8_t(len >> 24); file[18] = uint8_t(len >> 24);
file[19] = uint8_t(len >> 16); file[19] = uint8_t(len >> 16);
file[20] = uint8_t(len >> 8); file[20] = uint8_t(len >> 8);
@ -1081,9 +1081,9 @@ void MIDIStreamer::CreateSMF(TArray<uint8_t> &file, int looplimit)
// //
//========================================================================== //==========================================================================
static void WriteVarLen (TArray<uint8_t> &file, DWORD value) static void WriteVarLen (TArray<uint8_t> &file, uint32_t value)
{ {
DWORD buffer = value & 0x7F; uint32_t buffer = value & 0x7F;
while ( (value >>= 7) ) while ( (value >>= 7) )
{ {

View file

@ -261,7 +261,7 @@ int SoftSynthMIDIDevice::StreamOut(MidiHeader *header)
if (Events == NULL) if (Events == NULL)
{ {
Events = header; Events = header;
NextTickIn = SamplesPerTick * *(DWORD *)header->lpData; NextTickIn = SamplesPerTick * *(uint32_t *)header->lpData;
Position = 0; Position = 0;
} }
else else
@ -302,11 +302,11 @@ bool SoftSynthMIDIDevice::Pause(bool paused)
int SoftSynthMIDIDevice::PlayTick() int SoftSynthMIDIDevice::PlayTick()
{ {
DWORD delay = 0; uint32_t delay = 0;
while (delay == 0 && Events != NULL) while (delay == 0 && Events != NULL)
{ {
DWORD *event = (DWORD *)(Events->lpData + Position); uint32_t *event = (uint32_t *)(Events->lpData + Position);
if (MEVENT_EVENTTYPE(event[2]) == MEVENT_TEMPO) if (MEVENT_EVENTTYPE(event[2]) == MEVENT_TEMPO)
{ {
SetTempo(MEVENT_EVENTPARM(event[2])); SetTempo(MEVENT_EVENTPARM(event[2]));
@ -373,7 +373,7 @@ int SoftSynthMIDIDevice::PlayTick()
return int(Division); return int(Division);
} }
delay = *(DWORD *)(Events->lpData + Position); delay = *(uint32_t *)(Events->lpData + Position);
} }
return delay; return delay;
} }

View file

@ -35,7 +35,6 @@
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#define USE_WINDOWS_DWORD
#else #else
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif

View file

@ -1,7 +1,6 @@
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#define USE_WINDOWS_DWORD
#endif #endif
#include "sndfile_decoder.h" #include "sndfile_decoder.h"

View file

@ -31,7 +31,7 @@ struct GF1PatchHeader
uint8_t Channels; uint8_t Channels;
uint16_t WaveForms; uint16_t WaveForms;
uint16_t MasterVolume; uint16_t MasterVolume;
DWORD DataSize; uint32_t DataSize;
uint8_t Reserved[PATCH_HEADER_RESERVED_SIZE]; uint8_t Reserved[PATCH_HEADER_RESERVED_SIZE];
} GCC_PACKED; } GCC_PACKED;

View file

@ -255,6 +255,8 @@ typedef int16_t SHORT;
typedef uint16_t USHORT; typedef uint16_t USHORT;
typedef int32_t LONG; typedef int32_t LONG;
typedef uint32_t ULONG; typedef uint32_t ULONG;
typedef uint32_t DWORD;
#define mmioFOURCC MAKE_ID #define mmioFOURCC MAKE_ID
#define DEFINE_GUID(A, B, C, E, F, G, H, I, J, K, L, M) #define DEFINE_GUID(A, B, C, E, F, G, H, I, J, K, L, M)

View file

@ -3,7 +3,6 @@
#ifndef _WINNT_ #ifndef _WINNT_
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#define USE_WINDOWS_DWORD
#endif #endif
class FInternalCriticalSection class FInternalCriticalSection

View file

@ -9,7 +9,6 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#define USE_WINDOWS_DWORD
#include "resource.h" #include "resource.h"
#include "s_sound.h" #include "s_sound.h"
#include "templates.h" #include "templates.h"

View file

@ -51,7 +51,6 @@
#include <stdio.h> #include <stdio.h>
#define USE_WINDOWS_DWORD
#include "doomtype.h" #include "doomtype.h"
#include "c_dispatch.h" #include "c_dispatch.h"

View file

@ -44,7 +44,6 @@
#include <d3d9.h> #include <d3d9.h>
#include <stdio.h> #include <stdio.h>
#define USE_WINDOWS_DWORD
#include "doomtype.h" #include "doomtype.h"
#include "f_wipe.h" #include "f_wipe.h"
#include "win32iface.h" #include "win32iface.h"

View file

@ -41,7 +41,6 @@
#include <ddraw.h> #include <ddraw.h>
#include <stdio.h> #include <stdio.h>
#define USE_WINDOWS_DWORD
#include "doomtype.h" #include "doomtype.h"
#include "c_dispatch.h" #include "c_dispatch.h"

View file

@ -35,7 +35,6 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#define USE_WINDOWS_DWORD
#include "hardware.h" #include "hardware.h"
#include "win32iface.h" #include "win32iface.h"
#include "i_video.h" #include "i_video.h"

View file

@ -39,7 +39,6 @@
#include <ctype.h> #include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#define USE_WINDOWS_DWORD
#include "doomtype.h" #include "doomtype.h"
#include "c_cvars.h" #include "c_cvars.h"
#include "c_dispatch.h" #include "c_dispatch.h"

View file

@ -63,7 +63,6 @@
#include <uxtheme.h> #include <uxtheme.h>
#include <stddef.h> #include <stddef.h>
#define USE_WINDOWS_DWORD
#include "doomtype.h" #include "doomtype.h"
#include "resource.h" #include "resource.h"
#include "version.h" #include "version.h"

View file

@ -11,7 +11,6 @@
#include <oleauto.h> #include <oleauto.h>
#include <malloc.h> #include <malloc.h>
#define USE_WINDOWS_DWORD
#include "i_input.h" #include "i_input.h"
#include "i_system.h" #include "i_system.h"
#include "d_event.h" #include "d_event.h"

View file

@ -77,7 +77,6 @@
#endif #endif
#define USE_WINDOWS_DWORD
#include "c_dispatch.h" #include "c_dispatch.h"
#include "doomtype.h" #include "doomtype.h"
#include "doomdef.h" #include "doomdef.h"

View file

@ -37,13 +37,8 @@
#include "doomtype.h" #include "doomtype.h"
#include "doomdef.h" #include "doomdef.h"
void I_SetMouseCapture();
void I_ReleaseMouseCapture();
bool I_InitInput (void *hwnd); bool I_InitInput (void *hwnd);
void I_ShutdownInput (); void I_ShutdownInput ();
void I_PutInClipboard (const char *str);
FString I_GetFromClipboard (bool windows_has_no_selection_clipboard);
void I_GetEvent(); void I_GetEvent();
@ -56,7 +51,7 @@ enum
}; };
#ifdef USE_WINDOWS_DWORD #ifdef _WIN32
#include "m_joy.h" #include "m_joy.h"
// Don't make these definitions available to the main body of the source code. // Don't make these definitions available to the main body of the source code.

View file

@ -6,7 +6,6 @@
#include <windows.h> #include <windows.h>
#include <dinput.h> #include <dinput.h>
#define USE_WINDOWS_DWORD
#include "i_input.h" #include "i_input.h"
#include "i_system.h" #include "i_system.h"
#include "d_event.h" #include "d_event.h"

View file

@ -61,7 +61,6 @@
#include <stdarg.h> #include <stdarg.h>
#include <math.h> #include <math.h>
#define USE_WINDOWS_DWORD
#include "doomerrors.h" #include "doomerrors.h"
#include "hardware.h" #include "hardware.h"

View file

@ -7,7 +7,6 @@
#include <windows.h> #include <windows.h>
#include <dinput.h> #include <dinput.h>
#define USE_WINDOWS_DWORD
#include "i_input.h" #include "i_input.h"
#include "i_system.h" #include "i_system.h"
#include "d_event.h" #include "d_event.h"

View file

@ -6,7 +6,6 @@
#include <malloc.h> #include <malloc.h>
#include <limits.h> #include <limits.h>
#define USE_WINDOWS_DWORD
#include "i_input.h" #include "i_input.h"
#include "i_system.h" #include "i_system.h"
#include "d_event.h" #include "d_event.h"

View file

@ -37,7 +37,6 @@
#include <windows.h> #include <windows.h>
#include <lmcons.h> #include <lmcons.h>
#include <shlobj.h> #include <shlobj.h>
#define USE_WINDOWS_DWORD
#include "cmdlib.h" #include "cmdlib.h"
#include "m_misc.h" #include "m_misc.h"

View file

@ -63,7 +63,6 @@
#include <richedit.h> #include <richedit.h>
#include <wincrypt.h> #include <wincrypt.h>
#define USE_WINDOWS_DWORD
#include "hardware.h" #include "hardware.h"
#include "doomerrors.h" #include "doomerrors.h"
#include <math.h> #include <math.h>

View file

@ -9,7 +9,6 @@
#include <malloc.h> #include <malloc.h>
#include <limits.h> #include <limits.h>
#define USE_WINDOWS_DWORD
#include "i_input.h" #include "i_input.h"
#include "i_system.h" #include "i_system.h"
#include "d_event.h" #include "d_event.h"

View file

@ -6,7 +6,6 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <shlobj.h> #include <shlobj.h>
#define USE_WINDOWS_DWORD
#include "i_module.h" #include "i_module.h"

View file

@ -41,7 +41,6 @@
#include <stdio.h> #include <stdio.h>
#include "resource.h" #include "resource.h"
#define USE_WINDOWS_DWORD
#include "st_start.h" #include "st_start.h"
#include "resource.h" #include "resource.h"
#include "templates.h" #include "templates.h"
@ -659,7 +658,7 @@ FHexenStartupScreen::FHexenStartupScreen(int max_progress, HRESULT &hr)
union union
{ {
RGBQUAD color; RGBQUAD color;
DWORD quad; uint32_t quad;
} c; } c;
Wads.ReadLump (startup_lump, startup_screen); Wads.ReadLump (startup_lump, startup_screen);
@ -1332,8 +1331,8 @@ void ST_Util_DrawBlock (BITMAPINFO *bitmap_info, const uint8_t *src, int x, int
{ // progress notches { // progress notches
for (; height > 0; --height) for (; height > 0; --height)
{ {
((DWORD *)dest)[0] = ((const DWORD *)src)[0]; ((uint32_t *)dest)[0] = ((const uint32_t *)src)[0];
((DWORD *)dest)[1] = ((const DWORD *)src)[1]; ((uint32_t *)dest)[1] = ((const uint32_t *)src)[1];
dest += destpitch; dest += destpitch;
src += 8; src += 8;
} }
@ -1395,7 +1394,7 @@ void ST_Util_ClearBlock (BITMAPINFO *bitmap_info, uint8_t fill, int x, int y, in
BITMAPINFO *ST_Util_CreateBitmap (int width, int height, int color_bits) BITMAPINFO *ST_Util_CreateBitmap (int width, int height, int color_bits)
{ {
DWORD size_image = (width * height) >> int(color_bits == 4); uint32_t size_image = (width * height) >> int(color_bits == 4);
BITMAPINFO *bitmap_info = (BITMAPINFO *)M_Malloc (sizeof(BITMAPINFOHEADER) + BITMAPINFO *bitmap_info = (BITMAPINFO *)M_Malloc (sizeof(BITMAPINFOHEADER) +
(sizeof(RGBQUAD) << color_bits) + size_image); (sizeof(RGBQUAD) << color_bits) + size_image);

View file

@ -5,7 +5,6 @@
#include <GL/gl.h> #include <GL/gl.h>
#include "wglext.h" #include "wglext.h"
#define USE_WINDOWS_DWORD
#include "win32iface.h" #include "win32iface.h"
#include "win32gliface.h" #include "win32gliface.h"
//#include "gl/gl_intern.h" //#include "gl/gl_intern.h"

View file

@ -55,7 +55,6 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#define USE_WINDOWS_DWORD
#include "doomtype.h" #include "doomtype.h"
#include "c_dispatch.h" #include "c_dispatch.h"