gentclAPI.tcl

Clone Tools
  • last updated 3 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Provide support for TIP 627 (Tcl 8.7a6+ and Tcl 9)

TIP 627 introduces support for > 2^31 elements in object vectors

(e.g., number of words in a single Tcl command). For details, see

https://core.tcl-lang.org/tips/doc/trunk/tip/627.md

To provide also backwards compatibility, this change uses the macros

TCL_COMMAND_OBJPROC, TCL_CREATEOBJCOMMAND, TCL_NRCALLOBJPROC,

TCL_NRCREATECOMMAND, TCL_OBJCMDPROC_T, and TCL_OBJC_T.

  1. … 21 more files in changeset.
added support for enumeration values replaced anonymous arrays by dicts

improve type safety of generated code

  1. … 1 more file in changeset.
add missing EXTERN declarations

  1. … 4 more files in changeset.
avoid variable name "index" in generated code since "index" shadows an outer function

  1. … 3 more files in changeset.
improve spelling

  1. … 2 more files in changeset.
improve comments

  1. … 13 more files in changeset.
improve wording

  1. … 4 more files in changeset.
* gentclAPI.tcl, nsfAPI.decls (createconverter): Support for "-global 1" flag that will cause the options array corresponding to an enumeration to become available as a global, properly Nsf_* prefixed symbol. Used for NsfConfigureCmd and the corresponding DTrace probe, for now.

  1. … 2 more files in changeset.
More code cleanup

- make nsf compilable with tcl 8.7.2 and TCL_NO_DEPRECATED turned on

- prefer bool over int

- reduce nr of returns before end of function

- line bread overlong function definitions

  1. … 12 more files in changeset.
Align prototypes with function definitons and minor code cleanup

- reduce number of return statements before end of function

- reduce variable scopes

  1. … 3 more files in changeset.
make argument names more regular improve alignment of prototype names with function definitions

  1. … 3 more files in changeset.
Improve alignment of prototypes with function definitions improve regularity of variable names

  1. … 10 more files in changeset.
- Use uniform spelling of "Tcl" - Fix more spelling errors

  1. … 18 more files in changeset.
Use uniform spelling of "Tcl"

  1. … 11 more files in changeset.
- Dont't use ConvertToNothing but NULL in the terminating record, since the former is not available for extensions

  1. … 1 more file in changeset.
- provide clean compile for compilations with "-Wwrite-strings" - add const declarations

  1. … 6 more files in changeset.
* gentclAPI.tcl (methodDefinition): Deactivate docstring generation for now, as they are not actively used.

  1. … 4 more files in changeset.
code generator changes: - create enum types instead of enum values for nsf API - use enum types in code

  1. … 6 more files in changeset.
- New macros NSF_nonnull_assert() and nonnull_assert() Background: The unreleased gcc6 with "-pedantic" complaints since recently about asserts, in which nonnull conditions implied by nonnull declarations are explicitly tested, and spits out warnings like ... warning: nonnull argument ... compared to NULL ... The new macros turns off asserts, when gcc6 is used.

  1. … 16 more files in changeset.
- move assignmetns after assertions in generated code

  1. … 1 more file in changeset.
- revert overeager part of the change

  1. … 1 more file in changeset.
- remove logically dead code as flagged by coverity

  1. … 1 more file in changeset.
Improve profiling support - added profile support for undispatched methods (i.e. implemented via CallDirectly) - new function for controlling profile trace nsf:__profile_trace -enable /bool/ ?-verbose /bool/?

C-code generator:

- allow type boolean for non-positional arguments

  1. … 7 more files in changeset.
- use same definition for ObjCmds as in tcl - prefer "const" over "CONST" unless in Tcl interface

  1. … 2 more files in changeset.
- prefer boolean expression in tests over expressions of other types

  1. … 26 more files in changeset.
- fix (probably quite old) memory leak when parameter passing fails to reclaim temporary Tcl_Objs

  1. … 1 more file in changeset.
genttclAPI.tcl: - added option "-flags", which can be used for every parameter. example: .... -flags NSF_ARG_NOLEADINGDASH .... - experimental: use NSF_ARG_NOLEADINGDASH for pattern "info subclass" to improve error messages.

  1. … 1 more file in changeset.
nsf.c: parameter passing reform - don't pass full argument list for filteing methods calle further methods from C (such as new/create/... ) to allow processing of e.g. "--" in "new" to separate arguments to "new" cleanly from arguments passed to "create". Now we can use e.g. "C new -- -childof 123" in case class C has a property "childof". - extend c-generator to accept option "-objv0" to pass the original "objv[0]" to the called command. Since we had previously "allargs", we have to pass the objv[0] now differently - more thorough checking ISOBJ(someObj) macro for asserts (use "assert(ISOBJ(someObj))" instead of just "assert(someObj)") - extend regression test

  1. … 11 more files in changeset.
nsf.c, gentclAPI.tcl: - new argument types "virtualobjectargs" and "virtualclassargs" for context-specific argument resolutions: when a context object is provided, arguments of type "virtualobjectargs" are determined based on the slots applicable for the object (like "... lookup ..."), arguments of type "virtualclassargs" are resolved against a class. These types are used as follows: /obj/ configure /virtualobjectargs/ /cls/ create /name/ /virtualclassargs/ /cls/ recreate /name/ /virtualclassargs/ /cls/ new ?-childof /obj/? /virtualclassargs/ This new feature allows us to provide better error messages and to make much of the "... info ... configure parameter ..." infrastructure much less important. - For "virtualclassargs" we need the functionality to obtain from the C-Code based on a class the configure parameters applicable to objects of this class. - add argument "-context ..." to "cmd::info" to pass the context object (so far the only place where the context-object is used) - object system configuration parameters changes: new: -class.configureparameter new: -object.configureparameter removed: -class.objectparameter

  1. … 16 more files in changeset.