This commit is contained in:
Darryl Miles 2026-01-21 23:18:05 +00:00 committed by GitHub
commit 2e2450ba62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 30 additions and 11 deletions

View File

@ -953,24 +953,22 @@ DBFullResidueMask(type, rmask)
TileType type;
TileTypeBitMask *rmask;
{
TileType t;
TileTypeBitMask *lmask;
LayerInfo *li, *lr;
li = &dbLayerInfo[type];
lmask = &li->l_residues;
TTMaskZero(rmask);
LayerInfo *li = &dbLayerInfo[type];
const TileTypeBitMask *lmask = &li->l_residues;
if (type < DBNumUserLayers)
{
TTMaskSetMask(rmask, &li->l_residues);
TTMaskCopy(rmask, lmask);
}
else
{
for (t = TT_TECHDEPBASE; t < DBNumUserLayers; t++)
TileType t;
const int tt_last = DBNumUserLayers;
TTMaskZero(rmask);
for (t = TT_TECHDEPBASE; t < tt_last; t++)
if (TTMaskHasType(lmask, t))
{
lr = &dbLayerInfo[t];
LayerInfo *lr = &dbLayerInfo[t];
TTMaskSetMask(rmask, &lr->l_residues);
}
}

View File

@ -877,7 +877,7 @@ extern TileType DBTechFindStacking();
extern bool DBIsContact();
extern PlaneMask DBLayerPlanes();
extern TileTypeBitMask *DBResidueMask();
extern __nodiscard__ TileTypeBitMask *DBResidueMask(TileType type);
extern void DBFullResidueMask();
/* Miscellaneous */

View File

@ -51,6 +51,10 @@ add_generated_mask_macro(
"TTMaskZero(m)",
"(m)->tt_words[{i}] = 0",
)
add_generated_mask_macro(
"TTMaskCopy(m, n)",
"(m)->tt_words[{i}] = (n)->tt_words[{i}]",
)
add_generated_mask_macro(
"TTMaskIsZero(m)",
"(m)->tt_words[{i}] == 0",

View File

@ -194,6 +194,21 @@ extern char AbortMessage[];
/* looking to squash excessive -Wpedantic warnings ? add into defs.mak: CPPFLAGS += -Wno-variadic-macros */
#define ANALYSER_NONNULL(n...) __attribute__((nonnull(n)))
#define ANALYSER_RETURNS_NONNULL __attribute__((returns_nonnull))
/* These have keyword like behaviour so __nodiscard__ looks more like a keyword and is recognisable as such
* the historic use of __inline__ set a precedent on how backward compatibiliy maybe achieved for such things
*/
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L))
/* since C23 but maybe some compilers supported it before their official C23 releases */
#define __nodiscard__ [[nodiscard]]
#elif (defined(__GNUC__) && (__GNUC__ >= 4))
#define __nodiscard__ __attribute__((warn_unused_result))
#elif (defined(__clang__) && (__clang_major__ >= 1))
#define __nodiscard__ __attribute__((warn_unused_result))
#else
#define __nodiscard__ /* */
#endif
#else
#define ATTR_FORMAT_PRINTF_1 /* */
#define ATTR_FORMAT_PRINTF_2 /* */
@ -207,6 +222,8 @@ extern char AbortMessage[];
#define ANALYSER_MALLOC(dealloc, idx) /* */
#define ANALYSER_NONNULL(n...) /* */
#define ANALYSER_RETURNS_NONNULL /* */
#define __nodiscard__ /* */
#endif
/* ---------------- Start of Machine Configuration Section ----------------- */