Bladeren bron

added conversion from LONGINT to SIZE; without this NEW(x,size), does not work if size is of LONGINT type

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7774 8c9fc860-2736-0410-a75d-ab315db34111
eth.morozova 7 jaren geleden
bovenliggende
commit
66b3873e15
1 gewijzigde bestanden met toevoegingen van 11 en 0 verwijderingen
  1. 11 0
      source/FoxArrayBase.Mod

+ 11 - 0
source/FoxArrayBase.Mod

@@ -2081,6 +2081,17 @@ Sufficient (but not necessary) conditions:
 		ApplyUnaryAAOp( ADDRESSOF( RESULT ), ADDRESSOF( src ), SIZEOF( LONGINT ),ConvertLoopXL );
 		RETURN RESULT
 	END "@Convert";
+	
+	OPERATOR "@Convert"*(CONST src: ARRAY [ ? ] OF LONGINT ): ARRAY [ ? ] OF SIZE;
+	BEGIN
+		CASE SIZEOF(SIZE) OF
+			4: RETURN src;
+			|8: ApplyUnaryAAOp( ADDRESSOF( RESULT ), ADDRESSOF( src ), SIZEOF( SIZE ), ConvertLoopLX );
+		ELSE
+			HALT(100);
+		END;
+		RETURN RESULT
+	END "@Convert";
 
 	OPERATOR "ENTIER"*(CONST src: ARRAY [ ? ] OF LONGREAL ):  ARRAY [ ? ] OF LONGINT;
 	BEGIN