Index: code/cutscene/decoder16.cpp =================================================================== --- code/cutscene/decoder16.cpp (revision 6576) +++ code/cutscene/decoder16.cpp (working copy) @@ -10,18 +10,14 @@ static ushort *backBuf1, *backBuf2; static int lookup_initialized; -static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned char **pData, unsigned char **pOffData, int *pDataRemain, int *curXb, int *curYb); +static void dispatchDecoder16(ushort **pFrame, ubyte codeType, ubyte **pData, ubyte **pOffData, int *pDataRemain, int *curXb, int *curYb); static void genLoopkupTable(); -void decodeFrame16(unsigned char *pFrame, unsigned char *pMap, int mapRemain, unsigned char *pData, int dataRemain) +void decodeFrame16(ubyte *pFrame, ubyte *pMap, int mapRemain, unsigned char *pData, int dataRemain) { - unsigned char *pOrig; - unsigned char *pOffData, *pEnd; + ubyte *pOrig, *pOffData, *pEnd, op; ushort offset; - int length; - int op; - int i, j; - int xb, yb; + int i, j, xb, yb, length; if (!lookup_initialized) { genLoopkupTable(); Index: code/cutscene/mve_audio.cpp =================================================================== --- code/cutscene/mve_audio.cpp (revision 6576) +++ code/cutscene/mve_audio.cpp (working copy) @@ -29,7 +29,7 @@ static void sendWord(short **fout, int nOffset) { - *(*fout)++ = nOffset; + *(*fout)++ = (short)nOffset; } static void processSwath(short *fout, unsigned char *data, int swath, int *offsets) @@ -42,7 +42,7 @@ } } -void mveaudio_uncompress(short *buffer, unsigned char *data, int length) +void mveaudio_uncompress(short *buffer, unsigned char *data) { int nCurOffsets[2]; int swath; Index: code/cutscene/mveplayer.cpp =================================================================== --- code/cutscene/mveplayer.cpp (revision 6576) +++ code/cutscene/mveplayer.cpp (working copy) @@ -59,7 +59,7 @@ mve_audio_t *mas; // mve_audio_stream // audio decompressor -extern void mveaudio_uncompress(short *buffer, unsigned char *data, int length); +extern void mveaudio_uncompress(short *buffer, unsigned char *data); // video variables int g_width, g_height; @@ -366,7 +366,7 @@ int mve_audio_data(ubyte major, ubyte *data) nsamp += 4; buf = (short *)vm_malloc(nsamp); - mveaudio_uncompress(buf, data, -1); /* XXX */ + mveaudio_uncompress(buf, data); /* XXX */ } else { nsamp -= 8; data += 8; Index: code/ddsutils/ddsutils.cpp =================================================================== --- code/ddsutils/ddsutils.cpp (revision 6576) +++ code/ddsutils/ddsutils.cpp (working copy) @@ -495,7 +495,4 @@ const char *dds_error_string(int code) default: return "Abort, retry, fail?"; } - - //get a warning otherwise - return "Abort, retry, fail?"; } Index: code/debugconsole/console.cpp =================================================================== --- code/debugconsole/console.cpp (revision 6576) +++ code/debugconsole/console.cpp (working copy) @@ -80,6 +80,7 @@ uint Dc_arg_type; // The type of dc_arg. char *Dc_command_line; // The rest of the command line, from the end of the last processed arg on. int Dc_arg_int; // If Dc_arg_type & ARG_INT is set, then this is the value +ubyte Dc_arg_ubyte; // If Dc_arg_type & ARG_UBYTE is set, then this is the value float Dc_arg_float; // If Dc_arg_type & ARG_FLOAT is set, then this is the value int scroll_times = 0; // incremented each time display scrolls @@ -279,6 +280,11 @@ void dc_get_arg(uint type) if ( !strchr( Dc_arg, '.' )) { Dc_arg_type |= ARG_INT; Dc_arg_int = atoi(Dc_arg); + } else { + if ( !strchr( Dc_arg, '.' )) { + Dc_arg_type |= ARG_UBYTE; + Dc_arg_ubyte = (ubyte)atoi(Dc_arg); + } } } else { if ( (Dc_arg[0] == '0') && (Dc_arg[1] == 'x') ) { @@ -299,6 +305,9 @@ void dc_get_arg(uint type) if ( Dc_arg_type & ARG_INT ) dc_printf( "Found int number! %d\n", Dc_arg_int ); + if ( Dc_arg_type & ARG_UBYTE ) + dc_printf( "Found ubyte number! %d\n", Dc_arg_int ); + if ( Dc_arg_type & ARG_HEX ) dc_printf( "Found hex number! 0x%x\n", Dc_arg_int ); } @@ -329,6 +338,13 @@ void dc_get_arg(uint type) Dc_arg_type |= ARG_FALSE; } + if ( Dc_arg_type & ARG_UBYTE) { + if ( Dc_arg_ubyte ) + Dc_arg_type |= ARG_TRUE; + else + Dc_arg_type |= ARG_FALSE; + } + if ( !(Dc_arg_type&type) ) { if ( (Dc_arg_type & ARG_NONE) && !(type & ARG_NONE)) dc_printf( "Error: Not enough parameters.\n" ); Index: code/fs2netd/fs2netd_client.cpp =================================================================== --- code/fs2netd/fs2netd_client.cpp (revision 6576) +++ code/fs2netd/fs2netd_client.cpp (working copy) @@ -823,7 +823,7 @@ void fs2netd_gameserver_start() Multi_tracker_game_data.flags = Netgame.flags; Multi_tracker_game_data.type_flags = Netgame.type_flags; Multi_tracker_game_data.players = (short)multi_num_players(); - Multi_tracker_game_data.max_players = Netgame.max_players; + Multi_tracker_game_data.max_players = (short)Netgame.max_players; Multi_tracker_game_data.mode = (ubyte)Netgame.mode; Multi_tracker_game_data.rank_base = (ubyte)Netgame.rank_base; Multi_tracker_game_data.game_state = (ubyte)Netgame.game_state; Index: code/fs2netd/tcp_client.cpp =================================================================== --- code/fs2netd/tcp_client.cpp (revision 6576) +++ code/fs2netd/tcp_client.cpp (working copy) @@ -549,7 +549,7 @@ void FS2NetD_SendServerStart() PXO_ADD_INT( Netgame.type_flags ); PXO_ADD_SHORT( (short)multi_num_players() ); - PXO_ADD_SHORT( Netgame.max_players ); + PXO_ADD_SHORT( (short)Netgame.max_players ); tvar = (ubyte)Netgame.mode; PXO_ADD_DATA( tvar ); Index: code/fs2netd/tcp_socket.cpp =================================================================== --- code/fs2netd/tcp_socket.cpp (revision 6576) +++ code/fs2netd/tcp_socket.cpp (working copy) @@ -60,9 +60,10 @@ int FS2NetD_ConnectToServer(const char *host, const char *port) { struct hostent *my_host = NULL; char host_str[5]; +#ifdef SCP_UNIX int my_error = 0; +#endif - if ( !Connecting ) { #ifdef WIN32 WSADATA wsa; @@ -215,8 +216,6 @@ int FS2NetD_ConnectToServer(const char *host, const char *port) // not connected, and haven't failed to connect, so keep in the loop return 0; } - - return -1; } int FS2NetD_GetData(char *buffer, int blen) Index: code/globalincs/pstypes.h =================================================================== --- code/globalincs/pstypes.h (revision 6576) +++ code/globalincs/pstypes.h (working copy) @@ -371,6 +371,7 @@ extern uint Dc_arg_type; // The type of dc_arg. extern char *Dc_command_line; // The rest of the command line, from the end of the last processed arg on. extern int Dc_arg_int; // If Dc_arg_type & ARG_INT or ARG_HEX is set, then this is the value +extern ubyte Dc_arg_ubyte; // If Dc_arg_type & ARG_UBYTE is set, then this is the value extern float Dc_arg_float; // If Dc_arg_type & ARG_FLOAT is set, then this is the value // Outputs text to the console @@ -394,6 +395,7 @@ #define ARG_PLUS (1<<8) // Plus sign #define ARG_MINUS (1<<9) // Minus sign #define ARG_COMMA (1<<10) // a comma +#define ARG_UBYTE (1<<11) // a valid ubyte // A shortcut for boolean only variables. // Example: Index: code/graphics/2d.cpp =================================================================== --- code/graphics/2d.cpp (revision 6576) +++ code/graphics/2d.cpp (working copy) @@ -262,14 +262,14 @@ DCF(clear_color, "set clear color r, g, b") // set screen clear color DCF(clear_color, "set clear color r, g, b") { - int r, g, b; + ubyte r, g, b; - dc_get_arg(ARG_INT); - r = Dc_arg_int; - dc_get_arg(ARG_INT); - g = Dc_arg_int; - dc_get_arg(ARG_INT); - b = Dc_arg_int; + dc_get_arg(ARG_UBYTE); + r = Dc_arg_ubyte; + dc_get_arg(ARG_UBYTE); + g = Dc_arg_ubyte; + dc_get_arg(ARG_UBYTE); + b = Dc_arg_ubyte; // set the color gr_set_clear_color(r, g, b); Index: code/graphics/gropengl.cpp =================================================================== --- code/graphics/gropengl.cpp (revision 6576) +++ code/graphics/gropengl.cpp (working copy) @@ -770,7 +770,7 @@ static void opengl_make_gamma_ramp(float gamma, ushort *ramp) // I feel dirty... static void opengl_make_gamma_ramp(float gamma, ushort *ramp) { - int x, y; + ushort x, y; ushort base_ramp[256]; Assert( ramp != NULL ); @@ -801,12 +801,12 @@ static void opengl_make_gamma_ramp(float gamma, ushort *ramp) // for everything else we need to actually figure it up else { double g = 1.0 / (double)gamma; - int val; + double val; Assert( GL_original_gamma_ramp != NULL ); for (x = 0; x < 256; x++) { - val = (int) (pow(x/255.0, g) * 65535.0 + 0.5); + val = (pow(x/255.0, g) * 65535.0 + 0.5); CLAMP( val, 0, 65535 ); base_ramp[x] = (ushort)val; @@ -1523,7 +1523,7 @@ int opengl_init_display_device() Cmdline_no_set_gamma = 1; } else { // assume identity ramp by default, to be overwritten by true ramp later - for (int x = 0; x < 256; x++) { + for (ushort x = 0; x < 256; x++) { GL_original_gamma_ramp[x] = GL_original_gamma_ramp[x + 256] = GL_original_gamma_ramp[x + 512] = (x << 8) | x; } } Index: code/hud/hudtarget.cpp =================================================================== --- code/hud/hudtarget.cpp (revision 6576) +++ code/hud/hudtarget.cpp (working copy) @@ -1004,19 +1004,19 @@ color HUD_color_homing_indicator; -void hud_make_shader(shader *sh, int r, int g, int b, float dimmer = 1000.0f) +void hud_make_shader(shader *sh, ubyte r, ubyte g, ubyte b, float dimmer = 1000.0f) { // float rf,gf,bf,cf; - int R = 255, G = 255, B = 255, A = 255; + ubyte R = 255, G = 255, B = 255, A = 255; // The m matrix converts all colors to shades of green //float tmp = 16.0f*(0.0015625f * i2fl(HUD_color_alpha+1.0f)); float tmp = 0.025f * i2fl(HUD_color_alpha+1.0f); - R = fl2i(r * tmp); - G = fl2i(r * tmp); // fl2i(g * tmp); WTF?? - B = fl2i(r * tmp); // fl2i(b * tmp); WTF?? - A = fl2i((i2fl(r) / dimmer)*(i2fl(HUD_color_alpha) / 15.0f) * 255.0f); + R = (ubyte)fl2i(r * tmp); + G = (ubyte)fl2i(r * tmp); // fl2i(g * tmp); WTF?? + B = (ubyte)fl2i(r * tmp); // fl2i(b * tmp); WTF?? + A = (ubyte)fl2i((i2fl(r) / dimmer)*(i2fl(HUD_color_alpha) / 15.0f) * 255.0f); gr_create_shader( sh, R, G, B, A ); } Index: code/inetfile/chttpget.cpp =================================================================== --- code/inetfile/chttpget.cpp (revision 6576) +++ code/inetfile/chttpget.cpp (working copy) @@ -597,8 +597,6 @@ uint ChttpGet::ReadDataChannel() m_State = HTTP_STATE_FILE_RECEIVED; return 1; } - - return 1; } Index: code/lab/wmcgui.cpp =================================================================== --- code/lab/wmcgui.cpp (revision 6576) +++ code/lab/wmcgui.cpp (working copy) @@ -2390,7 +2390,7 @@ int Text::DoKeyPress(float frametime) //We can add the letter to the box. Cheers. //If this warning bothers you, go ahead and cast it. - Content += symbol; + Content += (char)symbol; //It bothered me, so I casted it. Zacam if(SaveType & T_ST_REALTIME) { Save(); @@ -2577,7 +2577,7 @@ bool Text::Save() } else if(SaveType & T_ST_SINT) { - int the_sint = atoi(Content.c_str()); + short the_sint = (short)atoi(Content.c_str()); if(the_sint <= SaveMax && the_sint >= SaveMin) { *siSavePointer = the_sint; Index: code/lab/wmcgui.h =================================================================== --- code/lab/wmcgui.h (revision 6576) +++ code/lab/wmcgui.h (working copy) @@ -574,7 +574,7 @@ int SaveType; union { - short int *siSavePointer; + short *siSavePointer; int *iSavePointer; ubyte *ubSavePointer; float *flSavePointer; Index: code/menuui/playermenu.cpp =================================================================== --- code/menuui/playermenu.cpp (revision 6576) +++ code/menuui/playermenu.cpp (working copy) @@ -169,7 +169,7 @@ char Player_select_last_pilot[CALLSIGN_LEN + 10]; // callsign of the last used pilot, or none if there wasn't one int Player_select_last_is_multi; -int Player_select_force_main_hall = -1; +ubyte Player_select_force_main_hall = 0; static int Player_select_no_save_pilot = 0; // to skip save of pilot in pilot_select_close() @@ -241,7 +241,7 @@ void player_select_init() // start a looping ambient sound main_hall_start_ambient(); - Player_select_force_main_hall = -1; + Player_select_force_main_hall = 0; Player_select_screen_active = 1; @@ -1410,11 +1410,11 @@ DCF(bastion,"Sets the player to be on the bastion (or any other main hall)") if (Dc_command) { - dc_get_arg(ARG_INT | ARG_NONE); + dc_get_arg(ARG_UBYTE | ARG_NONE); - if (Dc_arg_type & ARG_INT) + if (Dc_arg_type & ARG_UBYTE) { - int idx = Dc_arg_int; + ubyte idx = Dc_arg_ubyte; if (idx < 0 || idx >= MAIN_HALLS_MAX) { Index: code/mission/missionmessage.cpp =================================================================== --- code/mission/missionmessage.cpp (revision 6576) +++ code/mission/missionmessage.cpp (working copy) @@ -899,7 +899,6 @@ bool message_filename_is_generic(char *filename) // Goober5000 bool message_filename_is_generic(char *filename) { - int i; char truncated_filename[MAX_FILENAME_LEN]; // truncate any file extension @@ -914,7 +913,7 @@ bool message_filename_is_generic(char *filename) *ptr = '\0'; // test against the list - for (i = 0; i < generic_message_filenames.size(); i++) + for (unsigned int i = 0; i < generic_message_filenames.size(); i++) { if (!stricmp(generic_message_filenames[i].c_str(), truncated_filename)) return true; Index: code/nebula/neb.cpp =================================================================== --- code/nebula/neb.cpp (revision 6576) +++ code/nebula/neb.cpp (working copy) @@ -1692,14 +1692,14 @@ DCF(neb2_fog_color, "") DCF(neb2_fog_color, "") { - int r, g, b; + ubyte r, g, b; - dc_get_arg(ARG_INT); - r = Dc_arg_int; - dc_get_arg(ARG_INT); - g = Dc_arg_int; - dc_get_arg(ARG_INT); - b = Dc_arg_int; + dc_get_arg(ARG_UBYTE); + r = Dc_arg_ubyte; + dc_get_arg(ARG_UBYTE); + g = Dc_arg_ubyte; + dc_get_arg(ARG_UBYTE); + b = Dc_arg_ubyte; Neb2_fog_color_r = r; Neb2_fog_color_g = g; Index: code/network/multi_update.cpp =================================================================== --- code/network/multi_update.cpp (revision 6576) +++ code/network/multi_update.cpp (working copy) @@ -126,9 +126,6 @@ int multi_update_error_verifying() default: return MULTI_UPDATE_MAIN_MENU; } - - // should never happen, but if so, move back to the main menu - return MULTI_UPDATE_MAIN_MENU; } // check to see if the version of FS on this machine is not recent. run in a popup Index: code/parse/sexp.cpp =================================================================== --- code/parse/sexp.cpp (revision 6576) +++ code/parse/sexp.cpp (working copy) @@ -12357,14 +12357,14 @@ void sexp_ship_change_alt_name(int node) // change ingame ship case OSWPT_TYPE_SHIP: { - sexp_ingame_ship_alt_name(oswpt.shipp, new_alt_index); + sexp_ingame_ship_alt_name(oswpt.shipp, (char)new_alt_index); break; } // change ship yet to arrive case OSWPT_TYPE_PARSE_OBJECT: { - sexp_parse_ship_alt_name(oswpt.p_objp, new_alt_index); + sexp_parse_ship_alt_name(oswpt.p_objp, (char)new_alt_index); break; } @@ -12373,13 +12373,13 @@ void sexp_ship_change_alt_name(int node) { // current ships for (int i = 0; i < oswpt.wingp->current_count; i++) - sexp_ingame_ship_alt_name(&Ships[oswpt.wingp->ship_index[i]], new_alt_index); + sexp_ingame_ship_alt_name(&Ships[oswpt.wingp->ship_index[i]], (char)new_alt_index); // ships yet to arrive for (p_object *p_objp = GET_FIRST(&Ship_arrival_list); p_objp != END_OF_LIST(&Ship_arrival_list); p_objp = GET_NEXT(p_objp)) { if (p_objp->wingnum == WING_INDEX(oswpt.wingp)) - sexp_parse_ship_alt_name(p_objp, new_alt_index); + sexp_parse_ship_alt_name(p_objp, (char)new_alt_index); } break; } @@ -17259,9 +17259,9 @@ void sexp_show_subtitle_text(int node) gr_init_alphacolor(&new_color, red, green, blue, 255); // calculate pixel positions - int x_pos = gr_screen.max_w * (x_pct / 100.0f); - int y_pos = gr_screen.max_h * (y_pct / 100.0f); - int width = gr_screen.max_w * (width_pct / 100.0f); + int x_pos = (int) (gr_screen.max_w * (x_pct / 100.0f)); + int y_pos = (int) (gr_screen.max_h * (y_pct / 100.0f)); + int width = (int) (gr_screen.max_w * (width_pct / 100.0f)); // add the subtitle subtitle new_subtitle(x_pos, y_pos, text, NULL, display_time, fade_time, &new_color, fontnum, center_x, center_y, width, 0, post_shaded); @@ -17377,10 +17377,10 @@ void sexp_show_subtitle_image(int node) height_pct = 100; // calculate pixel positions - int x_pos = gr_screen.max_w * (x_pct / 100.0f); - int y_pos = gr_screen.max_h * (y_pct / 100.0f); - int width = gr_screen.max_w * (width_pct / 100.0f); - int height = gr_screen.max_h * (height_pct / 100.0f); + int x_pos = (int)(gr_screen.max_w * (x_pct / 100.0f)); + int y_pos = (int)(gr_screen.max_h * (y_pct / 100.0f)); + int width = (int)(gr_screen.max_w * (width_pct / 100.0f)); + int height = (int)(gr_screen.max_h * (height_pct / 100.0f)); // add the subtitle subtitle new_subtitle(x_pos, y_pos, NULL, image, display_time, fade_time, NULL, -1, center_x, center_y, width, height, post_shaded); Index: code/ship/awacs.cpp =================================================================== --- code/ship/awacs.cpp (revision 6576) +++ code/ship/awacs.cpp (working copy) @@ -338,9 +338,6 @@ float awacs_get_level(object *target, ship *viewer, int use_awacs) // untargetable at longer range return UNTARGETABLE; } - - Int3(); - return FULLY_TARGETABLE; } Index: code/sound/audiostr.cpp =================================================================== --- code/sound/audiostr.cpp (revision 6576) +++ code/sound/audiostr.cpp (working copy) @@ -846,7 +846,7 @@ int WaveFile::Read(ubyte *pbDest, uint cbSize, int service) int sample_size = sizeof(float) * m_wfmt.nChannels; while ( !m_abort_next_read && ((uint)actual_read < num_bytes_read)) { - float **pcm; + float **pcm = NULL; if (m_wfmt.wBitsPerSample == 32) { rc = ov_read_float(&m_snd_info.vorbis_file, &pcm, (num_bytes_read - actual_read) / sample_size, §ion); Index: code/sound/ds.cpp =================================================================== --- code/sound/ds.cpp (revision 6576) +++ code/sound/ds.cpp (working copy) @@ -763,7 +763,7 @@ int ds_load_buffer(int *sid, int *final_size, void *header, sound_info *si, int flags) nprintf(( "Sound", "SOUND ==> Converting sound from ADPCM to PCM\n" )); - rc = ACM_convert_ADPCM_to_PCM(pwfx, si->data, si->size, &convert_buffer, 0, &convert_len, &src_bytes_used, bits); + rc = ACM_convert_ADPCM_to_PCM(pwfx, si->data, si->size, &convert_buffer, 0, &convert_len, &src_bytes_used, (ushort)bits); if ( rc == -1 ) { return -1; @@ -869,7 +869,7 @@ int ds_load_buffer(int *sid, int *final_size, void *header, sound_info *si, int flags) } while (src_bytes_used < si->size) { - float **pcm; + float **pcm = NULL; if (si->bits == 32) { rc = ov_read_float(&si->ogg_info, &pcm, 1024, §ion); Index: projects/MSVC_2005/liblua.vcproj =================================================================== --- projects/MSVC_2005/liblua.vcproj (revision 6576) +++ projects/MSVC_2005/liblua.vcproj (working copy) @@ -428,10 +428,6 @@ > - - Index: projects/MSVC_2008/liblua.vcproj =================================================================== --- projects/MSVC_2008/liblua.vcproj (revision 6576) +++ projects/MSVC_2008/liblua.vcproj (working copy) @@ -1110,10 +1110,6 @@ > - - Index: projects/MSVC_2010/liblua.vcxproj =================================================================== --- projects/MSVC_2010/liblua.vcxproj (revision 6576) +++ projects/MSVC_2010/liblua.vcxproj (working copy) @@ -696,7 +696,6 @@ - Index: projects/MSVC_2010/liblua.vcxproj.filters =================================================================== --- projects/MSVC_2010/liblua.vcxproj.filters (revision 6576) +++ projects/MSVC_2010/liblua.vcxproj.filters (working copy) @@ -92,9 +92,6 @@ Source Files - - Source Files - Source Files Index: projects/MSVC_6/liblua.dsp =================================================================== --- projects/MSVC_6/liblua.dsp (revision 6576) +++ projects/MSVC_6/liblua.dsp (working copy) @@ -243,10 +243,6 @@ # End Source File # Begin Source File -SOURCE=..\..\lua\lua.c -# End Source File -# Begin Source File - SOURCE=..\..\lua\lundump.c # End Source File # Begin Source File