@@ -1205,34 +1205,31 @@ RenderDeclarerName(
12051205
12061206#define LIMIT 60
12071207#define ELLIPSIFY (str ,len ) \
1208- ((len) > LIMIT ? LIMIT : (int)(len)), (str), ((len) > LIMIT ? "..." : "")
1208+ ((len) > LIMIT ? LIMIT : (int)(len)), (str), ((len) > LIMIT ? "..." : "")
12091209
12101210static void
12111211CommonMethErrorHandler (
12121212 Tcl_Interp * interp ,
12131213 const char * special )
1214-
12151214{
12161215 Tcl_Size objectNameLen ;
1217- CallContext * contextPtr = (CallContext * )((Interp * ) interp )-> varFramePtr -> clientData ;
1216+ CallContext * contextPtr = (CallContext * )((Interp * )
1217+ interp )-> varFramePtr -> clientData ;
12181218 Method * mPtr = contextPtr -> callPtr -> chain [contextPtr -> index ].mPtr ;
12191219 const char * objectName , * kindName = "instance" ;
12201220 Object * declarerPtr = NULL ;
12211221
12221222 if (mPtr -> declaringObjectPtr != NULL ) {
12231223 declarerPtr = mPtr -> declaringObjectPtr ;
12241224 kindName = "object" ;
1225-
12261225 } else if (mPtr -> declaringClassPtr != NULL ) {
1227-
1228-
12291226 declarerPtr = mPtr -> declaringClassPtr -> thisPtr ;
12301227 kindName = "class" ;
12311228 }
12321229
12331230 if (declarerPtr ) {
12341231 objectName = TclGetStringFromObj (TclOOObjectName (interp , declarerPtr ),
1235- & objectNameLen );
1232+ & objectNameLen );
12361233 } else {
12371234 objectName = "unknown or deleted" ;
12381235 objectNameLen = 18 ;
@@ -1241,85 +1238,44 @@ CommonMethErrorHandler(
12411238 Tcl_Size nameLen ;
12421239 const char * methodName = TclGetStringFromObj (mPtr -> namePtr , & nameLen );
12431240 Tcl_AppendObjToErrorInfo (interp , Tcl_ObjPrintf (
1244- "\n (%s \"%.*s%s\" method \"%.*s%s\" line %d)" ,
1245- kindName , ELLIPSIFY (objectName , objectNameLen ),
1246- ELLIPSIFY (methodName , nameLen ), Tcl_GetErrorLine (interp )));
1241+ "\n (%s \"%.*s%s\" method \"%.*s%s\" line %d)" ,
1242+ kindName , ELLIPSIFY (objectName , objectNameLen ),
1243+ ELLIPSIFY (methodName , nameLen ), Tcl_GetErrorLine (interp )));
12471244 } else {
12481245 Tcl_AppendObjToErrorInfo (interp , Tcl_ObjPrintf (
1249- "\n (%s \"%.*s%s\" %s line %d)" , kindName ,
1250- ELLIPSIFY (objectName , objectNameLen ), special , Tcl_GetErrorLine (interp )));
1246+ "\n (%s \"%.*s%s\" %s line %d)" ,
1247+ kindName , ELLIPSIFY (objectName , objectNameLen ), special ,
1248+ Tcl_GetErrorLine (interp )));
12511249 }
12521250}
12531251
12541252static void
12551253MethodErrorHandler (
12561254 Tcl_Interp * interp ,
12571255 TCL_UNUSED (Tcl_Obj * ) /*methodNameObj*/ )
1258- /* We pull the method name out of context instead of from argument */
12591256{
1257+ /* We pull the method name out of context instead of from argument. */
12601258 CommonMethErrorHandler (interp , NULL );
12611259}
12621260
12631261static void
12641262ConstructorErrorHandler (
12651263 Tcl_Interp * interp ,
12661264 TCL_UNUSED (Tcl_Obj * ) /*methodNameObj*/ )
1267- /* Ignore. We know it is the constructor. */
12681265{
1269-
1270-
1271-
1272-
1273-
1266+ /* We know this is for the constructor. */
12741267 CommonMethErrorHandler (interp , "constructor" );
1275-
1276-
1277-
1278-
1279-
1280-
12811268}
12821269
1283-
1284-
1285-
1286-
1287-
1288-
1289-
1290-
1291-
1292-
12931270static void
12941271DestructorErrorHandler (
12951272 Tcl_Interp * interp ,
12961273 TCL_UNUSED (Tcl_Obj * ) /*methodNameObj*/ )
1297- /* Ignore. We know it is the destructor. */
12981274{
1299-
1300-
1301-
1302-
1303-
1275+ /* We know this is for the destructor. */
13041276 CommonMethErrorHandler (interp , "destructor" );
1305-
1306-
1307-
1308-
1309-
1310-
1311-
1312-
1313-
1314-
1315-
1316-
1317-
1318-
1319-
1320-
13211277}
1322-
1278+
13231279/*
13241280 * ----------------------------------------------------------------------
13251281 *
0 commit comments