mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
Replace "signed char" with "int8_t"
This commit is contained in:
parent
1618040db5
commit
a00639be24
@ -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
|
||||
// a "-playermessages" command line.
|
||||
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 (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
|
||||
// a "-playermessages" command line.
|
||||
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 (FindArg("-playermessages") != 0) {
|
||||
|
@ -954,7 +954,7 @@ void GetGameStartPacket(ubyte *data)
|
||||
memcpy(TeamScores,&data[size],sizeof(int)*DLLMAX_TEAMS); size+= (sizeof(int)*DLLMAX_TEAMS);
|
||||
|
||||
//who has the powerball
|
||||
signed char temp;
|
||||
int8_t temp;
|
||||
memcpy(&temp,&data[size],sizeof(char)); size+=sizeof(char);
|
||||
WhoHasPowerBall = temp;
|
||||
|
||||
@ -993,7 +993,7 @@ void SendGameStartPacket(int pnum)
|
||||
//add the team scores
|
||||
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
|
||||
temp = WhoHasPowerBall;
|
||||
memcpy(&data[size],&temp,sizeof(char)); size+= sizeof(char);
|
||||
|
@ -25,7 +25,7 @@ typedef int32_t sint32;
|
||||
typedef unsigned short uint16;
|
||||
typedef signed short sint16;
|
||||
typedef uint8_t uint8;
|
||||
typedef signed char sint8;
|
||||
typedef int8_t sint8;
|
||||
|
||||
class IAudioDecoder {
|
||||
public:
|
||||
|
@ -167,7 +167,7 @@
|
||||
|
||||
typedef uint8_t FxU8;
|
||||
|
||||
typedef signed char FxI8;
|
||||
typedef int8_t FxI8;
|
||||
|
||||
typedef unsigned short FxU16;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
// define unsigned types;
|
||||
typedef uint8_t ubyte;
|
||||
typedef signed char sbyte;
|
||||
typedef int8_t sbyte;
|
||||
typedef unsigned short ushort;
|
||||
typedef uint32_t uint32_t;
|
||||
typedef unsigned long ulong;
|
||||
|
@ -28,7 +28,7 @@ typedef int32_t sint32;
|
||||
typedef unsigned short uint16;
|
||||
typedef signed short sint16;
|
||||
typedef uint8_t uint8;
|
||||
typedef signed char sint8;
|
||||
typedef int8_t sint8;
|
||||
|
||||
struct BitsEncoder {
|
||||
FILE *m_outFile; // var50 | offset 0x10
|
||||
|
@ -201,7 +201,7 @@ public:
|
||||
initme() {
|
||||
int x, y;
|
||||
int m4, m3, m2, m1;
|
||||
signed char *ptr;
|
||||
int8_t *ptr;
|
||||
uint8_t *uptr;
|
||||
|
||||
// Do nfhpk_mov4l
|
||||
@ -277,7 +277,7 @@ public:
|
||||
}
|
||||
|
||||
// do nfpk_ShiftP1
|
||||
ptr = (signed char *)nfpk_ShiftP1;
|
||||
ptr = (int8_t *)nfpk_ShiftP1;
|
||||
for (y = -8; y != 8; y++) {
|
||||
for (x = -8; x != 8; x++) {
|
||||
#ifdef OUTRAGE_BIG_ENDIAN
|
||||
@ -292,7 +292,7 @@ public:
|
||||
}
|
||||
|
||||
// do nfpk_ShiftP2[]
|
||||
ptr = (signed char *)nfpk_ShiftP2;
|
||||
ptr = (int8_t *)nfpk_ShiftP2;
|
||||
for (y = 0; y != 8; y++) {
|
||||
for (x = 8; x != 15; x++) {
|
||||
#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;
|
||||
} reg_word;
|
||||
typedef struct {
|
||||
signed char hah, hal, ah, al;
|
||||
int8_t hah, hal, ah, al;
|
||||
} reg_byte;
|
||||
#else
|
||||
typedef struct {
|
||||
unsigned short ax, hax;
|
||||
} reg_word;
|
||||
typedef struct {
|
||||
signed char al, ah, hal, hah;
|
||||
int8_t al, ah, hal, hah;
|
||||
} reg_byte;
|
||||
#endif
|
||||
|
||||
|
@ -180,7 +180,7 @@ public:
|
||||
initme() {
|
||||
int x, y;
|
||||
int m4, m3, m2, m1;
|
||||
signed char *ptr;
|
||||
int8_t *ptr;
|
||||
uint8_t *uptr;
|
||||
|
||||
// Do nfhpk_mov4l
|
||||
@ -231,7 +231,7 @@ public:
|
||||
uptr++;
|
||||
}
|
||||
// do nfpk_ShiftP1
|
||||
ptr = (signed char *)nfpk_ShiftP1;
|
||||
ptr = (int8_t *)nfpk_ShiftP1;
|
||||
|
||||
for (y = -8; y != 8; y++) {
|
||||
for (x = -8; x != 8; x++) {
|
||||
@ -247,7 +247,7 @@ public:
|
||||
}
|
||||
|
||||
// do nfpk_ShiftP2[]
|
||||
ptr = (signed char *)nfpk_ShiftP2;
|
||||
ptr = (int8_t *)nfpk_ShiftP2;
|
||||
|
||||
for (y = 0; y != 8; y++) {
|
||||
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;
|
||||
} reg_word;
|
||||
typedef struct {
|
||||
signed char hah, hal, ah, al;
|
||||
int8_t hah, hal, ah, al;
|
||||
} reg_byte;
|
||||
#else
|
||||
typedef struct {
|
||||
unsigned short ax, hax;
|
||||
} reg_word;
|
||||
typedef struct {
|
||||
signed char al, ah, hal, hah;
|
||||
int8_t al, ah, hal, hah;
|
||||
} reg_byte;
|
||||
#endif
|
||||
union {
|
||||
@ -423,14 +423,14 @@ void nfHPkDecomp(uint8_t *ops, uint8_t *comp, unsigned x, unsigned y, unsigned w
|
||||
unsigned short hax, ax;
|
||||
} reg_word;
|
||||
typedef struct {
|
||||
signed char hah, hal, ah, al;
|
||||
int8_t hah, hal, ah, al;
|
||||
} reg_byte;
|
||||
#else
|
||||
typedef struct {
|
||||
unsigned short ax, hax;
|
||||
} reg_word;
|
||||
typedef struct {
|
||||
signed char al, ah, hal, hah;
|
||||
int8_t al, ah, hal, hah;
|
||||
} reg_byte;
|
||||
#endif
|
||||
union {
|
||||
|
@ -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
|
||||
// exists. These commands are not case sensitive.
|
||||
// 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(handler != NULL);
|
||||
|
||||
|
@ -896,7 +896,7 @@ void DLLFUNCCALL IDMFC_DisconnectMe(IDMFC *instance) {
|
||||
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 *)) {
|
||||
assert(instance != NULL);
|
||||
return instance->AddInputCommand(command, description, handler);
|
||||
|
@ -1597,7 +1597,7 @@ public:
|
||||
// exists. These commands are not case sensitive.
|
||||
// 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
|
||||
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
|
||||
//
|
||||
|
@ -1163,7 +1163,7 @@ public:
|
||||
// exists. These commands are not case sensitive.
|
||||
// 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
|
||||
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;
|
||||
|
||||
// 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);
|
||||
DLLEXPORT void DLLFUNCCALL IDMFC_StartUIWindow(IDMFC *instance, int id, void *user_data);
|
||||
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 *));
|
||||
DLLEXPORT void DLLFUNCCALL IDMFC_CheckPInfo(IDMFC *instance);
|
||||
DLLEXPORT void DLLFUNCCALL IDMFC_EnableStatisticalMessages(IDMFC *instance, bool on);
|
||||
|
@ -928,7 +928,7 @@ typedef int OMMSHANDLE;
|
||||
|
||||
// define unsigned types;
|
||||
typedef uint8_t ubyte;
|
||||
typedef signed char sbyte;
|
||||
typedef int8_t sbyte;
|
||||
typedef unsigned short ushort;
|
||||
typedef uint32_t uint32_t;
|
||||
typedef uint32_t ddgr_color;
|
||||
|
@ -929,7 +929,7 @@ typedef int OMMSHANDLE;
|
||||
|
||||
// define unsigned types;
|
||||
typedef uint8_t ubyte;
|
||||
typedef signed char sbyte;
|
||||
typedef int8_t sbyte;
|
||||
typedef unsigned short ushort;
|
||||
typedef uint32_t uint32_t;
|
||||
typedef uint32_t ddgr_color;
|
||||
|
10
third_party/stb/stb_image_write.h
vendored
10
third_party/stb/stb_image_write.h
vendored
@ -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
|
||||
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 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 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 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 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 };
|
||||
uint8_t sig[8] = { 137,80,78,71,13,10,26,10 };
|
||||
uint8_t *out,*o, *filt, *zlib;
|
||||
signed char *line_buffer;
|
||||
int8_t *line_buffer;
|
||||
int j,zlen;
|
||||
|
||||
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;
|
||||
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) {
|
||||
int filter_type;
|
||||
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.
|
||||
est = 0;
|
||||
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) {
|
||||
best_filter_val = est;
|
||||
|
Loading…
Reference in New Issue
Block a user