From 690eacc331f670b8d8a5974b6db3335529a4bdbd Mon Sep 17 00:00:00 2001
From: "jan.nijtmans" <nijtmans@users.sourceforge.net>
Date: Thu, 2 Jan 2025 15:22:36 +0000
Subject: [PATCH] Remove dead code in tclLoadDyld.c

---
 generic/tcl.h            |  4 ++--
 generic/tclArithSeries.c |  2 +-
 generic/tclBasic.c       |  2 +-
 unix/tclLoadDyld.c       | 47 ----------------------------------------
 4 files changed, 4 insertions(+), 51 deletions(-)

diff --git a/generic/tcl.h b/generic/tcl.h
index 5ad517b8c74..ae1e30deb64 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -729,8 +729,8 @@ typedef union Tcl_ObjInternalRep {	/* The internal representation: */
 	unsigned long value;
     } ptrAndLongRep;
     struct {			/*   - use for pointer and length reps */
-        void *ptr;
-        Tcl_Size size;
+	void *ptr;
+	Tcl_Size size;
     } ptrAndSize;
 } Tcl_ObjInternalRep;
 
diff --git a/generic/tclArithSeries.c b/generic/tclArithSeries.c
index 38218a2dda2..d05d07fd0f3 100755
--- a/generic/tclArithSeries.c
+++ b/generic/tclArithSeries.c
@@ -755,7 +755,7 @@ TclNewArithSeriesObj(
 
 	objPtr = NewArithSeriesDbl(dstart, dstep, len, precision);
     } else {
-    	objPtr = NewArithSeriesInt(start, step, len);
+	objPtr = NewArithSeriesInt(start, step, len);
     }
 
     return objPtr;
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index b74f2a7f715..622651af9fb 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -8101,7 +8101,7 @@ DoubleObjIsClass(
 	return TCL_ERROR;
     }
     dCls = (
-    	positive
+	positive
 	    ? (dCls == cmpCls)
 	    : (dCls != cmpCls && dCls != FP_NAN)
     ) ? 1 : 0;
diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c
index 6fda2ce49ae..c5422f85e8b 100644
--- a/unix/tclLoadDyld.c
+++ b/unix/tclLoadDyld.c
@@ -58,47 +58,6 @@ static void *		FindSymbol(Tcl_Interp *interp,
 			    Tcl_LoadHandle loadHandle, const char *symbol);
 static void		UnloadFile(Tcl_LoadHandle handle);
 
-/*
- *----------------------------------------------------------------------
- *
- * DyldOFIErrorMsg --
- *
- *	Converts a numerical NSObjectFileImage error into an error message
- *	string.
- *
- * Results:
- *	Error message string.
- *
- * Side effects:
- *	None.
- *
- *----------------------------------------------------------------------
- */
-
-#if defined(TCL_LOAD_FROM_MEMORY)
-static const char *
-DyldOFIErrorMsg(
-    int err)
-{
-    switch (err) {
-    case NSObjectFileImageSuccess:
-	return NULL;
-    case NSObjectFileImageFailure:
-	return "object file setup failure";
-    case NSObjectFileImageInappropriateFile:
-	return "not a Mach-O MH_BUNDLE file";
-    case NSObjectFileImageArch:
-	return "no object for this architecture";
-    case NSObjectFileImageFormat:
-	return "bad object file format";
-    case NSObjectFileImageAccess:
-	return "cannot read object file";
-    default:
-	return "unknown error";
-    }
-}
-#endif /* TCL_LOAD_FROM_MEMORY */
-
 /*
  *----------------------------------------------------------------------
  *
@@ -445,7 +404,6 @@ TclpLoadMemory(
     NSObjectFileImage dyldObjFileImage = NULL;
     Tcl_DyldModuleHandle *modulePtr;
     NSModule module;
-    const char *objFileImageErrMsg = NULL;
     int nsflags = NSLINKMODULE_OPTION_RETURN_ON_ERROR;
 
     /*
@@ -514,11 +472,6 @@ TclpLoadMemory(
 	if (err == NSObjectFileImageSuccess) {
 	    err = NSCreateObjectFileImageFromMemory(buffer, codeSize,
 		    &dyldObjFileImage);
-	    if (err != NSObjectFileImageSuccess) {
-		objFileImageErrMsg = DyldOFIErrorMsg(err);
-	    }
-	} else {
-	    objFileImageErrMsg = DyldOFIErrorMsg(err);
 	}
     }