mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Converted tabs to spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8669 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fdf148ea71
commit
4f901d6d99
@ -21,7 +21,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static inline bool read(const unsigned char *&Buf, const unsigned char *EndBuf,
|
||||
unsigned &Result) {
|
||||
unsigned &Result) {
|
||||
if (Buf+4 > EndBuf) return true;
|
||||
#ifdef ENDIAN_LITTLE
|
||||
Result = *(unsigned*)Buf;
|
||||
@ -33,7 +33,7 @@ static inline bool read(const unsigned char *&Buf, const unsigned char *EndBuf,
|
||||
}
|
||||
|
||||
static inline bool read(const unsigned char *&Buf, const unsigned char *EndBuf,
|
||||
uint64_t &Result) {
|
||||
uint64_t &Result) {
|
||||
if (Buf+8 > EndBuf) return true;
|
||||
|
||||
#ifdef ENDIAN_LITTLE
|
||||
@ -47,12 +47,12 @@ static inline bool read(const unsigned char *&Buf, const unsigned char *EndBuf,
|
||||
}
|
||||
|
||||
static inline bool read(const unsigned char *&Buf, const unsigned char *EndBuf,
|
||||
int &Result) {
|
||||
int &Result) {
|
||||
return read(Buf, EndBuf, (unsigned &)Result);
|
||||
}
|
||||
|
||||
static inline bool read(const unsigned char *&Buf, const unsigned char *EndBuf,
|
||||
int64_t &Result) {
|
||||
int64_t &Result) {
|
||||
return read(Buf, EndBuf, (uint64_t &)Result);
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ static inline bool read(const unsigned char *&Buf, const unsigned char *EndBuf,
|
||||
// read_vbr - Read an unsigned integer encoded in variable bitrate format.
|
||||
//
|
||||
static inline bool read_vbr(const unsigned char *&Buf,
|
||||
const unsigned char *EndBuf, unsigned &Result) {
|
||||
const unsigned char *EndBuf, unsigned &Result) {
|
||||
unsigned Shift = Result = 0;
|
||||
|
||||
do {
|
||||
@ -72,7 +72,7 @@ static inline bool read_vbr(const unsigned char *&Buf,
|
||||
}
|
||||
|
||||
static inline bool read_vbr(const unsigned char *&Buf,
|
||||
const unsigned char *EndBuf, uint64_t &Result) {
|
||||
const unsigned char *EndBuf, uint64_t &Result) {
|
||||
unsigned Shift = 0; Result = 0;
|
||||
|
||||
do {
|
||||
@ -84,7 +84,7 @@ static inline bool read_vbr(const unsigned char *&Buf,
|
||||
|
||||
// read_vbr (signed) - Read a signed number stored in sign-magnitude format
|
||||
static inline bool read_vbr(const unsigned char *&Buf,
|
||||
const unsigned char *EndBuf, int &Result) {
|
||||
const unsigned char *EndBuf, int &Result) {
|
||||
unsigned R;
|
||||
if (read_vbr(Buf, EndBuf, R)) return true;
|
||||
if (R & 1)
|
||||
@ -97,7 +97,7 @@ static inline bool read_vbr(const unsigned char *&Buf,
|
||||
|
||||
|
||||
static inline bool read_vbr(const unsigned char *&Buf,
|
||||
const unsigned char *EndBuf, int64_t &Result) {
|
||||
const unsigned char *EndBuf, int64_t &Result) {
|
||||
uint64_t R;
|
||||
if (read_vbr(Buf, EndBuf, R)) return true;
|
||||
if (R & 1)
|
||||
@ -110,13 +110,13 @@ static inline bool read_vbr(const unsigned char *&Buf,
|
||||
|
||||
// align32 - Round up to multiple of 32 bits...
|
||||
static inline bool align32(const unsigned char *&Buf,
|
||||
const unsigned char *EndBuf) {
|
||||
const unsigned char *EndBuf) {
|
||||
Buf = (const unsigned char *)((unsigned long)(Buf+3) & (~3UL));
|
||||
return Buf > EndBuf;
|
||||
}
|
||||
|
||||
static inline bool read(const unsigned char *&Buf, const unsigned char *EndBuf,
|
||||
std::string &Result, bool Aligned = true) {
|
||||
std::string &Result, bool Aligned = true) {
|
||||
unsigned Size;
|
||||
if (read_vbr(Buf, EndBuf, Size)) return true; // Failure reading size?
|
||||
if (Buf+Size > EndBuf) return true; // Size invalid?
|
||||
@ -131,8 +131,8 @@ 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) {
|
||||
const unsigned char *EndBuf,
|
||||
void *Ptr, void *End, bool Align = false) {
|
||||
unsigned char *Start = (unsigned char *)Ptr;
|
||||
unsigned Amount = (unsigned char *)End - Start;
|
||||
if (Buf+Amount > EndBuf) return true;
|
||||
@ -245,7 +245,7 @@ static inline void align32(std::deque<unsigned char> &Out) {
|
||||
}
|
||||
|
||||
static inline void output(const std::string &s, std::deque<unsigned char> &Out,
|
||||
bool Aligned = true) {
|
||||
bool Aligned = true) {
|
||||
unsigned Len = s.length();
|
||||
output_vbr(Len, Out); // Strings may have an arbitrary length...
|
||||
Out.insert(Out.end(), s.begin(), s.end());
|
||||
@ -255,7 +255,7 @@ static inline void output(const std::string &s, std::deque<unsigned char> &Out,
|
||||
}
|
||||
|
||||
static inline void output_data(void *Ptr, void *End,
|
||||
std::deque<unsigned char> &Out,
|
||||
std::deque<unsigned char> &Out,
|
||||
bool Align = false) {
|
||||
#ifdef ENDIAN_LITTLE
|
||||
Out.insert(Out.end(), (unsigned char*)Ptr, (unsigned char*)End);
|
||||
|
Loading…
x
Reference in New Issue
Block a user