Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Fix 64bit compiler warnings #162

Merged
merged 1 commit into from
Jan 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OVP/D3D9Client/VVessel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2032,7 +2032,7 @@ static inline const int clip(int v, int vMin, int vMax)

inline const char *value_string (char *buf, size_t buf_size, double val)
{
static const char unit_prefixes[] = { (char)230/*'µ'*/, 'm', '\0', 'k' , 'M' , 'G' , 'T' , 'P'};
static const char unit_prefixes[] = { (char)181/*'µ'*/, 'm', '\0', 'k' , 'M' , 'G' , 'T' , 'P'};

int index = (int) (log10(val)) / 3;
val /= pow(10.0, index*3);
Expand Down
2 changes: 1 addition & 1 deletion OVP/D3D9Client/samples/GenericCamera/MFD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ bool CameraMFD::Update(oapi::Sketchpad *pSkp)

hShell->Title (pSkp, text);

sprintf_s(text, 256, "[%s] FOV=%0.0f° Ofs=%2.2f[m]", paci[bParent], fov*2.0, offset);
sprintf_s(text, 256, "[%s] FOV=%0.0f%c Ofs=%2.2f[m]", paci[bParent], fov*2.0, (char)176/*°*/, offset);

pSkp->Text(10, H - tbgh, text, lstrlen(text));

Expand Down
4 changes: 3 additions & 1 deletion Orbitersdk/include/DrawAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,9 @@ namespace oapi {
*/
typedef union FMATRIX4
{
FMATRIX4() {}
FMATRIX4() {
m11 = m12 = m13, m14 = m21 = m22 = m23 = m24 = m31 = m32 = m33 = m34 = m41 = m42 = m43 = m44 = 0;
}

FMATRIX4(float m11, float m12, float m13, float m14,
float m21, float m22, float m23, float m24,
Expand Down
2 changes: 1 addition & 1 deletion Src/Orbiter/Vessel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7695,7 +7695,7 @@ void VESSEL::ShiftCG (const VECTOR3 &shift)
vessel->ShiftDocks (vs);
vessel->ShiftLightEmitters (nshift);
vessel->campos.Set (vessel->campos+vs);
if (g_pane) g_pane->ShiftVC (vs);
if ((g_pane) && (g_focusobj == vessel)) g_pane->ShiftVC (vs);
ShiftCentreOfMass (shift);
}

Expand Down
13 changes: 7 additions & 6 deletions Src/Vessel/Atlantis/Atlantis/AscentAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,11 +658,12 @@ void AscentApMfd::UpdatePg_Gbl (oapi::Sketchpad *skp)
{
double pitch, yaw;
int i;
int s2 = W/16;
int iW = (int)W;
int s2 = iW/16;
int s1 = s2*2;
int cx = W/2;
int cx = iW/2;
int cy = ch*3+s1;
int ssme_cx[3] = {(2*W)/10, (8*W)/10, cx};
int ssme_cx[3] = {(2*iW)/10, (8*iW)/10, cx};
int ssme_cy[3] = {cy+(3*s1)/2, cy+(3*s1)/2, cy};

skp->SetTextAlign (oapi::Sketchpad::CENTER);
Expand All @@ -674,7 +675,7 @@ void AscentApMfd::UpdatePg_Gbl (oapi::Sketchpad *skp)

if (ap->GetVessel()->status < 2) {
int srb_cy = H-s1-ch;
int srb_cx[2] = {(2*W)/10, (8*W)/10};
int srb_cx[2] = {(2*iW)/10, (8*iW)/10};
skp->Line (0, srb_cy-s1-ch*2, W, srb_cy-s1-ch*2);
skp->Text (W/2, srb_cy-s1-(3*ch)/2, "Gimbal SRB", 10);
for (i = 0; i < 2; i++) {
Expand Down Expand Up @@ -1455,9 +1456,9 @@ const char *MetStr (double met)
} else
str[0] = ' ';
h = (int)(met/3600.0);
met -= h*3600;
met -= (double)h*3600;
m = (int)(met/60.0);
met -= m*60;
met -= (double)m*60;
int nh = (h < 100 ? 2:3);
h = min(h,999);
sprintf (str+1, "%0*d:%02d:%04.1f", nh, h, m, met);
Expand Down
2 changes: 1 addition & 1 deletion Src/Vessel/DeltaGlider/FuelMfd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void FuelMFD::ResetVC (DEVMESHHANDLE hMesh)
vc_grp.nVtx = 20;
if (!vc_grp.Vtx) vc_grp.Vtx = new NTVERTEX[vc_grp.nVtx];

GROUPEDITSPEC ges = { GRPEDIT_SETUSERFLAG, isScram ? 3 : 0, 0, 0, 0 };
GROUPEDITSPEC ges = { GRPEDIT_SETUSERFLAG, (DWORD)(isScram ? 3 : 0), 0, 0, 0 };
oapiEditMeshGroup(hMesh, GRP_PROPELLANT_STATUS_NOSCRAM_VC, &ges);
ges.UsrFlag = (isScram ? 0 : 3);
oapiEditMeshGroup(hMesh, GRP_PROPELLANT_STATUS_SCRAM_VC, &ges);
Expand Down
2 changes: 1 addition & 1 deletion Src/Vessel/DeltaGlider/GearSubsys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ bool GearIndicator::RedrawVC (DEVMESHHANDLE hMesh, SURFHANDLE surf)
GROUPEDITSPEC ges;
static WORD vtxofs = VC_GEAR_INDICATOR_vofs;
static const DWORD nvtx = 2;
static WORD vidx[nvtx] = {vtxofs,vtxofs+1};
static WORD vidx[nvtx] = {vtxofs,(WORD)(vtxofs+1)};
static float v[2] = {0.2427f,0.3042f};
NTVERTEX vtx[nvtx];
for (DWORD i = 0; i < nvtx; i++)
Expand Down
2 changes: 1 addition & 1 deletion Src/Vessel/DeltaGlider/LightSubsys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void InstrumentLight::SetLight (bool on, bool force)
mat.emissive.b *= scale;
}
oapiSetMaterial (DG()->vcmesh, 11, on ? &mat : &norm);
GROUPEDITSPEC ges = {on ? GRPEDIT_ADDUSERFLAG : GRPEDIT_DELUSERFLAG, 0x18, 0,0,0};
GROUPEDITSPEC ges = {(DWORD)(on ? GRPEDIT_ADDUSERFLAG : GRPEDIT_DELUSERFLAG), 0x18, 0,0,0};
oapiEditMeshGroup (DG()->vcmesh, GRP_LIT_LABELS_VC, &ges);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Src/Vessel/DeltaGlider/MomentInd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void AngRateIndicator::ResetVC (DEVMESHHANDLE hMesh)

if (!vtxbuf_VC) {
vtxbuf_VC = new NTVERTEX[nvtx];
GROUPREQUESTSPEC grs = {vtxbuf_VC, nvtx, 0, 0, 0, 0, 0, 0};
GROUPREQUESTSPEC grs = {vtxbuf_VC, (DWORD)nvtx, 0, 0, 0, 0, 0, 0};
oapiGetMeshGroup(hMesh, GRP_ANGVEL_DISP_OVR_VC, &grs);
w0_VC = (double)vtxbuf_VC[0].x - (double)vtxbuf_VC[1].x;
for (i = 0; i < 3; i++) {
Expand Down Expand Up @@ -207,7 +207,7 @@ bool AngRateIndicator::RedrawVC (DEVMESHHANDLE hMesh, SURFHANDLE surf)
}
}

GROUPEDITSPEC ges = {GRPEDIT_VTXCRD, 0, vtx, nvtx, 0};
GROUPEDITSPEC ges = {GRPEDIT_VTXCRD, 0, vtx, (DWORD)nvtx, 0};
oapiEditMeshGroup(hMesh, GRP_ANGVEL_DISP_OVR_VC, &ges);
return false;
}
Expand Down