Fix Scala warnings from the future

mediatek_nojit
Georg Lukas 2017-04-24 05:19:01 +02:00
rodzic e5738ce090
commit 66e6d76c2d
6 zmienionych plików z 9 dodań i 9 usunięć

Wyświetl plik

@ -85,7 +85,7 @@ object AprsPacket {
return (splits(0), splits(1).toInt)
} catch {
// fallback to default port if none/bad one given
case _ => return (splits(0), defaultport)
case _ : Throwable => return (splits(0), defaultport)
}
}

Wyświetl plik

@ -267,7 +267,7 @@ class StationOverlay(icons : Drawable, context : MapAct, db : StorageDatabase) e
val strokePaint = new Paint(textPaint)
strokePaint.setColor(0xffc8ffc8)
strokePaint.setStyle(Paint.Style.STROKE)
strokePaint.setStrokeWidth(drawSize.asInstanceOf[Float]/12.f)
strokePaint.setStrokeWidth(drawSize.asInstanceOf[Float]/12.0f)
strokePaint.setShadowLayer(10, 0, 0, 0x80c8ffc8)

Wyświetl plik

@ -14,12 +14,12 @@ class PrefsWrapper(val context : Context) {
// safely read integers
def getStringInt(key : String, defValue : Int) = {
try { prefs.getString(key, null).trim.toInt } catch { case _ => defValue }
try { prefs.getString(key, null).trim.toInt } catch { case _ : Throwable => defValue }
}
// safely read integers
def getStringFloat(key : String, defValue : Float) = {
try { prefs.getString(key, null).trim.toFloat } catch { case _ => defValue }
try { prefs.getString(key, null).trim.toFloat } catch { case _ : Throwable => defValue }
}
// return commonly used prefs

Wyświetl plik

@ -82,10 +82,10 @@ class StationListAdapter(context : Context, prefs : PrefsWrapper,
view.findViewById(R.id.station_qrg).asInstanceOf[TextView].setTextColor(color)
val qrg_visible = if (qrg != null && qrg != "") View.VISIBLE else View.GONE
view.findViewById(R.id.station_qrg).setVisibility(qrg_visible)
val MCD = 1000000.
val MCD = 1000000.0
android.location.Location.distanceBetween(my_lat/MCD, my_lon/MCD,
lat/MCD, lon/MCD, dist)
distage.setText("%1.1f km %s\n%s".format(dist(0)/1000., getBearing(dist(1)), age))
distage.setText("%1.1f km %s\n%s".format(dist(0)/1000.0, getBearing(dist(1)), age))
view.findViewById(R.id.station_symbol).asInstanceOf[SymbolView].setSymbol(symbol)
super.bindView(view, context, cursor)
}

Wyświetl plik

@ -308,7 +308,7 @@ class StorageDatabase(context : Context) extends
}
def getNeighbors(mycall : String, lat : Int, lon : Int, ts : Long, limit : String) : Cursor = {
// calculate latitude correction
val corr = (cos(Pi*lat/180000000.)*cos(Pi*lat/180000000.)*100).toInt
val corr = (cos(Pi*lat/180000000.0)*cos(Pi*lat/180000000.0)*100).toInt
//Log.d(TAG, "getNeighbors: correcting by %d".format(corr))
// add a distance column to the query
val newcols = Station.COLUMNS :+ Station.COL_DIST.format(lat, lat, lon, lon, corr)
@ -319,7 +319,7 @@ class StorageDatabase(context : Context) extends
def getNeighborsLike(call : String, lat : Int, lon : Int, ts : Long, limit : String) : Cursor = {
// calculate latitude correction
val corr = (cos(Pi*lat/180000000.)*cos(Pi*lat/180000000.)*100).toInt
val corr = (cos(Pi*lat/180000000.0)*cos(Pi*lat/180000000.0)*100).toInt
Log.d(TAG, "getNeighborsLike: correcting by %d".format(corr))
// add a distance column to the query
val newcols = Station.COLUMNS :+ Station.COL_DIST.format(lat, lat, lon, lon, corr)

Wyświetl plik

@ -360,7 +360,7 @@ trait UIHelper extends Activity
val (found, lat, lon) = getStaPosition(StorageDatabase.open(this), targetcall)
if (found) {
val url = "geo:%1.6f,%1.6f?q=%1.6f,%1.6f(%s)".formatLocal(null,
lat/1000000., lon/1000000., lat/1000000., lon/1000000., targetcall)
lat/1000000.0, lon/1000000.0, lat/1000000.0, lon/1000000.0, targetcall)
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse(url)))
}