Commit Graph

1961 Commits

Author SHA1 Message Date
Tim Edwards 72368a3d13 Added a fallback method for "extresist" whenever a device terminal
connection to a net that has been decomposed into a resistor array
cannot be found.  This indicates some fundamental error in the way
extresist works.  However, it should not be producing an invalid
and unsimulatable netlist.  Instead, it makes an arbitrary connection
from the device terminal to the resistor array and adds an entry in
the output netlist (.res.ext file).  This results in a poor
representation of the resistor network to that terminal, but an
otherwise simulatable netlist.  A warning is issued to note that an
arbitrary connection has been made.  This is most typically a
"garbage in, garbage out" situation in which insufficient information
exists in a layout to inform magic on which direction current is
traveling through a net.  However, it should be possible to rewrite
the extresist code so that magic makes somewhat informed decisions
about current paths and produces a halfway decent representation of
the actual net, instead of just giving up on the detailed extraction.
2025-01-15 10:38:10 -05:00
Tim Edwards 4445663cb1 Modified a routine to return a valid string when attempting to
generate a name for an instance that is set to NULL.  It is not
clear to me by an instance would have a NULL name, but apparently
it can happen, and should not crash magic.
2025-01-12 17:36:05 -05:00
Tim Edwards 1cec414618 Added the contents of the "readline" module back. This is
generally unused, as it is incompatible with the Tcl/Tk build of
magic.  However, I had not intended to remove it, only move the
name from "readline-4.3" to "readline".  But "readline/readline"
was in .gitignore, which caused the contents to be removed from
the repository.  This commit restores those files, and also
prevents the readline directory Makefile from making a symbolic
link called "readline" to itself, which was causing compile-time
issues.  The readline code is only kept for backwards compatibility
with ancient versions of magic not using the Tcl/Tk interpreter.
2025-01-10 09:58:57 -05:00
Tim Edwards 82a1dc98b4 Updated the version to go along with the merge of pul request 2025-01-10 09:21:28 -05:00
Mamoru TASAKA cb2a79d6b1 gcc: support -Werror=format-security
Support gcc -Werror=format-security which is used by default on Fedora.

ext2spice/ext2spice.c: format not a string literal and no format arguments
extflat/EFargs.c: likewise
windows/windCmdNR.c: likewise
2025-01-10 14:19:52 +09:00
Tim Edwards 2afa222414 Updated the version number to go along with the merge of several
pull requests from Darryl Miles.
2025-01-07 14:02:58 -05:00
Darryl L. Miles f010d4d20b resis.h: create RESTRUE to replace use of TRUE macro ((bool)1)
Looks to be used as integer bitmask which is flagged by compiler warning
as dubious, when using compiler provided type 'bool' from stdbool.h
in C99 instead of unsigned char type.

C29 bool type compatibility
2025-01-07 14:02:07 -05:00
Darryl L. Miles 4887f71ca3 CIFread.h: fix struct cifrstyle.crs_layers type bool -> enum (unsigned char)
The type is actually an enum (assumed to be int by default) but relies
on the magic typedef to (unsigned char) so we make this explicit and
better document what the real type is.

I guess in the past it was really a bool with only 2 states NONE|TEXT.

C29 bool type compatibility
2025-01-07 14:02:07 -05:00
Darryl L. Miles b1a9e10be7 feat: quit [exit_status], option support
Affecting process exit status.
2025-01-07 13:58:45 -05:00
Darryl L. Miles faadb774b4 docs: quit -noprompt
Was looking to implement this feature and found it was already
implemented but is a secret feature.

Updated documentation and modified implementation so it is possible
a user can discover the feature via usage such as "quit -help -invalid"
like other commands.
2025-01-07 13:58:45 -05:00
Darryl L. Miles b694827bcb feat: flush [-noprompt], option support 2025-01-07 13:58:45 -05:00
Darryl L. Miles cfdd50aa63 Revert "commands/CmdFI.c: added CmdFlush_NoConfirm option to disable flush prompt"
This reverts commit 772bfe2f71.

