diff --git a/Include/Library/OcMachoLib.h b/Include/Library/OcMachoLib.h index ab958260..dbfe9ddf 100644 --- a/Include/Library/OcMachoLib.h +++ b/Include/Library/OcMachoLib.h @@ -172,7 +172,7 @@ MachoGetNextSection64 ( @retval NULL NULL is returned on failure. **/ -CONST MACH_SECTION_64 * +MACH_SECTION_64 * MachoGetSectionByIndex64 ( IN OUT VOID *Context, IN UINTN Index @@ -187,7 +187,7 @@ MachoGetSectionByIndex64 ( @retval NULL NULL is returned on failure. **/ -CONST MACH_SECTION_64 * +MACH_SECTION_64 * MachoGetSectionByAddress64 ( IN OUT VOID *Context, IN UINT64 Address @@ -235,7 +235,7 @@ MachoSymbolIsLocalDefined ( @param[in] Name Name of the symbol to locate. **/ -CONST MACH_NLIST_64 * +MACH_NLIST_64 * MachoGetLocalDefinedSymbolByName ( IN OUT VOID *Context, IN CONST CHAR8 *Name @@ -250,7 +250,7 @@ MachoGetLocalDefinedSymbolByName ( @retval NULL NULL is returned on failure. **/ -CONST MACH_NLIST_64 * +MACH_NLIST_64 * MachoGetSymbolByIndex64 ( IN OUT VOID *Context, IN UINT32 Index @@ -503,7 +503,7 @@ MachoVtableGetNumberOfEntries64 ( @retval NULL NULL is returned on failure. **/ -CONST MACH_NLIST_64 * +MACH_NLIST_64 * MachoGetMetaclassSymbolFromSmcpSymbol64 ( IN OUT VOID *Context, IN CONST MACH_NLIST_64 *Smcp diff --git a/Library/OcMachoLib/CxxSymbols.c b/Library/OcMachoLib/CxxSymbols.c index 9fc1f1c3..4b71464b 100644 --- a/Library/OcMachoLib/CxxSymbols.c +++ b/Library/OcMachoLib/CxxSymbols.c @@ -555,7 +555,7 @@ MachoVtableGetNumberOfEntries64 ( @retval NULL NULL is returned on failure. **/ -CONST MACH_NLIST_64 * +MACH_NLIST_64 * MachoGetMetaclassSymbolFromSmcpSymbol64 ( IN OUT VOID *Context, IN CONST MACH_NLIST_64 *Smcp diff --git a/Library/OcMachoLib/Header.c b/Library/OcMachoLib/Header.c index 3b398532..c4738080 100644 --- a/Library/OcMachoLib/Header.c +++ b/Library/OcMachoLib/Header.c @@ -478,7 +478,7 @@ MachoGetNextSection64 ( @retval NULL NULL is returned on failure. **/ -CONST MACH_SECTION_64 * +MACH_SECTION_64 * MachoGetSectionByIndex64 ( IN OUT VOID *Context, IN UINTN Index @@ -497,7 +497,7 @@ MachoGetSectionByIndex64 ( Segment = MachoGetNextSegment64 (Context, Segment) ) { if (Index <= (SectionIndex + (Segment->NumSections - 1))) { - return &Segment->Sections[Index - SectionIndex]; + return (MACH_SECTION_64 *)&Segment->Sections[Index - SectionIndex]; } SectionIndex += Segment->NumSections; @@ -515,7 +515,7 @@ MachoGetSectionByIndex64 ( @retval NULL NULL is returned on failure. **/ -CONST MACH_SECTION_64 * +MACH_SECTION_64 * MachoGetSectionByAddress64 ( IN OUT VOID *Context, IN UINT64 Address @@ -539,7 +539,7 @@ MachoGetSectionByAddress64 ( for (Index = 0; Index < Segment->NumSections; ++Index) { if ((Address >= Section->Address) && (Address < Section->Address + Section->Size)) { - return Section; + return (MACH_SECTION_64 *)Section; } ++Section; diff --git a/Library/OcMachoLib/OcMachoLibInternal.h b/Library/OcMachoLib/OcMachoLibInternal.h index 04447129..82721f2d 100644 --- a/Library/OcMachoLib/OcMachoLibInternal.h +++ b/Library/OcMachoLib/OcMachoLibInternal.h @@ -55,7 +55,7 @@ InternalRetrieveSymtabs64 ( @retval NULL NULL is returned on failure. **/ -CONST MACH_RELOCATION_INFO * +MACH_RELOCATION_INFO * InternalGetExternalRelocationByOffset ( IN OUT VOID *Context, IN UINT64 Address diff --git a/Library/OcMachoLib/Relocations.c b/Library/OcMachoLib/Relocations.c index 4a62e725..8f0767dc 100644 --- a/Library/OcMachoLib/Relocations.c +++ b/Library/OcMachoLib/Relocations.c @@ -74,7 +74,7 @@ MachoPreserveRelocationIntel64 ( @retval NULL NULL is returned on failure. **/ -CONST MACH_RELOCATION_INFO * +MACH_RELOCATION_INFO * InternalGetExternalRelocationByOffset ( IN OUT VOID *Context, IN UINT64 Address @@ -119,7 +119,7 @@ InternalGetExternalRelocationByOffset ( } if ((UINT64)Relocation->Address == Address) { - return Relocation; + return (MACH_RELOCATION_INFO *)Relocation; } // // Relocation Pairs can be skipped. diff --git a/Library/OcMachoLib/Symbols.c b/Library/OcMachoLib/Symbols.c index f54e4c17..ead848bc 100644 --- a/Library/OcMachoLib/Symbols.c +++ b/Library/OcMachoLib/Symbols.c @@ -174,7 +174,7 @@ MachoSymbolIsLocalDefined ( @retval NULL NULL is returned on failure. **/ -CONST MACH_NLIST_64 * +MACH_NLIST_64 * MachoGetSymbolByIndex64 ( IN OUT VOID *Context, IN UINT32 Index @@ -198,7 +198,7 @@ MachoGetSymbolByIndex64 ( if (Index < MachoContext->NumSymbols) { Symbol = &MachoContext->SymbolTable[Index]; if (InternalSymbolIsSane (MachoContext, Symbol)) { - return Symbol; + return (MACH_NLIST_64 *)Symbol; } } else { ASSERT (FALSE); @@ -263,7 +263,7 @@ MachoGetSymbolByExternRelocationOffset64 ( **/ STATIC -CONST MACH_NLIST_64 * +MACH_NLIST_64 * InternalGetSymbolByName ( IN CONST MACH_NLIST_64 *SymbolTable, IN CONST CHAR8 *StringTable, @@ -284,7 +284,7 @@ InternalGetSymbolByName ( (StringTable + SymbolTable[Index].UnifiedName.StringIndex) ); if (Result == 0) { - return &SymbolTable[Index]; + return (MACH_NLIST_64 *)&SymbolTable[Index]; } } @@ -298,7 +298,7 @@ InternalGetSymbolByName ( @param[in] Name Name of the symbol to locate. **/ -CONST MACH_NLIST_64 * +MACH_NLIST_64 * MachoGetLocalDefinedSymbolByName ( IN OUT VOID *Context, IN CONST CHAR8 *Name @@ -346,7 +346,7 @@ MachoGetLocalDefinedSymbolByName ( return NULL; } - return Symbol; + return (MACH_NLIST_64 *)Symbol; } /**