Use fabsf when return value is a float. Small warning fix.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4269
This commit is contained in:
parent
19478d45f5
commit
e1d8eb67a4
3 changed files with 5 additions and 5 deletions
|
@ -243,7 +243,7 @@ void DOS_Drive_Cache::AddEntryDirOverlay(const char* path, bool checkExists) {
|
|||
#if defined (WIN32)
|
||||
//OS2 ?
|
||||
if (post > dironly && *(post - 1) == ':' && (post - dironly) == 2)
|
||||
post++; //move away from X: as need to end up with x:\
|
||||
post++; //move away from X: as need to end up with x:\ .
|
||||
#else
|
||||
//Lets hope this is not really used.. (root folder specified as overlay)
|
||||
if (post == dironly)
|
||||
|
|
|
@ -67,7 +67,7 @@ struct JoyStick {
|
|||
}
|
||||
|
||||
void transform_circular(){
|
||||
float r = sqrt(xpos * xpos + ypos * ypos);
|
||||
float r = sqrtf(xpos * xpos + ypos * ypos);
|
||||
if (r == 0.0) {xfinal = xpos; yfinal = ypos; return;}
|
||||
float deadzone_f = deadzone / 100.0f;
|
||||
float s = 1.0f - deadzone_f;
|
||||
|
@ -77,8 +77,8 @@ struct JoyStick {
|
|||
}
|
||||
|
||||
float deadzonescale = (r - deadzone_f) / s; //r if deadzone=0;
|
||||
float xa = fabs(xpos);
|
||||
float ya = fabs(ypos);
|
||||
float xa = fabsf(xpos);
|
||||
float ya = fabsf(ypos);
|
||||
float maxpos = (ya>xa?ya:xa);
|
||||
xfinal = xpos * deadzonescale/maxpos;
|
||||
yfinal = ypos * deadzonescale/maxpos;
|
||||
|
|
|
@ -278,7 +278,7 @@ static void PCSPEAKER_CallBack(Bitu len) {
|
|||
index+=vol_len;
|
||||
} else {
|
||||
/* Check how long it will take to goto new level */
|
||||
float vol_time=fabs(vol_diff)/SPKR_SPEED;
|
||||
float vol_time=fabsf(vol_diff)/SPKR_SPEED;
|
||||
if (vol_time<=vol_len) {
|
||||
/* Volume reaches endpoint in this block, calc until that point */
|
||||
value+=vol_time*spkr.volcur;
|
||||
|
|
Loading…
Add table
Reference in a new issue