See #341
2025-01-07 13:58:45 -05:00
Darryl L. Miles 3fc1c7e452 gcc11 -Wall -Wpedantic document for the next person 2025-01-06 16:33:22 +00:00
Darryl L. Miles 065f31f689 gcc11 -Wall -Wpedantic cleanup (post __attribute__ DLONG_PREFIX) 2025-01-06 16:27:10 +00:00
Darryl L. Miles 6afadf9809 gcc11 -Wall -Wpedantic cleanup (post __attribute__) 2025-01-06 16:25:38 +00:00
Darryl L. Miles 48c99a7b1d gcc11 -Wall -Wpedantic cleanup (post TCL9) FUN2CD() CD2FUN()
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.
2025-01-06 16:25:15 +00:00
Darryl L. Miles c21e182b2c gcc11 -Wall -Wpedantic cleanup (post TCL9) 2025-01-06 16:24:57 +00:00
Darryl L. Miles aa5ddbaa58 database/database.h.in: const PaintResultType *resultTbl
Probably forgot to edit database.h.in template file (and edited
database.h) when working locally.
2025-01-06 16:24:02 +00:00
Darryl L. Miles 7e9d4cc15e ihash.c: cleanup warning use of void* with pointer arithmetic
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.
2025-01-06 16:21:22 +00:00
Darryl L. Miles 60c64db33a extflat: K&R various converted to ANSI (mainly due to bool use) 2025-01-06 16:18:41 +00:00
Darryl L. Miles ff9487de1f hash.c: K&R conversion to ANSI and constify arguments / callback
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
2025-01-06 16:15:58 +00:00
Darryl L. Miles d9cfd64d60 utils/*.c: K&R conversion to ANSI 2025-01-06 16:14:34 +00:00
Darryl L. Miles 07f9bbe1fb gcc11 -Wall -Wpedantic cleanup 2025-01-06 16:12:11 +00:00
Tim Edwards 3df2aaaa16 Modified the code in ext2spice.c that prints parameter values;
the former code attempted to determine the precision and generate
an output without unnecessary trailing zeros.  Unfortunately there
were counterexamples that fail to be formatted correctly, as found
by Mark Martin, and which generate output that has roundoff error.
Reimplemented the method using code found on StackOverflow, which
appears to solve the problem more robustly.
2025-01-06 11:49:29 -05:00
Tim Edwards 32138ccbc7 Modified some lines in tkcon.tcl that make it compatible with both
Tcl 8.6 and Tcl 9.0, fixing some features that got broken with an
attempt to update the script for version 9.0.
2025-01-04 14:09:58 -05:00
Tim Edwards e334fb919f Updating the revision number to go along with the merging of a
series of pull requests from Darryl Miles.
2025-01-04 11:45:11 -05:00
Darryl L. Miles af5b7f10cf lef/defWrite.c: reworked kareefardi_fix-def-write 2025-01-04 11:42:07 -05:00
Kareem Farid a6aac9c309 fix infinite def write
Signed-off-by: Kareem Farid <kareefardi@users.noreply.github.com>
2025-01-04 11:42:07 -05:00
Darryl L. Miles efcf36f348 Remove superfluous parenthesis around regular type declarations 2025-01-04 11:31:17 -05:00
Darryl L. Miles 1241e95dab debug/debug.c: constify and add prototype 2025-01-04 11:31:17 -05:00
Darryl L. Miles 195dda1e06 debug/hist.c: constify and add prototype 2025-01-04 11:31:17 -05:00
Darryl L. Miles eb89ab181c debug: use 'const' with 'rcsid' 2025-01-04 11:31:17 -05:00
Darryl L. Miles 0376430702 command: use 'const' with readonly data
This then required a cascade of function APIs to also now receive
const arguments.

This reduces the .data segment use of this module.
2025-01-04 11:31:17 -05:00
Darryl L. Miles 5c410e9dcb command: use 'const' with 'rcsid' 2025-01-04 11:31:17 -05:00
Darryl L. Miles 6b4d409d74 cmwind: use 'const' with readonly data
This then required a cascade of function APIs to also now receive
const arguments.

This reduces the .data segment use of this module.
2025-01-04 11:31:17 -05:00
Darryl L. Miles 34038ee687 cmwind: use 'const' with 'rcsid' 2025-01-04 11:31:17 -05:00
Darryl L. Miles ac56dd71a9 cif: use 'const' with readonly data (also consumer DBpaint)
This then required a cascade of function APIs to also now receive
const arguments.

This reduces the .data segment use of this module.
2025-01-04 11:31:17 -05:00
Darryl L. Miles 4e768d5a3d CIFrdpoly.c: qsort 'compar' function argument prototype fix
This makes it strictly conform to function pointer prototype.
2025-01-04 11:31:17 -05:00
Darryl L. Miles b6775f902b cif: use 'const' with 'rcsid' 2025-01-04 11:31:17 -05:00
Darryl L. Miles a616dbc113 calma: use 'const' with 'rcsid' 2025-01-04 11:31:17 -05:00
Darryl L. Miles 4cd1235575 calma: use 'const' with readonly data
This then required a cascade of function APIs to also now receive
const arguments.

This reduces the .data segment use of this module.
2025-01-04 11:31:17 -05:00
Darryl L. Miles 378755e083 CalmaRdpt.c: simplfy use of sprintf()
This replacement pattern is easier to reason about and less error prone.
2025-01-04 11:31:17 -05:00
Darryl L. Miles 46eb71491c GHA: MacOS maintenance update
GHA obsoleted macos-12 so we move to macos-13 for Intel.  Building with oldest
Intel image to provide feedback of continued expected support on that platform,
while ARM64 builds with latest to check the other end of their SDKs.

Lock the TCL version via brew to 8.6+ (currently the project is not expected to
build on TCL9 until other work is completed) so this is causing build failure.

Added additional diagnostics to show the location of executables/DSOs if they
got built from the tree.

Introduced GHA timeout clamping (MacOS default shell seems not to behave under
CI as well as Linux does, re signal/pipe handling)

'brew install tcl-tk@8' appears to append the @8 to the installed path such as
/usr/local/opt/tcl-tk@8 which configure needs to know.  configure_mac updated
to detect this now TCL9 is the default version that maybe installed at the old
location.  Then there is the issue of both TCL versions being installed
side-by-side on the same system causing more issues over selection.
2025-01-04 11:23:39 -05:00
Darryl L. Miles 3f85689985 cif/CIFgen.c: fix incorrect type bool -> int
There are 3 states for CLOSE_xxxxxx with 3 different values.

Issue introduced from 2f7f76bf9 merged since tag:8.3.509

This affected the scenarios using non-zero non-one values such as:
  #define CLOSE_DONE   2

This looks the result of an original bug where the forward declaration
 had a type mismatch with the real method, so the method implementation
 prototype was taken as the correct one.  The forward decl was rewritten
 with the correct prototype signature.
Maybe this is the cause of CIF data once drawn into view does not always
 seem to always erase after disabling and a redraw ?
2025-01-04 11:20:08 -05:00
Darryl L. Miles 76a515ca25 HACK tkcon.tcl to get it running 2025-01-04 11:08:01 -05:00
Darryl L. Miles c2a5a84a03 Revert "TCL9: *.tcl changes $::tcl_platform"
This reverts commit 8adbd75760aeeb4f39507dcd3e746287381b7b38.
2025-01-04 11:08:01 -05:00
Darryl L. Miles 7e5d0b0688 TCL9: FIXME OPTIONAL magic.h ClientData
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 ?
2025-01-04 11:08:01 -05:00
Darryl L. Miles 3931c4aff1 TCL9: *.tcl changes $::tcl_platform 2025-01-04 11:08:01 -05:00
Darryl L. Miles 272dda3c84 TCL9: TxResetTerminal(bool force) added arguments
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.
2025-01-04 11:08:01 -05:00
Darryl L. Miles c339e9b845 TCL9: CmdLQ.c Tcl_AppendResult(... (char*)NULL) cast sentinal
In the TCL8 to TCL9 porting information it was indicated the
sentinal NULL termination should be cast (char *) with API
call Tcl_AppendResult().

This was already in place for most of the codebase this
resolves the last few places.
2025-01-04 11:08:01 -05:00