Use correct format specifiers.

Used http://www.cplusplus.com/reference/cstdio/printf/ as a reference.
This commit is contained in:
Pappy Van Winkle 2018-10-11 22:52:04 -05:00
parent af2575da5b
commit 121fa84081
9 changed files with 22 additions and 22 deletions

View File

@ -101,7 +101,7 @@ if (os.path.isfile(SunDisplay_path)) :
os.system( SunDisplay_cmd);
else :
print('==================================================================================')
print('SunDisplay needs to be built. Please \"cd\" into models/Graphics and type \"make\".')
print('SunDisplay needs to be built. Please \"cd\" into models/graphics and type \"make\".')
print('==================================================================================')
trick.stop(86400.0)

View File

@ -60,12 +60,12 @@ int sun_pred_fast_display(
// sprintf(tmp_s," %ls %.6f",S->label_JD, S->JD);
// strcat(message,tmp_s);
if ( S->label_Azimuth != NULL ) {
sprintf(tmp_s," %ls %.3f%lc",S->label_Azimuth, S->solar_azimuth, DEGREE_SIGN);
sprintf(tmp_s," %ls %.3f%d",S->label_Azimuth, S->solar_azimuth, DEGREE_SIGN);
} else {
sprintf(tmp_s," AZIMUTH %.3f%lc", S->solar_azimuth, DEGREE_SIGN);
sprintf(tmp_s," AZIMUTH %.3f%d", S->solar_azimuth, DEGREE_SIGN);
}
strcat(message,tmp_s);
sprintf(tmp_s," %ls %.3f%lc",S->label_Elevation, S->solar_elevation, DEGREE_SIGN);
sprintf(tmp_s," %ls %.3f%d",S->label_Elevation, S->solar_elevation, DEGREE_SIGN);
strcat(message,tmp_s);
send_hs(stdout,"%s\n",message);

View File

@ -17,8 +17,8 @@ void CSV_Formatter::writeDatum(FILE* out_fp, int16_t datum) { fprintf(out_fp,"%
void CSV_Formatter::writeDatum(FILE* out_fp, uint16_t datum) { fprintf(out_fp,"%u", datum); }
void CSV_Formatter::writeDatum(FILE* out_fp, int32_t datum) { fprintf(out_fp,"%d", datum); }
void CSV_Formatter::writeDatum(FILE* out_fp, uint32_t datum) { fprintf(out_fp,"%u", datum); }
void CSV_Formatter::writeDatum(FILE* out_fp, int64_t datum) { fprintf(out_fp,"%lld", datum); }
void CSV_Formatter::writeDatum(FILE* out_fp, uint64_t datum) { fprintf(out_fp,"%lld", datum); }
void CSV_Formatter::writeDatum(FILE* out_fp, int64_t datum) { fprintf(out_fp,"%ld", datum); }
void CSV_Formatter::writeDatum(FILE* out_fp, uint64_t datum) { fprintf(out_fp,"%lu", datum); }
void CSV_Formatter::writeDatum(FILE* out_fp, float datum) { fprintf(out_fp,"%.7f", datum); }
void CSV_Formatter::writeDatum(FILE* out_fp, double datum) { fprintf(out_fp,"%.15g", datum); }
const char* CSV_Formatter::extension() { return ".csv"; };

View File

@ -57,7 +57,7 @@ int filterPostScriptColor( const char *psName, GPViewPageNode* gp_view_page_node
string next_lt ;
string new_buf_ptr ;
string line_color ;
int red , blue , green ;
unsigned int red , blue , green ;
int number_of_plots = (int)gp_view_page_node->plot_node_list.size();
//! Populate buf with file content.

View File

@ -76,7 +76,7 @@ int Trick::Executive::write_s_job_execution(FILE *fp) {
fprintf(fp, "\n===================================================================================================\n") ;
fprintf(fp, "Scheduled Loop:\n\n") ;
for ( ii = 0 ; ii < threads.size() ; ii++ ) {
fprintf(fp, "Thread %d:\n", ii) ;
fprintf(fp, "Thread %u:\n", ii) ;
threads[ii]->job_queue.write_sched_queue(fp) ;
fprintf(fp, "\n") ;
}
@ -87,7 +87,7 @@ int Trick::Executive::write_s_job_execution(FILE *fp) {
fprintf(fp, "Thread 0:\n");
top_of_frame_queue.write_sched_queue(fp) ;
for ( ii = 1 ; ii < threads.size() ; ii++ ) {
fprintf(fp, "Thread %d:\n", ii) ;
fprintf(fp, "Thread %u:\n", ii) ;
threads[ii]->top_of_frame_queue.write_sched_queue(fp) ;
fprintf(fp, "\n") ;
}
@ -98,7 +98,7 @@ int Trick::Executive::write_s_job_execution(FILE *fp) {
fprintf(fp, "Thread 0:\n");
end_of_frame_queue.write_sched_queue(fp) ;
for ( ii = 1 ; ii < threads.size() ; ii++ ) {
fprintf(fp, "Thread %d:\n", ii) ;
fprintf(fp, "Thread %u:\n", ii) ;
threads[ii]->end_of_frame_queue.write_sched_queue(fp) ;
fprintf(fp, "\n") ;
}

View File

@ -782,7 +782,7 @@ int Trick::FrameLog::create_DP_job_files() {
fprintf(fpx, " <page>\n");
for ( ii = 0 ; ii < 8 and (page_count * 8 + ii + 1) < drg_users.size() ; ii++ ) {
fprintf(fpx, " <plot grid=\"yes\">\n");
fprintf(fpx, " <title>Child thread %d Frame Scheduled Jobs</title>\n", (page_count * 8 + ii + 1));
fprintf(fpx, " <title>Child thread %u Frame Scheduled Jobs</title>\n", (page_count * 8 + ii + 1));
fprintf(fpx, " <xaxis> <label>Time</label> <units>s</units> </xaxis>\n");
fprintf(fpx, " <yaxis> <label>Frame Scheduled Jobs Time</label> </yaxis>\n");
fprintf(fpx, " <curve>\n");

View File

@ -100,28 +100,28 @@ int Trick::MTV::send_event_data() {
int jj;
for (ii=0; ii < mtv_count; ii++) {
sprintf(varname, "%s[%d][0].name", mtv_name,ii);
sprintf(varname, "%s[%u][0].name", mtv_name,ii);
var_add(varname);
sprintf(varname, "%s[%d][0].active", mtv_name,ii);
sprintf(varname, "%s[%u][0].active", mtv_name,ii);
var_add(varname);
sprintf(varname, "%s[%d][0].added", mtv_name,ii);
sprintf(varname, "%s[%u][0].added", mtv_name,ii);
var_add(varname);
sprintf(varname, "%s[%d][0].condition_count", mtv_name,ii);
sprintf(varname, "%s[%u][0].condition_count", mtv_name,ii);
var_add(varname);
sprintf(varname, "%s[%d][0].action_count", mtv_name,ii);
sprintf(varname, "%s[%u][0].action_count", mtv_name,ii);
var_add(varname);
sprintf(varname, "%s[%d][0].before_after", mtv_name,ii);
sprintf(varname, "%s[%u][0].before_after", mtv_name,ii);
var_add(varname);
for (jj=0; jj< mtv_list[ii]->condition_count; jj++) {
sprintf(varname, "%s[%d][0].cond[%d].comment", mtv_name,ii,jj);
sprintf(varname, "%s[%u][0].cond[%d].comment", mtv_name,ii,jj);
var_add(varname);
}
for (jj=0; jj< mtv_list[ii]->action_count; jj++) {
sprintf(varname, "%s[%d][0].act[%d].comment", mtv_name,ii,jj);
sprintf(varname, "%s[%u][0].act[%d].comment", mtv_name,ii,jj);
var_add(varname);
}
if (mtv_list[ii]->get_before_after() > 0) {
sprintf(varname, "%s[%d][0].target_name", mtv_name,ii);
sprintf(varname, "%s[%u][0].target_name", mtv_name,ii);
var_add(varname);
}
}

View File

@ -72,7 +72,7 @@ std::string Trick::MonteVarFile::get_next_value() {
// Verify the input column number is valid.
if ((column == 0) || (column > ntokens)) {
char string[100];
sprintf(string, "Trick:MonteVarFile An invalid column number %d, valid column numbers are 1 - %d", column, ntokens);
sprintf(string, "Trick:MonteVarFile An invalid column number %u, valid column numbers are 1 - %u", column, ntokens);
exec_terminate_with_return(-1, __FILE__, __LINE__, string);
}

View File

@ -424,7 +424,7 @@ int Trick::VariableServerThread::transmit_file(std::string sie_file) {
fseek(fp , 0L, SEEK_END) ;
file_size = ftell(fp) ;
sprintf(buffer, "%d\t%d\n" , VS_SIE_RESOURCE, file_size) ;
sprintf(buffer, "%d\t%u\n" , VS_SIE_RESOURCE, file_size) ;
tc_write(&connection , buffer , strlen(buffer)) ;
rewind(fp) ;