commands: Various fixes for TxPrintf() with !MAGIC_WRAPPER

!MAGIC_WRAPPER build for WASM exposes
This commit is contained in:
Darryl L. Miles 2025-10-03 22:10:25 +01:00 committed by R. Timothy Edwards
parent b1424bfaf3
commit cfd1d567bd
4 changed files with 8 additions and 8 deletions

View File

@ -431,7 +431,7 @@ CmdCalma(
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
Tcl_SetObjResult(magicinterp, Tcl_NewDoubleObj((double)CalmaMagScale)); Tcl_SetObjResult(magicinterp, Tcl_NewDoubleObj((double)CalmaMagScale));
#else #else
TxPrintf("Text magnification 1.0 = %g microns.\n"); TxPrintf("Text magnification 1.0 = %g microns.\n", (double)CalmaMagScale);
#endif #endif
return; return;
} }
@ -744,7 +744,7 @@ CmdCalma(
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
Tcl_SetObjResult(magicinterp, Tcl_NewBooleanObj(CalmaNoDuplicates)); Tcl_SetObjResult(magicinterp, Tcl_NewBooleanObj(CalmaNoDuplicates));
#else #else
TxPrintf("Cell defs that exist before reading GDS will not be paresd.\n", TxPrintf("Cell defs that exist before reading GDS will %sbe parsed.\n",
(CalmaNoDuplicates) ? "not " : ""); (CalmaNoDuplicates) ? "not " : "");
#endif #endif
return; return;
@ -764,7 +764,7 @@ CmdCalma(
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
Tcl_SetObjResult(magicinterp, Tcl_NewBooleanObj(CalmaUnique)); Tcl_SetObjResult(magicinterp, Tcl_NewBooleanObj(CalmaUnique));
#else #else
TxPrintf("Cell defs that exist before reading GDS will be renamed.\n", TxPrintf("Cell defs that exist before reading GDS will %sbe renamed.\n",
(CalmaUnique) ? "not " : ""); (CalmaUnique) ? "not " : "");
#endif #endif
return; return;

View File

@ -2435,14 +2435,14 @@ printPropertiesFunc(
} }
else else
{ {
keyvalue = (char *)mallocMagic(strlen(name) + strlen((char *)value) + 2); keyvalue = (char *)mallocMagic(strlen(name) + strlen((const char *)value) + 2);
sprintf(keyvalue, "%s %s", name, (char *)value); sprintf(keyvalue, "%s %s", name, (const char *)value);
} }
Tcl_AppendElement(magicinterp, keyvalue); Tcl_AppendElement(magicinterp, keyvalue);
freeMagic(keyvalue); freeMagic(keyvalue);
#else #else
TxPrintf("%s = %s\n", name, value); TxPrintf("%s = %s\n", name, (const char *)value);
#endif #endif
return 0; /* keep the search alive */ return 0; /* keep the search alive */

View File

@ -99,7 +99,7 @@ CmdRandom(
#ifdef MAGIC_WRAPPER #ifdef MAGIC_WRAPPER
Tcl_SetObjResult(magicinterp, Tcl_NewIntObj(random())); Tcl_SetObjResult(magicinterp, Tcl_NewIntObj(random()));
#else #else
TxPrintf("%d", random()); TxPrintf("%ld", random());
#endif #endif
} }
else if ((cmd->tx_argc >= 2) && (!strcmp(cmd->tx_argv[1], "seed"))) else if ((cmd->tx_argc >= 2) && (!strcmp(cmd->tx_argv[1], "seed")))

View File

@ -981,7 +981,7 @@ cmdTsrFunc(
Tile *tp) Tile *tp)
{ {
if (cmdTsearchDebug) if (cmdTsearchDebug)
TxPrintf("%lx\n", (intmax_t) tp); TxPrintf("%lx\n", (intptr_t) tp);
numTilesFound++; numTilesFound++;
return 0; return 0;
} }