diff --git a/PBasic.cpp b/PBasic.cpp index 4b2e064f..40129b03 100644 --- a/PBasic.cpp +++ b/PBasic.cpp @@ -472,7 +472,7 @@ numtostr(char * Result, LDBLE n) /* if ((n != 0 && fabs(n) < 1e-2) || fabs(n) >= 1e12) { */ if (ceil(n) == floor(n)) { - if (!PhreeqcPtr->current_selected_output != NULL && + if (PhreeqcPtr->current_selected_output != NULL && !PhreeqcPtr->current_selected_output->Get_high_precision()) { sprintf(l_s, "%12.0f", (double) n); @@ -484,7 +484,7 @@ numtostr(char * Result, LDBLE n) } else { - if (!PhreeqcPtr->current_selected_output != NULL && + if (PhreeqcPtr->current_selected_output != NULL && !PhreeqcPtr->current_selected_output->Get_high_precision()) { sprintf(l_s, "%12.4e", (double) n); @@ -4397,7 +4397,7 @@ cmdpunch(struct LOC_exec *LINK) if (n.stringval) { /* fputs(n.UU.sval, stdout); */ - if (!PhreeqcPtr->current_selected_output != NULL && + if (PhreeqcPtr->current_selected_output != NULL && !PhreeqcPtr->current_selected_output->Get_high_precision()) { if (strlen(n.UU.sval) <= 12) @@ -4422,7 +4422,7 @@ cmdpunch(struct LOC_exec *LINK) } PhreeqcPtr->PHRQ_free(n.UU.sval); } - else if (!PhreeqcPtr->current_selected_output != NULL && + else if (PhreeqcPtr->current_selected_output != NULL && !PhreeqcPtr->current_selected_output->Get_high_precision()) { PhreeqcPtr->fpunchf_user(PhreeqcPtr->n_user_punch_index, "%12.4e\t", (double) n.UU.val); diff --git a/SelectedOutput.cpp b/SelectedOutput.cpp index 35948f03..6d0fd607 100644 --- a/SelectedOutput.cpp +++ b/SelectedOutput.cpp @@ -38,7 +38,7 @@ SelectedOutput::SelectedOutput(int n, PHRQ_io *io) this->user_punch = true; this->charge_balance = false; this->percent_error = false; - this->punch = false; + //this->punch = false; } @@ -76,4 +76,4 @@ SelectedOutput::Set_file_name(int n) std::ostringstream os; os << "selected_output_" << n << ".sel"; file_name = os.str(); -} \ No newline at end of file +} diff --git a/SelectedOutput.h b/SelectedOutput.h index 2befd46f..44943934 100644 --- a/SelectedOutput.h +++ b/SelectedOutput.h @@ -42,7 +42,7 @@ public: bool Get_charge_balance(void) {return this->charge_balance;} bool Get_percent_error(void) {return this->percent_error;} bool Get_inverse(void) {return this->inverse;} - bool Get_punch(void) {return this->punch;} + //bool Get_punch(void) {return this->punch;} bool Get_active(void) {return this->active;} void Set_file_name(int i); @@ -67,7 +67,7 @@ public: void Set_charge_balance(bool tf) {this->charge_balance = tf;} void Set_percent_error(bool tf) {this->percent_error = tf;} void Set_inverse(bool tf) {this->inverse = tf;} - void Set_punch(bool tf) {this->punch = tf;} + //void Set_punch(bool tf) {this->punch = tf;} void Set_active(bool tf) {this->active = tf;} std::string file_name; @@ -103,6 +103,6 @@ public: bool charge_balance; bool percent_error; bool inverse; - bool punch; + //bool punch; }; -#endif // !defined(SELECTEDOUTPUT_H_INCLUDED) \ No newline at end of file +#endif // !defined(SELECTEDOUTPUT_H_INCLUDED) diff --git a/isotopes.cpp b/isotopes.cpp index 3d9d6373..f77f213a 100644 --- a/isotopes.cpp +++ b/isotopes.cpp @@ -930,12 +930,12 @@ punch_calculate_values(void) } if (!current_selected_output->Get_high_precision()) { - fpunchf(sformatf("V_%s", current_selected_output->Get_calculate_values()[i].first), + fpunchf(sformatf("V_%s", current_selected_output->Get_calculate_values()[i].first.c_str()), "%12.4e\t", (double) result); } else { - fpunchf(sformatf("V_%s", current_selected_output->Get_calculate_values()[i].first), + fpunchf(sformatf("V_%s", current_selected_output->Get_calculate_values()[i].first.c_str()), "%20.12e\t", (double) result); } } diff --git a/read.cpp b/read.cpp index 91e27f4d..1f53d4bb 100644 --- a/read.cpp +++ b/read.cpp @@ -4970,7 +4970,7 @@ read_selected_output(void) temp_selected_output.Set_new_def(true); warning_msg("Use PRINT; -selected_output, not SELECTED_OUTPUT; -selected_output"); value = get_true_false(next_char, TRUE); - temp_selected_output.Set_punch(value!=FALSE); + temp_selected_output.Set_active(value!=FALSE); opt_save = OPTION_ERROR; break; case 49: /* active */ diff --git a/readtr.cpp b/readtr.cpp index dce894c3..3910c381 100644 --- a/readtr.cpp +++ b/readtr.cpp @@ -1033,7 +1033,7 @@ dump_cpp(void) fs << token; for (size_t i = 0; i < current_selected_output->Get_molalities().size(); i++) { - sprintf(token, " %s", current_selected_output->Get_molalities()[i].first.size()); + sprintf(token, " %s", current_selected_output->Get_molalities()[i].first.c_str()); fs << token; } sprintf(token, "\n"); @@ -1151,7 +1151,7 @@ dump_cpp(void) } sprintf(token, "\t-length\n"); fs << token; - for (size_t i = 0; i < count_cells; i++) + for (int i = 0; i < count_cells; i++) { sprintf(token, "%12.3e", (double) cell_data[i].length); fs << token; @@ -1165,7 +1165,7 @@ dump_cpp(void) fs << token; sprintf(token, "\t-disp\n"); fs << token; - for (size_t i = 0; i < count_cells; i++) + for (int i = 0; i < count_cells; i++) { if (current_selected_output != NULL && !current_selected_output->Get_high_precision()) { @@ -1192,7 +1192,7 @@ dump_cpp(void) else j = count_cells; l = 0; - for (size_t i = 0; i < j; i++) + for (int i = 0; i < j; i++) { if (cell_data[i].punch != TRUE) continue; @@ -1214,7 +1214,7 @@ dump_cpp(void) else j = count_cells; l = 0; - for (size_t i = 0; i < j; i++) + for (int i = 0; i < j; i++) { if (cell_data[i].print != TRUE) continue; diff --git a/tidy.cpp b/tidy.cpp index faff973c..0367fff4 100644 --- a/tidy.cpp +++ b/tidy.cpp @@ -1781,6 +1781,7 @@ tidy_punch(void) current_selected_output = &(so_it->second); if (pr.punch == FALSE || current_selected_output == NULL || + !current_selected_output->Get_active() || current_selected_output->punch_ostream == NULL) continue; phrq_io->Set_punch_ostream(current_selected_output->punch_ostream);