aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-02-28 22:06:03 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-02-28 22:06:03 +0000
commit757c1f9d87b516a1e3bc4cd678245b207ae9c559 (patch)
tree2b366747712b5fe742b512f7e344ce298d8d5c53
parent5ab29b504d49d3fa84d76f79e73704260f900682 (diff)
Fix my sloppiness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11968 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/Support/ELF.h12
-rw-r--r--include/llvm/Support/ELF.h12
2 files changed, 12 insertions, 12 deletions
diff --git a/include/Support/ELF.h b/include/Support/ELF.h
index 204d26dd04..ab11e0c383 100644
--- a/include/Support/ELF.h
+++ b/include/Support/ELF.h
@@ -31,7 +31,7 @@ typedef int32_t Elf32_Sword;
typedef uint32_t Elf32_Word;
// Object file magic string.
-static const char *ElfMagic = "\x7fELF";
+static const char ElfMagic[] = { 0x7f, 'E', 'L', 'F', '\0' };
struct Elf32_Ehdr {
unsigned char e_ident[16]; // ELF Identification bytes
@@ -49,7 +49,7 @@ struct Elf32_Ehdr {
Elf32_Half e_shnum; // Number of entries in the section header table
Elf32_Half e_shstrndx; // Sect hdr table index of sect name string table
bool checkMagic () const {
- return (memcmp (e_ident, ElfMagic, strlen (ElfMagic)) == 0;
+ return (memcmp (e_ident, ElfMagic, strlen (ElfMagic))) == 0;
}
unsigned char getFileClass () const { return e_ident[4]; }
unsigned char getDataEncoding () { return e_ident[5]; }
@@ -192,8 +192,8 @@ struct Elf32_Rel {
// and ELF32_R_INFO macros defined in the ELF specification:
Elf32_Word getSymbol () const { return (r_info >> 8); }
unsigned char getType () const { return (unsigned char) (r_info & 0x0ff); }
- void setSymbol (Elf32_Word s) const { setSymbolAndType (s, getType ()); }
- void setType (unsigned char t) const { setSymbolAndType (getSymbol(), t); }
+ void setSymbol (Elf32_Word s) { setSymbolAndType (s, getType ()); }
+ void setType (unsigned char t) { setSymbolAndType (getSymbol(), t); }
void setSymbolAndType (Elf32_Word s, unsigned char t) {
r_info = (s << 8) + t;
};
@@ -209,8 +209,8 @@ struct Elf32_Rela {
// and ELF32_R_INFO macros defined in the ELF specification:
Elf32_Word getSymbol () const { return (r_info >> 8); }
unsigned char getType () const { return (unsigned char) (r_info & 0x0ff); }
- void setSymbol (Elf32_Word s) const { setSymbolAndType (s, getType ()); }
- void setType (unsigned char t) const { setSymbolAndType (getSymbol(), t); }
+ void setSymbol (Elf32_Word s) { setSymbolAndType (s, getType ()); }
+ void setType (unsigned char t) { setSymbolAndType (getSymbol(), t); }
void setSymbolAndType (Elf32_Word s, unsigned char t) {
r_info = (s << 8) + t;
};
diff --git a/include/llvm/Support/ELF.h b/include/llvm/Support/ELF.h
index 204d26dd04..ab11e0c383 100644
--- a/include/llvm/Support/ELF.h
+++ b/include/llvm/Support/ELF.h
@@ -31,7 +31,7 @@ typedef int32_t Elf32_Sword;
typedef uint32_t Elf32_Word;
// Object file magic string.
-static const char *ElfMagic = "\x7fELF";
+static const char ElfMagic[] = { 0x7f, 'E', 'L', 'F', '\0' };
struct Elf32_Ehdr {
unsigned char e_ident[16]; // ELF Identification bytes
@@ -49,7 +49,7 @@ struct Elf32_Ehdr {
Elf32_Half e_shnum; // Number of entries in the section header table
Elf32_Half e_shstrndx; // Sect hdr table index of sect name string table
bool checkMagic () const {
- return (memcmp (e_ident, ElfMagic, strlen (ElfMagic)) == 0;
+ return (memcmp (e_ident, ElfMagic, strlen (ElfMagic))) == 0;
}
unsigned char getFileClass () const { return e_ident[4]; }
unsigned char getDataEncoding () { return e_ident[5]; }
@@ -192,8 +192,8 @@ struct Elf32_Rel {
// and ELF32_R_INFO macros defined in the ELF specification:
Elf32_Word getSymbol () const { return (r_info >> 8); }
unsigned char getType () const { return (unsigned char) (r_info & 0x0ff); }
- void setSymbol (Elf32_Word s) const { setSymbolAndType (s, getType ()); }
- void setType (unsigned char t) const { setSymbolAndType (getSymbol(), t); }
+ void setSymbol (Elf32_Word s) { setSymbolAndType (s, getType ()); }
+ void setType (unsigned char t) { setSymbolAndType (getSymbol(), t); }
void setSymbolAndType (Elf32_Word s, unsigned char t) {
r_info = (s << 8) + t;
};
@@ -209,8 +209,8 @@ struct Elf32_Rela {
// and ELF32_R_INFO macros defined in the ELF specification:
Elf32_Word getSymbol () const { return (r_info >> 8); }
unsigned char getType () const { return (unsigned char) (r_info & 0x0ff); }
- void setSymbol (Elf32_Word s) const { setSymbolAndType (s, getType ()); }
- void setType (unsigned char t) const { setSymbolAndType (getSymbol(), t); }
+ void setSymbol (Elf32_Word s) { setSymbolAndType (s, getType ()); }
+ void setType (unsigned char t) { setSymbolAndType (getSymbol(), t); }
void setSymbolAndType (Elf32_Word s, unsigned char t) {
r_info = (s << 8) + t;
};