Made libPtr param const. Doesn't get modified so why not.

Also removed some unneccessary code (for now)

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40707
This commit is contained in:
Scott Ehlert 2007-04-20 18:50:52 +00:00
parent efa6067669
commit 199d839122
3 changed files with 7 additions and 12 deletions

View File

@ -21,17 +21,15 @@
MemoryUtils g_MemUtils; MemoryUtils g_MemUtils;
#if 0
MemoryUtils::MemoryUtils() MemoryUtils::MemoryUtils()
{ {
#ifdef PLATFORM_WINDOWS #ifdef PLATFORM_WINDOWS
/* This might be used in the future? */
#if 0
SYSTEM_INFO info; SYSTEM_INFO info;
GetSystemInfo(&info); GetSystemInfo(&info);
m_PageSize = info.dwPageSize; m_PageSize = info.dwPageSize;
#endif
#elif defined PLATFORM_POSIX #elif defined PLATFORM_POSIX
@ -39,8 +37,9 @@ MemoryUtils::MemoryUtils()
#endif #endif
} }
#endif
void *MemoryUtils::FindPattern(void *libPtr, const char *pattern, size_t len) void *MemoryUtils::FindPattern(const void *libPtr, const char *pattern, size_t len)
{ {
DynLibInfo lib; DynLibInfo lib;
bool found; bool found;
@ -77,7 +76,7 @@ void *MemoryUtils::FindPattern(void *libPtr, const char *pattern, size_t len)
return NULL; return NULL;
} }
bool MemoryUtils::GetLibraryInfo(void *libPtr, DynLibInfo &lib) bool MemoryUtils::GetLibraryInfo(const void *libPtr, DynLibInfo &lib)
{ {
unsigned long baseAddr; unsigned long baseAddr;

View File

@ -28,13 +28,9 @@ struct DynLibInfo
class MemoryUtils : public IMemoryUtils class MemoryUtils : public IMemoryUtils
{ {
public: public:
MemoryUtils(); void *FindPattern(const void *libPtr, const char *pattern, size_t len);
public:
void *FindPattern(void *libPtr, const char *pattern, size_t len);
private: private:
bool GetLibraryInfo(void *libPtr, DynLibInfo &lib); bool GetLibraryInfo(const void *libPtr, DynLibInfo &lib);
private:
size_t m_PageSize;
}; };
extern MemoryUtils g_MemUtils; extern MemoryUtils g_MemUtils;

View File

@ -46,7 +46,7 @@ namespace SourceMod
* @param len Size of the pattern in bytes. * @param len Size of the pattern in bytes.
* @return Pointer to pattern found in memory, NULL if not found. * @return Pointer to pattern found in memory, NULL if not found.
*/ */
virtual void *FindPattern(void *libPtr, const char *pattern, size_t len) =0; virtual void *FindPattern(const void *libPtr, const char *pattern, size_t len) =0;
}; };
} }