Quiet warnings about uninitialized values.

This commit is contained in:
C.W. Betts 2024-07-31 15:40:16 -06:00
parent ae5840f314
commit 1384aa62af
11 changed files with 30 additions and 29 deletions

View File

@ -554,7 +554,7 @@ void grFont::translate_to_surfaces(int slot) {
void grFont::translate_mono_char(grSurface *sf, int x, int y, int index, gr_font_file_record *ft, int width) {
int row, col; // byte width of char
int rowsize;
uint8_t bit_mask = 0, byte;
uint8_t bit_mask = 0, byte = 0;
uint8_t *fp;
fp = ft->char_data[index];

View File

@ -42,9 +42,9 @@ bool aenc_Compress(char *input_filename, char *output_filename, const int *input
FILE *in, *out;
int32_t result;
int levels, samples_per_subband;
unsigned sample_rate, channels;
float factor, volume_scale;
int levels = 0, samples_per_subband = 0;
unsigned sample_rate = 0, channels = 0;
float factor = 0, volume_scale = 0;
int levels_set = 0, samples_per_subband_set = 0, sample_rate_set = 0, channels_set = 0, factor_set = 0,
volume_scale_set = 0;
@ -105,7 +105,8 @@ bool aenc_Compress(char *input_filename, char *output_filename, const int *input
}
if (!levels_set && !samples_per_subband_set) {
levels = 7, samples_per_subband = 16;
levels = 7;
samples_per_subband = 16;
} else if (!samples_per_subband_set) {
samples_per_subband = 2048 / (1 << levels);

View File

@ -622,7 +622,7 @@ bool LoadGameDialog() {
fp = fopen(pathname, "rb");
if (fp) {
int bm_handle;
int bm_handle = -1;
int *pbm_handle;
fclose(fp);

View File

@ -510,7 +510,7 @@ int bm_AllocateMemoryForIndex(int n, int w, int h, int add_mem) {
// If add_mem is nonzero, adds that to the amount alloced
// Returns bitmap handle if successful, -1 if otherwise
int bm_AllocBitmap(int w, int h, int add_mem) {
int n, i;
int n = 0, i;
if (!Bitmaps_initted) {
Int3();
mprintf(0, "Bitmaps not initted!!!\n");
@ -539,7 +539,7 @@ int bm_AllocBitmap(int w, int h, int add_mem) {
}
// Just like bm_AllocBitmap but doesn't actually allocate memory. Useful for paging!
int bm_AllocNoMemBitmap(int w, int h) {
int n, i;
int n = 0, i;
if (!Bitmaps_initted) {
Int3();
mprintf(0, "Bitmaps not initted!!!\n");

View File

@ -327,7 +327,7 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) {
uint8_t upside_down = 0;
uint16_t width, height;
uint32_t pixel;
int i, t, n, data8bit = 0, savepos;
int i, t, n, data8bit = 0, savepos = 0;
int mipped = 0;
int num_mips = 1;
int read_ok = 1;
@ -539,7 +539,7 @@ int bm_page_in_file(int n) {
uint8_t image_id_len, color_map_type, image_type, pixsize, descriptor;
uint8_t upside_down = 0;
uint16_t width, height;
int i, data8bit = 0, savepos;
int i, data8bit = 0, savepos = 0;
int mipped = 0, file_mipped = 0;
int num_mips = 1;
char name[BITMAP_NAME_LEN];

View File

@ -913,7 +913,7 @@ void grfont_TranslateToBitmaps(int handle) {
// Font translation routines
void grfont_XlateMonoChar(int bmp_handle, int x, int y, int index, tFontFileInfo *ft, int width) {
int row, col; // byte width of char
uint8_t bit_mask = 0, byte;
uint8_t bit_mask = 0, byte = 0;
uint8_t *fp;
fp = ft->char_data[index];

View File

@ -362,7 +362,7 @@ int mng_CheckIfPageLocked(mngs_Pagelock *pl) {
CFILE *infile;
mngs_Pagelock testlock;
int r, done = 0;
int r = -1, done = 0;
if (!Network_up)
return 1;
@ -408,7 +408,7 @@ int mng_CheckIfPageOwned(mngs_Pagelock *pl, char *owner) {
CFILE *infile;
mngs_Pagelock testlock;
int r, done = 0;
int r = -1, done = 0;
infile = (CFILE *)cfopen(TableLockFilename, "rb");
if (infile == NULL) {

View File

@ -132,7 +132,7 @@ void Error(const char *fmt, ...) {
mprintf(0, "%s\n", Exit_message);
#ifdef _DEBUG
int answer;
int answer = IDOK;
if (DebugBreak_callback_stop)
(*DebugBreak_callback_stop)();

View File

@ -1779,7 +1779,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) {
case ID_ROT_ANIM:
case ID_ANIM: {
int nframes;
int nframes = 0;
// mprintf(0,"ROT ANIM chunk!!!\n");
if (!timed) {
@ -1861,7 +1861,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) {
}
case ID_POS_ANIM: {
int nframes;
int nframes = 0;
// mprintf(0,"POS ANIM chunk!!!\n");
if (!timed) {

View File

@ -248,7 +248,7 @@ BOOL InetGetFile::IsFileReceived() {
}
BOOL InetGetFile::IsFileError() {
int state;
int state = FTP_STATE_INTERNAL_ERROR;
if (m_HardError)
return true;
if (m_bUseHTTP) {
@ -278,7 +278,7 @@ BOOL InetGetFile::IsFileError() {
}
int InetGetFile::GetErrorCode() {
int state;
int state = FTP_STATE_INTERNAL_ERROR;
if (m_HardError)
return m_HardError;
if (m_bUseHTTP) {

View File

@ -8072,8 +8072,8 @@ void BarnSwallow::DoFrame(int me) {
case BSM_NEST: {
if (Game_GetTime() > memory->next_mode_time) {
int target;
int room;
int me_room;
int room = 0;
int me_room = 0;
AI_Value(me, VF_GET, AIV_I_TARGET_HANDLE, &target);