Replace "signed char" with "int8_t"

This commit is contained in:
GravisZro 2024-05-23 22:59:50 -04:00
parent 1618040db5
commit a00639be24
15 changed files with 32 additions and 32 deletions

View File

@ -539,7 +539,7 @@ bool AddColoredHUDMessage(ddgr_color color, const char *format, ...) {
// Adds a HUD message (similar to AddColoredHUDMessage), however can be filtered out by // Adds a HUD message (similar to AddColoredHUDMessage), however can be filtered out by
// a "-playermessages" command line. // a "-playermessages" command line.
bool AddFilteredColoredHUDMessage(ddgr_color color, const char *format, ...) { bool AddFilteredColoredHUDMessage(ddgr_color color, const char *format, ...) {
static signed char checked_command_line = -1; static int8_t checked_command_line = -1;
if (checked_command_line == -1) { if (checked_command_line == -1) {
if (FindArg("-playermessages") != 0) { if (FindArg("-playermessages") != 0) {
@ -575,7 +575,7 @@ bool AddFilteredColoredHUDMessage(ddgr_color color, const char *format, ...) {
// Adds a HUD message (similar to AddHUDMessage), however can be filtered out by // Adds a HUD message (similar to AddHUDMessage), however can be filtered out by
// a "-playermessages" command line. // a "-playermessages" command line.
bool AddFilteredHUDMessage(const char *format, ...) { bool AddFilteredHUDMessage(const char *format, ...) {
static signed char checked_command_line = -1; static int8_t checked_command_line = -1;
if (checked_command_line == -1) { if (checked_command_line == -1) {
if (FindArg("-playermessages") != 0) { if (FindArg("-playermessages") != 0) {

View File

@ -954,7 +954,7 @@ void GetGameStartPacket(ubyte *data)
memcpy(TeamScores,&data[size],sizeof(int)*DLLMAX_TEAMS); size+= (sizeof(int)*DLLMAX_TEAMS); memcpy(TeamScores,&data[size],sizeof(int)*DLLMAX_TEAMS); size+= (sizeof(int)*DLLMAX_TEAMS);
//who has the powerball //who has the powerball
signed char temp; int8_t temp;
memcpy(&temp,&data[size],sizeof(char)); size+=sizeof(char); memcpy(&temp,&data[size],sizeof(char)); size+=sizeof(char);
WhoHasPowerBall = temp; WhoHasPowerBall = temp;
@ -993,7 +993,7 @@ void SendGameStartPacket(int pnum)
//add the team scores //add the team scores
memcpy(&data[size],TeamScores,sizeof(int)*DLLMAX_TEAMS); size += (sizeof(int)*DLLMAX_TEAMS); memcpy(&data[size],TeamScores,sizeof(int)*DLLMAX_TEAMS); size += (sizeof(int)*DLLMAX_TEAMS);
signed char temp; int8_t temp;
//who has the powerball if anyone //who has the powerball if anyone
temp = WhoHasPowerBall; temp = WhoHasPowerBall;
memcpy(&data[size],&temp,sizeof(char)); size+= sizeof(char); memcpy(&data[size],&temp,sizeof(char)); size+= sizeof(char);

View File

@ -25,7 +25,7 @@ typedef int32_t sint32;
typedef unsigned short uint16; typedef unsigned short uint16;
typedef signed short sint16; typedef signed short sint16;
typedef uint8_t uint8; typedef uint8_t uint8;
typedef signed char sint8; typedef int8_t sint8;
class IAudioDecoder { class IAudioDecoder {
public: public:

View File

@ -167,7 +167,7 @@
typedef uint8_t FxU8; typedef uint8_t FxU8;
typedef signed char FxI8; typedef int8_t FxI8;
typedef unsigned short FxU16; typedef unsigned short FxU16;

View File

@ -23,7 +23,7 @@
// define unsigned types; // define unsigned types;
typedef uint8_t ubyte; typedef uint8_t ubyte;
typedef signed char sbyte; typedef int8_t sbyte;
typedef unsigned short ushort; typedef unsigned short ushort;
typedef uint32_t uint32_t; typedef uint32_t uint32_t;
typedef unsigned long ulong; typedef unsigned long ulong;

View File

@ -28,7 +28,7 @@ typedef int32_t sint32;
typedef unsigned short uint16; typedef unsigned short uint16;
typedef signed short sint16; typedef signed short sint16;
typedef uint8_t uint8; typedef uint8_t uint8;
typedef signed char sint8; typedef int8_t sint8;
struct BitsEncoder { struct BitsEncoder {
FILE *m_outFile; // var50 | offset 0x10 FILE *m_outFile; // var50 | offset 0x10

View File

@ -201,7 +201,7 @@ public:
initme() { initme() {
int x, y; int x, y;
int m4, m3, m2, m1; int m4, m3, m2, m1;
signed char *ptr; int8_t *ptr;
uint8_t *uptr; uint8_t *uptr;
// Do nfhpk_mov4l // Do nfhpk_mov4l
@ -277,7 +277,7 @@ public:
} }
// do nfpk_ShiftP1 // do nfpk_ShiftP1
ptr = (signed char *)nfpk_ShiftP1; ptr = (int8_t *)nfpk_ShiftP1;
for (y = -8; y != 8; y++) { for (y = -8; y != 8; y++) {
for (x = -8; x != 8; x++) { for (x = -8; x != 8; x++) {
#ifdef OUTRAGE_BIG_ENDIAN #ifdef OUTRAGE_BIG_ENDIAN
@ -292,7 +292,7 @@ public:
} }
// do nfpk_ShiftP2[] // do nfpk_ShiftP2[]
ptr = (signed char *)nfpk_ShiftP2; ptr = (int8_t *)nfpk_ShiftP2;
for (y = 0; y != 8; y++) { for (y = 0; y != 8; y++) {
for (x = 8; x != 15; x++) { for (x = 8; x != 15; x++) {
#ifdef OUTRAGE_BIG_ENDIAN #ifdef OUTRAGE_BIG_ENDIAN
@ -534,14 +534,14 @@ void PkDecompWorker(const bool hiColor, const uint8_t *ops, const uint8_t *comp,
unsigned short hax, ax; unsigned short hax, ax;
} reg_word; } reg_word;
typedef struct { typedef struct {
signed char hah, hal, ah, al; int8_t hah, hal, ah, al;
} reg_byte; } reg_byte;
#else #else
typedef struct { typedef struct {
unsigned short ax, hax; unsigned short ax, hax;
} reg_word; } reg_word;
typedef struct { typedef struct {
signed char al, ah, hal, hah; int8_t al, ah, hal, hah;
} reg_byte; } reg_byte;
#endif #endif

View File

@ -180,7 +180,7 @@ public:
initme() { initme() {
int x, y; int x, y;
int m4, m3, m2, m1; int m4, m3, m2, m1;
signed char *ptr; int8_t *ptr;
uint8_t *uptr; uint8_t *uptr;
// Do nfhpk_mov4l // Do nfhpk_mov4l
@ -231,7 +231,7 @@ public:
uptr++; uptr++;
} }
// do nfpk_ShiftP1 // do nfpk_ShiftP1
ptr = (signed char *)nfpk_ShiftP1; ptr = (int8_t *)nfpk_ShiftP1;
for (y = -8; y != 8; y++) { for (y = -8; y != 8; y++) {
for (x = -8; x != 8; x++) { for (x = -8; x != 8; x++) {
@ -247,7 +247,7 @@ public:
} }
// do nfpk_ShiftP2[] // do nfpk_ShiftP2[]
ptr = (signed char *)nfpk_ShiftP2; ptr = (int8_t *)nfpk_ShiftP2;
for (y = 0; y != 8; y++) { for (y = 0; y != 8; y++) {
for (x = 8; x != 15; x++) { for (x = 8; x != 15; x++) {
@ -390,14 +390,14 @@ void nfHPkDecomp(uint8_t *ops, uint8_t *comp, unsigned x, unsigned y, unsigned w
unsigned short hax, ax; unsigned short hax, ax;
} reg_word; } reg_word;
typedef struct { typedef struct {
signed char hah, hal, ah, al; int8_t hah, hal, ah, al;
} reg_byte; } reg_byte;
#else #else
typedef struct { typedef struct {
unsigned short ax, hax; unsigned short ax, hax;
} reg_word; } reg_word;
typedef struct { typedef struct {
signed char al, ah, hal, hah; int8_t al, ah, hal, hah;
} reg_byte; } reg_byte;
#endif #endif
union { union {
@ -423,14 +423,14 @@ void nfHPkDecomp(uint8_t *ops, uint8_t *comp, unsigned x, unsigned y, unsigned w
unsigned short hax, ax; unsigned short hax, ax;
} reg_word; } reg_word;
typedef struct { typedef struct {
signed char hah, hal, ah, al; int8_t hah, hal, ah, al;
} reg_byte; } reg_byte;
#else #else
typedef struct { typedef struct {
unsigned short ax, hax; unsigned short ax, hax;
} reg_word; } reg_word;
typedef struct { typedef struct {
signed char al, ah, hal, hah; int8_t al, ah, hal, hah;
} reg_byte; } reg_byte;
#endif #endif
union { union {

View File

@ -3305,7 +3305,7 @@ void strlowcpy(char *dest, const char *src) {
// command string to the given function handler. Returns 1 on success, -1 if out of memory, 0 if it already // command string to the given function handler. Returns 1 on success, -1 if out of memory, 0 if it already
// exists. These commands are not case sensitive. // exists. These commands are not case sensitive.
// Ex. AddInputCommand("team"); //this handles all the '$team' passed in // Ex. AddInputCommand("team"); //this handles all the '$team' passed in
signed char DMFCBase::AddInputCommand(const char *command, const char *description, void (*handler)(const char *), bool allow_remotely) { int8_t DMFCBase::AddInputCommand(const char *command, const char *description, void (*handler)(const char *), bool allow_remotely) {
ASSERT(command != NULL); ASSERT(command != NULL);
ASSERT(handler != NULL); ASSERT(handler != NULL);

View File

@ -896,7 +896,7 @@ void DLLFUNCCALL IDMFC_DisconnectMe(IDMFC *instance) {
instance->DisconnectMe(); instance->DisconnectMe();
} }
signed char DLLFUNCCALL IDMFC_AddInputCommand(IDMFC *instance, const char *command, const char *description, int8_t DLLFUNCCALL IDMFC_AddInputCommand(IDMFC *instance, const char *command, const char *description,
void (*handler)(const char *)) { void (*handler)(const char *)) {
assert(instance != NULL); assert(instance != NULL);
return instance->AddInputCommand(command, description, handler); return instance->AddInputCommand(command, description, handler);

View File

@ -1597,7 +1597,7 @@ public:
// exists. These commands are not case sensitive. // exists. These commands are not case sensitive.
// Ex. AddInputCommand("team"); //this handles all the '$team' passed in // Ex. AddInputCommand("team"); //this handles all the '$team' passed in
// allow_remotely : if set true, this input command can be called remotely via remote administration // allow_remotely : if set true, this input command can be called remotely via remote administration
signed char AddInputCommand(const char *command, const char *description, void (*handler)(const char *), bool allow_remotely = false); int8_t AddInputCommand(const char *command, const char *description, void (*handler)(const char *), bool allow_remotely = false);
// DMFCBase::CanInputCommandBeUsedRemotely // DMFCBase::CanInputCommandBeUsedRemotely
// //

View File

@ -1163,7 +1163,7 @@ public:
// exists. These commands are not case sensitive. // exists. These commands are not case sensitive.
// Ex. AddInputCommand("team"); //this handles all the '$team' passed in // Ex. AddInputCommand("team"); //this handles all the '$team' passed in
// allow_remotely : if set true, this input command can be called remotely via remote administration // allow_remotely : if set true, this input command can be called remotely via remote administration
virtual signed char AddInputCommand(const char *command, const char *description, void (*handler)(const char *), virtual int8_t AddInputCommand(const char *command, const char *description, void (*handler)(const char *),
bool allow_remotely = false) = 0; bool allow_remotely = false) = 0;
// Does a check on on the pinfo info making sure it is valid // Does a check on on the pinfo info making sure it is valid
@ -1915,7 +1915,7 @@ DLLEXPORT void DLLFUNCCALL IDMFC_DoDamageToPlayer(IDMFC *instance, int pnum, int
bool playsound = true); bool playsound = true);
DLLEXPORT void DLLFUNCCALL IDMFC_StartUIWindow(IDMFC *instance, int id, void *user_data); DLLEXPORT void DLLFUNCCALL IDMFC_StartUIWindow(IDMFC *instance, int id, void *user_data);
DLLEXPORT void DLLFUNCCALL IDMFC_DisconnectMe(IDMFC *instance); DLLEXPORT void DLLFUNCCALL IDMFC_DisconnectMe(IDMFC *instance);
DLLEXPORT signed char DLLFUNCCALL IDMFC_AddInputCommand(IDMFC *instance, const char *command, const char *description, DLLEXPORT int8_t DLLFUNCCALL IDMFC_AddInputCommand(IDMFC *instance, const char *command, const char *description,
void (*handler)(const char *)); void (*handler)(const char *));
DLLEXPORT void DLLFUNCCALL IDMFC_CheckPInfo(IDMFC *instance); DLLEXPORT void DLLFUNCCALL IDMFC_CheckPInfo(IDMFC *instance);
DLLEXPORT void DLLFUNCCALL IDMFC_EnableStatisticalMessages(IDMFC *instance, bool on); DLLEXPORT void DLLFUNCCALL IDMFC_EnableStatisticalMessages(IDMFC *instance, bool on);

View File

@ -928,7 +928,7 @@ typedef int OMMSHANDLE;
// define unsigned types; // define unsigned types;
typedef uint8_t ubyte; typedef uint8_t ubyte;
typedef signed char sbyte; typedef int8_t sbyte;
typedef unsigned short ushort; typedef unsigned short ushort;
typedef uint32_t uint32_t; typedef uint32_t uint32_t;
typedef uint32_t ddgr_color; typedef uint32_t ddgr_color;

View File

@ -929,7 +929,7 @@ typedef int OMMSHANDLE;
// define unsigned types; // define unsigned types;
typedef uint8_t ubyte; typedef uint8_t ubyte;
typedef signed char sbyte; typedef int8_t sbyte;
typedef unsigned short ushort; typedef unsigned short ushort;
typedef uint32_t uint32_t; typedef uint32_t uint32_t;
typedef uint32_t ddgr_color; typedef uint32_t ddgr_color;

View File

@ -1089,7 +1089,7 @@ static uint8_t stbiw__paeth(int a, int b, int c)
} }
// @OPTIMIZE: provide an option that always forces left-predict or paeth predict // @OPTIMIZE: provide an option that always forces left-predict or paeth predict
static void stbiw__encode_png_line(uint8_t *pixels, int stride_bytes, int width, int height, int y, int n, int filter_type, signed char *line_buffer) static void stbiw__encode_png_line(uint8_t *pixels, int stride_bytes, int width, int height, int y, int n, int filter_type, int8_t *line_buffer)
{ {
static int mapping[] = { 0,1,2,3,4 }; static int mapping[] = { 0,1,2,3,4 };
static int firstmap[] = { 0,1,0,5,6 }; static int firstmap[] = { 0,1,0,5,6 };
@ -1110,7 +1110,7 @@ static void stbiw__encode_png_line(uint8_t *pixels, int stride_bytes, int width,
case 1: line_buffer[i] = z[i]; break; case 1: line_buffer[i] = z[i]; break;
case 2: line_buffer[i] = z[i] - z[i-signed_stride]; break; case 2: line_buffer[i] = z[i] - z[i-signed_stride]; break;
case 3: line_buffer[i] = z[i] - (z[i-signed_stride]>>1); break; case 3: line_buffer[i] = z[i] - (z[i-signed_stride]>>1); break;
case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-signed_stride],0)); break; case 4: line_buffer[i] = (int8_t) (z[i] - stbiw__paeth(0,z[i-signed_stride],0)); break;
case 5: line_buffer[i] = z[i]; break; case 5: line_buffer[i] = z[i]; break;
case 6: line_buffer[i] = z[i]; break; case 6: line_buffer[i] = z[i]; break;
} }
@ -1131,7 +1131,7 @@ STBIWDEF uint8_t *stbi_write_png_to_mem(const uint8_t *pixels, int stride_bytes,
int ctype[5] = { -1, 0, 4, 2, 6 }; int ctype[5] = { -1, 0, 4, 2, 6 };
uint8_t sig[8] = { 137,80,78,71,13,10,26,10 }; uint8_t sig[8] = { 137,80,78,71,13,10,26,10 };
uint8_t *out,*o, *filt, *zlib; uint8_t *out,*o, *filt, *zlib;
signed char *line_buffer; int8_t *line_buffer;
int j,zlen; int j,zlen;
if (stride_bytes == 0) if (stride_bytes == 0)
@ -1142,7 +1142,7 @@ STBIWDEF uint8_t *stbi_write_png_to_mem(const uint8_t *pixels, int stride_bytes,
} }
filt = (uint8_t *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0; filt = (uint8_t *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0;
line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; } line_buffer = (int8_t *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; }
for (j=0; j < y; ++j) { for (j=0; j < y; ++j) {
int filter_type; int filter_type;
if (force_filter > -1) { if (force_filter > -1) {
@ -1156,7 +1156,7 @@ STBIWDEF uint8_t *stbi_write_png_to_mem(const uint8_t *pixels, int stride_bytes,
// Estimate the entropy of the line using this filter; the less, the better. // Estimate the entropy of the line using this filter; the less, the better.
est = 0; est = 0;
for (i = 0; i < x*n; ++i) { for (i = 0; i < x*n; ++i) {
est += abs((signed char) line_buffer[i]); est += abs((int8_t) line_buffer[i]);
} }
if (est < best_filter_val) { if (est < best_filter_val) {
best_filter_val = est; best_filter_val = est;