Merge pull request #676 from pappyvw/warnings

Remove all unused variables and use correct format specifiers
This commit is contained in:
Alex Lin 2018-10-19 07:47:42 -05:00 committed by GitHub
commit edddc79e25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 22 additions and 41 deletions

View File

@ -35,8 +35,6 @@ GLuint MakeTexture(GLubyte* data , int width, int height) {
void Satellite_initialize(void) {
FILE fp;
capsuleTextureID = MakeTexture(Capsule_texture, CAPSULE_TEXTURE_WIDTH, CAPSULE_TEXTURE_HEIGHT);
nozzleTextureID = MakeTexture(Nozzle_texture, NOZZLE_TEXTURE_WIDTH, NOZZLE_TEXTURE_HEIGHT);

View File

@ -28,8 +28,6 @@ void Satellite::get_force_of_gravity ( double* gForceV) {
void Satellite::get_Force_and_Torque() {
double gforcev[3];
double thruster_force[3];
double thruster_torque[3];
// Zero force.
for (int ii=0; ii<3; ii++) { force[ii] = 0.0; }

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

@ -237,7 +237,6 @@ bool FieldVisitor::VisitFieldDecl( clang::FieldDecl *field ) {
if ( !qt.isCanonical() ) {
fdes->setNonCanonicalTypeName(qt.getAsString()) ;
clang::QualType ct = qt.getCanonicalType() ;
std::string tst_string = ct.getAsString() ;
if ( debug_level >= 3 ) {
std::cout << "\033[33mFieldVisitor VisitFieldDecl: Processing canonical type\033[00m" << std::endl ;
ct.dump() ;
@ -271,8 +270,6 @@ bool FieldVisitor::ProcessTemplate(std::string in_name , clang::CXXRecordDecl *
return false ;
}
size_t pos ;
// Check to see if we've processed this template before
// If not we need to create attributes for this template
if ( processed_templates.find(in_name) == processed_templates.end() ) {

View File

@ -383,7 +383,6 @@ void PrintAttributes::printIOMakefile() {
std::ofstream io_link_list ;
std::ofstream ICG_processed ;
std::ofstream ext_lib ;
unsigned int ii ;
// Don't create a makefile if we didn't process any files.
if ( out_of_date_io_files.empty() ) {

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

@ -42,7 +42,6 @@ GPViewCurveNode::GPViewCurveNode( Widget Toplevel,
std::string curve_symbol_style;
std::string curve_symbol_size;
std::string tmp_string;
std::stringstream tmp_stream;
toplevel = Toplevel;
dpc_curve = Curve;

View File

@ -95,7 +95,6 @@ void GPViewPlotNode::finalize() {
std::string plot_data_src_label;
std::string plot_title;
std::string plot_x_label;
std::string plot_x_units;
std::string plot_x_scale;
std::string plot_x_min_rng;
std::string plot_x_max_rng;

View File

@ -60,7 +60,6 @@ int Trick::DebugPause::debug_signal() {
int Trick::DebugPause::debug_pause_on() {
std::map<std::string , Trick::JobData *>::iterator it ;
std::stringstream sem_name_stream ;
if ( debug_pause_flag == true ) {

View File

@ -38,7 +38,6 @@ int Trick::Executive::loop_multi_thread() {
JobData * depend_job ;
unsigned int ii ;
std::stringstream error_message ;
Trick::ScheduledJobQueue * main_sched_queue ;
int ret = 0 ;

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

@ -79,8 +79,6 @@ int Trick::IPPython::init() {
/** @par Detailed Design: */
FILE *input_fp ;
std::string shortcut ;
std::string verify_command ;
int ret ;
std::string error_message ;
pthread_mutexattr_t m_attr ;

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

@ -21,14 +21,12 @@ int Trick::MemoryManager::add_attr_info( const std::string & user_type_string ,
std::string sub_attr_init_name ;
std::string size_func_name ;
size_t spos ;
std::string::iterator pos ;
ATTRIBUTES* sub_attr = NULL ;
ENUM_ATTR* enum_attr = NULL ;
void (*init_sub_attr)(void) = NULL ;
size_t (*size_func)(void) = NULL ;
unsigned int ii ;
std::set<std::string>::iterator it ;
std::map<std::string,std::string>::iterator mit;
/** @par Design Details: */

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

@ -74,7 +74,6 @@ std::string map_trick_units_to_udunits( std::string orig_units ) {
std::vector<std::string>::iterator it ;
tokenize_units(orig_units, tokens, "*/^()") ;
for( it = tokens.begin() ; it != tokens.end() ; it++ ) {
std::string power ;
char last_char = *((*it).rbegin()) ;
// tokens can end in powers of 2 or 3 in the old system.
// save the power if it is the last character

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) ;

View File

@ -34,9 +34,7 @@ void dump_data ( DataFiles* df,
int main( int narg, char** args ) {
DataFiles df ;
DataFiles headers ;
TCDevice connection ;
int isAsciiData ;
int ret ;
char* file_name ;
char* msg ;