Cosmetic cbfstool update (trivial)
* remove some dead code * fix indentation * comment in some destructors and fix some other warnings * use HOSTCC instead of CC (not all the way cosmetic, but very simple) Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4299 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
committed by
Stefan Reinauer
parent
bbe29ee06e
commit
3a5c27763f
@@ -12,13 +12,13 @@ include $(tsrc)/lzma/Makefile
|
||||
COMMON = common.o compress.o $(LZMA_OBJ)
|
||||
|
||||
$(tobj)/cbfs-mkstage: $(tobj)/cbfs-mkstage.o $(patsubst %,$(tobj)/%,$(COMMON))
|
||||
$(CXX) $(CFLAGS) -o $@ $^
|
||||
$(HOSTCXX) $(CFLAGS) -o $@ $^
|
||||
|
||||
$(tobj)/cbfs-mkpayload: $(tobj)/cbfs-mkpayload.o $(patsubst %,$(tobj)/%,$(COMMON))
|
||||
$(CXX) $(CFLAGS) -o $@ $^
|
||||
$(HOSTCXX) $(CFLAGS) -o $@ $^
|
||||
|
||||
$(tobj)/%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
$(HOSTCC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
tools-clean:
|
||||
rm -f $(tobj)/cbfs-mkpayload.o $(tobj)/cbfs-mkstage.o $(patsubst %,$(tobj)/%,$(COMMON))
|
||||
|
@@ -34,7 +34,6 @@ int parse_elf(unsigned char *input, unsigned char **output,
|
||||
{
|
||||
Elf32_Phdr *phdr;
|
||||
Elf32_Ehdr *ehdr = (Elf32_Ehdr *) input;
|
||||
Elf32_Shdr *shdr;
|
||||
char *header, *buffer;
|
||||
unsigned char *out;
|
||||
|
||||
@@ -47,7 +46,6 @@ int parse_elf(unsigned char *input, unsigned char **output,
|
||||
header = (char *)ehdr;
|
||||
|
||||
phdr = (Elf32_Phdr *) & (header[ehdr->e_phoff]);
|
||||
shdr = (Elf32_Shdr *) & (header[ehdr->e_shoff]);
|
||||
|
||||
/* Now, regular headers - we only care about PT_LOAD headers,
|
||||
* because thats what we're actually going to load
|
||||
|
@@ -26,7 +26,7 @@ struct IMatchFinder: public IInWindowStream
|
||||
|
||||
struct IMatchFinderSetNumPasses
|
||||
{
|
||||
//virtual ~IMatchFinderSetNumPasses(){}
|
||||
virtual ~IMatchFinderSetNumPasses(){}
|
||||
virtual void SetNumPasses(UInt32 numPasses) PURE;
|
||||
};
|
||||
|
||||
|
@@ -101,7 +101,7 @@ typedef LONG SCODE;
|
||||
|
||||
struct IUnknown
|
||||
{
|
||||
//virtual ~IUnknown() {}
|
||||
virtual ~IUnknown() {}
|
||||
STDMETHOD(QueryInterface) (REFIID iid, void **outObject) PURE;
|
||||
STDMETHOD_(ULONG, AddRef)() PURE;
|
||||
STDMETHOD_(ULONG, Release)() PURE;
|
||||
|
@@ -303,12 +303,12 @@ void do_lzma_compress(char *in, int in_len, char *out, int *out_len) {
|
||||
void do_lzma_uncompress(char *dst, int dst_len, char *src, int src_len) {
|
||||
std::vector<unsigned char> result;
|
||||
result = LZMADeCompress(std::vector<unsigned char>(src, src + src_len));
|
||||
if (result.size() <= dst_len)
|
||||
if (result.size() <= (SizeT)dst_len)
|
||||
std::memcpy(dst, &result[0], result.size());
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Not copying %d bytes to %d-byte buffer!\n",
|
||||
result.size(), dst_len);
|
||||
(unsigned int)result.size(), dst_len);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user