Skip to content

Commit

Permalink
Minor code cleanup (fixing compilation warnings)
Browse files Browse the repository at this point in the history
  • Loading branch information
perwin committed Jul 24, 2024
1 parent 4c95751 commit eb0b371
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.
6 changes: 3 additions & 3 deletions core/config_file_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ int ParseFunctionSection( vector<string>& inputLines, const bool mode2D,
int functionNumber = 0;
int paramNumber = 0;
parameterLimitsFound = false;
while (i < inputLines.size()) {
while (i < (int)inputLines.size()) {
if (inputLines[i].find("X0", 0) != string::npos) {
//printf("X0 detected (i = %d)\n", i);
fsetStartIndices.push_back(functionNumber);
Expand Down Expand Up @@ -559,7 +559,7 @@ int ReadConfigFile( const string& configFileName, const bool mode2D, vector<stri
// OK, now parse the function section
vector<string> funcSectionLines;
vector<int> funcSectionOrigLineNumbers;
for (i = functionSectionStart; i < inputLines.size(); i++) {
for (i = functionSectionStart; i < (int)inputLines.size(); i++) {
funcSectionLines.push_back(inputLines[i]);
funcSectionOrigLineNumbers.push_back(origLineNumbers[i]);
}
Expand Down Expand Up @@ -645,7 +645,7 @@ int ReadConfigFile( const string& configFileName, const bool mode2D, vector<stri
// OK, now parse the function section
vector<string> funcSectionLines;
vector<int> funcSectionOrigLineNumbers;
for (i = functionSectionStart; i < inputLines.size(); i++) {
for (i = functionSectionStart; i < (int)inputLines.size(); i++) {
funcSectionLines.push_back(inputLines[i]);
funcSectionOrigLineNumbers.push_back(origLineNumbers[i]);
}
Expand Down
2 changes: 1 addition & 1 deletion core/model_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,7 @@ int ModelObject::PrintModelParamsToStrings( vector<string> &stringVector, double
// print optional parameters, if they were set
if (functionObjects[n]->ExtraParamsSet()) {
functionObjects[n]->GetExtraParamsDescription(extraParamLines);
for (int p = 0; p < extraParamLines.size(); p++)
for (int p = 0; p < (int)extraParamLines.size(); p++)
stringVector.push_back(PrintToString("%s%s\n", prefix, extraParamLines[p].c_str()));
}

Expand Down
48 changes: 23 additions & 25 deletions function_objects/func_brokenexpdisk3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ double BrokenExponentialDisk3D::GetValue( double x, double y )
double y_diff = y - y0;
double xp, yp, x_d0, y_d0, z_d0, totalIntensity;
double integLimit;
double xyParameters[17];
double xyParameters[16];

// Calculate x,y in component (projected sky) reference frame
xp = x_diff*cosPA + y_diff*sinPA;
Expand All @@ -190,18 +190,17 @@ double BrokenExponentialDisk3D::GetValue( double x, double y )
xyParameters[2] = z_d0;
xyParameters[3] = cosInc;
xyParameters[4] = sinInc;
xyParameters[5] = J_0;
xyParameters[6] = h1;
xyParameters[7] = h2;
xyParameters[8] = r_b;
xyParameters[9] = alpha;
xyParameters[10] = J_0_times_S;
xyParameters[11] = delta_Rb_scaled;
xyParameters[12] = exponent;
xyParameters[13] = z_0;
xyParameters[14] = scaledZ0;
xyParameters[15] = two_to_alpha;
xyParameters[16] = alphaVert;
xyParameters[5] = h1;
xyParameters[6] = h2;
xyParameters[7] = r_b;
xyParameters[8] = alpha;
xyParameters[9] = J_0_times_S;
xyParameters[10] = delta_Rb_scaled;
xyParameters[11] = exponent;
xyParameters[12] = z_0;
xyParameters[13] = scaledZ0;
xyParameters[14] = two_to_alpha;
xyParameters[15] = alphaVert;
F.params = xyParameters;

// integrate out to +/- integLimit, which is larger of (multiple of break radius)
Expand Down Expand Up @@ -238,18 +237,17 @@ double LuminosityDensityBED( double s, void *params )
double z_d0 = paramsVect[2];
double cosInc = paramsVect[3];
double sinInc = paramsVect[4];
double J_0 = paramsVect[5];
double h1 = paramsVect[6];
double h2 = paramsVect[7];
double r_b = paramsVect[8];
double alpha = paramsVect[9];
double J_0_times_S = paramsVect[10];
double delta_Rb_scaled = paramsVect[11];
double exponent = paramsVect[12];
double z_0 = paramsVect[13];
double scaledZ0 = paramsVect[14];
double two_to_alpha = paramsVect[15];
double alphaVert = paramsVect[16];
double h1 = paramsVect[5];
double h2 = paramsVect[6];
double r_b = paramsVect[7];
double alpha = paramsVect[8];
double J_0_times_S = paramsVect[9];
double delta_Rb_scaled = paramsVect[10];
double exponent = paramsVect[11];
double z_0 = paramsVect[12];
double scaledZ0 = paramsVect[13];
double two_to_alpha = paramsVect[14];
double alphaVert = paramsVect[15];

// Given s and the pre-defined parameters, determine our 3D location (x_d,y_d,z_d)
// [by construction, x_d = x_d0]
Expand Down

0 comments on commit eb0b371

Please sign in to comment.