mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-01 07:30:31 +00:00
Like output_data, it's obvious that input_data was only used with 1 character
data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10861 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
411a9a6f07
commit
4e8683664d
@ -132,20 +132,12 @@ static inline bool read(const unsigned char *&Buf, const unsigned char *EndBuf,
|
||||
|
||||
static inline bool input_data(const unsigned char *&Buf,
|
||||
const unsigned char *EndBuf,
|
||||
void *Ptr, void *End, bool Align = false) {
|
||||
void *Ptr, void *End) {
|
||||
unsigned char *Start = (unsigned char *)Ptr;
|
||||
unsigned Amount = (unsigned char *)End - Start;
|
||||
if (Buf+Amount > EndBuf) return true;
|
||||
#ifdef ENDIAN_LITTLE
|
||||
std::copy(Buf, Buf+Amount, Start);
|
||||
Buf += Amount;
|
||||
#else
|
||||
unsigned char *E = (unsigned char *)End;
|
||||
while (Ptr != E)
|
||||
*--E = *Buf++;
|
||||
#endif
|
||||
|
||||
if (Align) return align32(Buf, EndBuf);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user