Commit Graph

2045 Commits

Author SHA1 Message Date
Darryl L. Miles 606f37cc80 Ti[GS]etClient() usage enforcement
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*)
2025-04-09 14:55:58 -04:00
R. Timothy Edwards 6e83cbe2d3 Added handling of coordinates in a FOREIGN statement in a LEF
macro.  Based on observation of cells in PDKs where ORIGIN and/or
FOREIGN are non-zero, added code that forces a correction of LEF
macro coordinates to match the GDS coordinates, with an
equivalent negative shift of the LEF macro ORIGIN to compensate.
Normally, both ORIGIN and FOREIGN will be zero and the added code
will do nothing.  Note that this code does not handle the
additional optional orientation.  A LEF macro with a different
coordinate system than its GDS is already weird;  a LEF macro
with a different rotation than its GDS is hopefully something
that nobody ever does in practice.  If needed, I'll cross that
bridge when I come to it.
2025-03-29 15:46:23 -04:00
R. Timothy Edwards 6b9efefc02 Added a new "orthogonal" operator to cifoutput to allow non-
manhattan shapes (especially minimum-sized ones) to be eliminated,
as these can survive a shrink-grow operation intended to get rid
of such shapes.  This implementation may not be in its final form
but should suffice for now.
2025-03-28 10:11:17 -04:00
R. Timothy Edwards dde7144966 Modified the behavior of SelectCopy() so that it surveys cell
instance names in both the selection and in the root edit CellDef,
and then wipes duplicate names from the selection and regenerates
unique IDs.  This avoids the unexpected behavior displayed by
magic in which a "copy" function renames the *original* instance
and gives the original name to the copied instance.  This is not
only unexpected, but causes an error in which "undo" after
multiple copies fails to remove earlier copies because the name
change was not recorded, and the instance can no longer be found
by name.
2025-03-26 14:45:46 -04:00
Darryl L. Miles 705b4da105 TxParseString() refactor to 1-arg public form
Only the txCommands.c file needs the 3-arg form locally
2025-02-23 10:24:40 -05:00
Darryl L. Miles 9aef87c355 database: TxDialog() constification ripple 2025-02-23 10:24:40 -05:00
Darryl L. Miles aa35a612b0 tclmagic.c: match new textio prototypes for constified implementations 2025-02-23 10:24:40 -05:00
Darryl L. Miles 6ed8f17136 textio: create callback typedef cb_textio_input_t 2025-02-23 10:24:40 -05:00
Darryl L. Miles c8ca1d242e txOutput.c: FILR -> FILE (typo fix)
Long standing typo, I guess no configuration compiles this code.
2025-02-23 10:24:40 -05:00
Darryl L. Miles 1166a56cff textio: getenv() comes from <stdlib.h> remove declaration 2025-02-23 10:24:40 -05:00
Darryl L. Miles 934fe32436 textio: constify various internal
This maybe a little gratuitous (as I'm not convinced all changed lines
are being compiled)
2025-02-23 10:24:40 -05:00
Darryl L. Miles c92ded99df textio: constify various data 2025-02-23 10:24:40 -05:00
Darryl L. Miles 7e1692800b textio: contify various APIs 2025-02-23 10:24:40 -05:00
Darryl L. Miles 906e02c898 K&R textio/*.c: bulk forward reference function prototype conversion
K&R obsolete syntax removal for C23 compatibility series
2025-02-23 10:24:40 -05:00
Darryl L. Miles 8cce1bdb7e K&R textio: conversion to ANSI
K&R obsolete syntax removal for C23 compatibility series
2025-02-23 10:24:40 -05:00
Darryl L. Miles 6c6e48a9a3 textioInt.h: add assumed prototype for Tcl_printf() 2025-02-23 10:24:40 -05:00
Darryl L. Miles f63dc318a7 textio: removed prototypes for non-existant functions
extern void TxVisChar();
extern void TxPromptOnNewLine();
extern TxCommand *TxDeviceStdin();
extern TxCommand *TxButtonMaskToCommand();

Found during K&R removal of textio/**
2025-02-23 10:24:40 -05:00
Darryl L. Miles 12c6ccc97b ResReadSim.c remove existing fclose() as conflict with recent change
After futher review of this function it looks like the existing
fclose() is not in the correct place, and recent patches have
added fclose() to this function in better places (covering all
returns) but did not take into account the existing misplaced
fclose().
2025-02-23 10:23:51 -05:00
Darryl L. Miles dd84be9172 CmdCD.c: fix missing 'else' from my recent commit e88dcba1c 2025-02-23 10:23:51 -05:00
Darryl L. Miles 78f2c0696c wiring: forward declaration prototypes and consistency 2025-02-23 10:21:41 -05:00
Darryl L. Miles 154c3efa5c wiring: use 'const' with 'rcsid' 2025-02-23 10:21:41 -05:00
Darryl L. Miles 922abe6b8d wiring: constify API call arguments where possible
mark cb_database_buttonhandler_t
2025-02-23 10:21:41 -05:00
Darryl L. Miles 81d526562c dbwind: DBWAddButtonHandler() cb_database_buttonhandler_t
constify API call arguments as appropiate
2025-02-23 10:21:41 -05:00
Darryl L. Miles 4f54bcf4f4 K&R wiring/*.c: bulk function implementation conversion
K&R obsolete syntax removal for C23 compatibility series
2025-02-23 10:21:41 -05:00
Darryl L. Miles 5058152c8f K&R wiring.h wireInt.h: conversion to ANSI
K&R obsolete syntax removal for C23 compatibility series
2025-02-23 10:21:41 -05:00
Darryl L. Miles 92c4fc35db ResMain.c: use-after-free: simple reorder of statements 2025-02-23 10:20:41 -05:00
Tim Edwards 48708c52a4 Removed two unused statements from EFantenna.c, per the discussion
in github pull request #377.
2025-02-23 10:15:48 -05:00
Darryl L. Miles 983f4cb76f lef: constify remaining .data into .rodata 2025-02-22 21:48:17 -05:00
Darryl L. Miles ac37927186 lef: constify static data and LefNextToken() return
LefHelper_DBTechNameType_LefLower() identified and introduced during
conversion to const data usage.

Only side-effect is some log messages will use original verbatim token
now instead of lowercase version (but this seems ok when file parsing,
to quote the problematic information source verbatim)
2025-02-22 21:48:17 -05:00
Darryl L. Miles 451dab4b9b lef: constify strings in data structures of lef module 2025-02-22 21:48:17 -05:00
Darryl L. Miles ed87c3a98b lef: cleanup mark unnecessary call to function with no side-effects
Maybe these function call can be removed or at least their return
value discarded (as the returned value is never used).
2025-02-22 21:48:17 -05:00
Darryl L. Miles 56bf27548d lef: cleanup remove unused local/static variables
Many appear to be the result of copy-and-paste from a similar func
nearby.
2025-02-22 21:48:17 -05:00
Darryl L. Miles 9d0cd63a4e lef: use 'const' with 'rcsid' 2025-02-22 21:48:17 -05:00
Darryl L. Miles ad6ecb5bbb lef/*.h: constify string function arguments 2025-02-22 21:48:17 -05:00
Darryl L. Miles 695692b620 K&R lef/*.c: bulk forward reference function prototype conversion
K&R obsolete syntax removal for C23 compatibility series
2025-02-22 21:48:17 -05:00
Darryl L. Miles 05a5b169bc defWrite.c: defHNsprintfPrefix() constify implementation 2025-02-22 21:48:17 -05:00
Darryl L. Miles 4930e0307a tcllef.c: missing include textio/textio.h (due to TxPrint usage) 2025-02-22 21:48:17 -05:00
Darryl L. Miles 19e03fc4f8 K&R lef/*.c: bulk function implementation conversion
Some function parameters (char *sname) have been made const due
referencing const data sources.

K&R obsolete syntax removal for C23 compatibility series
2025-02-22 21:48:17 -05:00
Darryl L. Miles a1f7e4ed5e lef: post K&R constify ripple
These functions are using data that is already const.
2025-02-22 21:48:17 -05:00
Darryl L. Miles f7c550e82f defRead.c: DefRead() incorrect arg0 to LefParseEndStatement() 2025-02-22 21:48:17 -05:00
Darryl L. Miles 25ec9fccef K&R lef.h lefInt.h: conversion to ANSI
K&R obsolete syntax removal for C23 compatibility series
2025-02-22 21:48:17 -05:00
Darryl L. Miles acf0e474e8 K&R lefInt.h: missing prototype removal
Function does not appear to exist:
 extern char *LefGetInput();

K&R obsolete syntax removal for C23 compatibility series
2025-02-22 21:48:17 -05:00
Darryl L. Miles a764fdbbd1 CodeQL MemoryMayNotBeFreed.ql grTCairo1.c GrTCairoPlotSVG()
created use of 'alloc' local variable to track when an allocation occurred
so exit path logic is more straight forward for compiler/analyser to see
potential optimisations.

the previous version was probably working just fine
2025-02-22 21:35:23 -05:00
Darryl L. Miles e565b4c360 CodeQL MemoryMayNotBeFreed.ql NMnetlist.c NMWriteNetlist()
created use of 'alloc' local variable to track when an allocation occurred
so exit path logic is more straight forward for compiler/analyser to see
potential optimisations.

no attempt to free memory was made previously
2025-02-22 21:35:23 -05:00
Darryl L. Miles 37fa75dd77 CodeQL MemoryMayNotBeFreed.ql ResRex.c ResCheckSimNodes()
created use of 'alloc' local variable to track when an allocation occurred
so exit path logic is more straight forward for compiler/analyser to see
potential optimisations.
2025-02-22 21:35:23 -05:00
Darryl L. Miles c33b6be2bb CodeQL MemoryMayNotBeFreed.ql rtrChannel.c RtrChannelRoute()
Unclear with all the flip operations if there is some kind of attachment
(exchange of channels), the other 2 channels created in the function
are also cleaned up.
2025-02-22 21:35:23 -05:00
Darryl L. Miles b5d068b0ea CodeQL MemoryMayNotBeFreed.ql rtrCmd.c CmdRoute() 2025-02-22 21:35:23 -05:00
Darryl L. Miles cb9333804a CodeQL MemoryMayNotBeFreed.ql rtrCmd.c CmdRoute()
temporary channel created to run command is not cleaned up
2025-02-22 21:35:23 -05:00
Darryl L. Miles 822a95ab35 CodeQL MemoryMayNotBeFreed.ql antennacheckVisit()
Looks like straight forward exit path doesn't cleanup locally malloc
block.
2025-02-22 21:35:23 -05:00
Darryl L. Miles 7508a9e6b7 CodeQL MemoryMayNotBeFreed.ql calma/**
Looks straight forward lost pointer to recently malloced block
2025-02-22 21:35:23 -05:00