gentclAPI.tcl

Clone Tools
  • last updated 5 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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.
gentclAPI.tcl: - handle duplicated domains by folding these to a single definition

nsf.c:

- added command nsf::method::get.

Rationale: provide a central place to obtain information

about all kind of method handles, which might be

- scripted and c-based methods

- nsf::procs

- plain tcl procs

- cmds (with and without paramter definitions)

- make results of ListMethod() robust against missing

information (e.g. plain tcl cmds, missing object registrations,

etc.)

- factor out common code for ListMethod call sites

for per-object methods, instance methods and procs/cmds

to ListMethodResolve()

- return errors from failing converter registrations

- extend regression test (new test set nsf-method.test)

  1. … 7 more files in changeset.
- let the c-code generator produce as well nonnull assertions

  1. … 3 more files in changeset.
- update more copyright notices

  1. … 31 more files in changeset.
nsf.c: - change name of enumeratorConverterEntry to Nsf_EnumeratorConverterEntry, move it with NSF_ARG_* flags to tcl.h to make it available in derived modules using the converter - Added editor hints for a more uniform appearance

  1. … 44 more files in changeset.
- make converter usable from c-based packages compiled with subs activated

- further release work

  1. … 35 more files in changeset.
- C-code Generator: added "-typeName" for enumeration types that allows for disambiguation of enumerations with different argument names. Before that, the argument name determined the c-type of the enumeration. Therefore it was not possible to use argName "-type" for two different functions with a different list of enumerators.

- changed "-methodtype" to simply "-type" in

/obj/ info methods ... ?-type all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ...

/obj/ info object methods ... ?-type all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ...

/obj/ info lookup methods ... ?-type all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ...

  1. … 14 more files in changeset.
make assumptions explicit

  1. … 1 more file in changeset.
nsf.c: - handling of method names in error messages from nsfAPI.h. Make sure that error message is generated with the actual method name.

  1. … 4 more files in changeset.