@@ -168,7 +168,7 @@ void Fred_mission_save::convert_special_tags_to_retail()
168168 }
169169}
170170
171- int Fred_mission_save::fout (char * format, ...)
171+ int Fred_mission_save::fout (const char * format, ...)
172172{
173173 // don't output anything if we're saving in retail and have version-specific comments active
174174 if (save_config.save_format == MissionFormat::RETAIL && !fso_ver_comment.empty ()) {
@@ -190,7 +190,7 @@ int Fred_mission_save::fout(char* format, ...)
190190 return 0 ;
191191}
192192
193- int Fred_mission_save::fout_ext (char * pre_str, char * format, ...)
193+ int Fred_mission_save::fout_ext (const char * pre_str, const char * format, ...)
194194{
195195 // don't output anything if we're saving in retail and have version-specific comments active
196196 if (save_config.save_format == MissionFormat::RETAIL && !fso_ver_comment.empty ()) {
@@ -298,7 +298,7 @@ int Fred_mission_save::fout_ext(char* pre_str, char* format, ...)
298298 return 0 ;
299299}
300300
301- int Fred_mission_save::fout_version (char * format, ...)
301+ int Fred_mission_save::fout_version (const char * format, ...)
302302{
303303 SCP_string str_scp;
304304 char * ch = NULL ;
@@ -563,7 +563,8 @@ void Fred_mission_save::parse_comments(int newlines)
563563
564564void Fred_mission_save::save_ai_goals (ai_goal* goalp, int ship)
565565{
566- char *str = NULL , buf[80 ];
566+ const char * str = NULL ;
567+ char buf[80 ];
567568 int i, valid, flag = 1 ;
568569
569570 for (i = 0 ; i < MAX_AI_GOALS; i++) {
@@ -1389,7 +1390,7 @@ int Fred_mission_save::save_cmd_briefs()
13891390 return err;
13901391}
13911392
1392- void Fred_mission_save::fso_comment_push (char * ver)
1393+ void Fred_mission_save::fso_comment_push (const char * ver)
13931394{
13941395 if (fso_ver_comment.empty ()) {
13951396 fso_ver_comment.push_back (SCP_string (ver));
@@ -1406,7 +1407,7 @@ void Fred_mission_save::fso_comment_push(char* ver)
14061407 elem2 = scan_fso_version_string (ver, &in_major, &in_minor, &in_build, &in_revis);
14071408
14081409 // check consistency
1409- if (elem1 == 3 && elem2 == 4 || elem1 == 4 && elem2 == 3 ) {
1410+ if (( elem1 == 3 && elem2 == 4 ) || ( elem1 == 4 && elem2 == 3 ) ) {
14101411 elem1 = elem2 = 3 ;
14111412 } else if ((elem1 >= 3 && elem2 >= 3 ) && (revis < 1000 || in_revis < 1000 )) {
14121413 elem1 = elem2 = 3 ;
@@ -2437,7 +2438,9 @@ int Fred_mission_save::save_mission_file(const char* pathname)
24372438 *ext_ch = 0 ;
24382439
24392440 strcat_s (backup_name, " .bak" );
2441+ #ifdef _WIN32
24402442 cf_attrib (pathname, 0 , FILE_ATTRIBUTE_READONLY, CF_TYPE_MISSIONS);
2443+ #endif
24412444 cf_delete (backup_name, CF_TYPE_MISSIONS);
24422445 cf_rename (pathname, backup_name, CF_TYPE_MISSIONS);
24432446 cf_rename (savepath, pathname, CF_TYPE_MISSIONS);
@@ -4836,7 +4839,7 @@ int Fred_mission_save::save_waypoint_list(const waypoint_list* wp_list)
48364839int Fred_mission_save::save_wings ()
48374840{
48384841 SCP_string sexp_out;
4839- int i, j, z, ship, count = 0 ;
4842+ int i, j, z, count = 0 ;
48404843
48414844 fred_parse_flag = 0 ;
48424845 required_string_fred (" #Wings" );
@@ -5019,7 +5022,7 @@ int Fred_mission_save::save_wings()
50195022 fout (" (\t\t ;! %d total\n " , Wings[i].wave_count );
50205023
50215024 for (j = 0 ; j < Wings[i].wave_count ; j++) {
5022- ship = Wings[i].ship_index [j];
5025+ // ship = Wings[i].ship_index[j];
50235026 // if (Objects[Ships[ship].objnum].type == OBJ_START)
50245027 // fout("\t\"Player 1\"\n");
50255028 // else
0 commit comments