Skip to content

Commit

Permalink
Remove dead code in tclLoadDyld.c
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Jan 2, 2025
1 parent 92fd1eb commit 690eacc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 51 deletions.
4 changes: 2 additions & 2 deletions generic/tcl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion generic/tclArithSeries.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ TclNewArithSeriesObj(

objPtr = NewArithSeriesDbl(dstart, dstep, len, precision);
} else {
objPtr = NewArithSeriesInt(start, step, len);
objPtr = NewArithSeriesInt(start, step, len);
}

return objPtr;
Expand Down
2 changes: 1 addition & 1 deletion generic/tclBasic.c
Original file line number Diff line number Diff line change
Expand Up @@ -8101,7 +8101,7 @@ DoubleObjIsClass(
return TCL_ERROR;
}
dCls = (
positive
positive
? (dCls == cmpCls)
: (dCls != cmpCls && dCls != FP_NAN)
) ? 1 : 0;
Expand Down
47 changes: 0 additions & 47 deletions unix/tclLoadDyld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

/*
*----------------------------------------------------------------------
*
Expand Down Expand Up @@ -445,7 +404,6 @@ TclpLoadMemory(
NSObjectFileImage dyldObjFileImage = NULL;
Tcl_DyldModuleHandle *modulePtr;
NSModule module;
const char *objFileImageErrMsg = NULL;
int nsflags = NSLINKMODULE_OPTION_RETURN_ON_ERROR;

/*
Expand Down Expand Up @@ -514,11 +472,6 @@ TclpLoadMemory(
if (err == NSObjectFileImageSuccess) {
err = NSCreateObjectFileImageFromMemory(buffer, codeSize,
&dyldObjFileImage);
if (err != NSObjectFileImageSuccess) {
objFileImageErrMsg = DyldOFIErrorMsg(err);
}
} else {
objFileImageErrMsg = DyldOFIErrorMsg(err);
}
}

Expand Down

0 comments on commit 690eacc

Please sign in to comment.