diasurgical / diasurgical/devilution

Suggestion to use WinAPI typedefs for signed integer types

Open
#444 8 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
9k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

Currently winapi types are being used for mostly unsigned types (BYTE, WORD, DWORD).
These are defined in WinDef.h, the project files also are including [WinNT.h](https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-tools/widl/include/winnt.h) which defines the following types:

```
/* Define the basic types */
#ifndef VOID
#define VOID void
#endif
typedef VOID *PVOID;
typedef VOID *PVOID64;
typedef BYTE BOOLEAN, *PBOOLEAN;
typedef char CHAR, *PCHAR;
typedef short SHORT, *PSHORT;
#ifdef _MSC_VER
typedef long LONG, *PLONG;
#else
typedef int LONG, *PLONG;
#endif
```
(note the use of "BOOLEAN" for 8 bit unlike the 32 bit "BOOL")

and was probably available at the time at least of v1.09b.

This would read well along with, and be consistent with the unsigned types already in use.

edit: my suggestion also includes the use of "VOID".

Contributor guide

Open the contributing guide

Research direction

Locate the project files that currently use BYTE, WORD, and DWORD, then compare their declarations with the WinDef.h and WinNT.h definitions referenced in the issue. Update the signed integer types and VOID usage for consistent WinAPI naming, and verify that the affected code still builds with the intended Windows headers.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.