Browse Source

lang fixes according to lintian

Andy Li 8 years ago
parent
commit
6a64ddde78

+ 3 - 3
extra/CHANGES.txt

@@ -986,7 +986,7 @@
 	cpp : Fix socket sellect passing _s
 	cpp : Throw error when match count does not match regex
 	cpp : Improve register capture in GC
-	cpp : Fix Dynamic interger compare
+	cpp : Fix Dynamic integer compare
 	cpp : Implement makeVarArgs
 	cpp : Fix toString for nulls in Enums and Arrays
 	cpp : Added initial Android support
@@ -1220,7 +1220,7 @@
 	set all private+protected names from SWF lib to public (allow override+reflect)
 	flash9 : use findprop instead of findpropstrict for 'this' access (allow dynamic)
 	don't allow nullness changes in overrided/implemented
-	prevent typing hole with overriden polymorphic methods
+	prevent typing hole with overridden polymorphic methods
 	added neko.vm.Mutex and neko.vm.Deque (included in neko 1.7.1)
 	added package remapping using --remap
 
@@ -1477,7 +1477,7 @@
 2007-01-28: 1.11
 	changed StringBuf.add implementation
 	added haxe.Firebug
-	allowed variable return type for overriden/implemented methods
+	allowed variable return type for overridden/implemented methods
 	display error position in front of each error line
 	improved error messages when optional arguments not matched
 	added neko.io.Path

+ 1 - 1
src/codegen/codegen.ml

@@ -368,7 +368,7 @@ let stack_block ctx c m e =
 
 (*
 	on some platforms which doesn't support type parameters, we must have the
-	exact same type for overriden/implemented function as the original one
+	exact same type for overridden/implemented function as the original one
 *)
 
 let rec find_field com c f =

+ 1 - 1
src/codegen/gencommon/realTypeParams.ml

@@ -405,7 +405,7 @@ struct
 		Will also look for previous cast() definitions and override them, to reflect the current type and fields
 
 		FIXME: this function still doesn't support generics that extend generics, and are cast as one of its subclasses. This needs to be taken care, by
-		looking at previous superclasses and whenever a generic class is found, its cast argument must be overriden. the toughest part is to know how to type
+		looking at previous superclasses and whenever a generic class is found, its cast argument must be overridden. the toughest part is to know how to type
 		the current type correctly.
 	*)
 	let create_cast_cfield gen cl name =

+ 3 - 3
src/codegen/java.ml

@@ -728,14 +728,14 @@ let fix_overrides_jclass com cls =
 			let super_methods = cls.cmethods @ super_methods in
 			let super_fields = cls.cfields @ super_fields in
 			let cmethods = if force_check then begin
-				let overriden = ref [] in
+				let overridden = ref [] in
 				let cmethods = List.map (fun jm ->
 					(* TODO rewrite/standardize empty spaces *)
 					if not (is_override jm) && not (List.mem JStatic jm.jf_flags) && List.exists (fun msup ->
 						let ret = msup.jf_name = jm.jf_name && not(List.mem JStatic msup.jf_flags) && compatible_methods msup jm in
 						if ret then begin
 							let f = mk_override msup in
-							overriden := { f with jf_flags = jm.jf_flags } :: !overriden
+							overridden := { f with jf_flags = jm.jf_flags } :: !overridden
 						end;
 						ret
 					) cls.cmethods then
@@ -743,7 +743,7 @@ let fix_overrides_jclass com cls =
 					else
 						jm
 				) cmethods in
-				!overriden @ cmethods
+				!overridden @ cmethods
 			end else
 				cmethods
 			in

+ 4 - 4
src/core/define.ml

@@ -119,7 +119,7 @@ let infos = function
 	| AdvancedTelemetry -> "advanced-telemetry",("Allow the SWF to be measured with Monocle tool",[Platform Flash])
 	| AnnotateSource -> "annotate_source",("Add additional comments to generated source code",[Platform Cpp])
 	(* | Analyzer -> "analyzer",("Use static analyzer for optimization (experimental)") *)
-	| As3 -> "as3",("Defined when outputing flash9 as3 source code",[])
+	| As3 -> "as3",("Defined when outputting flash9 as3 source code",[])
 	| CheckXmlProxy -> "check_xml_proxy",("Check the used fields of the xml proxy",[])
 	| CoreApi -> "core_api",("Defined in the core api context",[])
 	| CoreApiSerialize -> "core_api_serialize",("Mark some generated core api classes with the Serializable attribute on C#",[Platform Cs])
