the "tool" implementation. Previously, the "tool" implementation
would overwrite the button bindings for the mouse. The problem
with that is that if the user customizes one or more of the
bindings, such as using the mouse wheel for zooming instead of
panning, then the custom macro gets obliterated when the tool
changes. The reimplementation creates multiple macro sets which
are unique to each tool. The "enable_tools" function sets up
the initial unique default bindings for each tool. The user
can then customize the bindings for any tool, and the
implementation no longer requires the constant changing of key
bindings. Note that the new implementation is slightly less
efficient because the macro tables are found by string hash
based on the name of the tool or client type, not the integer
client ID. The reduction in efficiency is balanced by the
increased flexibility of the macros.
1) Corrected spurious error messages about cells already existing
in GDS when using "flatten" or "flatglob".
2) Fixed handling of resistance as a subcircuit parameter
3) Added area and perimeter resistance for a device; this is done
through the "devresist" statement in the tech file, which is an
extension of the original "fetresist" statement. Where "fetresist"
only supported type "linear", "devresist" supports types "area"
and "perimeter".
4) Support for CDL syntax, including generating subcircuit-like
parameters for components starting with SPICE-standard prefixes
like M, R, C, etc., adding "/" between pins and subcircuit name,
and saving the file as ".cdl" instead of ".spice".
5) Estimated L and W for devices whose geometry is complex and do not
reduce to a simple rectangle. L and W are estimated as the square
root of the area.
6) Changed the method of extracting L and W for diodes to use the same
method as capacitors. Note that diodes are not usually specified
by L and W, but if they are, this will produce the right result.
7) Corrected the reported filename and line number when printing error
messages related to errors inside a technology file, when the
technology file uses "include" to combine multiple files.
prefix when doing a reentrant load, causing include files to not
be found. Fixed a divide-by-zero issue that occurs when some
tech file sections are not loaded to the abovementioned error.
Guided by CodeQL static code analyser.
FileMayNotBeClosed.ql
FileMayNeverBeClosed.ql
Multiple paths exist that seems to be equivalent, some of those
paths handled the error path, some of them didn't.
CodeQL will still report a concern (instead of multiple concerns)
so this has been commented to clarify when the libz handle setup
is successful, the ownership of the 'fd' changed.
Example build issue using SunOS Solaris solaris 5.11 11.4.42.111.0 i86pc i386
with gcc version 5.5.0 (GCC).
It turns out the definition is not used by the magic codebase. So only the
macro name is changed by this commit.
This platform also has a definition for FREAD but the MacOS patch can be used
to rename that.
In file included from DBio.c:51:0:
../utils/magic.h:141:0: warning: "FOPEN" redefined
#define FOPEN gzopen
^
In file included from DBio.c:30:0:
/usr/include/sys/file.h:74:0: note: this is the location of the previous definition
#define FOPEN 0xffffffff
^
In file included from DBio.c:51:0:
../utils/magic.h:144:0: warning: "FREAD" redefined
#define FREAD(a,b,c,d) gzread(d,a,b*c)
^
In file included from DBio.c:30:0:
/usr/include/sys/file.h:75:0: note: this is the location of the previous definition
#define FREAD 0x01 /* <sys/aiocb.h> LIO_READ must be identical */
^
Remove limited use HAVE_ZLIB wrapper API into separate header as
utils.h is used in many places and most source files don't need
to drag in the header file from this external dependency.
Copyright date(s) taken from original source file / git blame.
This is a low level thing that other lowlevel API (platform shims for
strlen_s() and ctime_r() want to make use of, without any application
global pollution).
Copyright date(s) taken from git blame information for moved lines.
The man page end(3) changed as well over time to support the new definition.
This was revised from 2.41+ to 2.29+ as it seems top relate to a mix of
Kernel / Glibc / Compiler and the new defintion probably works on any
older system.
When global <sys/mman.h> was removed from tile.h it also removed
<unistd.h> nearby. This exposes the lack of <unistd.h> being
included where needed using APIs like close()/read()/unlink()/isatty()
the WASM build seems to show this as the header file set is structured
differently.
All naked access to `ti_client` now uses the function-like-macro
to encapsulate this action. This macro existed before this just
makes all sites utilize it.
Added additional INT and PTR variants to remove the programmer
load on thinking about casing and casts polluting the point
of use. So the use now looks cleaner.
Equivalent prototypes:
void TiSetClient(Tile*, ClientData)
void TiSetClientINT(Tile*, intptr_t) /* pointertype */
void TiSetClientPTR(Tile*, void*)
ClientData TiGetClient(Tile*)
intptr_t TiGetClientINT(Tile*) /* pointertype */
void *TiGetClientPTR(Tile*)
FUN2CD() on a function pointer still raises -Wpedantic warning due to the
officially undefined behaviour as defined by C standards.
So added FUN2CD() and CD2FUN() to at least mark the call-sites to help
with identification and ignoring -Wpedantic based on the source file
context given in the compiler output.
Use of (void*) with pointer arithmetic warning removal.
But more so as it is in a macro (all be it local to file) which will
take on the form of the type passed as argument when the 'offset' looks
to be always be specified in bytes.
cb_heap_kill_t callback typedef created
Invoked from HeapKill()
No active callback implementation in the codebase.
callback interface (from hash.h):
marked @invoke call-site
This did not work as expected. Maybe that indicate this should have
a slighlt restructure so the tcl.h definition is always given a chance
to provide type.
Or maybe autoconf should detect the type and provide in config.h ?
This seems like it has 2 use cases.
Internal console management around reprinting command prompt, but many
modes of operation delegate the prompt processing to tkcon or readline.
Process termination to restore the termios.
The Tcl_Exit() replacement proc takes charge of calling exit()
So this function can be easily migrated to libc atexit() which will
now run during exit() not just before. Which seems ok for the purpose
of restoring the termios state of the tty.
This solution seems compatible with TCL8 as well so all calls to this
removed API are removed.
Note this patch also removes the invalidation (of the callback so
the deefault use of Tcl_Exit() is restored) before returning from
this function. atexit() usage can not be invalidated after
registration but that can be controlled with application flag
checked inside the callback function if needed.
I have observed scenarios where I need to issue 'reset' manually
after exiting magic, still understanding better the build types
and scenarios that triggers this.
Now a (void *) but previously an integer.
These macros resolve the codebase allowing it to be built against both
tcl8 (8.5, 8.6) and tcl9 (9.0).
tar -zxvf tcl9.0.0-src.tar.gz
cd tcl9.0.0/unix
./configure --enable-symbols --prefix=/opt/tktcl9
make install
tar -zxvf tk9.0.0-src.tar.gz
cd tk9.0.0/unix
./configure --enable-symbols --prefix=/opt/tktcl9 --with-tcl=/opt/tktcl9/lib
make install
cd magic
./configure --with-tk=/opt/tktcl9/lib --with-tcl=/opt/tktcl9/lib