Selaa lähdekoodia

fix some `@:coreApi` related argument names

Simon Krajewski 9 vuotta sitten
vanhempi
commit
e6c315e7a8
2 muutettua tiedostoa jossa 20 lisäystä ja 18 poistoa
  1. 10 8
      std/hl/_std/Math.hx
  2. 10 10
      std/hl/_std/Std.hx

+ 10 - 8
std/hl/_std/Math.hx

@@ -7,13 +7,13 @@ class Math {
 	@:hlNative("std","math_floor") public static function floor( v : Float ) : Int 			return 0;
 	@:hlNative("std","math_round") public static function round( v : Float ) : Int 			return 0;
 	@:hlNative("std","math_ceil") public static function ceil( v : Float ) : Int 			return 0;
-	@:hlNative("std","math_finite") public static function isFinite( v : Float ) : Bool 	return true;
-	@:hlNative("std","math_isnan") public static function isNaN( v : Float ) : Bool 		return false;
+	@:hlNative("std","math_finite") public static function isFinite( f : Float ) : Bool 	return true;
+	@:hlNative("std","math_isnan") public static function isNaN( f : Float ) : Bool 		return false;
 
 	@:hlNative("std","math_ffloor") public static function ffloor( v : Float ) : Float 		return 0.;
 	@:hlNative("std","math_fround") public static function fround( v : Float ) : Float 		return 0.;
 	@:hlNative("std","math_fceil") public static function fceil( v : Float ) : Float 		return 0.;
-	
+
 	@:hlNative("std","math_cos") public static function cos( v : Float ) : Float 			return 0.;
 	@:hlNative("std","math_sin") public static function sin( v : Float ) : Float 			return 0.;
 	@:hlNative("std","math_exp") public static function exp( v : Float ) : Float 			return 0.;
@@ -22,22 +22,24 @@ class Math {
 	@:hlNative("std","math_atan") public static function atan( v : Float ) : Float 			return 0.;
 	@:hlNative("std","math_acos") public static function acos( v : Float ) : Float 			return 0.;
 	@:hlNative("std","math_asin") public static function asin( v : Float ) : Float 			return 0.;
-	@:hlNative("std","math_pow") public static function pow( v : Float, pow : Float ) : Float 				return 0.;
-	@:hlNative("std","math_atan2") public static function atan2( a : Float, b : Float ) : Float 			return 0.;
+	@:hlNative("std","math_pow") public static function pow( v : Float, exp : Float ) : Float 				return 0.;
+	@:hlNative("std","math_atan2") public static function atan2( y : Float, x : Float ) : Float 			return 0.;
 
 	public static function min( a : Float, b : Float ) : Float 			return a < b || isNaN(a) ? a : b;
 	public static function max( a : Float, b : Float ) : Float 			return a < b || isNaN(b) ? b : a;
-	
+
 	public static var PI(default,null) : Float;
 	public static var NaN(default,null) : Float;
 	public static var POSITIVE_INFINITY(default,null) : Float;
 	public static var NEGATIVE_INFINITY(default,null) : Float;
-	
+
+	public static function random():Float return 0.15; // I rolled a D20
+
 	static function __init__() : Void {
 		PI = 3.14159265359;
 		NaN = 0. / 0.;
 		POSITIVE_INFINITY = 1. / 0.;
 		NEGATIVE_INFINITY = -1. / 0.;
 	}
-	
+
 }

+ 10 - 10
std/hl/_std/Std.hx

@@ -24,7 +24,7 @@ import hl.Boot;
 @:coreApi
 class Std {
 
-	public static function random( max : Int ) : Int {
+	public static function random( x : Int ) : Int {
 		throw "TODO:Std.random";
 		return 0;
 	}
@@ -38,22 +38,22 @@ class Std {
 		return null;
 	}
 
-	@:extern public static inline function int( v : Float ) : Int {
-		return untyped $int(v);
+	@:extern public static inline function int( x : Float ) : Int {
+		return untyped $int(x);
 	}
 
-	public static function string( v : Dynamic ) : String {
+	public static function string( s : Dynamic ) : String {
 		var len = 0;
-		var bytes = hl.types.Bytes.ofValue(v,new hl.types.Ref(len));
+		var bytes = hl.types.Bytes.ofValue(s,new hl.types.Ref(len));
 		return @:privateAccess String.__alloc__(bytes,len,bytes.utf8Length(0,len));
 	}
 
-	public static function parseInt( s : String ) : Null<Int> {
-		return @:privateAccess s.bytes.parseInt(0, s.size);
+	public static function parseInt( x : String ) : Null<Int> {
+		return @:privateAccess x.bytes.parseInt(0, x.size);
 	}
 
-	public static function parseFloat( s : String ) : Float {
-		return @:privateAccess s.bytes.parseFloat(0, s.size);
+	public static function parseFloat( x : String ) : Float {
+		return @:privateAccess x.bytes.parseFloat(0, x.size);
 	}
 
 	@:keep static function __add__( a : Dynamic, b : Dynamic ) : Dynamic {
@@ -62,7 +62,7 @@ class Std {
 		if( ta == hl.types.Type.get("") )
 			return (a : String) + b;
 		if( tb == hl.types.Type.get("") )
-			return a + (b : String);	
+			return a + (b : String);
 		switch( (cast ta.kind : Int) | ((cast tb.kind : Int) << 8) ) {
 		case x:
 			throw "Can't add "+ta+" and "+tb+" ("+StringTools.hex(x)+")";