@@ -149,7 +149,7 @@ let infos = function
 	(* force_lib_check is only here as a debug facility - compiler checking allows errors to be found more easily *)
 	| ForceLibCheck -> "force_lib_check",("Force the compiler to check -net-lib and -java-lib added classes (internal)",[Platforms [Cs;Java]])
 	| ForceNativeProperty -> "force_native_property",("Tag all properties with :nativeProperty metadata for 3.1 compatibility",[Platform Cpp])
-	| FormatWarning -> "format_warning",("Print a warning for each formated string, for 2.x compatibility",[])
+	| FormatWarning -> "format_warning",("Print a warning for each formatted string, for 2.x compatibility",[])
 	| GencommonDebug -> "gencommon_debug",("GenCommon internal",[Platforms [Cs;Java]])
 	| Haxe3Compat -> "haxe3compat", ("Gives warnings about transition from Haxe 3.x to Haxe 4.0",[])
 	| HaxeBoot -> "haxe_boot",("Given the name 'haxe' to the flash boot class instead of a generated name",[Platform Flash])
@@ -160,9 +160,9 @@ let infos = function
 	| IncludePrefix -> "include_prefix",("prepend path to generated include files",[Platform Cpp])
 	| Interp -> "interp",("The code is compiled to be run with --interp",[])
 	| JavaVer -> "java_ver",("<version:5-7> Sets the Java version to be targeted",[Platform Java])
-	| JqueryVer -> "jquery_ver",("The jQuery version supported by js.jquery.*. The version is encoded as an interger. e.g. 1.11.3 is encoded as 11103",[Platform Js])
+	| JqueryVer -> "jquery_ver",("The jQuery version supported by js.jquery.*. The version is encoded as an integer. e.g. 1.11.3 is encoded as 11103",[Platform Js])
 	| JsClassic -> "js_classic",("Don't use a function wrapper and strict mode in JS output",[Platform Js])
-	| JsEs -> "js_es",("Generate JS compilant with given ES standard version (default 5)",[Platform Js; HasParam "version number"])
+	| JsEs -> "js_es",("Generate JS compliant with given ES standard version (default 5)",[Platform Js; HasParam "version number"])
 	| JsEnumsAsObjects -> "js_enums_as_objects",("Generate enum representation as object instead of as array",[Platform Js])
 	| JsUnflatten -> "js_unflatten",("Generate nested objects for packages and types",[Platform Js])
 	| JsSourceMap -> "js_source_map",("Generate JavaScript source map even in non-debug mode",[Platform Js])

+ 3 - 3
src/core/meta.ml

@@ -332,7 +332,7 @@ let get_info = function
 	| Require -> ":require",("Allows access to a field only if the specified compiler flag is set",[HasParam "Compiler flag to check";UsedOn TClassField])
 	| RequiresAssign -> ":requiresAssign",("Used internally to mark certain abstract operator overloads",[UsedInternally])
 	| Resolve -> ":resolve",("Abstract fields marked with this metadata can be used to resolve unknown fields",[UsedOn TClassField])
-	| Rtti -> ":rtti",("Adds runtime type informations",[UsedOn TClass])
+	| Rtti -> ":rtti",("Adds runtime type information",[UsedOn TClass])
 	| Runtime -> ":runtime",("?",[])
 	| RuntimeValue -> ":runtimeValue",("Marks an abstract as being a runtime value",[UsedOn TAbstract])
 	| Scalar -> ":scalar",("Used by hxcpp to mark a custom coreType abstract",[UsedOn TAbstract; Platform Cpp])
@@ -347,9 +347,9 @@ let get_info = function
 	| Strict -> ":strict",("Used to declare a native C# attribute or a native Java metadata. Is type checked",[Platforms [Java;Cs]])
 	| Struct -> ":struct",("Marks a class definition as a struct",[Platform Cs; UsedOn TClass])
 	| StructAccess -> ":structAccess",("Marks an extern class as using struct access('.') not pointer('->')",[Platform Cpp; UsedOn TClass])
-	| StructInit -> ":structInit",("Allows to initialize the class with a structure that matches constructor parameters",[UsedOn TClass])
+	| StructInit -> ":structInit",("Allows one to initialize the class with a structure that matches constructor parameters",[UsedOn TClass])
 	| SuppressWarnings -> ":suppressWarnings",("Adds a SuppressWarnings annotation for the generated Java class",[Platform Java; UsedOn TClass])
