@@ -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++) {
@@ -1385,7 +1386,7 @@ int Fred_mission_save::save_cmd_briefs()
13851386 return err;
13861387}
13871388
1388- void Fred_mission_save::fso_comment_push (char * ver)
1389+ void Fred_mission_save::fso_comment_push (const char * ver)
13891390{
13901391 if (fso_ver_comment.empty ()) {
13911392 fso_ver_comment.push_back (SCP_string (ver));
@@ -1402,7 +1403,7 @@ void Fred_mission_save::fso_comment_push(char* ver)
14021403 elem2 = scan_fso_version_string (ver, &in_major, &in_minor, &in_build, &in_revis);
14031404
14041405 // check consistency
1405- if (elem1 == 3 && elem2 == 4 || elem1 == 4 && elem2 == 3 ) {
1406+ if (( elem1 == 3 && elem2 == 4 ) || ( elem1 == 4 && elem2 == 3 ) ) {
14061407 elem1 = elem2 = 3 ;
14071408 } else if ((elem1 >= 3 && elem2 >= 3 ) && (revis < 1000 || in_revis < 1000 )) {
14081409 elem1 = elem2 = 3 ;
@@ -2433,7 +2434,9 @@ int Fred_mission_save::save_mission_file(const char* pathname)
24332434 *ext_ch = 0 ;
24342435
24352436 strcat_s (backup_name, " .bak" );
2437+ #ifdef _WIN32
24362438 cf_attrib (pathname, 0 , FILE_ATTRIBUTE_READONLY, CF_TYPE_MISSIONS);
2439+ #endif
24372440 cf_delete (backup_name, CF_TYPE_MISSIONS);
24382441 cf_rename (pathname, backup_name, CF_TYPE_MISSIONS);
24392442 cf_rename (savepath, pathname, CF_TYPE_MISSIONS);
@@ -4832,7 +4835,7 @@ int Fred_mission_save::save_waypoint_list(const waypoint_list* wp_list)
48324835int Fred_mission_save::save_wings ()
48334836{
48344837 SCP_string sexp_out;
4835- int i, j, z, ship, count = 0 ;
4838+ int i, j, z, count = 0 ;
48364839
48374840 fred_parse_flag = 0 ;
48384841 required_string_fred (" #Wings" );
@@ -5015,7 +5018,7 @@ int Fred_mission_save::save_wings()
50155018 fout (" (\t\t ;! %d total\n " , Wings[i].wave_count );
50165019
50175020 for (j = 0 ; j < Wings[i].wave_count ; j++) {
5018- ship = Wings[i].ship_index [j];
5021+ // ship = Wings[i].ship_index[j];
50195022 // if (Objects[Ships[ship].objnum].type == OBJ_START)
50205023 // fout("\t\"Player 1\"\n");
50215024 // else
0 commit comments