Sfoglia il codice sorgente

Fixed some potential overload arg type issues.

woollybah 9 anni fa
parent
commit
4e1b39bd7e

+ 5 - 5
max2d.mod/max2d.bmx

@@ -629,7 +629,7 @@ Rem
 bbdoc: Move virtual mouse
 End Rem
 Function MoveVirtualMouse( x#,y# )
-	MoveMouse x/gc.vres_mousexscale,y/gc.vres_mouseyscale
+	MoveMouse Int(x/gc.vres_mousexscale),Int(y/gc.vres_mouseyscale)
 End Function
 
 Rem
@@ -814,10 +814,10 @@ about:
 This command is useful for calculating horizontal alignment of text when using 
 the #DrawText command.
 End Rem
-Function TextWidth( text$ )
+Function TextWidth( Text$ )
 	Local width=0
-	For Local n=0 Until text.length
-		Local i=gc.image_font.CharToGlyph( text[n] )
+	For Local n=0 Until Text.length
+		Local i=gc.image_font.CharToGlyph( Text[n] )
 		If i<0 Continue
 		width:+gc.image_font.LoadGlyph(i).Advance()
 	Next
@@ -831,7 +831,7 @@ about:
 This command is useful for calculating vertical alignment of text when using 
 the #DrawText command.
 End Rem
-Function TextHeight( text$ )
+Function TextHeight( Text$ )
 	Return gc.image_font.Height()
 	Rem
 	Local height=0

+ 2 - 2
maxlua.mod/maxlua.bmx

@@ -64,7 +64,7 @@ Function Invoke( L:Byte Ptr )
 		Case IntTypeId, ShortTypeId, ByteTypeId, LongTypeId
 			args[i]=String.FromInt( lua_tointeger( L,i+1 ) )
 		Case FloatTypeId
-			args[i]=String.FromFloat( lua_tonumber( L,i+1 ) )
+			args[i]=String.FromFloat( Float(lua_tonumber( L,i+1 )) )
 		Case DoubleTypeId
 			args[i]=String.FromDouble( lua_tonumber( L,i+1 ) )
 		Case StringTypeId
@@ -138,7 +138,7 @@ Function NewIndex( L:Byte Ptr )
 		Case IntTypeId, ShortTypeId, ByteTypeId, LongTypeId
 			fld.SetInt obj,lua_tointeger( L,3 )
 		Case FloatTypeId
-			fld.SetFloat obj,lua_tonumber( L,3 )
+			fld.SetFloat obj,Float(lua_tonumber( L,3 ))
 		Case DoubleTypeId
 			fld.SetDouble obj,lua_tonumber( L,3 )
 		Case StringTypeId

+ 1 - 1
openalaudio.mod/openalaudio.bmx

@@ -239,7 +239,7 @@ Type TOpenALChannel Extends TChannel
 		If _seq<>_source._seq Return
 
 		pan:*90
-		alSource3f _source._id,AL_POSITION,Sin(pan),0,-Cos(pan)
+		alSource3f _source._id,AL_POSITION,Float(Sin(pan)),0,Float(-Cos(pan))
 	End Method
 	
 	Method SetDepth( depth# )

+ 1 - 1
pixmap.mod/pixmap.bmx

@@ -484,7 +484,7 @@ Function ResizePixmap:TPixmap( pixmap:TPixmap,width,height ) NoDebug
 		Else If iy>=in_pixmap.height-1
 			iy=in_pixmap.height-1;fy=0;in_pitch=0
 		EndIf
-		Local src:Byte Ptr=in_pixmap.PixelPtr(0,iy),dst:Byte Ptr=tmp
+		Local src:Byte Ptr=in_pixmap.PixelPtr(0,Int(iy)),dst:Byte Ptr=tmp
 		For Local x=0 Until width
 			Local tx#=(x+.5)*x_sc-.5
 			Local ix#=Floor(tx),fx#=tx-ix

+ 2 - 2
retro.mod/retro.bmx

@@ -163,7 +163,7 @@ bbdoc: Convert a 64 bit long integer value to a hexadecimal string
 returns: The hexadecimal string representation of @val 
 End Rem 
 Function LongHex$( val:Long ) 
-	Return Hex$( val Shr 32 )+Hex$( val ) 
+	Return Hex$( Int(val Shr 32) )+Hex$( Int(val) ) 
 End Function 
 
 Rem 
@@ -171,5 +171,5 @@ bbdoc: Convert a 64 bit long integer value to a binary string
 returns: The binary string representation of @val 
 End Rem 
 Function LongBin$( val:Long ) 
-	Return Bin$( val Shr 32 )+Bin$( val ) 
+	Return Bin$( Int(val Shr 32) )+Bin$( Int(val) ) 
 End Function 

+ 4 - 4
socket.mod/socket.bmx

@@ -45,14 +45,14 @@ End Type
 
 Type TSocket
 
-	Method Send( buf:Byte Ptr,count,flags=0 )
-		Local n=send_( _socket,buf,count,flags )
+	Method Send:size_t( buf:Byte Ptr,count:size_t,flags=0 )
+		Local n:size_t=send_( _socket,buf,count,flags )
 		If n<0 Return 0
 		Return n
 	End Method
 
-	Method Recv( buf:Byte Ptr,count,flags=0 )
-		Local n=recv_( _socket,buf,count,flags )
+	Method Recv:size_t( buf:Byte Ptr,count:size_t,flags=0 )
+		Local n:size_t=recv_( _socket,buf,count,flags )
 		If n<0 Return 0
 		Return n
 	End Method

+ 2 - 2
socketstream.mod/socketstream.bmx

@@ -23,11 +23,11 @@ Import BRL.Stream
 Type TSocketStream Extends TStream
 
 	Method Read:Long( buf:Byte Ptr,count:Long )
-		Return _socket.Recv( buf,count )
+		Return _socket.Recv( buf,size_t(count) )
 	End Method
 
 	Method Write:Long( buf:Byte Ptr,count:Long )
-		Return _socket.Send( buf,count )
+		Return _socket.Send( buf,size_t(count) )
 	End Method
 
 	Method Eof()