-	| TemplatedCall -> ":templatedCall",("Indicates that the first parameter of static call should be treated as a template arguement",[Platform Cpp; UsedOn TClassField])
+	| TemplatedCall -> ":templatedCall",("Indicates that the first parameter of static call should be treated as a template argument",[Platform Cpp; UsedOn TClassField])
 	| Throws -> ":throws",("Adds a 'throws' declaration to the generated function",[HasParam "Type as String"; Platform Java; UsedOn TClassField])
 	| This -> ":this",("Internally used to pass a 'this' expression to macros",[UsedInternally; UsedOn TExpr])
 	| To -> ":to",("Specifies that the field of the abstract is a cast operation to the type identified in the function",[UsedOn TAbstractField])

+ 3 - 3
src/generators/genhl.ml

@@ -246,7 +246,7 @@ let efield_name e f =
 let global_type ctx g =
 	DynArray.get ctx.cglobals.arr g
 
-let is_overriden ctx c f =
+let is_overridden ctx c f =
 	ctx.is_macro || Hashtbl.mem ctx.overrides (f.cf_name,c.cl_path)
 
 let alloc_float ctx f =
@@ -592,7 +592,7 @@ and class_type ?(tref=None) ctx c pl statics =
 					let vid = (try -(fst (get_index f.cf_name p))-1 with Not_found -> assert false) in
 					DynArray.set virtuals vid g;
 					Some vid
-				else if is_overriden ctx c f then begin
+				else if is_overridden ctx c f then begin
 					let vid = DynArray.length virtuals in
 					DynArray.add virtuals g;
 					p.pindex <- PMap.add f.cf_name (-vid-1,HVoid) p.pindex;
@@ -1208,7 +1208,7 @@ and direct_method_call ctx c f ethis =
 		false
 	else if (match c.cl_kind with KTypeParameter _ ->  true | _ -> false) then
 		false
-	else if is_overriden ctx c f && ethis.eexpr <> TConst(TSuper) then
+	else if is_overridden ctx c f && ethis.eexpr <> TConst(TSuper) then
 		false
 	else
 		true

+ 1 - 1
src/typing/macroContext.ml

@@ -724,7 +724,7 @@ let type_macro ctx mode cpath f (el:Ast.expr list) p =
 			So instead, we generate a haxe.macro.Context.delayedCalled(i) expression that will only evaluate the
 			macro if/when it is called.
 
