1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-02 05:00:38 +00:00

Adds .overloaded and .minargs to idstruct.

Allows more functions to be overloaded in the future, like _RGB32.
This commit is contained in:
FellippeHeitor 2018-07-03 00:33:37 -03:00
parent 6ee70f1afa
commit 19fda93caf
2 changed files with 6 additions and 1 deletions

View file

@ -659,7 +659,9 @@ TYPE idstruct
callname AS STRING * 256
ccall AS INTEGER
overloaded AS _BYTE
args AS INTEGER
minargs AS INTEGER
arg AS STRING * 400 'similar to t
argsize AS STRING * 400 'similar to tsize (used for fixed length strings)
specialformat AS STRING * 256
@ -15680,7 +15682,8 @@ IF LEN(f$) THEN 'special format given
ELSE 'no special format given
IF n$ = "ASC" AND args = 2 THEN GOTO skipargnumchk
IF n$ = "_RGB32" AND (args > 0 AND args <= 4) THEN GOTO skipargnumchk
IF id2.overloaded = -1 AND (args >= id2.minargs AND args <= id2.args) THEN GOTO skipargnumchk
IF id2.args <> args THEN Give_Error "Incorrect number of arguments passed to function": EXIT FUNCTION
END IF

View file

@ -1331,6 +1331,8 @@ clearid
id.n = "_RGB32"
id.subfunc = 1
id.callname = "func__rgb32"
id.overloaded = -1
id.minargs = 1
id.args = 4
id.arg = MKL$(LONGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER) + MKL$(LONGTYPE - ISPOINTER)
id.ret = ULONGTYPE - ISPOINTER