-			The tricky part is that the whole delayed-evaluation process has to use the same contextual informations
+			The tricky part is that the whole delayed-evaluation process has to use the same contextual information
 			as if it was evaluated now.
 		*)
 		let ctx = {

+ 1 - 1
src/typing/typer.ml

@@ -2801,7 +2801,7 @@ and format_string ctx s p =
 	in
 	let warn_escape = Common.defined ctx.com Define.FormatWarning in
 	let warn pos len =
-		ctx.com.warning "This string is formated" { p with pmin = !pmin + 1 + pos; pmax = !pmin + 1 + pos + len }
+		ctx.com.warning "This string is formatted" { p with pmin = !pmin + 1 + pos; pmax = !pmin + 1 + pos + len }
 	in
 	let len = String.length s in
 	let rec parse start pos =

+ 1 - 1
std/Date.hx

@@ -109,7 +109,7 @@ extern class Date
 	static function fromTime( t : Float ) : Date;
 
 	/**
-		Returns a Date from a formated string `s`, with the following accepted
+		Returns a Date from a formatted string `s`, with the following accepted
 		formats:
 
 		- `"YYYY-MM-DD hh:mm:ss"`

+ 1 - 1
std/haxe/crypto/Base64.hx

@@ -22,7 +22,7 @@
 package haxe.crypto;
 
 /**
-	Allows to encode/decode String and bytes using Base64 encoding.
+	Allows one to encode/decode String and bytes using Base64 encoding.
 **/
 class Base64 {
 

+ 1 - 1
std/haxe/crypto/BaseCode.hx

@@ -22,7 +22,7 @@
 package haxe.crypto;
 
 /**
-	Allows to encode/decode String and bytes using a power of two base dictionary.
+	Allows one to encode/decode String and bytes using a power of two base dictionary.
 **/
 class BaseCode {
 

+ 1 - 1
std/hl/Gc.hx

@@ -27,7 +27,7 @@ enum GcFlag {
 	**/
 	Profile;
 	/**
-		Allows to dump a hlmemory.dump file when HL runs out of memory to be examined with hl memory inspector tool.
+		Allows one to dump a hlmemory.dump file when HL runs out of memory to be examined with hl memory inspector tool.
 	**/
 	DumpMem;
 	/**

+ 2 - 2
std/php/Error.hx

@@ -37,6 +37,6 @@ extern class Error implements Throwable {
 	function getFile() : String;          // source filename
 	function getLine() : Int;             // source line
 	function getTrace() : NativeIndexedArray<NativeAssocArray<Dynamic>>;  // an array of the backtrace
-	function getTraceAsString() : String; // formated string of trace
-	@:phpMagic function __toString() : String;       // formated string for display
+	function getTraceAsString() : String; // formatted string of trace
+	@:phpMagic function __toString() : String;       // formatted string for display
 }

+ 2 - 2
std/php/ErrorException.hx

@@ -35,6 +35,6 @@ extern class ErrorException implements Throwable {
     @:final function getFile() : String;          // source filename
     @:final function getLine() : Int;             // source line
     @:final function getTrace() : NativeIndexedArray<NativeAssocArray<Dynamic>>;  // an array of the backtrace
-    @:final function getTraceAsString() : String; // formated string of trace
-	@:phpMagic function __toString() : String;       // formated string for display
+    @:final function getTraceAsString() : String; // formatted string of trace
+	@:phpMagic function __toString() : String;       // formatted string for display
 }

+ 2 - 2
std/php/Exception.hx

@@ -37,6 +37,6 @@ extern class Exception implements Throwable {
     function getFile() : String;          // source filename
     function getLine() : Int;             // source line
     function getTrace() : NativeIndexedArray<NativeAssocArray<Dynamic>>;  // an array of the backtrace
-    function getTraceAsString() : String; // formated string of trace
-	@:phpMagic function __toString() : String;       // formated string for display
+    function getTraceAsString() : String; // formatted string of trace
+	@:phpMagic function __toString() : String;       // formatted string for display
 }

+ 1 - 1
std/php/Syntax.hx

@@ -10,7 +10,7 @@ import haxe.extern.EitherType;
 **/
 extern class Syntax {
     /**
-        This method allows to force specified binary operation for `left` and `right` values.
+        This method allows one to force specified binary operation for `left` and `right` values.
         `operator` must be a constant string like "+" or "==".
     **/
     static function binop( left:Dynamic, operator:String, right:Dynamic ) : Dynamic;

+ 2 - 2
std/php/Throwable.hx

@@ -11,6 +11,6 @@ extern interface Throwable {
     function getFile() : String;          // source filename
     function getLine() : Int;             // source line
     function getTrace() : NativeIndexedArray<NativeAssocArray<Dynamic>>;  // an array of the backtrace
-    function getTraceAsString() : String; // formated string of trace
-	@:phpMagic function __toString() : String;       // formated string for display
+    function getTraceAsString() : String; // formatted string of trace
+	@:phpMagic function __toString() : String;       // formatted string for display
 }

+ 2 - 2
std/python/io/NativeInput.hx

@@ -62,11 +62,11 @@ class NativeInput<T:IOBase> extends Input {
 	}
 
 	function readinto (b:Bytearray):Int {
-		throw "abstract method, should be overriden";
+		throw "abstract method, should be overridden";
 	}
 
 	function seek (p:Int, mode:sys.io.FileSeek) {
-		throw "abstract method, should be overriden";
+		throw "abstract method, should be overridden";
 	}
 
 	override public function readBytes(s:haxe.io.Bytes, pos:Int, len:Int):Int {

+ 2 - 2
tests/unit/src/unit/TestMisc.hx

@@ -253,14 +253,14 @@ class TestMisc extends Test {
 		eq( inst.add.bind(1)(2), 103 );
 		eq( add(1,2), 103 );
 
-		// check overriden dynamic method
+		// check overridden dynamic method
 		var inst = new MyDynamicSubClass(100);
 		var add = inst.add;
 		eq( inst.add(1,2), 206 );
 		eq( inst.add.bind(1)(2), 206 );
 		eq( add(1,2), 206 );
 
-		// check overriden dynamic method
+		// check overridden dynamic method
 		var inst = new MyDynamicSubClass2(100);
 		var add = inst.add;
 		eq( inst.add(1,2), 206 );